Xposed icon indicating copy to clipboard operation
Xposed copied to clipboard

Loses paired bluetooth devices after reboot.

Open Bogeyof opened this issue 7 years ago • 42 comments

Samsung S6, Firmware G920FXXU5EQJ2, Root with SuperSu 2.82, Xposed 88.2 installed via Xposed Installer 3.1.4. After installation of Xposed (no modules enabled, only installer and xposed 88.2) list of paired bluetooth devices is lost. Pairing of devices works fine, but after every reboot, all paired bluetooth devices are removed from list again. Flashed Firmware via Odin again, Devices remain in the list after rebooting. Rooted with CF-Autoroot (SuperSu 2.82), Devices remain in the list after rebooting. Installed xposed again, Devices were deleted in the list after rebooting... Edit: It also happens every time I turn flight mode on and off. Afterwards all paired devices are removed also. tried Firmware Downgrade to last Firmware from August, same behavior...

Bogeyof avatar Nov 20 '17 15:11 Bogeyof

I confirm: Moto G (Osprey), LineageOS+Magisk, Xposed 88.2

burunduk avatar Nov 20 '17 15:11 burunduk

Same issue on S7, Xposed 88.3

ghost avatar Dec 07 '17 12:12 ghost

Confirmed. Samsung Galaxy Tab S2 T819, Xposed 88.2 systemless, ma Magisk has nothing to do with this. Exact same symptoms. Very annoying.

giansalvatoremecca avatar Dec 12 '17 08:12 giansalvatoremecca

Same behavior here on a Galaxy a3 2017 with Xposed 88.2 and no magisk Can we get some feedback? Thanks

farfromrefug avatar Jan 06 '18 12:01 farfromrefug

Experiencing the same issue here as well. Lost pairing after airplane mode or reboot. Xposed v89, no magisk. Using supersu On galaxy s7 edge model: g935w8. All other functions are working well. It would be great to hear if a fix is underway.

JDawg88 avatar Feb 02 '18 18:02 JDawg88

It would be great to hear if a fix is underway.

Actually, no, I haven't looked at this yet. I'm working on fixing several crashes at the moment. It sounds strange to me that the Xposed Framework alone should cause this, but as multiple people (most with Samsung devices) have reported it meanwhile, there seems to be a relationship between Xposed and this issue. Anyway, I have no time to look at this now, sorry.

rovo89 avatar Feb 02 '18 18:02 rovo89

Confirmed Samsung C5000 having the same issue. Running on Android 7.0 with Xposed 89

ghost avatar Feb 16 '18 03:02 ghost

I have tested many Samsung handsets. And I saw that all the newer devices that already use bluetooth 5.0 They have a problem with XPOSED Of course they all come with Android 7 or 7.1

But the Samsung S7 with Android 7 does work well because it still has less than 5.0 bluetooth.

The problem is that the file /data/misc/bluedroid/bt_config.conf For some reason, it is deleted every time you restart your device And therefore all information stored there is deleted

ahronshor avatar Mar 06 '18 22:03 ahronshor

Actually to me it was also happening without restart.

Now it actually stopped happening! (at least without restart). And i think it got fixed when i uninstalled Xposed and installed it again through the systemless version in Magisk

farfromrefug avatar Mar 07 '18 10:03 farfromrefug

I noticed something else That if you install XPOSED and delete only the cache, this is not happening.

Only if you then delete the total data, It begins to lose the connected devices.

ahronshor avatar Mar 08 '18 22:03 ahronshor

I found in data/misc/bluedroiddump/subBuffer.log this line: btif_storage.c -- btif_in_fetch_bonded_devices: Encryption key isn't available from secure storage. remove paired device

But in the google source code in btif_storage.c There is no such examination And probably Samsung put it in their code

ahronshor avatar Mar 09 '18 00:03 ahronshor

Just want to add the same thing is happening on my S7 running nougat.

It has to do with secure storage as ahronshor found. I remember on the S6 it required a modified library file but that file is no longer on the S7.

I am getting the exact same error in that log that they are. Xposed V89

elesbb avatar Mar 10 '18 15:03 elesbb

Can confirm the same issue happens to me on my Galaxy Note 5, Android 7.0 + Magisk 16.0 + Systemless Xposed v89.

jackyhk02 avatar Mar 14 '18 14:03 jackyhk02

Same issue S8 plus.

DavidFReyna avatar Apr 22 '18 02:04 DavidFReyna

So, I fixed this on my S7. It requires modified libsecure_storage.so and libsecure_storage_jni.so as well as build.prop being set to ro.securestorage.support=false

elesbb avatar May 07 '18 22:05 elesbb

How we can get or make this modified binaries?

ahronshor avatar May 08 '18 07:05 ahronshor

@ahronshor I used to disable it on L/M builds on my xposed variant on the bridge part: https://github.com/wanam/XposedBridge/commit/b9595e96bd204099bd8e6b1d9dbb89575fe1052a

But i don't own any Samsung device running 8+ to debug this.

wanam avatar May 08 '18 08:05 wanam

@wanam I tried the solution you wrote,

But it did not work for me.

