Files
root-avd/README.md
T
2021-04-06 09:10:27 +02:00

7.2 KiB

rootAVD

newbit @ xda-developers

A Script to root your Android Studio Virtual Device (AVD), with Magisk within seconds.

Preconditions

  • the AVD is running
  • a command prompt / terminal is opened
  • adb shell will connect to the running AVD

How To Use it

  • run rootAVD with a path to an AVDs ramdisk.img file
  • rootAVD will backup that ramdisk.img and replace it when done patching

How To Use it under Android S with Magisk v22

  • rootAVD needs to run twice
  • 1st - to patch the ramdisk.img
  • 2nd - after Shut-Down & Reboot the AVD:
    • Option 1 - re-run same script command
    • Option 2 - run script with EnvFixTask Argument
      • The "Additional Setup Required" will not be triggered in Android S by Magisk App in AVD,
      • this must be done manually on the 2nd run
      • Grant Shell Su Permissions will pop up a few times
      • rootAVD will reboot the AVD automatically
      • check Magisk App !!

Linux

./rootAVD.sh ~/Android/Sdk/system-images/android-S/google_apis_playstore/x86_64/ramdisk.img
./rootAVD.sh EnvFixTask

MacOS

./rootAVD.sh ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/x86_64/ramdisk.img
./rootAVD.sh EnvFixTask

Windows

set PATH=%LOCALAPPDATA%\Android\Sdk\platform-tools;%PATH%
rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-S\google_apis_playstore\x86_64\ramdisk.img

Notes

  • Android 12 (S) rev.2 needs Magisk Canary
  • With the new Menu, you can choose between the newest Magisk, Canary and Stable, Version.
  • Once choosen, the script will make that Version to your local one.

Options

  • Install all APKs placed in the Apps folder
  • If you set PATCHFSTAB=true
    • fstab.ranchu will get patched to automount Block Devices like /dev/block/sda1
    • !! a custom build Kernel is needed !!

Magisk v22 Successfully tested with Stock Kernel on

Magisk v21.4 Successfully tested with Stock Kernel on

Change Logs

[Mar. 2021]

  • [General] - Add a Download Manager Function for bad TLS record using wget
  • [rootAVD.bat] - Adjustments to run with the updated rootAVD.sh
  • [General] - Add a Menu to choose the Magisk Version to install
  • [rootAVD.sh] - Added EnvFixTask Argument to fix Requires Additional Setup in Android S
  • [General] - Changed to BusyBox (D)ASH Standalone
  • [General] - Re-Structured Script
  • [rootAVD.sh] - Added "Additional Setup Required" manually for Android S
  • [rootAVD.sh] - Updated shakalaca's Ramdisk Repack Routine
  • [rootAVD.sh] - Added Compression Detection for LZ4 and GZ
  • [General] - Fixed some bugs and typos
  • [General] - Updated to Magisk App v22.0

Credits