diff --git a/zip_static/META-INF/com/google/android/update-binary b/zip_static/META-INF/com/google/android/update-binary index 8610d7d43..43900cff2 100644 --- a/zip_static/META-INF/com/google/android/update-binary +++ b/zip_static/META-INF/com/google/android/update-binary @@ -344,6 +344,8 @@ if (! $NORESTORE); then if [ -f "sbin/launch_daemonsu.sh" ]; then SUPERSU=true # Save it for helper module + mkdir -p /magisk/zzsupersu + touch /magisk/zzsupersu/stub cp -af sbin/launch_daemonsu.sh $INSTALLER/roothelper/launch_daemonsu.sh fi # Non-standard boot image restores diff --git a/zip_static/roothelper/phh.sh b/zip_static/roothelper/phh.sh index 641d0446c..3a0a86a02 100644 --- a/zip_static/roothelper/phh.sh +++ b/zip_static/roothelper/phh.sh @@ -16,6 +16,9 @@ launch_daemonsu() { exec /magisk/phh/bin/su --daemon } +# Disable the other root +[ -d "/magisk/zzsupersu" ] && touch /magisk/zzsupersu/disable + log_print "Live patching sepolicy" /magisk/phh/bin/sepolicy-inject --live diff --git a/zip_static/roothelper/post-fs-data.sh b/zip_static/roothelper/post-fs-data.sh index d639ba810..1b6fc1f29 100644 --- a/zip_static/roothelper/post-fs-data.sh +++ b/zip_static/roothelper/post-fs-data.sh @@ -4,12 +4,12 @@ cd /magisk/00roothelper if [ -f "launch_daemonsu.sh" ]; then # SuperSU mode - rm -rf /magisk/supersu /magisk/99supersu - mkdir -p /magisk/99supersu - cp supersu.sh /magisk/99supersu/post-fs-data.sh - cp supersu.prop /magisk/99supersu/module.prop - cp launch_daemonsu.sh /magisk/99supersu/launch_daemonsu.sh - chmod 755 /magisk/99supersu /magisk/99supersu/* + rm -rf /magisk/supersu /magisk/zzsupersu + mkdir -p /magisk/zzsupersu + cp supersu.sh /magisk/zzsupersu/post-fs-data.sh + cp supersu.prop /magisk/zzsupersu/module.prop + cp launch_daemonsu.sh /magisk/zzsupersu/launch_daemonsu.sh + chmod 755 /magisk/zzsupersu /magisk/zzsupersu/* else # phh mode if [ -f "/magisk/phh/su" ]; then diff --git a/zip_static/roothelper/supersu.sh b/zip_static/roothelper/supersu.sh index 2129b5529..c64fa0748 100644 --- a/zip_static/roothelper/supersu.sh +++ b/zip_static/roothelper/supersu.sh @@ -4,8 +4,8 @@ mount -o rw,remount rootfs / mkdir /su 2>/dev/null mount -o ro,remount rootfs / -chmod 755 /magisk/99supersu/launch_daemonsu.sh -/magisk/99supersu/launch_daemonsu.sh post-fs-data +chmod 755 /magisk/zzsupersu/launch_daemonsu.sh +/magisk/zzsupersu/launch_daemonsu.sh post-fs-data rm -rf /magisk/.core/bin ln -s /su/bin /magisk/.core/bin