Android's Ethernet Adapter Mystery: A Stupid Regex

2025-06-08
Android's Ethernet Adapter Mystery: A Stupid Regex

This post details the author's frustrating attempt to use a USB Ethernet adapter on their Android phone. The investigation revealed the problem wasn't driver support, but rather Android's `EthernetTracker` service using a regex `eth\d` to match Ethernet interface names. CDC Ethernet adapters create interfaces named `usbX`, resulting in non-recognition. The author meticulously documents the debugging process, including obtaining kernel configuration and analyzing Android source code. The root cause? A simple, restrictive regex. The post showcases impressive problem-solving skills but also highlights a potential flaw in Android's design.