Check before enable/disable

This commit is contained in:
topjohnwu 2017-02-05 23:41:24 +08:00
parent 9ad03994d1
commit 6d3ac2aa55
2 changed files with 7 additions and 0 deletions

View File

@ -10,7 +10,11 @@ log_print() {
log -p i -t Magisk "MagiskHide: $1"
}
# Only disable when MagiskHide is started
ps | grep "magiskhide --daemon" | grep -v grep >/dev/null 2>&1 || exit
log_print "Stopping MagiskHide daemon"
set --
set `$TOOLPATH/ps -o pid,args | grep "magiskhide" | grep -v grep | head -1` >/dev/null
[ ! -z "$1" ] && kill "$1"

View File

@ -11,6 +11,9 @@ log_print() {
log -p i -t Magisk "MagiskHide: $1"
}
# Only enable when isn't started
ps | grep "magiskhide --daemon" | grep -v grep >/dev/null 2>&1 && exit
log_print "Removing tampered read-only system props"
VERIFYBOOT=`getprop ro.boot.verifiedbootstate`