diff --git a/ksu-webui/src/index.js b/ksu-webui/src/index.js index 600902d..db07a30 100644 --- a/ksu-webui/src/index.js +++ b/ksu-webui/src/index.js @@ -42,7 +42,7 @@ async function main() { const pkgs = await run("pm list packages"); if (pkgs === undefined) return; - const detached_list_out = await run("detach list"); + const detached_list_out = await run("/data/adb/modules/zygisk-detach/system/bin/detach list"); if (detached_list_out === undefined) return; const detached = detached_list_out.split('\n'); @@ -64,7 +64,7 @@ async function main() { document.getElementById("detach").addEventListener('click', (e) => { const detach_arg = detach_list.join(' '); - run(`detach detachall "${detach_arg}"`).then((out) => toast(out)); + run(`/data/adb/modules/zygisk-detach/system/bin/detach detachall "${detach_arg}"`).then((out) => toast(out)); }); } diff --git a/magisk/customize.sh b/magisk/customize.sh index ba0646c..1c4b6a3 100644 --- a/magisk/customize.sh +++ b/magisk/customize.sh @@ -7,6 +7,16 @@ fi mv -f "$MODPATH/system/bin/detach-${ARCH}" "$MODPATH/system/bin/detach" rm "$MODPATH"/system/bin/detach-* +# symlink detach to manager path +# for ez termux usage +manager_paths="/data/adb/ap/bin /data/adb/ksu/bin" +for i in $manager_paths; do + if [ -d $i ] && [ ! -f $i/detach ]; then + echo "[+] creating symlink in $i" + ln -sf /data/adb/modules/zygisk-detach/system/bin/detach $i/detach + fi +done + # preserve detach.bin if [ -f "$NVBASE/modules/zygisk-detach/detach.bin" ]; then ui_print "- Preserving existing detach.bin" diff --git a/magisk/service.sh b/magisk/service.sh index 9118f77..4b50d8c 100644 --- a/magisk/service.sh +++ b/magisk/service.sh @@ -1,3 +1,11 @@ #!/system/bin/sh MODDIR=${0%/*} [ -f "$MODDIR/detach.txt" ] && "$MODDIR"/system/bin/detach serialize "$MODDIR/detach.txt" "$MODDIR/detach.bin" + +# yes we just create the symlink at every boot these tmpfs dirs +# magisk will add /debug_ramdisk, /sbin on $PATH +[ -f /data/adb/magisk/magisk ] && { + [ -w /sbin ] && rwdir=/sbin + [ -w /debug_ramdisk ] && rwdir=/debug_ramdisk + ln -sf $MODDIR/system/bin/detach $rwdir/detach +} diff --git a/magisk/skip_mount b/magisk/skip_mount new file mode 100644 index 0000000..e69de29 diff --git a/magisk/uninstall.sh b/magisk/uninstall.sh new file mode 100755 index 0000000..9343a5c --- /dev/null +++ b/magisk/uninstall.sh @@ -0,0 +1,2 @@ +rm /data/adb/ap/bin/detach +rm /data/adb/ksu/bin/detach