From d3d853ac825561c74a0a0e58b63b5b6c90420e90 Mon Sep 17 00:00:00 2001 From: osm0sis Date: Mon, 13 Jan 2020 01:17:19 -0400 Subject: [PATCH] AK3: only attempt to dump .magisk config if patch found --- tools/ak3-core.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ak3-core.sh b/tools/ak3-core.sh index 150991d..8a7ffe7 100755 --- a/tools/ak3-core.sh +++ b/tools/ak3-core.sh @@ -212,7 +212,7 @@ repack_ramdisk() { cd $home; $bin/magiskboot cpio ramdisk-new.cpio test; magisk_patched=$?; - $bin/magiskboot cpio ramdisk-new.cpio "extract .backup/.magisk $split_img/.magisk"; + test $((magisk_patched & 3)) -eq 1 && $bin/magiskboot cpio ramdisk-new.cpio "extract .backup/.magisk $split_img/.magisk"; if [ "$comp" ]; then $bin/magiskboot compress=$comp ramdisk-new.cpio; if [ $? != 0 ]; then @@ -308,7 +308,7 @@ flash_boot() { if [ ! "$magisk_patched" ]; then $bin/magiskboot cpio ramdisk.cpio test; magisk_patched=$?; - $bin/magiskboot cpio ramdisk.cpio "extract .backup/.magisk .magisk"; + test $((magisk_patched & 3)) -eq 1 && $bin/magiskboot cpio ramdisk.cpio "extract .backup/.magisk .magisk"; fi; if [ "$kernel" ]; then cp -f $kernel kernel;