mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-08-12 14:27:47 +00:00
Move root helper location
This commit is contained in:
9
zip_static/common/roothelper/phh.prop
Normal file
9
zip_static/common/roothelper/phh.prop
Normal file
@@ -0,0 +1,9 @@
|
||||
id=phh
|
||||
name=phh's SuperUser
|
||||
version=Root Helper
|
||||
versionCode=1
|
||||
author=phhusson, topjohnwu
|
||||
description=This is a helper, please upgrade from downloads section :)
|
||||
support=http://forum.xda-developers.com/showthread.php?t=3216394
|
||||
donate=http://forum.xda-developers.com/donatetome.php?u=1915408
|
||||
cacheModule=false
|
40
zip_static/common/roothelper/phh.sh
Normal file
40
zip_static/common/roothelper/phh.sh
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/system/bin/sh
|
||||
|
||||
LOGFILE=/cache/magisk.log
|
||||
|
||||
log_print() {
|
||||
echo $1
|
||||
echo "phh: $1" >> $LOGFILE
|
||||
log -p i -t phh "$1"
|
||||
}
|
||||
|
||||
launch_daemonsu() {
|
||||
export PATH=$OLDPATH
|
||||
# Switch contexts
|
||||
echo "u:r:su_daemon:s0" > /proc/self/attr/current
|
||||
# Start daemon
|
||||
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
|
||||
|
||||
# Expose the root path
|
||||
log_print "Linking supath"
|
||||
rm -rf /magisk/.core/bin
|
||||
ln -s /magisk/phh/bin /magisk/.core/bin
|
||||
|
||||
# Run su.d
|
||||
for script in /magisk/phh/su.d/* ; do
|
||||
if [ -f "$script" ]; then
|
||||
chmod 755 $script
|
||||
log_print "su.d: $script"
|
||||
$script
|
||||
fi
|
||||
done
|
||||
|
||||
log_print "Starting su daemon"
|
||||
(launch_daemonsu &)
|
29
zip_static/common/roothelper/post-fs-data.sh
Normal file
29
zip_static/common/roothelper/post-fs-data.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/system/bin/sh
|
||||
|
||||
cd /magisk/00roothelper
|
||||
|
||||
if [ -f "launch_daemonsu.sh" ]; then
|
||||
# SuperSU mode
|
||||
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
|
||||
# Old version detected
|
||||
cp /magisk/phh/su su
|
||||
rm -rf /magisk/phh
|
||||
mkdir -p /magisk/phh/bin
|
||||
mkdir -p /magisk/phh/su.d
|
||||
cp su /magisk/phh/bin/su
|
||||
cp /data/magisk/sepolicy-inject /magisk/phh/bin/sepolicy-inject
|
||||
cp phh.sh /magisk/phh/post-fs-data.sh
|
||||
cp phh.prop /magisk/phh/module.prop
|
||||
chmod 755 /magisk/phh /magisk/phh/* /magisk/phh/bin/*
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -rf /magisk/00roothelper
|
7
zip_static/common/roothelper/supersu.prop
Normal file
7
zip_static/common/roothelper/supersu.prop
Normal file
@@ -0,0 +1,7 @@
|
||||
id=supersu
|
||||
name=SuperSU Helper
|
||||
version=v1
|
||||
versionCode=1
|
||||
author=topjohnwu
|
||||
description=This is a helper module for Chainfire's SuperSU to work with Magisk
|
||||
cacheModule=false
|
11
zip_static/common/roothelper/supersu.sh
Normal file
11
zip_static/common/roothelper/supersu.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/system/bin/sh
|
||||
|
||||
mount -o rw,remount rootfs /
|
||||
mkdir /su 2>/dev/null
|
||||
mount -o ro,remount rootfs /
|
||||
|
||||
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
|
Reference in New Issue
Block a user