Never allow multiple root implementation

This commit is contained in:
Nullptr
2023-02-24 08:57:51 +08:00
parent d08b415577
commit 915749e59b
5 changed files with 13 additions and 4 deletions

View File

@@ -13,6 +13,9 @@ static ROOT_IMPL: OnceCell<RootImpl> = OnceCell::new();
pub fn setup() -> Result<()> {
if kernelsu::is_kernel_su()? {
if let Ok(true) = magisk::is_magisk() {
bail!("Multiple root implementation");
}
let _ = ROOT_IMPL.set(RootImpl::KernelSU);
} else if magisk::is_magisk()? {
let _ = ROOT_IMPL.set(RootImpl::Magisk);