BluetoothLibraryPatcher - Fix bluetooth pairings loss [Android 11/10/Pie/Oreo/Nougat]

Search This thread

alexcheveau

Senior Member
Oct 3, 2013
163
67
Samsung Galaxy S21
I can't be sure about that.. But it sounds right, it could work.
If you are fine to try, your feedback will be greatly appreciated.
Just tried, no luck:

sed: short write: No space left on device

Edit: Tried to delete the lines via Solid Explorer, no luck. Tried to delete the file then copy from sdcard to vendor no luck too
FFS
 
Last edited:

3arthur6

Senior Member
Sep 15, 2011
459
896
Just tried, no luck:

sed: short write: No space left on device

Edit: Tried to delete the lines via Solid Explorer, no luck. Tried to delete the file then copy from sdcard to vendor no luck too
FFS

Sad.. Thanks a lot for the feedback!
So at this point you need to resize the vendor partition which implies to unmount it, which implies a custom recovery.
 

3arthur6

Senior Member
Sep 15, 2011
459
896
I really don't want to flash a custom recovery but I just can't figure how to fix this without doing it :(

You can take a look in the twrp zip script, in the vendor resizing section and try the command from your booted device. But you should get errors when executing it..
Or maybe install twrp only to flash the zip then flash back stock recovery
 

Luix333

Member
Jun 6, 2015
16
0
thanks for the awesome work!

I keep getting

/system/bin/sh: [: /vendor/etc/vintf/manifest.xml.bak: unexpected operator/operand​

when I run:

su
mount -o remount,rw /vendor
i=`grep -lr 'security.wsm' /vendor/etc/vintf` && [ ! -z $i ] && [ $i != *.bak ] && cp --preserve=all $i $i.bak && sed -i '/<.*security.wsm.*/,/<hal format="hidl">/d' $i
mount -o remount,ro /vendor

Can anyone please help me?

SM-G980F
 

harleyusa

Member
Apr 21, 2017
18
2
Samsung Galaxy S10+
I am going to use odin to flash this on my s10+ .... Can someone tell me in what slot to put this file...tyvm. I am a newbie with these new phones and haven't done a successful root job since. I did try to root my s20+ but now it is all messed up... the binary was wrong and now I can only get into the download mode and I don't know how to fix it.
 

3arthur6

Senior Member
Sep 15, 2011
459
896
thanks for the awesome work!

I keep getting

/system/bin/sh: [: /vendor/etc/vintf/manifest.xml.bak: unexpected operator/operand​

when I run:

su
mount -o remount,rw /vendor
i=`grep -lr 'security.wsm' /vendor/etc/vintf` && [ ! -z $i ] && [ $i != *.bak ] && cp --preserve=all $i $i.bak && sed -i '/<.*security.wsm.*/,/<hal format="hidl">/d' $i
mount -o remount,ro /vendor

Can anyone please help me?

SM-G980F

Looks like you cut the third command in multiple lines.
Execute each command line one after the other, there is only 4 command lines.

I am going to use odin to flash this on my s10+ .... Can someone tell me in what slot to put this file...tyvm. I am a newbie with these new phones and haven't done a successful root job since. I did try to root my s20+ but now it is all messed up... the binary was wrong and now I can only get into the download mode and I don't know how to fix it.

There is nothing to flash through odin in this thread...
And you will not get help to root your device here... Make some search, for sure there is a lot of guide to root your device and learn the basis in the dedicated forum sections.
 

DjLeleX

Member
Dec 18, 2016
33
10
Venice
Sorry but nothing concerning your issue..
You can try to add these two line :
Code:
on property:sys.boot_completed=1
    stop sec_wsm_service
At the end of /init.rc or in dedicated init file.
And check again any files in /vendor/etc/vintf contain "wsm". Then reboot and try again to pair

Edit: Or in better way, rather than modifying init.rc, place a script in /data/adb/service.d which is handled by magisk. Something like this

Code:
#!/system/bin/sh

while [ "$(getprop sys.boot_completed | tr -d '\r')" != "1" ]; do sleep 1; done

stop sec_wsm_service
I tried placing a script like you said, but the problem is still there.

I guess there's something not yet discovered with the Galaxy Fit, Fit e and Fit 2 and the bluetooth and/or Samsung Wereable app, as these are the only wereable device that has problem after reboot/airplane mode/turning on and off bluetooth.
Anyway thanks for you help
 

petrellosky

New member
Jun 5, 2021
1
0
Hi everyone, after I installed BluetoothLibraryPatcher_2.2.4.zip by TWRP my phone went in lock screen loop after insert PIN: the screen comes black and instead to load home screen and unlock device brings me again to lock screen.
My phone is Samsung A50 SMA505FN Android 11 - samsung stock/based.
After many trials and pushing random keys I received the message that an app is continuing to crash, I stopped it. Then, I used finger print to unlock screen and use the phone. I find out root was disabled, Magisk doesn't work. I tried to unset PIN protection without lucky.
If I reboot phone I have the same problem. Please help me, I don't want to reset my phone and reinstall everything. Thanks in advance
 

adspro001

New member
Jun 9, 2021
1
0
Just wanted to THANK you for this. I was going crazy trying to get my S21 Ultra working with wearable and my Galaxy Watch3.

Read this a few days ago and finally had time on my day off today to give it ago.

I was already bootloader unlocked and rooted with magisk, but I used this for TWRP (https://forum.xda-developers.com/t/...p-for-galaxy-s21-ultra-5g-snapdragon.4241001/)

and then this thread and instructions to TWRP the zip file. After doing this my watch connected straight away.

THank you!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Thanks @3arthur6 and everyone else that may have contributed here.

    Installing TWRP on my Samsung S21 and flashing the zip finally made me able to pair the phone with my Galaxy Watch 3.:)
  • 47


    Bluetooth Library Patcher





    This patch/module attends to avoid bluetooth pairings loss after reboot on rooted samsung devices.





    It handles most of samsung devices on android Nougat, Oreo, Pie, 10 and 11.


    This patch is NOT applicable with an aosp rom, only samsung stock/based.


    In case installation fails, please upload here the BluetoothLibPatcher-files.tar created in your internal storage.




    To fix Galaxy Wearable pairing issue, as the modifcations aren't applicable through Magisk :

    Either go to twrp flashable zip


    S21 serie owner need the twrp zip (for vendor partition resizing), terminal commands below could brick your device

    Or you can directly execute these commands from a terminal app, one line after another, then reboot :
    Code:
    su
    mount -o remount,rw /vendor
    i=`grep -lr 'security.wsm' /vendor/etc/vintf` && [ ! -z $i ] && [ $i != *.bak ] && cp --preserve=all $i $i.bak && sed -i '/<.*security.wsm.*/,/<hal format="hidl">/d' $i
    mount -o remount,ro /vendor



    • Link :

    - TWRP zip : BluetoothLibraryPatcher_2.2.4.zip
    - Mega
    - GDrive

    - Magisk module : Bluetooth Library Patcher module from Magisk Manager


    • Credits :

    - @topjohnwu for magisk and magiskboot used here for its easy-to-use hexpatcher
    - @afaneh92 for the vendor resizing script needed with S21 serie


    • Source & changelogs : Github BluetoothLibraryPatcher
    5
    Libbluetooth patcher

    Thanks a ton for this, i'm gonna test it right away. You da mvp! :highfive:
    LE: Works as expected on BSKO and S10+, thanks again!!!!!
    5
    Just added a magisk module :good:
    It works flawlessly on my N9 and does the same stuff as the twrp zip. So should works with all others devices.
    4

    That module really only works for Pie and earlier. It does, however, currently contain a hack, based on byte strings found by the author of this module, that allows libluetooth.so to be patched for Android 10 on S10 and N10 series devices, but this was added to allow an easy transition to Android 10 for users of those devices and will be removed in the next version.

    Users of Android 10 should really use this module, as it is more comprehensive and supports many more models of device.
    3
    Hello! I trying to install this for my S10e (G970F), but getting a library not supported error. I've attached the libbluetooth.so and build.prop if it's any help. Thanks!

    Hey
    Give it a new try, it should be fixed