Skip to content

Commit

Permalink
Fix incorrect ksu denylist meaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-TSNG authored Apr 21, 2023
1 parent 250b4b2 commit 3eee57e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions zygiskd/src/root_impl/kernelsu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const KERNEL_SU_OPTION: i32 = 0xdeadbeefu32 as i32;

const CMD_GET_VERSION: usize = 2;
const CMD_GET_ALLOW_LIST: usize = 5;
const CMD_GET_DENY_LIST: usize = 6;

pub enum Version {
Supported,
Expand Down Expand Up @@ -35,9 +34,5 @@ pub fn uid_on_allowlist(uid: i32) -> bool {

#[inline(never)]
pub fn uid_on_denylist(uid: i32) -> bool {
let mut size = 1024u32;
let mut uids = vec![0; size as usize];
unsafe { prctl(KERNEL_SU_OPTION, CMD_GET_DENY_LIST, uids.as_mut_ptr(), &mut size as *mut u32) };
uids.resize(size as usize, 0);
uids.contains(&uid)
false
}

0 comments on commit 3eee57e

Please sign in to comment.