xref: /btstack/port/mtk/deinstaller.sh (revision 8caefee39d444df6d8908a96a844825f10fbdaa4)
1#!/bin/bash
2
3echo "BTstack Deinstaller for RugGear/Mediatek devices"
4
5# make /system writable
6if adb shell mount | grep -q "/system ext4 ro" ; then
7	echo "- remounting /system as read/write"
8	adb shell su root mount -o remount,rw /emmc@android /system
9fi
10
11if adb shell mount | grep -q "/system ext4 ro" ; then
12	echo "- remounting failed, abort"
13fi
14echo "- /system mounted as read/write"
15
16if adb shell stat /system/bin/BTstackDaemon | grep -q "regular file" ; then
17echo "- deleting BTstackDaemon and BTstackDaemonRespawn"
18adb shell su root rm /system/bin/BTstackDaemon
19adb shell su root rm /system/bin/BTstackDaemonRespawn
20fi
21
22echo "- stopping Bluetooth daemon"
23adb shell su root setprop ctl.stop mtkbt
24
25# put mtkbt back in place
26echo "- restore mtkbk"
27adb shell su root cp /system/bin/mtkbt_orig /system/bin/mtkbt
28
29echo "- start Bluetooth daemon"
30adb shell su root setprop ctl.start mtkbt
31
32echo "DONE"
33