From a87ad35a50af86c5008b8fc41cc61cbe1da4d356 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 14 Jul 2017 01:01:25 +0800 Subject: [PATCH] Check Android version before actually doing anything Close #233 --- scripts/addon.d.sh | 3 +++ scripts/flash_script.sh | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/addon.d.sh b/scripts/addon.d.sh index 255e58d84..5040a9a0c 100644 --- a/scripts/addon.d.sh +++ b/scripts/addon.d.sh @@ -39,6 +39,9 @@ main() { api_level_arch_detect + # Check if system root is installed and remove + remove_system_su + recovery_actions find_boot_image diff --git a/scripts/flash_script.sh b/scripts/flash_script.sh index ccf68f42b..cda9c8306 100644 --- a/scripts/flash_script.sh +++ b/scripts/flash_script.sh @@ -66,14 +66,14 @@ getvar KEEPVERITY getvar KEEPFORCEENCRYPT getvar BOOTIMAGE -# Check if system root is installed and remove -remove_system_su - # Detect version and architecture api_level_arch_detect [ $API -lt 21 ] && abort "! Magisk is only for Lollipop 5.0+ (SDK 21+)" +# Check if system root is installed and remove +remove_system_su + ui_print "- Device platform: $ARCH" BINDIR=$INSTALLER/$ARCH