mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-07-28 21:53:38 +00:00
Check binary existence before injecting zygisk bins
This commit is contained in:
parent
898580bf90
commit
5e050d7456
@ -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(),
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user