Skip to content

Commit

Permalink
Add support for Magisk 27006
Browse files Browse the repository at this point in the history
Version 27006 now requires init-ld to be included in the ramdisk.

Signed-off-by: Andrew Gunnerson <[email protected]>
  • Loading branch information
chenxiaolong committed Jul 28, 2024
1 parent 9a7cece commit f77ac33
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions avbroot/src/patch/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ impl MagiskRootPatcher {
const VER_XZ_BACKUP: Range<u32> =
26403..Self::VERS_SUPPORTED[Self::VERS_SUPPORTED.len() - 1].end;

const ZIP_INIT_LD: &'static str = "lib/arm64-v8a/libinit-ld.so";
const ZIP_LIBMAGISK: &'static str = "lib/arm64-v8a/libmagisk.so";
const ZIP_LIBMAGISK32: &'static str = "lib/armeabi-v7a/libmagisk32.so";
const ZIP_LIBMAGISK64: &'static str = "lib/arm64-v8a/libmagisk64.so";
Expand Down Expand Up @@ -462,6 +463,13 @@ impl BootImagePatch for MagiskRootPatcher {
xz_files.insert(Self::ZIP_STUB, b"overlay.d/sbin/stub.xz");
}

// Add init-ld, which only exists after Magisk commit
// 33aebb59763b6ec27209563035303700e998633d
if zip.file_names().any(|n| n == Self::ZIP_INIT_LD) {
debug!("Magisk init-ld found");
xz_files.insert(Self::ZIP_INIT_LD, b"overlay.d/sbin/init-ld.xz");
}

for (source, target) in xz_files {
let reader = zip
.by_name(source)
Expand Down

0 comments on commit f77ac33

Please sign in to comment.