Skip to content

Instantly share code, notes, and snippets.

@thebino
Last active April 26, 2024 08:06
Show Gist options
  • Select an option

  • Save thebino/c9e7025be9c1261eb23bfac3612cc66d to your computer and use it in GitHub Desktop.

Select an option

Save thebino/c9e7025be9c1261eb23bfac3612cc66d to your computer and use it in GitHub Desktop.
Intercept, mock & debug Android HTTP traffic

Intercept, mock & debug Android HTTP traffic

Charles Proxy (~50€ license) mitmproxy (free & opensource)
https://www.charlesproxy.com. https://mitmproxy.org.
Check the Gateway IP Adress in the emulator and set it as proxy address, use the port set inside the proxy application used.

The setup of a real device differs by the IP used (where the proxy is running)

Charles Proxy (~50€ license) mitmproxy (free & opensource)
open chls.pro/ssl in the browser on the emulator. open mitm.it in the browser on the emulator.

Install the SSL Certificate on the emulator for VPN and apps

These can be found later in the system settings in Encryption & credentials > User credentials

Such credentials need to be explicit allowed for debug builds in the network security config

Charles Proxy (~50€ license) mitmproxy (free & opensource)
Enable each interested host by rightclick on the host. SSL recording is enabled by default.
save the regarding response to a local file save the regarding response to a local file by pressing B
add the replacement below to the configuration file
map_local:
  - "|~m GET|echoserver.dev/server|~/MockResponses/body.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment