Support Magisk Manager boot image file patch

This commit is contained in:
topjohnwu
2017-08-31 03:08:09 +08:00
parent 189c671ce2
commit f63af0601c
3 changed files with 21 additions and 15 deletions

View File

@ -1,6 +1,12 @@
# EX_ARM, EX_X86, BB_ARM, and BB_X86 should be generated in build.py
dirname_wrap() {
case "$1" in
*/*) dir=${1%/*}; [ -z $dir ] && echo "/" || echo $dir ;;
*) echo "." ;;
esac
}
[ "$1" = "indep" ] && INDEP=true || INDEP=false
$INDEP && TMPDIR=/data/local/tmp || TMPDIR=/dev/tmp
$INDEP && TMPDIR="`cd "\`dirname_wrap "${BASH_SOURCE:-$0}"\`" && pwd`" || TMPDIR=/dev/tmp
INSTALLER=$TMPDIR/install; BBDIR=$TMPDIR/bin
EXBIN=$BBDIR/b64xz; BBBIN=$BBDIR/busybox
$INDEP || rm -rf $TMPDIR 2>/dev/null;
@ -17,7 +23,7 @@ $BBBIN --install -s $TMPDIR/bin
export PATH=$BBDIR:$PATH
if $INDEP; then
shift
exec sh $@
exec sh "$@"
else
mkdir -p $INSTALLER
unzip -o "$3" -d $INSTALLER