From cd5f5d702fa9017a4ca72a145c43ae31835f34d4 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 11 Sep 2017 15:26:34 +0800 Subject: [PATCH] Fix stock image dump not stored correctly --- scripts/flash_script.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/flash_script.sh b/scripts/flash_script.sh index f09b2890a..94fc0b764 100644 --- a/scripts/flash_script.sh +++ b/scripts/flash_script.sh @@ -89,6 +89,9 @@ if $BOOTMODE; then rm -rf /dev/magisk/mirror/bin 2>/dev/null fi +# Save our stock boot image dump before removing it +[ -f $MAGISKBIN/stock_boot* ] && mv $MAGISKBIN/stock_boot* /data + # Copy required files rm -rf $MAGISKBIN 2>/dev/null mkdir -p $MAGISKBIN @@ -119,7 +122,10 @@ cd $MAGISKBIN # Source the boot patcher . $COMMONDIR/boot_patch.sh "$BOOTIMAGE" -[ -f stock_boot* ] && rm -f /data/stock_boot* 2>/dev/null +if [ -f stock_boot* ]; then + rm -f /data/stock_boot* 2>/dev/null + mv stock_boot* /data +fi ui_print "- Flashing new boot image" if [ -L "$BOOTIMAGE" ]; then