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
977 stars 166 forks source link

A question about battery values #25

Closed desugar-64 closed 5 years ago

desugar-64 commented 5 years ago

Hi. Thanks for your contribution to the opensource android community. I have a question regarding how battery values are encoded inside the payload. You said they are storing in range 0-10(0-100%, step 10). But how the iPhone shows battery charge with step by 1%?

Maybe you could recommend some resources about the reverse engineering of AirPods signal?

Best regards, Serhii.

adolfintel commented 5 years ago

Hi, I did the reverse engineering myself so all I know is in the comments in PodsService.java

According to my reverse engineering, the second digit is completely faked and the airpods only use 1 digit to represent the battery level. I might be wrong though, I'm not really an expert at reverse engineering; maybe someone can find this mysterious second digit.

desugar-64 commented 5 years ago

Thanks for your reply. I will try to debug the headphones too when my AirPods arrive. If you do not mind, I will play around with the source code of your application. Maybe I'll find out something else.

adolfintel commented 5 years ago

Sure, it's open source for a reason. Let me know if you find something

desugar-64 commented 5 years ago

Sure. I will let you know if any.

huseyint commented 4 years ago

has anyone figured out how iOS widget shows a finer detail value, and not the increments of 10?

adolfintel commented 4 years ago

@huseyint No, It's either completely fake or it is not sent via BLE. I suspect the first because it behaves kinda erratically with older airpods with worn out batteries.