Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Skip mounted detach #56

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ksu-webui/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -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));
});
}

Expand Down
10 changes: 10 additions & 0 deletions magisk/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions magisk/service.sh
Original file line number Diff line number Diff line change
@@ -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
}
Empty file added magisk/skip_mount
Empty file.
2 changes: 2 additions & 0 deletions magisk/uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rm /data/adb/ap/bin/detach
rm /data/adb/ksu/bin/detach