Skip to content

Instantly share code, notes, and snippets.

@stefanstranger
Last active September 26, 2023 10:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanstranger/7a17b53e0bc3d354e94774420ec406a2 to your computer and use it in GitHub Desktop.
Save stefanstranger/7a17b53e0bc3d354e94774420ec406a2 to your computer and use it in GitHub Desktop.
# How to install mitmproxy certificate as root CA steps:

How to install mitmproxy certificate as root CA steps:

  1. Create a Android Virtual Device (AVD) using a non Google image to enable root access

  2. Start mitmproxy

  3. Install DuckDuckGo browser via downloaded apk on AVD

    Download via: https://apkcombo.com/duckduckgo/com.duckduckgo.mobile.android/

  4. Start ADV emulator with mitmproxy configured:

   .\emulator.exe -avd Pixel_7_API_28 -http-proxy 127.0.0.1:8080 -writable-system
  1. Install mitmproxy certificate as User.

    Go to mitm.it in your browser (DuckDuckGo) and download the certificate.

    Install the certificate via Settings -> Security -> Advanced -> Encryption and credentials -> Install a certificate -> CA certificate (or similar) instead.

  2. Move the User Certificate to Root CA store

   ./adb.exe root
   ./adb.exe shell avbctl disable-verification
   ./adb.exe reboot
   ./adb.exe remount
   ./adb.exe -s emulator-5554 shell

Run within the AVD:

     # su
     # whoami
     # cp /data/misc/user/0/cacerts-added/* /system/etc/security/cacerts

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment