From ef52c3117eccd6788b849fa75e7cfb18d8fc2dfb Mon Sep 17 00:00:00 2001 From: newbit1 Date: Tue, 27 Jun 2023 23:32:51 +0200 Subject: [PATCH] improved finding BusyBox routine, and once again --- README.md | 1 + rootAVD.sh | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7286216..1c1786a 100644 --- a/README.md +++ b/README.md @@ -371,6 +371,7 @@ rootAVD.bat system-images\android-25\google_apis_playstore\armeabi-v7a\ramdisk.i ### Change Logs #### [June 2023] +* [rootAVD.sh] - improved finding BusyBox routine, and once again * [rootAVD.sh] - rewritten the file and folder handling entirely, Darwin and Linux * [rootAVD.sh] - improved finding BusyBox routine, again * [General] - Added `.gitattributes` with `*.sh text eol=lf` to force UNIX line ending on Windows diff --git a/rootAVD.sh b/rootAVD.sh index b59bbfb..000f5c1 100755 --- a/rootAVD.sh +++ b/rootAVD.sh @@ -19,7 +19,6 @@ getdir() { get_flags() { echo "[-] Get Flags" - if [ -f /system/init -o -L /system/init ]; then SYSTEM_ROOT=true else @@ -1112,18 +1111,22 @@ TestingBusyBoxVersion() { local busyboxworks=false local RESULT="" - echo "[*] Testing Busybox ..." + echo "[*] Testing Busybox $1" rm -fR $TMP mkdir -p $TMP cd $TMP > /dev/null - $($1 unzip $MZ -oq > /dev/null 2>&1) + $(ASH_STANDALONE=1 $1 sh -c 'grep' > /dev/null 2>&1) RESULT="$?" - if [[ "$RESULT" != "0" ]]; then - echo "[!] Busybox binary does not support extracting Magisk.zip" - else - busyboxworks=true + if [[ "$RESULT" != "255" ]]; then + $($1 unzip $MZ -oq > /dev/null 2>&1) + RESULT="$?" + if [[ "$RESULT" != "0" ]]; then + echo "[!] Busybox binary does not support extracting Magisk.zip" + else + busyboxworks=true + fi fi cd - > /dev/null