Skip to content
falasiPublic
forked from newbit1/rootAVD

About

Script to root AVDs running with QEMU Emulator from Android Studio

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

163 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rootAVD PATCH for Magisk v28+

Fork of https://github.com/newbit1/rootAVD (upstream last updated Oct 2023).

Upstream fails on current Magisk. Three bugs, all fixed here:

  • Can not find any working Busybox Version — the version check required "Magisk" in the BusyBox banner; current builds say "topjohnwu".
  • open 'magisk64': No such file or directory — Magisk v28+ unified magisk32/magisk64 into a single magisk binary.
  • Patches and boots fine, but su not found and Superuser greyed out — init-ld.xz (new in v28+) was never installed, so magiskd never starts.

Verified: Android 17 / API 37, google_apis_playstore_ps16k x86_64, 16 KB pages, Magisk v30.7. Legacy Magisk paths are gated and unchanged.

./getMagisk.sh fetches the latest Magisk and warns if it's newer than the last verified version.

Getting Magisk

rootAVD reads a file called Magisk.zip from the repo root. That file is just the Magisk APK, renamed. An APK is already a zip archive, so no repackaging is needed — and repackaging is the single most common way people break this.

Option A — use the helper (recommended)

./getMagisk.sh

Downloads the latest stable Magisk, verifies it contains what rootAVD needs, and writes Magisk.zip for you. It also warns if the release is newer than the last version this fork was tested against.

Other uses:

./getMagisk.sh --list      # show recent releases
./getMagisk.sh v30.7       # pin a specific version
./getMagisk.sh --keep      # also keep the original .apk file

Option B — by hand

Download the APK from https://github.com/topjohnwu/Magisk/releases — you want the asset named Magisk-vXX.X.apk, not app-debug.apk.

Then copy it into place:

cp Magisk-v30.7.apk Magisk.zip

⚠️ Use cp, not zip. Do not right-click → "Compress" in a file manager, and do not run zip Magisk.zip Magisk-v30.7.apk. Those create a zip containing the APK, which is not the same thing, and rootAVD will fail with a confusing BusyBox error. The APK is already a zip — it only needs renaming.

Verify before running

unzip -l Magisk.zip | grep -i busybox

Correct — four architectures listed:

  1710600  1980-00-00 00:00   lib/arm64-v8a/libbusybox.so
  1282828  1980-00-00 00:00   lib/armeabi-v7a/libbusybox.so
  1715048  1980-00-00 00:00   lib/x86/libbusybox.so
  1767048  1980-00-00 00:00   lib/x86_64/libbusybox.so

Wrong — nothing returned. Check what's actually inside:

unzip -l Magisk.zip | head

If you see a single .apk entry, you have a zip-in-a-zip:

 11613864  2026-02-23 03:07   Magisk-v30.7.apk

Fix it with cp Magisk-v30.7.apk Magisk.zip (or ./getMagisk.sh).

You can also confirm the copy is byte-identical:

md5sum Magisk-v30.7.apk Magisk.zip   # hashes must match

Troubleshooting

Can not find any working Busybox Version

Two different problems print this message. Which one you have depends on whether the output includes an ls: line just above it.

With this line:

ls: /data/data/com.android.shell/Magisk/lib/*/*busybox*: No such file or directory
[!] Can not find any working Busybox Version

Your Magisk.zip contains no BusyBox — almost always the zip-in-a-zip mistake described above. See "Verify before running".

Without that line — the glob matched, so BusyBox was found and then rejected. That's the version-check bug (rootAVD required the string "Magisk" in a banner that now says "topjohnwu"), fixed in this fork. Confirm you're actually running this fork:

grep -n 'BusyBox"\*"multi-call' rootAVD.sh

One match means the fix is present. No match means you're on upstream, or the patch didn't apply.

open 'magisk64': No such file or directory / Failed to process cpio

Magisk v28+ unified magisk32/magisk64 into a single magisk binary. Fixed in this fork. If you see this, you're on upstream.

Note that upstream still copies the failed result over your live ramdisk.img. Restore it before retrying:

./rootAVD.sh <path>/ramdisk.img restore

Patching succeeds, AVD boots, but su is not found

Check the Magisk app: if it offers only "Select and patch a file" and Superuser is greyed out, magiskd never started. That's the missing init-ld.xz payload (new in Magisk v28+), fixed in this fork.

A correctly patched image shows the app's normal "requires additional setup" prompt instead.

It worked before and stopped after an SDK update

Android Studio replaces ramdisk.img with the stock version when it updates a system image. Re-run rootAVD, or keep a copy of your patched ramdisk and restore it:

cp ramdisk-patched-WORKING.img \
   ~/Android/Sdk/system-images/android-XX/.../x86_64/ramdisk.img

Credit to newbit1 for the original — https://github.com/newbit1/rootAVD

About

Script to root AVDs running with QEMU Emulator from Android Studio

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages