Since Android 9.0, BluetoothDevice#removeBond()
is annotated with @SystemApi
to prevent the method from being invoked through reflections. This made previous methods inapplicable. However, it seems that some apps are still capable of unpairing Bluetooth devices. Is there any other method to unbind a paired device from an app?
The device to be unbound is not arbitrary. The MAC address of the device is known to the app and the connection is initiated by the app.
EDIT: The app capable of unpairing devices is not a system app. It's a smartwatch app capable of automatically pairing and unpairing with the audio chip of the watch. It distributes as a single .apk
file so probably there is no special signatures enabling it to invoke system APIs. It does not require root permission or any other excessive permission as I know. I tried to take it apart but all I get is a bunch of .smali
files and there aren't any package names I could recognize. It does work on an Android 10 phone running an AOSP fork so it is not relying on vendor-specific libraries to do the work. I am way too curious about how is it implemented but there is too little information. Searching on Google returns the results mentioned above and nothing useful else. Is "unpairing a device" possible on Android 9.0 and above or it's just a trick they implemented in the watch instead of the companion app?