presenting AirPodsLikeNormal - bringing AirPods' apple-exclusive features on android! (and linux too)
(i do realize this is not the best name, but i'm a programmer, not a creative thinker :p)
this FOSS app is not just another BLE broadcast based app that relies on airpods to occasionaly broadcast inccomplete data to non-apple devices as well – no, this app does exactly what apple's operating systems do, and brings many features like (accurate) ear detection and battery status, and even sending data to airpods to Android which the BLE broadcasts based apps are incapable of.
i reverse engineered airpods and how they communicate with apple software. apple uses the l2cap layer for this communication. tl;dr on how the app works: this app sends whatever packets are necessary and makes the airpods believe like it's connected to an apple device, and listens to/sends packets for specific stuff.
here are a few things that the app does
1. ear detection: the app controls media based on if the airpods are worn. it also switches to the phones speakers when none of the airpods are in ear.
2. conversational awareness: when you start speaking, the app would lower the volume of the media playing
3. battery status: it shows the accurate battery levels
4. changing nosie control mode: the app is the first app to be able to change the noise control mode of airpods from an android phone! it even has a QuickSetting tile for this.
4. configure airpods: this includes many things, like - renaming airpods, changing what pressing and holding the stem of airpods does, etc.
5. presents all of this in a UI exactly like in iOS/iPadOS: the whole app is designed to be a clone of the settings screen for airpods on ios! (i know i know, material 3. but, i tried material 3, and i didn't what what many of the things should look - like the nosie control settings!)
the catch:
well, apple being apple decided to not stick to the standards. on top of that, airpods require a 'handshake' packet to be sent to them before they can start talking with the device, or else, they won't respond to anything (this usually hangs any program trying to connect and send any packet before sending the handshake packet). so when the android device tries to establish a connection over l2cap with the airpods, the android bluetooth stack sends an additional packet to check for extended flow support (idk what that is) and the app trying to open and connect to a l2cap socket ends up not responding and crashing. of course, there are workarounds - either you can overlay a patched library using root, or ask your ROM maintainer to patch it! details in the repository.
links:
screenshots – https://github.com/kavishdevar/aln#screenshots
GitHub - https://github.com/kavishdevar/aln
XDAForums - https://xdaforums.com/t/app-root-for-now-airpodslikenormal-u...
Telegram - https://t.me/airpodslikenormal
the patch i did - https://github.com/kavishdevar/packages_modules_Bluetooth/co...
open for feedback and suggestions!
about making the project:
why?
i'm a high-school student. i got airpods pro 2 as a gift for getting good grades, but i did what any student would obviously do - make an app so that i can use
everything what i paid for.
how?
i used the packetlogger app for macos to sniff the packets sent to/from the airpods and a little bit of my brain to understand what those packets meant!