2019-01-15 08:32:18 -05:00
|
|
|
#!/sbin/sh
|
2021-01-22 02:28:53 -08:00
|
|
|
|
|
|
|
TMPDIR=/dev/tmp
|
|
|
|
rm -rf $TMPDIR
|
|
|
|
mkdir -p $TMPDIR 2>/dev/null
|
|
|
|
|
|
|
|
export BBBIN=$TMPDIR/busybox
|
2021-05-12 13:40:53 +08:00
|
|
|
for arch in "x86_64" "x86" "arm64-v8a" "armeabi-v7a"; do
|
2021-05-29 22:30:25 +08:00
|
|
|
unzip -o "$3" "lib/$arch/libbusybox.so" -d $TMPDIR >&2
|
2021-05-12 13:40:53 +08:00
|
|
|
libpath="$TMPDIR/lib/$arch/libbusybox.so"
|
2021-05-29 22:30:25 +08:00
|
|
|
chmod 755 $libpath
|
2021-05-12 13:40:53 +08:00
|
|
|
if [ -x $libpath ] && $libpath >/dev/null 2>&1; then
|
|
|
|
mv -f $libpath $BBBIN
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
2021-01-22 02:28:53 -08:00
|
|
|
$BBBIN rm -rf $TMPDIR/lib
|
|
|
|
|
|
|
|
export INSTALLER=$TMPDIR/install
|
|
|
|
$BBBIN mkdir -p $INSTALLER
|
|
|
|
$BBBIN unzip -o "$3" "assets/*" "lib/*" "META-INF/com/google/*" -x "lib/*/libbusybox.so" -d $INSTALLER >&2
|
|
|
|
export ASH_STANDALONE=1
|
2021-01-24 07:18:14 -08:00
|
|
|
if echo "$3" | $BBBIN grep -q "uninstall"; then
|
|
|
|
exec $BBBIN sh "$INSTALLER/assets/uninstaller.sh" "$@"
|
2021-01-23 20:21:43 +08:00
|
|
|
else
|
|
|
|
exec $BBBIN sh "$INSTALLER/META-INF/com/google/android/updater-script" "$@"
|
|
|
|
fi
|