Merge pull request #183 from hwti/patch-1

Fix phh-securize.sh with Magisk modules
This commit is contained in:
Pierre-Hugues HUSSON 2020-05-10 12:53:02 +02:00 committed by GitHub
commit 88003acb57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,18 +1,28 @@
#!/system/bin/sh #!/system/bin/sh
mount -o remount,rw / SYSTEM=/system
mount -o remount,rw /system [ -d /sbin/.magisk/mirror/system ] && SYSTEM=/sbin/.magisk/mirror/system
for MOUNTPOINT in \
/sbin/.magisk/mirror/system_root \
/sbin/.magisk/mirror/system \
/system \
/
do
[ -d $MOUNTPOINT ] && mountpoint -q $MOUNTPOINT && break
done
mount -o remount,rw $MOUNTPOINT
remount remount
touch /system/phh/secure touch $SYSTEM/phh/secure
umount -l /system/xbin/su umount -l $SYSTEM/xbin/su
rm /system/xbin/su rm $SYSTEM/xbin/su
rm /system/bin/phh-su rm $SYSTEM/bin/phh-su
rm /system/etc/init/su.rc rm $SYSTEM/etc/init/su.rc
rm /system/bin/phh-securize.sh rm $SYSTEM/bin/phh-securize.sh
rm -Rf /system/{app,priv-app}/me.phh.superuser/ rm -Rf $SYSTEM/{app,priv-app}/me.phh.superuser/
rm -Rf /data/su || true rm -Rf /data/su || true
mount -o remount,ro / mount -o remount,ro $MOUNTPOINT
mount -o remount,ro /system
sync sync
reboot reboot