setup-android_certs.ps1 508 B

1234567891011121314
  1. # setup-certs.ps1
  2. # 1. Get Phone IP (assumes connected via ADB)
  3. $phoneIp = adb shell "ip route" | Select-String "src" | ForEach-Object { $_.ToString().Split(' ')[8] }
  4. Write-Host "Detected Phone IP: $phoneIp"
  5. # 2. Generate Certs
  6. mkcert -cert-file cert.pem -key-file key.pem $phoneIp localhost 127.0.0.1
  7. Write-Host "Certificates generated."
  8. # 3. Push to Phone
  9. adb push cert.pem /sdcard/Download/cert.pem
  10. adb push key.pem /sdcard/Download/key.pem
  11. Write-Host "Certificates pushed to Android Downloads folder."