From 9df4fb64cdc07d33d018d9f2e2e65cfd41907905 Mon Sep 17 00:00:00 2001 From: Nullptr Date: Sat, 21 Oct 2023 16:25:00 +0800 Subject: [PATCH] Fix magisk unmount --- loader/src/injector/unmount.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/loader/src/injector/unmount.cpp b/loader/src/injector/unmount.cpp index f4aea2b..49a23b6 100644 --- a/loader/src/injector/unmount.cpp +++ b/loader/src/injector/unmount.cpp @@ -18,7 +18,9 @@ namespace { if (umount2(mountpoint, MNT_DETACH) != -1) { LOGD("Unmounted (%s)", mountpoint); } else { +#ifndef NDEBUG PLOGE("Unmount (%s)", mountpoint); +#endif } } } @@ -35,7 +37,7 @@ void revert_unmount_ksu() { ksu_loop = info.source; continue; } - // Unmount everything on /data/adb except ksu module dir + // Unmount everything mounted to /data/adb if (info.target.starts_with("/data/adb")) { targets.emplace_back(info.target); } @@ -73,6 +75,14 @@ void revert_unmount_magisk() { info.root.starts_with("/adb/modules")) { // bind mount from data partition targets.push_back(info.target); } + // Unmount everything mounted to /data/adb + if (info.target.starts_with("/data/adb")) { + targets.emplace_back(info.target); + } + // Unmount fuse + if (info.type == "fuse" && info.source == ZYGISK_FUSE_SOURCE) { + targets.emplace_back(info.target); + } } for (auto& s: reversed(targets)) {