2017-02-01 15:22:07 +00:00
|
|
|
#!/system/bin/sh
|
|
|
|
|
|
|
|
MODDIR=/magisk/.core/magiskhide
|
|
|
|
LOGFILE=/cache/magisk.log
|
2017-02-04 17:45:53 +00:00
|
|
|
TOOLPATH=/dev/busybox
|
2017-02-01 15:22:07 +00:00
|
|
|
|
|
|
|
log_print() {
|
|
|
|
echo "MagiskHide: $1"
|
|
|
|
echo "MagiskHide: $1" >> $LOGFILE
|
|
|
|
log -p i -t Magisk "MagiskHide: $1"
|
|
|
|
}
|
|
|
|
|
2017-02-05 15:41:24 +00:00
|
|
|
# Only disable when MagiskHide is started
|
2017-03-26 21:51:23 +00:00
|
|
|
$TOOLPATH/ps | grep "magiskhide --daemon" | grep -v grep >/dev/null 2>&1 || exit
|
2017-02-05 15:41:24 +00:00
|
|
|
|
2017-02-01 15:22:07 +00:00
|
|
|
log_print "Stopping MagiskHide daemon"
|
2017-02-05 15:41:24 +00:00
|
|
|
|
2017-02-01 15:22:07 +00:00
|
|
|
set --
|
2017-02-04 17:45:53 +00:00
|
|
|
set `$TOOLPATH/ps -o pid,args | grep "magiskhide" | grep -v grep | head -1` >/dev/null
|
2017-02-01 15:22:07 +00:00
|
|
|
[ ! -z "$1" ] && kill "$1"
|
|
|
|
|
|
|
|
while read PROCESS; do
|
|
|
|
log_print "Killing $PROCESS"
|
|
|
|
set --
|
2017-02-04 17:45:53 +00:00
|
|
|
set `$TOOLPATH/ps -o pid,args | grep "$PROCESS" | grep -v grep` >/dev/null
|
2017-02-01 15:22:07 +00:00
|
|
|
[ ! -z "$1" ] && kill "$1"
|
|
|
|
done < $MODDIR/hidelist
|