From 55869c2ea43ce7a8b905357bc1ad45d26fa8cdf3 Mon Sep 17 00:00:00 2001 From: NewBit Date: Tue, 12 Oct 2021 22:27:02 +0200 Subject: [PATCH] Added Alpha Channel to the Menu --- README.md | 104 +++++++++++++++++++++++++++++++++--------- rootAVD.bat | 5 +- rootAVD.sh | 129 ++++++++++++++++++++++++++++++++++++++++------------ 3 files changed, 186 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 6b87f55..4e9a46a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # rootAVD ### [newbit @ xda-developers](https://forum.xda-developers.com/m/newbit.1350876) A Script to... -* root your Android Studio Virtual Device (AVD), with Magisk (Stable or Canary) +* root your Android Studio Virtual Device (AVD), with Magisk (Stable, Canary or Alpha) * patch its fstab * download and install the USB HOST Permissions Module for Magisk * install custom build Kernel and its Modules @@ -21,7 +21,6 @@ A Script to... * `adb shell` will connect to the running AVD ## rootAVD Help Menu -### Linux & MacOS & Windows ``` rootAVD A Script to root AVD by NewBit XDA @@ -36,6 +35,7 @@ Arguments: - only works with an already Magisk patched ramdisk.img - without [DIR/ramdisk.img] [OPTIONS] [PATCHFSTAB] - needed since Android 12 (S) rev.1 + - not needed anymore since Android 12 (S) API 31 and Magisk Alpha - Grant Shell Su Permissions will pop up a few times - the AVD will reboot automatically @@ -87,23 +87,26 @@ Extra Commands can be combined, there is no particular order. Notes: rootAVD will - always create .backup files of ramdisk.img and kernel-ranchu - replace both when done patching -- show a Menu, to choose the Magisk Version (Stable || Canary), if the AVD is online +- show a Menu, to choose the Magisk Version (Stable || Canary || Alpha), if the AVD is online - make the choosen Magisk Version to its local - install all APKs placed in the Apps folder - +``` +### Linux & MacOS +``` Command Examples: ./rootAVD.sh ./rootAVD.sh ListAllAVDs ./rootAVD.sh EnvFixTask ./rootAVD.sh InstallApps -./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/x86_64/ramdisk.img -./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/x86_64/ramdisk.img DEBUG PATCHFSTAB GetUSBHPmodZ -./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/x86_64/ramdisk.img restore -./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/x86_64/ramdisk.img InstallKernelModules -./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/x86_64/ramdisk.img InstallPrebuiltKernelModules -./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/x86_64/ramdisk.img InstallPrebuiltKernelModules GetUSBHPmodZ PATCHFSTAB DEBUG +./rootAVD.sh ~/Library/Android/sdk/system-images/android-31/google_apis_playstore/x86_64/ramdisk.img +./rootAVD.sh ~/Library/Android/sdk/system-images/android-31/google_apis_playstore/x86_64/ramdisk.img DEBUG PATCHFSTAB GetUSBHPmodZ +./rootAVD.sh ~/Library/Android/sdk/system-images/android-31/google_apis_playstore/x86_64/ramdisk.img restore +./rootAVD.sh ~/Library/Android/sdk/system-images/android-31/google_apis_playstore/x86_64/ramdisk.img InstallKernelModules +./rootAVD.sh ~/Library/Android/sdk/system-images/android-31/google_apis_playstore/x86_64/ramdisk.img InstallPrebuiltKernelModules +./rootAVD.sh ~/Library/Android/sdk/system-images/android-31/google_apis_playstore/x86_64/ramdisk.img InstallPrebuiltKernelModules GetUSBHPmodZ PATCHFSTAB DEBUG ``` +
Command Examples: for ALL installed AVDs @@ -134,18 +137,71 @@ Command Examples: ./rootAVD.sh ~/Library/Android/sdk/system-images/android-30/google_apis_playstore/x86_64/ramdisk.img InstallPrebuiltKernelModules ./rootAVD.sh ~/Library/Android/sdk/system-images/android-30/google_apis_playstore/x86_64/ramdisk.img InstallPrebuiltKernelModules GetUSBHPmodZ PATCHFSTAB DEBUG -./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/x86_64/ramdisk.img -./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/x86_64/ramdisk.img DEBUG PATCHFSTAB GetUSBHPmodZ -./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/x86_64/ramdisk.img restore -./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/x86_64/ramdisk.img InstallKernelModules -./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/x86_64/ramdisk.img InstallPrebuiltKernelModules -./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/x86_64/ramdisk.img InstallPrebuiltKernelModules GetUSBHPmodZ PATCHFSTAB DEBUG +./rootAVD.sh ~/Library/Android/sdk/system-images/android-31/google_apis_playstore/x86_64/ramdisk.img +./rootAVD.sh ~/Library/Android/sdk/system-images/android-31/google_apis_playstore/x86_64/ramdisk.img DEBUG PATCHFSTAB GetUSBHPmodZ +./rootAVD.sh ~/Library/Android/sdk/system-images/android-31/google_apis_playstore/x86_64/ramdisk.img restore +./rootAVD.sh ~/Library/Android/sdk/system-images/android-31/google_apis_playstore/x86_64/ramdisk.img InstallKernelModules +./rootAVD.sh ~/Library/Android/sdk/system-images/android-31/google_apis_playstore/x86_64/ramdisk.img InstallPrebuiltKernelModules +./rootAVD.sh ~/Library/Android/sdk/system-images/android-31/google_apis_playstore/x86_64/ramdisk.img InstallPrebuiltKernelModules GetUSBHPmodZ PATCHFSTAB DEBUG ```
+### Windows +``` +Command Examples: +rootAVD.bat +rootAVD.bat ListAllAVDs +rootAVD.bat EnvFixTask +rootAVD.bat InstallApps +rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-31\google_apis_playstore\x86_64\ramdisk.img +rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-31\google_apis_playstore\x86_64\ramdisk.img DEBUG PATCHFSTAB GetUSBHPmodZ +rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-31\google_apis_playstore\x86_64\ramdisk.img restore +rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-31\google_apis_playstore\x86_64\ramdisk.img InstallKernelModules +rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-31\google_apis_playstore\x86_64\ramdisk.img InstallPrebuiltKernelModules +rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-31\google_apis_playstore\x86_64\ramdisk.img InstallPrebuiltKernelModules GetUSBHPmodZ PATCHFSTAB DEBUG +``` + +
+Command Examples: for ALL installed AVDs + +``` +./rootAVD.bat +./rootAVD.bat ListAllAVDs +./rootAVD.bat EnvFixTask +./rootAVD.bat InstallApps + +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-29\android-automotive-playstore\x86\ramdisk.img +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-29\android-automotive-playstore\x86\ramdisk.img DEBUG PATCHFSTAB GetUSBHPmodZ +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-29\android-automotive-playstore\x86\ramdisk.img restore +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-29\android-automotive-playstore\x86\ramdisk.img InstallKernelModules +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-29\android-automotive-playstore\x86\ramdisk.img InstallPrebuiltKernelModules +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-29\android-automotive-playstore\x86\ramdisk.img InstallPrebuiltKernelModules GetUSBHPmodZ PATCHFSTAB DEBUG + +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-29\google_apis_playstore\x86_64\ramdisk.img +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-29\google_apis_playstore\x86_64\ramdisk.img DEBUG PATCHFSTAB GetUSBHPmodZ +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-29\google_apis_playstore\x86_64\ramdisk.img restore +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-29\google_apis_playstore\x86_64\ramdisk.img InstallKernelModules +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-29\google_apis_playstore\x86_64\ramdisk.img InstallPrebuiltKernelModules +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-29\google_apis_playstore\x86_64\ramdisk.img InstallPrebuiltKernelModules GetUSBHPmodZ PATCHFSTAB DEBUG + +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-30\google_apis_playstore\x86_64\ramdisk.img +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-30\google_apis_playstore\x86_64\ramdisk.img DEBUG PATCHFSTAB GetUSBHPmodZ +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-30\google_apis_playstore\x86_64\ramdisk.img restore +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-30\google_apis_playstore\x86_64\ramdisk.img InstallKernelModules +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-30\google_apis_playstore\x86_64\ramdisk.img InstallPrebuiltKernelModules +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-30\google_apis_playstore\x86_64\ramdisk.img InstallPrebuiltKernelModules GetUSBHPmodZ PATCHFSTAB DEBUG + +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-31\google_apis_playstore\x86_64\ramdisk.img +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-31\google_apis_playstore\x86_64\ramdisk.img DEBUG PATCHFSTAB GetUSBHPmodZ +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-31\google_apis_playstore\x86_64\ramdisk.img restore +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-31\google_apis_playstore\x86_64\ramdisk.img InstallKernelModules +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-31\google_apis_playstore\x86_64\ramdisk.img InstallPrebuiltKernelModules +./rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-31\google_apis_playstore\x86_64\ramdisk.img InstallPrebuiltKernelModules GetUSBHPmodZ PATCHFSTAB DEBUG +``` +
### Notes -* Android 12 (S) rev.2+ needs Magisk v22.1+ or Canary -* With the new Menu, you can choose between the newest Magisk, Canary and Stable, Version. +* Android 12 (S) API 31 is a 64 Bit Only System, needs Magisk Alpha +* With the new Menu, you can choose between the newest Magisk, Canary, Stable and Alpha, Version. * Once choosen, the script will make that Version to your local one. * Prebuilt Kernel and Modules will be pulled from [AOSP](https://android.googlesource.com/kernel/prebuilts) @@ -171,15 +227,17 @@ Command Examples: ### Links * [XDA [GUIDE] Build / Mod AVD Kernel Android 10 / 11 rootAVD [Magisk] [USB passthrough Linux] [Google Play Store API]](https://forum.xda-developers.com/t/guide-build-mod-avd-kernel-android10-x86_64-29-root-magisk-usb-passthrough-linux.4212719) * [Inject Android Hardware USB HOST Permissions](https://github.com/newbit1/usbhostpermissons) -* [XDA [SCRIPT] rootAVD - root your Android Studio Virtual Device emulator with Magisk [Android 11][Linux][Darwin/MacOS][WIN][Google Play Store APIs]](https://forum.xda-developers.com/t/script-rootavd-root-your-android-studio-virtual-device-emulator-with-magisk-android-11-linux-darwin-macos-win-google-play-store-apis.4218123) +* [XDA [SCRIPT] rootAVD - root your Android Studio Virtual Device emulator with Magisk [Android 12][Linux][Darwin/MacOS][WIN][Google Play Store APIs]](https://forum.xda-developers.com/t/script-rootavd-root-your-android-studio-virtual-device-emulator-with-magisk-android-11-linux-darwin-macos-win-google-play-store-apis.4218123) * [rootCROS - A Script to root your Google Chrome OS installed on a non Chromebook Device](https://github.com/newbit1/rootCROS) * [Video - Android Studio Emulator (AVD) Rooting with Magisk using rootAVD](https://www.youtube.com/watch?v=JR4gDRYzY2c) ### XDA [GUIDE] How to [Build|Mod|Update] a custom AVD Kernel and its Modules * [[GUIDE][Build|Mod|Update][kernel-ranchu][goldfish][5.4][5.10][GKI][ramdisk.img][modules][rootAVD][Android 11(R) 12(S)][AVD][Google Play Store API]](https://forum.xda-developers.com/t/guide-build-mod-update-kernel-ranchu-goldfish-5-4-5-10-gki-ramdisk-img-modules-rootavd-android-11-r-12-s-avd-google-play-store-api.4220697) -### Magisk doesn't work on -* [[July 2021] - Android 12 (S) API 31 Google Apis Play Store x86_64 r06 Darwin/MacOS Production Build](https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86_64-31_r06-darwin.zip) +### Magisk v23.0 Alpha Successfully tested with Stock Kernel on +* [[Oct. 2021] - Android 12 (S) API 31 Google Apis Play Store x86_64 r08 Darwin/MacOS Production Build](https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86_64-31_r08-darwin.zip) +* [[Oct. 2021] - Android 11 (R) API 30 Google Apis Play Store x86 r09 Darwin/MacOS Production Build](https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86-30_r09-darwin.zip) +* [[Oct. 2021] - Android 11 (R) API 30 Google Apis Play Store x86_64 r10 Darwin/MacOS Production Build](https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86_64-30_r10-darwin.zip) ### Magisk v22.1+ Successfully tested with Stock Kernel on * [[Oct. 2021] - Android 11 (R) API 30 Google Apis Play Store x86 r09 Windows Production Build](https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86-30_r09-windows.zip) @@ -206,6 +264,7 @@ Command Examples: ### Change Logs #### [October 2021] +* [General] - Added Alpha Channel to the Menu * [rootAVD.bat] - Added Shut Down Feature * [rootAVD.sh] - Added Shut Down Feature * [General] - Added Android 12 (S) API 31 Status @@ -277,4 +336,5 @@ Command Examples: * [Sébastien Corne magisk-single-user](https://github.com/seebz) * [remote-android Native Bridge Support in ReDroid](https://github.com/remote-android/redroid-doc/tree/master/native_bridge) * [Android AppSec - for his wonderful little video about this script](https://www.youtube.com/c/AndroidAppSec) - +* [vvb2060 Magisk Alpha](https://github.com/vvb2060/magisk_files/) + \ No newline at end of file diff --git a/rootAVD.bat b/rootAVD.bat index 52b6c06..db1e8a1 100644 --- a/rootAVD.bat +++ b/rootAVD.bat @@ -139,7 +139,7 @@ if "%ERRORLEVEL%"=="1" ( echo [-] Shut-Down and Reboot [Cold Boot Now] the AVD and see if it worked echo [-] Root and Su with Magisk for Android Studio AVDs echo [-] Modded by NewBit XDA - Jan. 2021 - echo [*] Huge Credits and big Thanks to topjohnwu and shakalaca + echo [*] Huge Credits and big Thanks to topjohnwu, shakalaca and vvb2060 call :ShutDownAVD ) ) @@ -377,6 +377,7 @@ exit /B 0 echo - only works with an already Magisk patched ramdisk.img echo - without [DIR/ramdisk.img] [OPTIONS] [PATCHFSTAB] echo - needed since Android 12 (S) rev.1 + echo - not needed anymore since Android 12 (S) API 31 and Magisk Alpha echo - Grant Shell Su Permissions will pop up a few times echo - the AVD will reboot automatically echo. @@ -428,7 +429,7 @@ exit /B 0 echo Notes: rootAVD will echo - always create .backup files of ramdisk.img and kernel-ranchu echo - replace both when done patching - echo - show a Menu, to choose the Magisk Version (Stable ^|^| Canary), if the AVD is online + echo - show a Menu, to choose the Magisk Version (Stable ^|^| Canary ^|^| Alpha), if the AVD is online echo - make the choosen Magisk Version to its local echo - install all APKs placed in the Apps folder echo. diff --git a/rootAVD.sh b/rootAVD.sh index 67f312c..235f67c 100755 --- a/rootAVD.sh +++ b/rootAVD.sh @@ -62,35 +62,88 @@ api_level_arch_detect() { echo "[-] Api Level Arch Detect" # Detect version and architecture # To select the right files for the patching - API=$(getprop ro.build.version.sdk) + ABI=$(getprop ro.product.cpu.abi) - ABI2=$(getprop ro.product.cpu.abi2) - ABILONG=$(getprop ro.product.cpu.abi) + ABILIST32=$(getprop ro.product.cpu.abilist32) + ABILIST64=$(getprop ro.product.cpu.abilist64) + + API=$(getprop ro.build.version.sdk) FIRSTAPI=$(getprop ro.product.first_api_level) - ARCH=arm - ARCH32=arm + IS64BIT=false - if [ "$ABI" = "x86" ]; then ARCH=x86; ARCH32=x86; fi; - if [ "$ABI2" = "x86" ]; then ARCH=x86; ARCH32=x86; fi; - if [ "$ABILONG" = "arm64-v8a" ]; then ARCH=arm64; ARCH32=arm; IS64BIT=true; fi; - if [ "$ABILONG" = "x86_64" ]; then ARCH=x64; ARCH32=x86; IS64BIT=true; fi; + IS64BITONLY=false + IS32BITONLY=false + + if [ "$ABI" = "x86" ]; then + ARCH=x86 + ARCH32=x86 + elif [ "$ABI" = "arm64-v8a" ]; then + ARCH=arm64 + ARCH32=arm + IS64BIT=true + elif [ "$ABI" = "x86_64" ]; then + ARCH=x64 + ARCH32=x86 + IS64BIT=true + #elif [ "$ABI" = "armeabi-v7a" ]; then + else + ARCH=arm + ARCH32=arm + #ABI=armeabi-v7a + #ABI32=armeabi-v7a + #IS64BIT=false + fi + + #if [ "$ABI" = "x86" ]; then ARCH=x86; ARCH32=x86; fi; + #if [ "$ABILONG" = "arm64-v8a" ]; then ARCH=arm64; ARCH32=arm; IS64BIT=true; fi; + #if [ "$ABILONG" = "x86_64" ]; then ARCH=x64; ARCH32=x86; IS64BIT=true; fi; + + if [ -z "$ABILIST32" ]; then + IS64BITONLY=true + fi + + if [ -z "$ABILIST64" ]; then + IS32BITONLY=true + fi + + if $IS64BITONLY || $IS32BITONLY ; then + echo "[-] Device Platform is $ARCH only" + else + echo "[-] Device Platform: $ARCH" + echo "[-] ARCH32 $ARCH32" + fi - echo "[-] Device Platform: $ARCH" - echo "[-] Device SDK API: $API" - echo "[-] ARCH32 $ARCH32" + echo "[-] Device SDK API: $API" echo "[-] First API Level: $FIRSTAPI" - - # There is only a x86 or arm DIR with binaries - BINDIR=$BASEDIR/lib/$ARCH32 - - [ ! -d "$BINDIR" ] && BINDIR=$BASEDIR/lib/armeabi-v7a + + if $IS64BIT && ! $IS64BITONLY; then + BINDIR=$BASEDIR/lib/$ABI + cd $BINDIR + for file in lib*.so; do mv "$file" "${file:3:${#file}-6}"; done + cd $BASEDIR + echo "[*] copy all $ABI files from $BINDIR to $BASEDIR" + cp $BINDIR/* $BASEDIR 2>/dev/null + fi + + BINDIR=$BASEDIR/lib/$ARCH32 + #[ ! -d "$BINDIR" ] && BINDIR=$BASEDIR/lib/armeabi-v7a cd $BINDIR - for file in lib*.so; do mv "$file" "${file:3:${#file}-6}"; done + for file in lib*.so; do mv "$file" "${file:3:${#file}-6}"; done cd $BASEDIR - echo "[*] copy all files from $BINDIR to $BASEDIR" + echo "[*] copy all $ARCH32 files from $BINDIR to $BASEDIR" cp $BINDIR/* $BASEDIR - + + # If 64 Bit Only, make sure you have 64 Bit Binarys + if ( "$IS64BITONLY" ); then + BINDIR=$BASEDIR/lib/$ABI + cd $BINDIR + for file in lib*.so; do mv "$file" "${file:3:${#file}-6}"; done + cd $BASEDIR + echo "[*] copy all $ARCH only files from $BINDIR to $BASEDIR" + cp $BINDIR/* $BASEDIR 2>/dev/null + fi + chmod -R 755 $BASEDIR [ -d /system/lib64 ] && IS64BIT=true || IS64BIT=false @@ -448,7 +501,7 @@ CopyMagiskToAVD() { echo "[-] Shut-Down & Reboot (Cold Boot Now) the AVD and see if it worked" echo "[-] Root and Su with Magisk for Android Studio AVDs" echo "[-] Modded by NewBit XDA - Jan. 2021" - echo "[!] Huge Credits and big Thanks to topjohnwu and shakalaca" + echo "[!] Huge Credits and big Thanks to topjohnwu, shakalaca and vvb2060" ShutDownAVD fi fi @@ -555,29 +608,37 @@ CheckAvailableMagisks() { CheckAVDIsOnline if ("$AVDIsOnline"); then echo "[!] Checking available Magisk Versions" - URL="https://raw.githubusercontent.com/topjohnwu/magisk-files/master/" + URL="https://raw.githubusercontent.com/topjohnwu/magisk-files/master/" + ALPHAURL="https://raw.githubusercontent.com/vvb2060/magisk_files/alpha/" + CANJSON="canary.json" STABLJSON="stable.json" - rm $CANJSON $STABLJSON > /dev/null 2>&1 + ALPHAJSON="alpha.json" + rm $CANJSON $STABLJSON $ALPHAJSON > /dev/null 2>&1 $BB wget -q --no-check-certificate $URL$CANJSON $BB wget -q --no-check-certificate $URL$STABLJSON + $BB wget -q --no-check-certificate $ALPHAURL$ALPHAJSON MAGISK_CAN_VER=$(json_value "version" < $CANJSON) MAGISK_CAN_VER_CODE=$(json_value "versionCode" 1 < $CANJSON) MAGISK_CAN_DL=$(json_value "link" 1 < $CANJSON) - MAGISK_CAN_VER=$(GetPrettyVer $MAGISK_CAN_VER $MAGISK_CAN_VER_CODE) MAGISK_STABL_VER=$(json_value "version" < $STABLJSON) MAGISK_STABL_VER_CODE=$(json_value "versionCode" 1 < $STABLJSON) MAGISK_STABL_DL=$(json_value "link" 1 < $STABLJSON) - MAGISK_STABL_VER=$(GetPrettyVer $MAGISK_STABL_VER $MAGISK_STABL_VER_CODE) + + MAGISK_ALPHA_VER=$(json_value "version" < $ALPHAJSON) + MAGISK_ALPHA_VER_CODE=$(json_value "versionCode" 1 < $ALPHAJSON) + MAGISK_ALPHA_DL=$(json_value "link" 1 < $ALPHAJSON) + MAGISK_ALPHA_VER=$(GetPrettyVer $MAGISK_ALPHA_VER $MAGISK_ALPHA_VER_CODE) MAGISK_V1="[1] Local $MAGISK_LOCL_VER (ENTER)" MAGISK_V2="[2] Canary $MAGISK_CAN_VER" MAGISK_V3="[3] Stable $MAGISK_STABL_VER" + MAGISK_V4="[4] Alpha $MAGISK_ALPHA_VER" while : do @@ -585,6 +646,7 @@ CheckAvailableMagisks() { echo $MAGISK_V1 echo $MAGISK_V2 echo $MAGISK_V3 + echo $MAGISK_V4 read choice case $choice in "1"|"") @@ -605,6 +667,14 @@ CheckAvailableMagisks() { echo "[$choice] You choose Magisk Stable Version $MAGISK_STABL_VER" break ;; + "4") + MAGISK_VER=$MAGISK_ALPHA_VER + # Alpha Entry is diffrent from Magisk-files + MAGISK_DL=$ALPHAURL$MAGISK_ALPHA_DL + echo "[$choice] You choose Magisk Alpha Version $MAGISK_ALPHA_VER" + break + ;; + *) echo "invalid option $choice";; esac done @@ -705,12 +775,14 @@ PrepBusyBoxAndMagisk() { cd $BASEDIR echo "[*] Extracting busybox and Magisk.zip ..." + rm -rf lib assets + $(which unzip > /dev/null 2>&1) if [[ "$?" == "0" ]]; then - unzip $MZ -oq + unzip $MZ -oq "lib/*" "assets/*" else ExtractBusyboxFromScript $@ - $BB unzip $MZ -oq + $BB unzip $MZ -oq "lib/*" "assets/*" fi chmod -R 755 $BASEDIR/lib @@ -1218,6 +1290,7 @@ echo " - construct Magisk Environment manual" echo " - only works with an already Magisk patched ramdisk.img" echo " - without [DIR/ramdisk.img] [OPTIONS] [PATCHFSTAB]" echo " - needed since Android 12 (S) rev.1" +echo " - not needed anymore since Android 12 (S) API 31 and Magisk Alpha" echo " - Grant Shell Su Permissions will pop up a few times" echo " - the AVD will reboot automatically" echo "" @@ -1271,7 +1344,7 @@ echo " " echo "${bold}Notes: rootAVD will${normal}" echo "- always create ${bold}.backup${normal} files of ${bold}ramdisk.img${normal} and ${bold}kernel-ranchu${normal}" echo "- ${bold}replace${normal} both when done patching" -echo "- show a ${bold}Menu${normal}, to choose the Magisk Version ${bold}(Stable || Canary)${normal}, if the AVD is ${bold}online${normal}" +echo "- show a ${bold}Menu${normal}, to choose the Magisk Version ${bold}(Stable || Canary || Alpha)${normal}, if the AVD is ${bold}online${normal}" echo "- make the ${bold}choosen${normal} Magisk Version to its ${bold}local${normal}" echo "- install all APKs placed in the Apps folder" echo " "