@echo off SetLocal EnableDelayedExpansion REM ########################################################################################## REM # REM # Magisk Boot Image Patcher - original created by topjohnwu and modded by shakalaca's REM # modded by NewBit XDA for Android Studio AVD REM # Successfully tested on Android API: REM # [Dec. 2019] - 29 Google Apis Play Store x86_64 Production Build REM # [Jan. 2021] - 30 Google Apis Play Store x86_64 Production Build REM # REM ########################################################################################## if "%1" == "" ( echo "rootAVD needs a path with file to an AVD ramdisk" echo "rootAVD will backup your ramdisk.img and replace it when finished" echo "rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-30\google_apis_playstore\x86_64\ramdisk.img" exit /B 0 ) set RAMDISKFILE=%1 set BACKUPFILE=%RAMDISKFILE%.bak set ROOTAVD="%cd%" set MAGISKZIP=%ROOTAVD%\Magisk.zip set BUSYBOXINSTLR=%ROOTAVD%\update-binary CD %RAMDISKFILE% IF "%ERRORLEVEL%"=="0" ( echo "[*] Please give a PATH to a file, not just a Directory" exit /B 0 ) IF NOT EXIST %RAMDISKFILE% ( echo "[*] %RAMDISKFILE% doesn't exist" exit /B 0 ) IF NOT EXIST %BACKUPFILE% ( echo "[*] create Backup File" copy %RAMDISKFILE% %BACKUPFILE% ) ELSE ( echo "[-] Backup exists already" ) echo "[-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell" set ADBWORKDIR=/data/data/com.android.shell set ADBBASEDIR=%ADBWORKDIR%/Magisk set ADBWORKS= adb shell -n echo true > tmpFile set /P ADBWORKS=