From c8497596821135282a9b8e0b380ef58db7327a64 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Fri, 11 Feb 2022 04:34:26 +0800 Subject: [PATCH] Use magiskboot to patch avd Fix #5421 --- build.py | 2 +- scripts/avd_patch.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.py b/build.py index 2024e8c46..5cacda890 100755 --- a/build.py +++ b/build.py @@ -491,7 +491,7 @@ def patch_avd_ramdisk(args): 'scripts/avd_patch.sh', '/data/local/tmp']) if proc.returncode != 0: error('adb push failed!') - proc = execv([adb_path, 'push', backup, '/data/local/tmp/ramdisk.cpio.gz']) + proc = execv([adb_path, 'push', backup, '/data/local/tmp/ramdisk.cpio.tmp']) if proc.returncode != 0: error('adb push failed!') diff --git a/scripts/avd_patch.sh b/scripts/avd_patch.sh index 9856ae9fa..bd8f686fb 100644 --- a/scripts/avd_patch.sh +++ b/scripts/avd_patch.sh @@ -57,7 +57,7 @@ for file in lib*.so; do mv "$file" "${file:3:${#file}-6}" done -gzip -d ramdisk.cpio.gz +./magiskboot decompress ramdisk.cpio.tmp ramdisk.cpio cp ramdisk.cpio ramdisk.cpio.orig touch config @@ -84,4 +84,4 @@ export KEEPFORCEENCRYPT=true "add 000 .backup/.magisk config" rm -f ramdisk.cpio.orig config magisk*.xz -gzip -9 ramdisk.cpio +./magiskboot compress=gzip ramdisk.cpio ramdisk.cpio.gz