No inline for root_impl

This commit is contained in:
Nullptr
2023-03-21 22:55:14 +08:00
parent 87cf885070
commit a6f455218f
5 changed files with 8 additions and 4 deletions

View File

@@ -24,6 +24,7 @@ pub fn get_kernel_su() -> Option<Version> {
}
}
#[inline(never)]
pub fn uid_on_allowlist(uid: i32) -> bool {
let mut size = 1024u32;
let mut uids = vec![0; size as usize];
@@ -32,6 +33,7 @@ pub fn uid_on_allowlist(uid: i32) -> bool {
uids.contains(&uid)
}
#[inline(never)]
pub fn uid_on_denylist(uid: i32) -> bool {
let mut size = 1024u32;
let mut uids = vec![0; size as usize];

View File

@@ -23,6 +23,7 @@ pub fn get_magisk() -> Option<Version> {
})
}
#[inline(never)]
pub fn uid_on_allowlist(uid: i32) -> bool {
let output: Option<String> = Command::new("magisk")
.arg("--sqlite")
@@ -40,6 +41,7 @@ pub fn uid_on_allowlist(uid: i32) -> bool {
})
}
#[inline(never)]
pub fn uid_on_denylist(uid: i32) -> bool {
// TODO: uid_on_denylist
return false;

View File

@@ -198,7 +198,7 @@ fn handle_daemon_action(mut stream: UnixStream, context: &Context) -> Result<()>
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,
_ => ()
_ => unreachable!(),
}
// TODO: PROCESS_IS_SYSUI?
stream.write_u32(flags)?;