show root impl

This commit is contained in:
5ec1cff
2023-12-11 20:22:52 +08:00
parent 5d95f627bf
commit ad8510dee0
2 changed files with 7 additions and 2 deletions

View File

@@ -25,10 +25,15 @@ fn start() {
} else if args.len() == 2 && args[1] == "version" {
println!("Zygisk Next daemon {}", ZKSU_VERSION);
return;
} else if args.len() == 2 && args[1] == "root" {
root_impl::setup();
println!("root impl: {:?}", root_impl::get_impl());
return;
}
utils::switch_mount_namespace(1).expect("switch mnt ns");
root_impl::setup();
log::info!("current root impl: {:?}", root_impl::get_impl());
zygiskd::main().expect("zygiskd main");
}

View File

@@ -45,7 +45,7 @@ pub fn uid_granted_root(uid: i32) -> bool {
match get_impl() {
RootImpl::KernelSU => kernelsu::uid_granted_root(uid),
RootImpl::Magisk => magisk::uid_granted_root(uid),
_ => unreachable!(),
_ => panic!("uid_granted_root: unknown root impl {:?}", get_impl()),
}
}
@@ -53,6 +53,6 @@ pub fn uid_should_umount(uid: i32) -> bool {
match get_impl() {
RootImpl::KernelSU => kernelsu::uid_should_umount(uid),
RootImpl::Magisk => magisk::uid_should_umount(uid),
_ => unreachable!(),
_ => panic!("uid_should_umount: unknown root impl {:?}", get_impl()),
}
}