diff --git a/README.md b/README.md index 4df8564..ecb01d3 100644 --- a/README.md +++ b/README.md @@ -169,11 +169,17 @@ Command Examples: * [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) * [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 v22.1+ Successfully tested with Stock Kernel on +* [[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 10 (Q) API 29 Google Apis Play Store x86 r08 Darwin/MacOS Production Build](https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86-29_r08-darwin.zip) * [[June 2021] - Android 12 (S) API 30 Google Apis Play Store x86_64 r05 Darwin/MacOS Production Build](https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86_64-S_r05-darwin.zip) * [[Apr. 2021] - Android 12 (S) API 30 Google Apis Play Store x86_64 r04 Darwin/MacOS Production Build](https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86_64-S_r04-darwin.zip) * [[May. 2021] - Android Wear 8 (Oreo) API 26 Google Apis Play Store x86 r04 Darwin/MacOS Production Build](https://dl.google.com/android/repository/sys-img/android-wear/x86-26_r04.zip) @@ -193,14 +199,19 @@ Command Examples: * [[Mar. 2021] - Android 10 (Q) API 29 Google Apis Play Store x86_64 r08 Windows Production Build](https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86_64-29_r08-windows.zip) ### Change Logs -#### [July 2021] -* [rootAVD.bat] - Changed TestADB -* [General] - Added rootCROS Project to Links +#### [October 2021] +* [rootAVD.bat] - Added Shut Down Feature +* [rootAVD.sh] - Added Shut Down Feature +* [General] - Added Android 12 (S) API 31 Status +* [General] - Added Link to Android AppSecs Video about rootAVD
Archive ### Change Logs +#### [July 2021] +* [rootAVD.bat] - Changed TestADB +* [General] - Added rootCROS Project to Links #### [June 2021] * [General] - Android 12 (S) r05 #### [May 2021] @@ -259,3 +270,5 @@ Command Examples: * [Tad Fisher Android Nixpkgs](https://github.com/tadfisher/android-nixpkgs) * [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) + \ No newline at end of file diff --git a/rootAVD.bat b/rootAVD.bat index 733afae..cd0501a 100644 --- a/rootAVD.bat +++ b/rootAVD.bat @@ -136,16 +136,33 @@ if "%ERRORLEVEL%"=="1" ( call :installapps - echo [-] reboot the AVD and see if it worked + 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 + call :ShutDownAVD ) ) ) exit /B %ERRORLEVEL% +:ShutDownAVD + SetLocal EnableDelayedExpansion + set ADBPULLECHO= + + adb shell reboot -p > tmpFile 2>&1 + set /P ADBPULLECHO=Nul || ( + echo [-] Trying to shut down the AVD + ) + echo [^^!] If the AVD doesnt shut down, try it manually^^! + + EndLocal +exit /B 0 + :InstallKernelModules SetLocal EnableDelayedExpansion if exist "%BZFILE%" ( diff --git a/rootAVD.sh b/rootAVD.sh index 4cb2539..67f312c 100755 --- a/rootAVD.sh +++ b/rootAVD.sh @@ -314,6 +314,14 @@ TestADB() { fi } +ShutDownAVD() { + ADBPULLECHO=$(adb shell reboot -p 2>/dev/null) + if [[ ! "$ADBPULLECHO" == *"error"* ]]; then + echo "[-] Trying to shut down the AVD" + fi + echo "[!] If the AVD doesn't shut down, try it manually!" +} + CopyMagiskToAVD() { # Set Folders and FileNames echo "[*] Set Directorys" @@ -437,10 +445,11 @@ CopyMagiskToAVD() { install_apps - echo "[-] Shut-Down & Reboot the AVD and see if it worked" + 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" + ShutDownAVD fi fi } @@ -801,6 +810,8 @@ decompress_ramdisk(){ update_lib_modules echo "[*] Repacking ramdisk .." cd $TMPDIR/ramdisk > /dev/null + echo "[-] Deleting system ramdisk build.prop" + rm -rf $TMPDIR/ramdisk/system `find . | cpio -H newc -o > $CPIO` cd - > /dev/null else