diff --git a/zip_static/common/magiskhide/disable b/zip_static/common/magiskhide/disable index 9e6961957..f7dda86c9 100644 --- a/zip_static/common/magiskhide/disable +++ b/zip_static/common/magiskhide/disable @@ -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" diff --git a/zip_static/common/magiskhide/enable b/zip_static/common/magiskhide/enable index bbce84b54..740ff1489 100644 --- a/zip_static/common/magiskhide/enable +++ b/zip_static/common/magiskhide/enable @@ -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`