diff --git a/jni/su b/jni/su index 1d2eb13ca..8475cecfe 160000 --- a/jni/su +++ b/jni/su @@ -1 +1 @@ -Subproject commit 1d2eb13cae13380bbccff4b0ba77c14140158ea8 +Subproject commit 8475cecfeb47fbc596898fb9fb296b5027bdc46b diff --git a/scripts/flash_script.sh b/scripts/flash_script.sh index 282190b45..11fd67db1 100644 --- a/scripts/flash_script.sh +++ b/scripts/flash_script.sh @@ -381,13 +381,14 @@ if (! $SUPERSU); then fi # SuperSU already have root, no need to install root - if [ ! -d /magisk/phh ]; then - ui_print "- Installing phh's SuperUser" - mkdir -p /magisk/phh/bin - mkdir -p /magisk/phh/su.d + if [ ! -d /magisk/phh -o `grep_prop versionCode /magisk/phh/module.prop` -lt \ + `grep_prop versionCode $INSTALLER/common/phh/module.prop` ]; then + ui_print "- Installing/Upgrading phh's SuperUser" + mkdir -p /magisk/phh/bin 2>/dev/null + mkdir -p /magisk/phh/su.d 2>/dev/null cp -af $INSTALLER/common/phh/. /magisk/phh cp -af $BINDIR/su $BINDIR/sepolicy-inject /magisk/phh/bin - chmod -R 755 /magisk/phh + chmod -R 755 /magisk/phh/bin fi fi diff --git a/zip_static/common/phh/module.prop b/zip_static/common/phh/module.prop index 81134d64a..444634a59 100644 --- a/zip_static/common/phh/module.prop +++ b/zip_static/common/phh/module.prop @@ -1,7 +1,7 @@ id=phh name=phh's SuperUser -version=r266-2 -versionCode=4 +version=r266 (topjohnwu v1) +versionCode=5 author=phhusson & topjohnwu description=OpenSource SELinux-capable SuperUser support=http://forum.xda-developers.com/showthread.php?t=3216394 diff --git a/zip_static/common/phh/service.sh b/zip_static/common/phh/service.sh index 3c1ece822..88d52fc29 100644 --- a/zip_static/common/phh/service.sh +++ b/zip_static/common/phh/service.sh @@ -9,19 +9,6 @@ log_print() { log -p i -t phh "$1" } -launch_daemonsu() { - # Revert to original path, legacy issue - case $PATH in - *busybox* ) - export PATH=$OLDPATH - ;; - esac - # Switch contexts - echo "u:r:su_daemon:s0" > /proc/self/attr/current - # Start daemon - exec /sbin/su --daemon -} - # Disable the other root [ -d "/magisk/zzsupersu" ] && touch /magisk/zzsupersu/disable @@ -47,4 +34,5 @@ for script in $MODDIR/su.d/* ; do done log_print "Starting su daemon" -(launch_daemonsu &) +[ ! -z $OLDPATH ] && export PATH=$OLDPATH +/sbin/su --daemon