Fix magisk unmount

This commit is contained in:
Nullptr
2023-10-21 16:25:00 +08:00
parent 9f28e0a7ad
commit 9df4fb64cd

View File

@@ -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)) {