Add new util functions for new template version

This commit is contained in:
topjohnwu 2017-08-12 23:15:39 +08:00
parent 0b3c078aeb
commit 6eb7c0b5d6
2 changed files with 5 additions and 1 deletions

View File

@ -184,7 +184,7 @@ if ! $BOOTMODE; then
recovery_cleanup recovery_cleanup
fi fi
# rm -rf $TMPDIR rm -rf $TMPDIR
ui_print "- Done" ui_print "- Done"
exit 0 exit 0

View File

@ -191,6 +191,10 @@ request_size_check() {
reqSizeM=$((reqSizeM / 1024 + 1)) reqSizeM=$((reqSizeM / 1024 + 1))
} }
request_zip_size_check() {
reqSizeM=`unzip -l "$1" | tail -n 1 | awk '{ print int($1 / 1048567 + 1) }'`
}
image_size_check() { image_size_check() {
SIZE="`$MAGISKBIN/magisk --imgsize $IMG`" SIZE="`$MAGISKBIN/magisk --imgsize $IMG`"
curUsedM=`echo "$SIZE" | cut -d" " -f1` curUsedM=`echo "$SIZE" | cut -d" " -f1`