topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
47.59k stars 12.08k forks source link

[Request] explicitly specify files/directories for MagiskHide to unmount instead of unmounting all items mounted by MagicMount #62

Closed Shadowghost closed 7 years ago

Shadowghost commented 7 years ago

Especially when dealing with large modules it's quite resource intens (and in case of libs most of the time not even possible and log spamming) for MagiskHide to always unmount every folder mounted by MagicMount. In most of the cases it's not even necessary for passing SafetyNet to unmount everything. So I thought it would be quite nice to have an option (inside the module config) to specify which files MagiskHide should unmount except the predefined mounts by Magisk itself.

Would be nice to have some opinions on this.

Regards

Shadowghost commented 7 years ago

After some digging I think in some cases the behavior of MagiskHide described above can lead to loosing root directly after boot. I always encounter this problem when a module mounts libs and other files which are actively in use while MagiskHide tries to unmount them when a safety net check comes in. MagiskHide now fails on unmounting them and somehow fails again on remounting the su binaries, so root is permanently lost until you turn off MagiskHide and reboot (you can still do that within the app since you have ~10secs after boot before MagiskHide initializes in which root is available).

Shadowghost commented 7 years ago

Just a push here, the problem if you want to call it one still persists on 11.6.

topjohnwu commented 7 years ago

Not possible, ALL mounts has to be unmounted in order for SafetyNet to work All the rules within MagiskHide are necessary

Shadowghost commented 7 years ago

Thanks for the info. Does it break root if an unmount fails?