From 02e039d792c33367d13a9d4c76e8af22a33d9347 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 20 Mar 2017 05:03:52 +0800 Subject: [PATCH] Small fixes --- scripts/magic_mask.sh | 10 +++++----- scripts/magisk_uninstaller.sh | 3 +-- zip_static/common/magisk.apk | Bin 46517 -> 46522 bytes 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/magic_mask.sh b/scripts/magic_mask.sh index 00efcc7ca..d8ef8e047 100644 --- a/scripts/magic_mask.sh +++ b/scripts/magic_mask.sh @@ -310,7 +310,7 @@ case $1 in if [ -f $UNINSTALLER ]; then touch /dev/.magisk.unblock chcon u:object_r:device:s0 /dev/.magisk.unblock - sh $UNINSTALLER + BOOTMODE=true sh $UNINSTALLER exit fi @@ -493,10 +493,10 @@ case $1 in bind_mount $COREDIR/hosts /system/etc/hosts fi - if [ -f /data/magisk/magisk.apk ]; then - if [ -z `ls /data/app | grep com.topjohnwu.magisk` ]; then + if [ -f $BINPATH/magisk.apk ]; then + if ! ls /data/app | grep com.topjohnwu.magisk; then mkdir /data/app/com.topjohnwu.magisk-1 - cp /data/magisk/magisk.apk /data/app/com.topjohnwu.magisk-1/base.apk + cp $BINPATH/magisk.apk /data/app/com.topjohnwu.magisk-1/base.apk chown 1000.1000 /data/app/com.topjohnwu.magisk-1 chown 1000.1000 /data/app/com.topjohnwu.magisk-1/base.apk chmod 755 /data/app/com.topjohnwu.magisk-1 @@ -504,7 +504,7 @@ case $1 in chcon u:object_r:apk_data_file:s0 /data/app/com.topjohnwu.magisk-1 chcon u:object_r:apk_data_file:s0 /data/app/com.topjohnwu.magisk-1/base.apk fi - rm -f /data/magisk/magisk.apk 2>/dev/null + rm -f $BINPATH/magisk.apk 2>/dev/null fi # Expose busybox diff --git a/scripts/magisk_uninstaller.sh b/scripts/magisk_uninstaller.sh index d245138c1..68ae15b32 100644 --- a/scripts/magisk_uninstaller.sh +++ b/scripts/magisk_uninstaller.sh @@ -1,5 +1,4 @@ -# Detect whether in boot mode -ps | grep zygote | grep -v grep >/dev/null && BOOTMODE=true || BOOTMODE=false +[ -z $BOOTMODE ] && BOOTMODE=false # This path should work in any cases TMPDIR=/dev/tmp diff --git a/zip_static/common/magisk.apk b/zip_static/common/magisk.apk index 6913d406ca38396989da61203e40f21391ce66b8..d273535118d449c77f7002b34f894b50c41359d3 100644 GIT binary patch delta 42 ucmdn`nrYW-rUk-`yqkm{3o`Ozit3m^$(i> delta 33 rcmV++0N($)>jJgw0-zJK0Tbg9v*jem3bU;*dl<7RNRuYBy>9(R2ICK9