Fix SuperSU support for helper module

This commit is contained in:
topjohnwu 2016-10-03 11:01:24 +08:00
parent 88c25a9390
commit f64f95d8ff
4 changed files with 13 additions and 8 deletions

View File

@ -344,6 +344,8 @@ if (! $NORESTORE); then
if [ -f "sbin/launch_daemonsu.sh" ]; then if [ -f "sbin/launch_daemonsu.sh" ]; then
SUPERSU=true SUPERSU=true
# Save it for helper module # Save it for helper module
mkdir -p /magisk/zzsupersu
touch /magisk/zzsupersu/stub
cp -af sbin/launch_daemonsu.sh $INSTALLER/roothelper/launch_daemonsu.sh cp -af sbin/launch_daemonsu.sh $INSTALLER/roothelper/launch_daemonsu.sh
fi fi
# Non-standard boot image restores # Non-standard boot image restores

View File

@ -16,6 +16,9 @@ launch_daemonsu() {
exec /magisk/phh/bin/su --daemon exec /magisk/phh/bin/su --daemon
} }
# Disable the other root
[ -d "/magisk/zzsupersu" ] && touch /magisk/zzsupersu/disable
log_print "Live patching sepolicy" log_print "Live patching sepolicy"
/magisk/phh/bin/sepolicy-inject --live /magisk/phh/bin/sepolicy-inject --live

View File

@ -4,12 +4,12 @@ cd /magisk/00roothelper
if [ -f "launch_daemonsu.sh" ]; then if [ -f "launch_daemonsu.sh" ]; then
# SuperSU mode # SuperSU mode
rm -rf /magisk/supersu /magisk/99supersu rm -rf /magisk/supersu /magisk/zzsupersu
mkdir -p /magisk/99supersu mkdir -p /magisk/zzsupersu
cp supersu.sh /magisk/99supersu/post-fs-data.sh cp supersu.sh /magisk/zzsupersu/post-fs-data.sh
cp supersu.prop /magisk/99supersu/module.prop cp supersu.prop /magisk/zzsupersu/module.prop
cp launch_daemonsu.sh /magisk/99supersu/launch_daemonsu.sh cp launch_daemonsu.sh /magisk/zzsupersu/launch_daemonsu.sh
chmod 755 /magisk/99supersu /magisk/99supersu/* chmod 755 /magisk/zzsupersu /magisk/zzsupersu/*
else else
# phh mode # phh mode
if [ -f "/magisk/phh/su" ]; then if [ -f "/magisk/phh/su" ]; then

View File

@ -4,8 +4,8 @@ mount -o rw,remount rootfs /
mkdir /su 2>/dev/null mkdir /su 2>/dev/null
mount -o ro,remount rootfs / mount -o ro,remount rootfs /
chmod 755 /magisk/99supersu/launch_daemonsu.sh chmod 755 /magisk/zzsupersu/launch_daemonsu.sh
/magisk/99supersu/launch_daemonsu.sh post-fs-data /magisk/zzsupersu/launch_daemonsu.sh post-fs-data
rm -rf /magisk/.core/bin rm -rf /magisk/.core/bin
ln -s /su/bin /magisk/.core/bin ln -s /su/bin /magisk/.core/bin