Several minor fixes

This commit is contained in:
topjohnwu 2017-02-05 01:45:53 +08:00
parent 69ded881c6
commit 35228f80b8
5 changed files with 9 additions and 9 deletions

View File

@ -51,10 +51,6 @@ for RC in init*.rc; do
sed -i "/import \/init\.environ\.rc/iimport /init.magisk.rc" $RC
cpio_add $RC 750
fi
if file_contain "trigger load_persist_props_action" $RC && ! file_contain "trigger load_magisk_props_action" $RC; then
sed -i "/trigger load_persist_props_action/a\ \ \ \ trigger load_magisk_props_action" $RC
cpio_add $RC 750
fi
if file_contain "selinux.reload_policy"; then
sed -i "/selinux.reload_policy/d" $RC
cpio_add $RC 750

View File

@ -2,12 +2,13 @@
HIDELIST=/magisk/.core/magiskhide/hidelist
PROCESS=$1
TOOLPATH=/dev/busybox
if [ ! -z "$PROCESS" ]; then
if [ `grep -c "^$PROCESS$" $HIDELIST` -eq "0" ]; then
echo "$PROCESS" >> $HIDELIST
set --
set `/data/busybox/ps -o pid,args | grep "$PROCESS" | grep -v grep` >/dev/null
set `$TOOLPATH/ps -o pid,args | grep "$PROCESS" | grep -v grep` >/dev/null
[ ! -z "$1" ] && kill "$1"
fi
fi

View File

@ -2,6 +2,7 @@
MODDIR=/magisk/.core/magiskhide
LOGFILE=/cache/magisk.log
TOOLPATH=/dev/busybox
log_print() {
echo "MagiskHide: $1"
@ -11,12 +12,12 @@ log_print() {
log_print "Stopping MagiskHide daemon"
set --
set `/data/busybox/ps -o pid,args | grep "magiskhide" | grep -v grep | head -1` >/dev/null
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 `/data/busybox/ps -o pid,args | grep "$PROCESS" | grep -v grep` >/dev/null
set `$TOOLPATH/ps -o pid,args | grep "$PROCESS" | grep -v grep` >/dev/null
[ ! -z "$1" ] && kill "$1"
done < $MODDIR/hidelist

View File

@ -3,6 +3,7 @@
MODDIR=/magisk/.core/magiskhide
BINPATH=/data/magisk
LOGFILE=/cache/magisk.log
TOOLPATH=/dev/busybox
log_print() {
echo "MagiskHide: $1"
@ -31,7 +32,7 @@ $MODDIR/add com.google.android.gms.unstable
while read PROCESS; do
log_print "Killing $PROCESS"
set --
set `/data/busybox/ps -o pid,args | grep "$PROCESS" | grep -v grep` >/dev/null
set `$TOOLPATH/ps -o pid,args | grep "$PROCESS" | grep -v grep` >/dev/null
[ ! -z "$1" ] && kill "$1"
done < $MODDIR/hidelist

View File

@ -2,12 +2,13 @@
HIDELIST=/magisk/.core/magiskhide/hidelist
PROCESS=$1
TOOLPATH=/dev/busybox
if [ ! -z "$PROCESS" ]; then
cp -af $HIDELIST $HIDELIST.tmp
cat $HIDELIST.tmp | grep -v "^$PROCESS$" > $HIDELIST
rm -f $HIDELIST.tmp
set --
set `/data/busybox/ps -o pid,args | grep "$PROCESS" | grep -v grep` >/dev/null
set `$TOOLPATH/ps -o pid,args | grep "$PROCESS" | grep -v grep` >/dev/null
[ ! -z "$1" ] && kill "$1"
fi