From c19c5be18cbbd61b8f8639ff325725deb5ed68f8 Mon Sep 17 00:00:00 2001 From: osm0sis Date: Sun, 3 Apr 2022 09:02:59 -0300 Subject: [PATCH] AK3: fix unpack/repack with magiskboot zimage kernel support - exclude "zimage" as a compression type since magiskboot unpack, split and repack handle it automatically and there is no fallback - ensure $comp is a working command for all busybox compression fallbacks --- META-INF/com/google/android/updater-script | 2 +- tools/ak3-core.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/META-INF/com/google/android/updater-script b/META-INF/com/google/android/updater-script index c915721..d26cf45 100644 --- a/META-INF/com/google/android/updater-script +++ b/META-INF/com/google/android/updater-script @@ -3,4 +3,4 @@ # Dummy file; update-binary is a shell script (DO NOT CHANGE) # # -# AK_BASE_VERSION=20220310 +# AK_BASE_VERSION=20220403 diff --git a/tools/ak3-core.sh b/tools/ak3-core.sh index ad94085..5e592ca 100755 --- a/tools/ak3-core.sh +++ b/tools/ak3-core.sh @@ -320,9 +320,9 @@ flash_boot() { fi; if [ $((magisk_patched & 3)) -eq 1 ]; then ui_print " " "Magisk detected! Patching kernel so reflashing Magisk is not necessary..."; - comp=$($bin/magiskboot decompress kernel 2>&1 | grep -v 'raw' | sed -n 's;.*\[\(.*\)\];\1;p'); + comp=$($bin/magiskboot decompress kernel 2>&1 | grep -vE 'raw|zimage' | sed -n 's;.*\[\(.*\)\];\1;p'); ($bin/magiskboot split $kernel || $bin/magiskboot decompress $kernel kernel) 2>/dev/null; - if [ $? != 0 -a "$comp" ]; then + if [ $? != 0 -a "$comp" ] && $comp --help 2>/dev/null; then echo "Attempting kernel unpack with busybox $comp..." >&2; $comp -dc $kernel > kernel; fi; @@ -332,7 +332,7 @@ flash_boot() { fi; if [ "$comp" ]; then $bin/magiskboot compress=$comp kernel kernel.$comp; - if [ $? != 0 ]; then + if [ $? != 0 ] && $comp --help 2>/dev/null; then echo "Attempting kernel repack with busybox $comp..." >&2; $comp -9c kernel > kernel.$comp; fi;