Support Magisk out of box

This commit is contained in:
Nullptr
2023-02-17 21:08:19 +08:00
parent c8ad933388
commit 9b5eb1bac7
5 changed files with 71 additions and 34 deletions

View File

@@ -1,8 +1,24 @@
#!/system/bin/sh
MODDIR=${0%/*}
if [ "$ZYGISK_ENABLED" ]; then
exit 0
fi
cd $MODDIR
cd "$MODDIR"
export NATIVE_BRIDGE=$(getprop ro.dalvik.vm.native.bridge)
if [ $(which magisk) ] && [ ".." -ef "/data/adb/modules" ]; then
for file in ../*; do
if [ -d "$file" ] && [ -d "$file/zygisk" ] && ! [ -f "$file/disable" ]; then
if [ -f "$file/post-fs-data.sh" ]; then
cd "$file"
log -p i -t "zygisksu" "Manually trigger post-fs-data.sh for $file"
sh "$(realpath ./post-fs-data.sh)"
cd "$MODDIR"
fi
fi
done
fi
unshare -m sh -c "./daemon.sh $@&"