├── 7z.tar.xz ├── 7z64.tar.xz ├── META-INF └── com │ └── google │ └── android │ ├── update-binary │ └── updater-script ├── README.md ├── SUPPORT.md ├── bash.tar.xz ├── bash64.tar.xz ├── busybox.tar.xz ├── busybox64.tar.xz ├── customize.sh ├── hexpatch.sh ├── latestchange.log ├── module.prop ├── service.sh └── update.json /7z.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3arthur6/BluetoothLibraryPatcher/e22da26ae7eb0856f1342bb565e6aa26a5ccaa73/7z.tar.xz -------------------------------------------------------------------------------- /7z64.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3arthur6/BluetoothLibraryPatcher/e22da26ae7eb0856f1342bb565e6aa26a5ccaa73/7z64.tar.xz -------------------------------------------------------------------------------- /META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | 3 | ################# 4 | # Initialization 5 | ################# 6 | 7 | umask 022 8 | 9 | # echo before loading util_functions 10 | ui_print() { echo "$1"; } 11 | 12 | require_new_magisk() { 13 | ui_print "*******************************" 14 | ui_print " Please install Magisk v20.4+! " 15 | ui_print "*******************************" 16 | exit 1 17 | } 18 | 19 | ######################### 20 | # Load util_functions.sh 21 | ######################### 22 | 23 | OUTFD=$2 24 | ZIPFILE=$3 25 | 26 | mount /data 2>/dev/null 27 | 28 | [ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk 29 | . /data/adb/magisk/util_functions.sh 30 | [ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk 31 | 32 | install_module 33 | exit 0 34 | -------------------------------------------------------------------------------- /META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bluetooth Library Patcher 2 | 3 | ## Description 4 | 5 | This module attends to avoid losing Bluetooth pairings after reboot or airplane mode switch on rooted Samsung devices. 6 | 7 | It patches on the fly the bluetooth library and should support most of Samsung devices on Android Nougat, Oreo, Pie, 10, 11, 12, 13, 14 and 15. 8 | 9 | > [!WARNING] 10 | > This patch is **NOT** applicable with an AOSP ROM, only Samsung stock/based. 11 | 12 | ## Galaxy Watch devices support 13 | 14 | Due to limitations in Magisk, a manual step is required to fix pairing issues with Galaxy Watch devices. After installing the Magisk module, use a command line (like Terminal Emulator or Termux) to run the following commands, then reboot: 15 | 16 | > [!CAUTION] 17 | > Starting from the S21 series you can **NOT** use these commands (or you have to be SURE your vendor partition isn't read only or full) and must instead use the zip bellow to flash using TWRP. The commands below **could brick your device!** 18 | 19 | ```bash 20 | $ su 21 | $ mount -o remount,rw /vendor 22 | $ for i in `grep -lr 'security.wsm' /vendor/etc/vintf`; do [ ! -z $i ] && sed -i "$((`awk '/security.wsm/ {print FNR}' $i`-1)),/<\/hal>/d" $i; done 23 | $ mount -o remount,ro /vendor 24 | ``` 25 | 26 | Alternatively with Android 12L and below, instead of installing the Magisk module and running the commands, flash the zip file from [this Github repo releases](https://github.com/3arthur6/BluetoothLibraryPatcher/releases) (BluetoothLibraryPatcher_twrp_X.X.X.zip) meant for TWRP recovery. 27 | 28 | Another new and easier alternative is to use [Magisk Delta fork](https://huskydg.github.io/magisk-files/). 29 | With this version of magisk no additional steps are required. Just install the module and enjoy. 30 | 31 | ## Credits 32 | 33 | - @topjohnwu for magisk 34 | - @afaneh92 for the partition resizing script 35 | 36 | ## Source code 37 | 38 | [Github](https://github.com/3arthur6/BluetoothLibraryPatcher) 39 | 40 | ## Support 41 | 42 | [XDA](https://forum.xda-developers.com/galaxy-note-9/development/zip-libbluetooth-patcher-fix-losing-t4017735) 43 | 44 | ## Changelog 45 | 46 | ### v2.8.0 47 | 48 | - Add A15 support 49 | 50 | ### v2.7.2 51 | 52 | - Not needed for A15 and above 53 | - Fix patching api 27 & 28 54 | 55 | ### v2.7.1 56 | 57 | - Add Support for APatch root 58 | - Fix samsung brand check 59 | 60 | ### v2.7.0 61 | 62 | - Use embedded busybox 63 | - Fix latest magisk canary versions 64 | - Fix Kitsune/Alpha 65 | 66 | ### v2.6.9 67 | 68 | - Add support for android 14 arm 69 | 70 | ### v2.6.8 71 | 72 | - Fix support for S24 73 | 74 | ### v2.6.7 75 | 76 | - Fix Magisk Delta/Kitsune 77 | 78 | ### v2.6.6 79 | 80 | - Fix Magisk Alpha 81 | 82 | ### v2.6.4 83 | 84 | - Add A14 support 85 | - Fix some issue with S23 86 | 87 | ### v2.6.3 88 | 89 | - Add A137F support & fix regressions 90 | - TWRP zip: Apply gear watch fix first 91 | 92 | ### v2.6.2 93 | 94 | - Add support for arm devices on A13 95 | - Process 7z only on A13 96 | 97 | ### v2.6.1 98 | 99 | - Fix OTA survival script on Android 13 100 | 101 | ### v2.6 102 | 103 | - Adding back support for Android 13 104 | 105 | ### v2.5.1 106 | 107 | - Add support for arm devices on A12 108 | 109 | ### v2.5 110 | 111 | - Bring back support for Android 12L (API 32) 112 | - Drop support for Android 13 (API 33) and above 113 | 114 | ### v2.4.4 115 | 116 | - Optimize hex sequences 117 | - Fix support for some old mediatek devices 118 | - Revert adding support for Android 13, module not needed anymore 119 | 120 | ### v2.4.3 121 | 122 | - Fix qcom detection logic 123 | - Add gear watch patch support for Magisk Delta fork 124 | - Fix twrp patch 125 | 126 | ### v2.4.2 127 | 128 | - Add support to Android 13 129 | - Optimize debug stuff 130 | 131 | ### v2.4.1 132 | 133 | - Fix broken qcom patch 134 | 135 | ### v2.4.0 136 | 137 | - Update for Magisk v24.0 138 | - Misc updates 139 | 140 | ### v2.3.1 141 | 142 | - Fix qcoms on Android 12 143 | - Add A105F on Android 11 144 | 145 | ### v2.3 146 | 147 | - Android 12 support 148 | - Handle few specific devices 149 | 150 | ### v2.2.3 151 | 152 | - Handle library changes from latest A505FN firmware and possibly others devices 153 | 154 | ### v2.2.2 155 | 156 | - Fix OTA survival script 157 | 158 | ### v2.2.1 159 | 160 | - Misc fixes 161 | 162 | ### v2.2 163 | 164 | - Large rewrite 165 | - Detect now OTAs and reapply the patch if needed 166 | 167 | ### v2.1.1 168 | 169 | - Divers Android 11 fixes 170 | 171 | ### v2.1 172 | 173 | - Android 11 support 174 | - Android Nougat support 175 | - Misc optimizations 176 | 177 | ### v2.0 178 | 179 | - Support more devices 180 | - Misc optimizations 181 | 182 | ### v1.9 183 | 184 | - Support more arm devices 185 | - Auto create tar with needed files in internal storage to fix unsupported devices 186 | 187 | ### v1.8 188 | 189 | - Add support for A6, A10, A80, some S10e and N10 variants 190 | - Apply the only known qcom fix to all of them 191 | - Add some checks to avoid false negatives 192 | 193 | ### v1.7 194 | 195 | - Add support for chinese/global snapdragon on Pie 196 | - Add support for chinese/global S/N9 snapdragon on Q & simplify the hexpatch 197 | 198 | ### v1.6 199 | 200 | - Fix brand and model detection for magisk manager and recovery installation 201 | 202 | ### v1.5 203 | 204 | - Check we try to apply the patch on a Samsung device & add missing chinese Note10+ 5G variant 205 | 206 | ### v1.4 207 | 208 | - Add support for chinese variants 209 | 210 | ### v1.3 211 | 212 | - Modify hexpatch (more safer patch) 213 | 214 | ### v1.2 215 | 216 | - Add recovery installation support 217 | 218 | ### v1.1 219 | 220 | - Add verification point, to know if we successfully hexpatch 221 | 222 | ### v1.0 223 | 224 | - Initial release 225 | -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | ## Library not supported 2 | 3 | If you are here so your bluetooth library isn't supported by the module yet. 4 | 5 | Open an issue here in [github](https://github.com/3arthur6/BluetoothLibraryPatcher/issues/new) or at the [XDA thread](https://forum.xda-developers.com/galaxy-note-9/development/zip-libbluetooth-patcher-fix-losing-t4017735). 6 | 7 | A file called BluetoothLibPatcher-files.tar has been created on the main folder of your phone storage. 8 | Please attach it (or a link to it) with your report! 9 | -------------------------------------------------------------------------------- /bash.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3arthur6/BluetoothLibraryPatcher/e22da26ae7eb0856f1342bb565e6aa26a5ccaa73/bash.tar.xz -------------------------------------------------------------------------------- /bash64.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3arthur6/BluetoothLibraryPatcher/e22da26ae7eb0856f1342bb565e6aa26a5ccaa73/bash64.tar.xz -------------------------------------------------------------------------------- /busybox.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3arthur6/BluetoothLibraryPatcher/e22da26ae7eb0856f1342bb565e6aa26a5ccaa73/busybox.tar.xz -------------------------------------------------------------------------------- /busybox64.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3arthur6/BluetoothLibraryPatcher/e22da26ae7eb0856f1342bb565e6aa26a5ccaa73/busybox64.tar.xz -------------------------------------------------------------------------------- /customize.sh: -------------------------------------------------------------------------------- 1 | # BluetoothLibraryPatcher 2 | # by 3arthur6 3 | 4 | check() { 5 | if [[ ! -z $KSU_VER ]] ; then 6 | ui_print "- KernelSU Manager installation" 7 | sys=/system 8 | elif [[ $APATCH == true ]] ; then 9 | ui_print "- APatch Manager installation" 10 | sys=/system 11 | elif $BOOTMODE ; then 12 | ui_print "- Magisk Manager installation" 13 | if [[ $MAGISK_VER == *-alpha ]] || [[ $MAGISK_VER == *-kitsune ]] ; then 14 | ui_print "- Magisk Alpha/Kitsune fork detected" 15 | sys=/system 16 | elif [[ $MAGISK_VER_CODE -ge 27005 ]] ; then 17 | sys=/system 18 | else 19 | sys=`magisk --path`/.magisk/mirror/system 20 | fi 21 | else 22 | ui_print "- Recovery installation" 23 | sys=`dirname $(find / -mindepth 2 -maxdepth 3 -path "*system/build.prop"|head -1)` 24 | fi 25 | if ! `grep -Eqw "ro.build.PDA|ro.product_ship|ro.config.knox" $sys/build.prop` ; then 26 | ui_print "- Only for Samsung devices!" 27 | abort 28 | elif ! `grep -qw ro.build.type=user $sys/build.prop` ; then 29 | ui_print "- Only for Samsung stock based roms!" 30 | ui_print "- Not relevant for aosp roms!" 31 | abort 32 | elif [[ $API -lt 24 ]] ; then 33 | ui_print "- Only for Android 7.0 (Nougat) and above" 34 | abort 35 | fi 36 | } 37 | 38 | search() { 39 | ui_print "- Searching for relevant hex byte sequence" 40 | $IS64BIT && bits=64 41 | unzip -q $ZIPFILE hexpatch.sh -d $TMPDIR 42 | chmod 755 $TMPDIR/hexpatch.sh 43 | # Executed through bash for array handling 44 | unzip -p $ZIPFILE bash$bits.tar.xz|tar x -J -C $TMPDIR bash 45 | chmod 755 $TMPDIR/bash 46 | if [[ $API -le 32 ]] ; then 47 | lib=`find $sys/lib*|grep -E "\/(libbluetooth|bluetooth\.default)\.so$"|tail -n 1` 48 | else 49 | unzip -p $ZIPFILE 7z$bits.tar.xz|tar x -J -C $TMPDIR 7z 50 | chmod 755 $TMPDIR/7z 51 | unzip -q $sys/apex/com.android.btservices.apex apex_payload.img -d $TMPDIR 52 | $TMPDIR/7z x -y -bso0 $TMPDIR/apex_payload.img lib$bits/libbluetooth_jni.so -o$TMPDIR/system 53 | lib=$TMPDIR/system/lib$bits/libbluetooth_jni.so 54 | fi 55 | unzip -p $ZIPFILE busybox$bits.tar.xz|tar x -J -C $TMPDIR busybox 56 | chmod 755 $TMPDIR/busybox 57 | bb=$TMPDIR/busybox 58 | export TMPDIR API IS64BIT lib bb 59 | $TMPDIR/bash $TMPDIR/hexpatch.sh 60 | } 61 | 62 | patchlib() { 63 | ui_print "- Applying patch" 64 | pre=`grep pre_hex $TMPDIR/tmp|cut -d '=' -f2` 65 | post=`grep post_hex $TMPDIR/tmp|cut -d '=' -f2` 66 | if [[ $pre == already ]] ; then 67 | if [[ $MAGISK_VER == *-alpha ]] || [[ $MAGISK_VER == *-kitsune ]] ; then 68 | ui_print "- You are using Magisk Alpha/Kitsune fork" 69 | ui_print "- Try to uninstall the module, reboot and install it again" 70 | ui_print "- Or maybe the library is already (system-ly) patched" 71 | else 72 | ui_print "- Library already (system-ly) patched!" 73 | ui_print "- You don't need this Magisk module" 74 | fi 75 | abort 76 | elif [[ -f $lib ]] && [[ ! -z $pre ]] ; then 77 | mod_path=$MODPATH/`echo $lib|grep -o system.*` 78 | mkdir -p `dirname $mod_path` 79 | $bb xxd -p -c `stat -c %s $lib` $lib|$bb sed "s/$pre/$post/"|$bb xxd -pr -c `stat -c %s $lib` > $mod_path 80 | fi 81 | if [[ -f $lib ]] && `$bb xxd -p $mod_path|$bb tr -d ' \n'|$bb grep -qm1 $post` ; then 82 | ui_print "- Successfully patched!" 83 | else 84 | ui_print "- Patch failed!" 85 | echo -e "BOOTMODE=$BOOTMODE\nAPI=$API\nIS64BIT=$IS64BIT\nlib=$lib" >> $TMPDIR/tmp 86 | cp -f $lib $TMPDIR 87 | tar c -f /sdcard/BluetoothLibPatcher-files.tar -C $TMPDIR `ls $TMPDIR|sed -E '/bash|hexpatch\.sh|7z/d'` 88 | ui_print " " 89 | ui_print "- Opening support webpage in 10 seconds" 90 | (sleep 10 && am start -a android.intent.action.VIEW -d https://github.com/3arthur6/BluetoothLibraryPatcher/blob/master/SUPPORT.md >/dev/null) & 91 | abort 92 | fi 93 | } 94 | 95 | otasurvival() { 96 | if [[ $MAGISK_VER == *-alpha ]] || [[ $MAGISK_VER == *-kitsune ]] ; then 97 | rm -rf $MODPATH/service.sh 98 | else 99 | ui_print "- Creating OTA survival service" 100 | cp -f $ZIPFILE $MODPATH/module.zip 101 | if [[ $API -le 32 ]] ; then 102 | sed -i -e "s@previouslibmd5sum_tmp@previouslibmd5sum=`md5sum $lib|cut -d ' ' -f1`@" \ 103 | -e "s@post_path@`echo $lib|grep -o lib.*.so`@" $MODPATH/service.sh 104 | else 105 | sed -i -e "s@previouslibmd5sum_tmp@previouslibmd5sum=`md5sum $sys/apex/com.android.btservices.apex|cut -d ' ' -f1`@" \ 106 | -e "s@post_path@apex/com.android.btservices.apex@" $MODPATH/service.sh 107 | fi 108 | if [[ ! -z $KSU_VER ]] || [[ $APATCH == true ]] || [[ $MAGISK_VER == *-alpha ]] || [[ $MAGISK_VER == *-kitsune ]] || [[ $MAGISK_VER_CODE -ge 27005 ]] ; then 109 | sed -i 's@$(magisk --path)/.magisk/mirror@@' $MODPATH/service.sh 110 | fi 111 | fi 112 | } 113 | 114 | deltafork() { 115 | if [[ $MAGISK_VER == *-delta ]] || [[ $MAGISK_VER == *-kitsune ]] ; then 116 | ui_print "- Magisk Delta/Kitsune fork detected" 117 | ui_print "- Applying gear watch fix" 118 | if `grep "$(magisk --path)/.magisk/early-mount.d" /proc/mounts | grep -q '^early-mount.d/v2'` ; then 119 | earlymountdir=$MODPATH/early-mount 120 | else 121 | earlymountdir=`magisk --path`/.magisk/mirror/early-mount 122 | fi 123 | mkdir -p $earlymountdir/system/vendor/vintf/manifest 124 | for i in `grep -lr 'security.wsm' /vendor/etc/vintf` 125 | do 126 | if [[ ! -z $i ]] ; then 127 | rm -f $earlymountdir/system$i 128 | cp -af $i $earlymountdir/system$i 129 | sed -i $((`awk '/security.wsm/ {print FNR}' $i`-1)),/<\/hal>/d $earlymountdir/system$i 130 | fi 131 | done 132 | ui_print "- Adding com.android.bluetooth to SuList" 133 | magiskhide add com.android.bluetooth 2>/dev/null 134 | fi 135 | } 136 | 137 | check 138 | search 139 | patchlib 140 | otasurvival 141 | deltafork 142 | -------------------------------------------------------------------------------- /hexpatch.sh: -------------------------------------------------------------------------------- 1 | # BluetoothLibraryPatcher 2 | # hexpatch script 3 | # by 3arthur6 4 | 5 | qcom=`$bb grep -qw androidboot.hardware=qcom /proc/cmdline && echo 'true' || echo 'false'` 6 | 7 | # default(mostly arm64 exynos)=1 arm=2 qcom=3 8 | var=`if ! $IS64BIT || [[ $API -le 25 ]] ; then echo 2 ; elif $qcom && [[ $API -ge 28 ]] && [[ $API -le 30 ]] ; then echo 3 ; else echo 1 ; fi` 9 | 10 | hex=( \ 11 | # default 12 | [135]=480500352800805228 [1135]=530100142800805228 \ 13 | [134]=6804003528008052 [1134]=2b00001428008052 \ 14 | [133]=6804003528008052 [1133]=2a00001428008052 \ 15 | [132]=........f9031f2af3031f2a41 [1132]=1f2003d5f9031f2af3031f2a48 \ 16 | [131]=........f9031f2af3031f2a41 [1131]=1f2003d5f9031f2af3031f2a48 \ 17 | [130]=........f3031f2af4031f2a3e [1130]=1f2003d5f3031f2af4031f2a3e \ 18 | [129]=........f4031f2af3031f2ae8030032 [1129]=1f2003d5f4031f2af3031f2ae8031f2a \ 19 | [128]=88000034e8030032 [1128]=1f2003d5e8031f2a \ 20 | [127]=88000034e8030032 [1127]=1f2003d5e8031f2a \ 21 | [126]=88000034e8030032 [1126]=1f2003d5e8031f2a \ 22 | # arm 23 | [234]=4e7e4448bb [1234]=4e7e4437e0 \ 24 | [233]=4e7e4440bb [1233]=4e7e4432e0 \ 25 | [231]=20b14ff000084ff000095ae0 [1231]=00bf4ff000084ff0000964e0 \ 26 | [230]=18b14ff0000b00254a [1230]=00204ff0000b002554 \ 27 | [229]=..b100250120 [1229]=00bf00250020 \ 28 | [228]=..b101200028 [1228]=00bf00200028 \ 29 | [227]=09b1012032e0 [1227]=00bf002032e0 \ 30 | [226]=08b1012031e0 [1226]=00bf002031e0 \ 31 | [225]=087850bbb548 [1225]=08785ae1b548 \ 32 | [224]=007840bb6a48 [1224]=0078c4e06a48 \ 33 | # qcom 34 | [330]=88000054691180522925c81a69000037 [1330]=1f2003d5691180522925c81a1f2003d5 \ 35 | [329]=88000054691180522925c81a69000037 [1329]=1f2003d5691180522925c81a1f2003d5 \ 36 | [328]=7f1d0071e91700f9e83c0054 [1328]=7f1d0071e91700f9e7010014 \ 37 | # what is happening samsung 38 | [429]=....0034f3031f2af4031f2a....0014 [1429]=1f2003d5f3031f2af4031f2a47000014 \ 39 | # A137F 40 | [531]=10b1002500244ce0 [1531]=00bf0025002456e0 \ 41 | # what again (T510) 42 | [530]=18b100244ff0000b4d [1530]=002000244ff0000b57 \ 43 | [529]=44387810b1002400254a [1529]=44387800200024002556 \ 44 | # ... (T595) 45 | [629]=90387810b1002400254a [1629]=90387800200024002558 ) 46 | 47 | if [[ $var == 3 ]] && ! `$bb xxd -p $lib|$bb tr -d '\n'|$bb grep -qm1 ${hex[$var$API]}` ; then 48 | if `$bb xxd -p $lib|$bb tr -d '\n'|$bb grep -qm1 ${hex[1$var$API]}` ; then 49 | hex[$var$API]=already 50 | else 51 | var=1 52 | fi 53 | fi 54 | if ( [[ $var == 1 ]] && [[ $API -ge 29 ]] ) || ( [[ $var == 2 ]] && [[ $API -ge 28 ]] && [[ $API -le 29 ]] ) ; then 55 | hex[$var$API]=`$bb xxd -p $lib|$bb tr -d '\n'|$bb grep -om1 ${hex[$var$API]}` 56 | fi 57 | if ! `$bb xxd -p $lib|$bb tr -d '\n'|$bb grep -qm1 ${hex[$var$API]}` ; then 58 | if `$bb xxd -p $lib|$bb tr -d '\n'|$bb grep -qm1 ${hex[1$var$API]}` ; then 59 | hex[$var$API]=already 60 | elif [[ $var == 1 ]] && [[ $API == 29 ]] && hex[4$API]=`$bb xxd -p $lib|$bb tr -d '\n'|$bb grep -om1 ${hex[4$API]}` && [[ ! -z ${hex[4$API]} ]] ; then 61 | var=4 62 | elif [[ $var == 2 ]] ; then 63 | if [[ $API -ge 29 ]] && [[ $API -le 31 ]] ; then 64 | if `$bb xxd -p $lib|$bb tr -d '\n'|$bb grep -qm1 ${hex[5$API]}` ; then 65 | var=5 66 | elif `$bb xxd -p $lib|$bb tr -d '\n'|$bb grep -qm1 ${hex[6$API]}` ; then 67 | var=6 68 | fi 69 | elif [[ $API == 27 ]] && `$bb xxd -p $lib|$bb tr -d '\n'|$bb grep -qm1 ${hex[${var}26]}` ; then 70 | hex[$var$API]=${hex[${var}26]} 71 | hex[1$var$API]=${hex[1${var}26]} 72 | fi 73 | fi 74 | fi 75 | echo -e "pre_hex=${hex[$var$API]}\npost_hex=${hex[1$var$API]}\nvar=$var\nchip=`$bb grep -o androidboot.hardware=.* /proc/cmdline|$bb cut -d ' ' -f1|$bb cut -d '=' -f2`\nbl=`$bb grep -o androidboot.bootloader=.* /proc/cmdline|$bb cut -d ' ' -f1|$bb cut -d '=' -f2`" >> $TMPDIR/tmp 76 | -------------------------------------------------------------------------------- /latestchange.log: -------------------------------------------------------------------------------- 1 | - Add A15 support 2 | -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=BluetoothLibraryPatcher 2 | name=Bluetooth Library Patcher 3 | version=v2.8.0 4 | versionCode=280 5 | author=3arthur6 6 | description=Magisk/KernelSU module preventing loss of bluetooth pairings after reboot or airplane mode switch on rooted samsung devices. 7 | updateJson=https://raw.githubusercontent.com/3arthur6/BluetoothLibraryPatcher/master/update.json 8 | -------------------------------------------------------------------------------- /service.sh: -------------------------------------------------------------------------------- 1 | # BluetoothLibraryPatcher 2 | # ota survival script 3 | # by 3arthur6 4 | 5 | MODDIR=${0%/*} 6 | previouslibmd5sum_tmp 7 | 8 | if `echo $(magisk -v)|grep -q '-delta'` ; then 9 | magiskhide add com.android.bluetooth 2>/dev/null 10 | fi 11 | 12 | if [[ $previouslibmd5sum != `md5sum $(magisk --path)/.magisk/mirror/system/post_path|cut -d " " -f1` ]] ; then 13 | magisk --install-module $MODDIR/module.zip 14 | else 15 | exit 16 | fi 17 | -------------------------------------------------------------------------------- /update.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "v2.8.0", 3 | "versionCode": "280", 4 | "zipUrl": "https://github.com/3arthur6/BluetoothLibraryPatcher/releases/download/v2.8.0/BluetoothLibraryPatcher_module_2.8.0.zip", 5 | "changelog": "https://raw.githubusercontent.com/3arthur6/BluetoothLibraryPatcher/master/latestchange.log" 6 | } 7 | --------------------------------------------------------------------------------