From 6eb7c0b5d6e0cfd1ffa2c156a440871fc56f5f3f Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 12 Aug 2017 23:15:39 +0800 Subject: [PATCH] Add new util functions for new template version --- scripts/flash_script.sh | 2 +- scripts/util_functions.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/flash_script.sh b/scripts/flash_script.sh index e0f53c5c6..4d7099217 100644 --- a/scripts/flash_script.sh +++ b/scripts/flash_script.sh @@ -184,7 +184,7 @@ if ! $BOOTMODE; then recovery_cleanup fi -# rm -rf $TMPDIR +rm -rf $TMPDIR ui_print "- Done" exit 0 diff --git a/scripts/util_functions.sh b/scripts/util_functions.sh index 1f252018b..d54c31b70 100644 --- a/scripts/util_functions.sh +++ b/scripts/util_functions.sh @@ -191,6 +191,10 @@ request_size_check() { reqSizeM=$((reqSizeM / 1024 + 1)) } +request_zip_size_check() { + reqSizeM=`unzip -l "$1" | tail -n 1 | awk '{ print int($1 / 1048567 + 1) }'` +} + image_size_check() { SIZE="`$MAGISKBIN/magisk --imgsize $IMG`" curUsedM=`echo "$SIZE" | cut -d" " -f1`