From 35228f80b8c7f083b4d17f0a357c61bf451cbba9 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 5 Feb 2017 01:45:53 +0800 Subject: [PATCH] Several minor fixes --- scripts/custom_ramdisk_patch.sh | 4 ---- zip_static/common/magiskhide/add | 3 ++- zip_static/common/magiskhide/disable | 5 +++-- zip_static/common/magiskhide/enable | 3 ++- zip_static/common/magiskhide/rm | 3 ++- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/custom_ramdisk_patch.sh b/scripts/custom_ramdisk_patch.sh index 83386d91e..4cde3dbb7 100644 --- a/scripts/custom_ramdisk_patch.sh +++ b/scripts/custom_ramdisk_patch.sh @@ -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 diff --git a/zip_static/common/magiskhide/add b/zip_static/common/magiskhide/add index 1a362e317..c723bc65c 100644 --- a/zip_static/common/magiskhide/add +++ b/zip_static/common/magiskhide/add @@ -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 diff --git a/zip_static/common/magiskhide/disable b/zip_static/common/magiskhide/disable index a6a068b24..9e6961957 100644 --- a/zip_static/common/magiskhide/disable +++ b/zip_static/common/magiskhide/disable @@ -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 diff --git a/zip_static/common/magiskhide/enable b/zip_static/common/magiskhide/enable index 50ab2a3be..bbce84b54 100644 --- a/zip_static/common/magiskhide/enable +++ b/zip_static/common/magiskhide/enable @@ -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 diff --git a/zip_static/common/magiskhide/rm b/zip_static/common/magiskhide/rm index 587adc588..ba5c7c749 100644 --- a/zip_static/common/magiskhide/rm +++ b/zip_static/common/magiskhide/rm @@ -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