Implement revert_unmount_magisk

This commit is contained in:
Nullptr
2023-02-28 16:00:34 +08:00
parent 5f8eb4af09
commit 09b6673ab0
10 changed files with 258 additions and 92 deletions

View File

@@ -51,4 +51,6 @@ pub enum DaemonSocketAction {
// Zygisk process flags
pub const PROCESS_GRANTED_ROOT: u32 = 1 << 0;
pub const PROCESS_ON_DENYLIST: u32 = 1 << 1;
pub const PROCESS_ROOT_IS_KSU: u32 = 1 << 29;
pub const PROCESS_ROOT_IS_MAGISK: u32 = 1 << 30;
pub const PROCESS_IS_SYSUI: u32 = 1 << 31;

View File

@@ -201,6 +201,11 @@ fn handle_daemon_action(mut stream: UnixStream, context: &Context) -> Result<()>
if root_impl::uid_on_denylist(uid) {
flags |= constants::PROCESS_ON_DENYLIST;
}
match root_impl::get_impl() {
root_impl::RootImpl::KernelSU => flags |= constants::PROCESS_ROOT_IS_KSU,
root_impl::RootImpl::Magisk => flags |= constants::PROCESS_ROOT_IS_MAGISK,
_ => ()
}
// TODO: PROCESS_IS_SYSUI?
stream.write_u32(flags)?;
}