Update uninstaller

This commit is contained in:
topjohnwu
2017-02-06 03:22:37 +08:00
parent 14204c9bfc
commit faab79b41a
7 changed files with 179 additions and 204 deletions

View File

@@ -2,6 +2,7 @@
LOGFILE=/cache/magisk.log
DISABLEFILE=/cache/.disable_magisk
UNINSTALLER=/cache/magisk_uninstaller.sh
IMG=/data/magisk.img
WHITELIST="/system/bin"
@@ -262,7 +263,7 @@ case $1 in
# Cleanup legacy stuffs...
rm -rf /cache/magisk /cache/magisk_merge /cache/magiskhide.log
[ -f $DISABLEFILE ] && unblock
[ -f $DISABLEFILE -o -f $UNINSTALLER ] && unblock
if [ -d /cache/magisk_mount ]; then
log_print "* Mounting cache files"
@@ -303,6 +304,13 @@ case $1 in
# Live patch sepolicy
$BINPATH/sepolicy-inject --live
if [ -f $UNINSTALLER ]; then
touch /dev/.magisk.unblock
chcon u:object_r:device:s0 /dev/.magisk.unblock
BOOTMODE=true sh $UNINSTALLER
exit
fi
# Set up environment
mkdir -p $TOOLPATH
$BINPATH/busybox --install -s $TOOLPATH