@echo off cls echo ================================================================================ echo COMPLETE ANDROID STUDIO AVD SETUP + ROOT + FRIDA echo For Canada Post App Analysis echo ================================================================================ echo. REM Set Android SDK path set ANDROID_HOME=%LOCALAPPDATA%\Android\Sdk set PATH=%ANDROID_HOME%\emulator;%ANDROID_HOME%\platform-tools;%PATH% echo [1/7] Checking Android Studio installation... if not exist "%ANDROID_HOME%\emulator" ( echo ERROR: Android Studio not found! echo Please install Android Studio first: https://developer.android.com/studio pause exit /b 1 ) echo [OK] Android Studio found echo. echo [2/7] Listing available AVDs... emulator -list-avds echo. echo Enter the AVD name you want to setup (or press CTRL+C to exit): set /p AVD_NAME="> " echo. echo [3/7] Starting AVD: %AVD_NAME% echo This will open a new window. Please wait... start "" emulator -avd %AVD_NAME% -writable-system timeout /t 10 >nul echo Waiting for device to boot... :WAIT_BOOT adb wait-for-device adb shell getprop sys.boot_completed 2>nul | findstr "1" >nul if errorlevel 1 ( timeout /t 2 >nul goto WAIT_BOOT ) echo [OK] Device booted echo. echo [4/7] Downloading rootAVD... if not exist "rootAVD" ( git clone https://gitlab.com/newbit/rootAVD.git if errorlevel 1 ( echo ERROR: Failed to download rootAVD. Install git or download manually. echo Download: https://gitlab.com/newbit/rootAVD/-/archive/master/rootAVD-master.zip pause exit /b 1 ) ) echo [OK] rootAVD ready echo. echo [5/7] Finding ramdisk.img for your AVD... adb shell getprop ro.build.version.sdk for /f "tokens=*" %%i in ('adb shell getprop ro.build.version.sdk') do set API_LEVEL=%%i echo API Level: %API_LEVEL% REM Try to find ramdisk for /f "tokens=*" %%i in ('adb shell getprop ro.product.cpu.abi') do set CPU_ABI=%%i echo CPU ABI: %CPU_ABI% set RAMDISK_PATH=%ANDROID_HOME%\system-images\android-%API_LEVEL%\google_apis\%CPU_ABI%\ramdisk.img if not exist "%RAMDISK_PATH%" ( set RAMDISK_PATH=%ANDROID_HOME%\system-images\android-%API_LEVEL%\google_apis_playstore\%CPU_ABI%\ramdisk.img ) if not exist "%RAMDISK_PATH%" ( echo ERROR: Could not find ramdisk.img echo Please provide the path manually when running rootAVD.bat pause exit /b 1 ) echo Found: %RAMDISK_PATH% echo. echo [6/7] Rooting AVD with Magisk... echo This will take a few minutes... cd rootAVD call rootAVD.bat "%RAMDISK_PATH%" cd .. echo. echo [7/7] Setting up Frida-server (ARM64)... if not exist "frida-server-arm64" ( echo Downloading frida-server... powershell -Command "Invoke-WebRequest -Uri 'https://github.com/frida/frida/releases/download/17.5.1/frida-server-17.5.1-android-arm64.xz' -OutFile 'frida-arm64.xz'" echo Extracting... python -c "import lzma, shutil; f_in = lzma.open('frida-arm64.xz', 'rb'); f_out = open('frida-server-arm64', 'wb'); shutil.copyfileobj(f_in, f_out); f_in.close(); f_out.close()" ) echo Pushing to device... adb push frida-server-arm64 /data/local/tmp/frida-server adb shell "chmod 755 /data/local/tmp/frida-server" echo Starting frida-server... adb root timeout /t 2 >nul adb shell "/data/local/tmp/frida-server &" timeout /t 2 >nul echo. echo ================================================================================ echo SETUP COMPLETE! echo ================================================================================ echo. echo Next steps: echo 1. Install Canada Post app: echo adb install-multiple cpc_extracted\base.apk cpc_extracted\split_config.arm64_v8a.apk cpc_extracted\split_config.xxhdpi.apk echo. echo 2. Run Frida hooks: echo .\RUN_FRIDA_HOOKS.bat echo. echo 3. Select "Ultimate Bypass" from the menu echo. echo ================================================================================ pause