adolfintel / OpenPods

The Free and Open Source app for monitoring your AirPods on Android
https://fdossena.com/?p=openPods/index.frag
GNU General Public License v3.0
938 stars 161 forks source link

Reverse engineering AirPods clone #52

Closed edofullin closed 4 years ago

edofullin commented 4 years ago

Hi, I've just bought a new pair or AirPods clones (Urbanpods, I suspect them being the same as the i2000 though). Your app does not work by default but I did manage to fork your repo and to reverse engeneer how they report the battery percentage. Basically, instead of being encoded in the 12th,13th,14th nibble of the manufacturer info it lies on the 12th,13th and 14th byte and works a little bit differently (the actual percentage is reported and the first bit indicates if it's charging). The problem I have is that as soon as the earpods connect with the phone I cannot get their manufacter info anymore (basically the device goes totally invisible to any btle scan app). This way I can only read the battery level once when your app detects them but they have not gone invisible yet. Do you happen to know a way to read the manufacter info directly from the connected device?

Also, how do the original AirPods work? Don't they go invisible as soon as a phone is connected? I don't have a pair of those to try.

Thanks for your help and sorry for my English, it's not my first language.

adolfintel commented 4 years ago

It's possible that your clone needs some kind of input from the phone, maybe you have to send something via BLE? Try to sniff the BLE traffic with another device and see what it's sending.

Anyway, I gave it some thought and I've decided not to support clones, since it requires a lot of reverse engineering and only benefits very few people. I recommend that you fork the app if you want to support this specific model (or other clones)

edofullin commented 4 years ago

It's strange because it works fine on iOS, I wonder if Apple uses a different request method on iOS to get the battery from the device. I'll try to sniff the packets from an iPad, now it's frustrating to use because the notification goes loading after 30 seconds after connection