@@ -31,26 +31,26 @@ BOOTIMAGE=$2
3131FLASH_TO_DEVICE=$3
3232shift 2
3333
34- [ -z " $SUPERKEY " ] && { >&2 echo " - SuperKey empty! " ; exit 1; }
35- [ -e " $BOOTIMAGE " ] || { >&2 echo " - $BOOTIMAGE does not exist! " ; exit 1; }
34+ [ -z " $SUPERKEY " ] && { >&2 echo " ! SuperKey empty" ; exit 1; }
35+ [ -e " $BOOTIMAGE " ] || { >&2 echo " ! $BOOTIMAGE does not exist" ; exit 1; }
3636
3737# Check for dependencies
38- command -v magiskboot > /dev/null 2>&1 || { >&2 echo " - Command magiskboot not found! " ; exit 1; }
39- command -v kptools > /dev/null 2>&1 || { >&2 echo " - Command kptools not found! " ; exit 1; }
38+ command -v magiskboot > /dev/null 2>&1 || { >&2 echo " ! Command magiskboot not found" ; exit 1; }
39+ command -v kptools > /dev/null 2>&1 || { >&2 echo " ! Command kptools not found" ; exit 1; }
4040
4141if [ ! -f kernel ]; then
4242echo " - Unpacking boot image"
4343magiskboot unpack " $BOOTIMAGE " > /dev/null 2>&1
4444 if [ $? -ne 0 ]; then
45- >&2 echo " - Unpack error: $? "
45+ >&2 echo " ! Unpack error: $? "
4646 exit 1
4747 fi
4848fi
4949
5050if [ ! $( kptools -i kernel -f | grep CONFIG_KALLSYMS=y) ]; then
51- echo " - Patcher has Aborted! "
52- echo " - APatch requires CONFIG_KALLSYMS to be Enabled."
53- echo " - But your kernel seems NOT enabled it."
51+ echo " ! Patcher has Aborted. "
52+ echo " ! APatch requires CONFIG_KALLSYMS to be Enabled."
53+ echo " ! But your kernel seems NOT enabled it."
5454 exit 1
5555fi
5656
@@ -69,21 +69,21 @@ patch_rc=$?
6969set +x
7070
7171if [ $patch_rc -ne 0 ]; then
72- >&2 echo " - Patch kernel error: $patch_rc "
72+ >&2 echo " ! Patch kernel error: $patch_rc "
7373 exit 1
7474fi
7575
7676echo " - Repacking boot image"
7777magiskboot repack " $BOOTIMAGE " > /dev/null 2>&1
7878
7979if [ ! $( kptools -i kernel.ori -f | grep CONFIG_KALLSYMS_ALL=y) ]; then
80- echo " - Detected CONFIG_KALLSYMS_ALL is not set!"
81- echo " - APatch has patched but maybe your device won't boot."
82- echo " - Make sure you have original boot image backup."
80+ echo " ! Detected CONFIG_KALLSYMS_ALL is not set!"
81+ echo " ! APatch has patched but maybe your device won't boot."
82+ echo " ! Make sure you have original boot image backup."
8383fi
8484
8585if [ $? -ne 0 ]; then
86- >&2 echo " - Repack error: $? "
86+ >&2 echo " ! Repack error: $? "
8787 exit 1
8888fi
8989
@@ -93,13 +93,15 @@ if [ "$FLASH_TO_DEVICE" = "true" ]; then
9393 echo " - Flashing new boot image"
9494 flash_image new-boot.img " $BOOTIMAGE "
9595 if [ $? -ne 0 ]; then
96- >&2 echo " - Flash error: $? "
96+ >&2 echo " ! Flash error: $? "
97+ save_image_to_storage " new-boot.img"
9798 exit 1
9899 fi
99100 fi
100101
101102 echo " - Successfully Flashed!"
102103else
104+ save_image_to_storage " new-boot.img"
103105 echo " - Successfully Patched!"
104106fi
105107
0 commit comments