My test was on the devices:      SAMSUNG NOTE 8 with android 7.1      SAMSUNG S9 with android 8

The only thing that works is to just run a first time without XPOSED, Then back up the files in the folder /data/system/secure_storage/com.android.bluetooth/

Then if I reset the device after installing XPOSED. I return the files manually to the same place.

But that it is not a comfortable enough solution. And requires ROOT.

ahronshor avatar May 08 '18 14:05 ahronshor

@ahronshor - I have no idea what the modifications were. The person I obtained the files from (back on my S6) did not mention how they modified it. I know for a fact it requires a dissassembler, and hex address editing. But as to what addresses to modify, I haven't found it. I am trying to just do a direct comparison between the stock and modified files but that isn't as easy as I hoped.

Everyone else - I can upload the files but I suggest only using them on the S7. If you use them on the S8 or other devices, that is your own choosing and I cannot tell you if it will work or not. So don't come back saying it doesn't work and expect a fix. Plus if it bricks your phone (most probably won't) its not my fault. But honestly these are hard to perma brick unless you eff up the bootloader partition.

Lib directory - http://www.mediafire.com/folder/dawhd511rzk41/lib

Lib64 directory - http://www.mediafire.com/folder/ezld25821h76t/lib64

elesbb avatar May 11 '18 21:05 elesbb

@elesbb Well done. It worked for me on several devices, Even with the SAMSUNG S9 with android 8 ...

ahronshor avatar May 13 '18 13:05 ahronshor

tested on: samsung J5 2017 j520f, android 7.0, arm-v7, samsung A5 2017 a520f, android 7.0, arm64-v8, samsung NOTE 8 n950f, android 7.1, arm64-v8, samsung S9 g960f, android 8.0, arm64-v8, and It worked.

Thanks @elesbb.

ahronshor avatar May 13 '18 14:05 ahronshor

Thanks. It worked for my S6 G920I. This solution erase all wifi networks stored, but I can now see again the password of the new wifi stored

zacaso avatar May 13 '18 15:05 zacaso

@ahronshor @zacaso

You are right about the WiFi issue.. I personally don't use WiFi like ever so I didn't recognize it. I did notice it takes longer to turn on the WiFi though.

I guess we fix one problem and create another xD

I do recall this problem though before. Hopefully I can find a fix for this that also keeps the Bluetooth fix working.

EDIT: If I recall, it requires a "wipe data" to fix. Because this clears out all of the secure storage stuff. The problem is that the WiFi data is stored encrypted. So now that secure storage is off, it can't access the stored file anymore. So wiping data removes all of the secure storage stuff. I am gonna see if I can find precisely what it is that needs to be removed.

EDIT2: I wonder if using stock binaries and securestorage = true, then trying to edit the Bluetooth ss_ids.. i'll play with it some more and see if I can figure it out. I wonder why xposed even causes this issue...

elesbb avatar May 13 '18 22:05 elesbb

Tried method on s7 edge and bluetooth settings still erased on phone reboot

Sabre8073 avatar May 14 '18 17:05 Sabre8073

@ahronshor

So here is what I did to get everything working perfectly.

  1. Fresh clean Odin installed firmware. Setup things like snapchat etc
  2. Root device. Move the custom lib files to their respectable positions. Modify build.prop to turn off secure storage.
  3. Install xposed
  4. Wipe data
  5. Reboot and allow things to settle, can now use phone without any Bluetooth or WiFi issues.

What is happening is the secure storage creates a key, and when turning off secure storage, it can no longer decrypt the file which holds the wifi info. So wiping data gets rid of all secure storage stuff, so now it can use the newly created files without secure storage encryption.

elesbb avatar May 19 '18 01:05 elesbb

@elesbb thanks a loooot, i was fighting 1 week trying to fix it. S7 G930F Nougat 7.0 Binary 2.

EDIT: I'm facing another kind of problems with my smartphone. i can't set a pin, patter, password or use fingerprint sensor, i don't know what's going on.

DnLaG avatar May 21 '18 00:05 DnLaG

Just wondering, all these people having the same issue, have they all used the official Xposed installer, or one of the many other alternatives? I've had the same issues until I went back to the official version.

sconim avatar Jul 25 '18 11:07 sconim

@elesbb How did you setup your device without root? For me, after a flash, the whole reason to root is to immediately install Titanium Backup and restore all apps/data. If I'm understanding your process correctly, you're saying install all apps before rooting, so basically you aren't able to use the most useful part of rooting :/

strongui avatar May 18 '19 11:05 strongui

I'm not sure this is helpful, but I came across this thread while searching for the exact same issue with Magisk (on Samsung Galaxy S9+, SM-G965F, Exynos). So it might be helpful to look for similarities or shared code/libraries. Since I don't use Xposed, I can't contribute anything more.

Gaibhne avatar Aug 14 '19 08:08 Gaibhne

Actually I found the solution. It has to do with Samsung secure storage. Installing libsecure_storage custom kernel companion module solved the problem!

https://github.com/ianmacd/libsecure_storage

strongui avatar Aug 14 '19 09:08 strongui