Support MagiskHide when /sbin does not exist

This commit is contained in:
topjohnwu
2020-04-18 23:45:00 -07:00
parent 4c959cd983
commit 1e714af3cf
3 changed files with 20 additions and 16 deletions

View File

@ -87,13 +87,14 @@ void hide_unmount(int pid) {
vector<string> targets;
// Unmount dummy skeletons and /sbin links
targets.push_back(MAGISKTMP);
parse_mnt("/proc/self/mounts", [&](mntent *mentry) {
if (TMPFS_MNT(system) || TMPFS_MNT(vendor) || TMPFS_MNT(sbin) || TMPFS_MNT(product))
if (TMPFS_MNT(system) || TMPFS_MNT(vendor) || TMPFS_MNT(product) || TMPFS_MNT(system_ext))
targets.emplace_back(mentry->mnt_dir);
return true;
});
for (auto &s : targets)
for (auto &s : reversed(targets))
lazy_unmount(s.data());
targets.clear();
@ -104,7 +105,7 @@ void hide_unmount(int pid) {
return true;
});
for (auto &s : targets)
for (auto &s : reversed(targets))
lazy_unmount(s.data());
}