mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-27 03:07:39 +00:00
28 lines
693 B
Bash
28 lines
693 B
Bash
#!/system/bin/sh
|
|
|
|
MODDIR=/magisk/.core/magiskhide
|
|
LOGFILE=/cache/magisk.log
|
|
TOOLPATH=/dev/busybox
|
|
|
|
log_print() {
|
|
echo "MagiskHide: $1"
|
|
echo "MagiskHide: $1" >> $LOGFILE
|
|
log -p i -t Magisk "MagiskHide: $1"
|
|
}
|
|
|
|
# Only disable when MagiskHide is started
|
|
$TOOLPATH/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"
|
|
|
|
while read PROCESS; do
|
|
log_print "Killing $PROCESS"
|
|
set --
|
|
set `$TOOLPATH/ps -o pid,args | grep "$PROCESS" | grep -v grep` >/dev/null
|
|
[ ! -z "$1" ] && kill "$1"
|
|
done < $MODDIR/hidelist
|