From 5e050d74563021b1cc323124544c9228a0ddd192 Mon Sep 17 00:00:00 2001 From: Wang Han <416810799@qq.com> Date: Mon, 2 Jun 2025 00:39:41 +0800 Subject: [PATCH] Check binary existence before injecting zygisk bins --- native/src/core/module.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/native/src/core/module.rs b/native/src/core/module.rs index f357b37f0..53e27ef00 100644 --- a/native/src/core/module.rs +++ b/native/src/core/module.rs @@ -440,12 +440,19 @@ fn inject_zygisk_bins(system: &mut FsNode, name: &str) { #[cfg(target_pointer_width = "32")] bin_path.append_path("magisk"); - children.insert( - name.to_string(), - FsNode::File { - src: bin_path.to_owned(), - }, - ); + // There are some devices that announce ABI as 64 bit only, but ship with linker64 + // because they make use of a special 32 bit to 64 bit translator (such as tango). + // In this case, magisk32 does not exist, so inserting it will cause bind mount + // failure and affect module mount. Native bridge injection does not support these + // kind of translators anyway, so simply check if magisk32 exists here. + if bin_path.exists() { + children.insert( + name.to_string(), + FsNode::File { + src: bin_path.to_owned(), + }, + ); + } } }