mirror of
https://github.com/MobSF/Mobile-Security-Framework-MobSF.git
synced 2026-10-11 22:50:09 +00:00
Fix x86_64 Android AVD in Windows (#2471)
This commit is contained in:
+34
-2
@@ -51,5 +51,37 @@ if (-not $AVD_FOUND) {
|
||||
}
|
||||
|
||||
# Start the emulator with user-defined AVD and port
|
||||
Start-Process -FilePath $EMULATOR_PATH -ArgumentList "-avd $AVD_NAME -writable-system -no-snapshot -wipe-data -port $START_PORT"
|
||||
Write-Output "Emulator started with AVD $AVD_NAME on port $START_PORT."
|
||||
Start-Process -NoNewWindow -FilePath $EMULATOR_PATH -ArgumentList "-avd $AVD_NAME -writable-system -no-snapshot -wipe-data -port $START_PORT"
|
||||
Write-Output "Starting AVD $AVD_NAME on port $START_PORT."
|
||||
|
||||
# Wait for the emulator to boot completely
|
||||
Write-Output "Waiting for emulator to boot..."
|
||||
& $ADB_PATH wait-for-device
|
||||
Start-Sleep -Seconds 5
|
||||
Write-Output "Emulator booted successfully."
|
||||
|
||||
# Allow /system remount
|
||||
Write-Output "Restarting adb as root..."
|
||||
Start-Process -NoNewWindow -Wait -FilePath $ADB_PATH -ArgumentList "root"
|
||||
|
||||
Write-Output "Disabling AVB verification..."
|
||||
Start-Process -NoNewWindow -Wait -FilePath $ADB_PATH -ArgumentList "shell avbctl disable-verification"
|
||||
|
||||
Write-Output "Disabling verity..."
|
||||
Start-Process -NoNewWindow -Wait -FilePath $ADB_PATH -ArgumentList "disable-verity"
|
||||
|
||||
Write-Output "Restarting emulator..."
|
||||
Start-Process -NoNewWindow -Wait -FilePath $ADB_PATH -ArgumentList "reboot"
|
||||
|
||||
Write-Output "Waiting for emulator to reboot..."
|
||||
& $ADB_PATH wait-for-device
|
||||
Start-Sleep -Seconds 5
|
||||
Write-Output "Emulator rebooted successfully."
|
||||
|
||||
Write-Output "Restarting adb as root..."
|
||||
Start-Process -NoNewWindow -Wait -FilePath $ADB_PATH -ArgumentList "root"
|
||||
|
||||
Write-Output "Remounting the filesystem..."
|
||||
Start-Process -NoNewWindow -Wait -FilePath $ADB_PATH -ArgumentList "remount"
|
||||
|
||||
Write-Output "Emulator ready for Dynamic Analysis with MobSF."
|
||||
|
||||
@@ -66,7 +66,9 @@ done
|
||||
|
||||
# Start the emulator with user-defined AVD and port
|
||||
"$EMULATOR_PATH" -avd "$AVD_NAME" -writable-system -no-snapshot -wipe-data -port "$START_PORT" >/dev/null 2>&1 &
|
||||
echo "$(tput setaf 2)Emulator AVD $AVD_NAME started on port $START_PORT$(tput sgr0)"
|
||||
echo "$(tput setaf 2)Starting AVD $AVD_NAME on port $START_PORT$(tput sgr0)"
|
||||
echo "Waiting for emulator to boot..."
|
||||
"$ADB_PATH" wait-for-device
|
||||
|
||||
# Check if socat is available only on Linux
|
||||
if [ "$(uname)" = "Linux" ]; then
|
||||
@@ -124,7 +126,7 @@ if [ -n "$GAPPS_ZIP" ]; then
|
||||
tar -x --strip-components 2 -f $f -C $PLAY_EXTRACT_DIR || { echo "$(tput setaf 1)Error: Extraction failed$(tput sgr0)"; exit 1; }
|
||||
done
|
||||
|
||||
echo "Waiting for emulator to complete booting..."
|
||||
echo "Waiting for the emulator to be ready..."
|
||||
sleep 25
|
||||
echo "Installing PlayStore components"
|
||||
"$ADB_PATH" root
|
||||
|
||||
Reference in New Issue
Block a user