Skip to content

Instantly share code, notes, and snippets.

@exzork
Created May 15, 2022 01:05
Show Gist options
  • Save exzork/7940af7b34adeef9656b9c7cf8cd44de to your computer and use it in GitHub Desktop.
Save exzork/7940af7b34adeef9656b9c7cf8cd44de to your computer and use it in GitHub Desktop.

TUTORIAL BY Senti#7498

Modified for genshin.exzork.me

How to run mitmproxy on android without needing a PC. Rooted users

  1. Install the magisk module to trust user certificates. You don't need to reboot after installing, we'll reboot later. https://github.com/NVISOsecurity/MagiskTrustUserCerts/releases/tag/v0.4.1 Non root users
  2. Install patched apk that accepts user ca certs, unfortunately you will have to uninstall the regular apk https://file.yuuki.me/0:/Leak/uc-patched.apk If the patched apk is not working you can patch it yourself by extracting the apk using SAI (on Play Store) & using apk-mitm. https://github.com/shroudedcode/apk-mitm 1b. Download the game files in the patched apk, or restore a backup if possible continued for root/nonroot...
  3. Install termux
  4. use these commands
pkg upgrade -y
pkg install python wget rustc-dev nano
python3 -m ensurepip --upgrade
python3 -m pip install --user pipx
python3 -m pipx ensurepath
export CARGO_BUILD_TARGET=aarch64-linux-android
pipx install mitmproxy
  1. Now download proxy config:
wget https://gist.githubusercontent.com/exzork/8bbf5975bb9efab0a9c8a03a01dadd5e/raw/c2574d6f66798e65f2ed4709a69b43c6cecf60be/proxy.py
  1. Now run mitmproxy: mitmdump -s proxy.py -k --ssl-insecure --set block_global=false
  2. Then go to wifi settings and set proxy to 127.0.0.1 and 8080. Note that proxies are ignored if you are using a VPN. 6b. (optional) set excluded to discordapp.com,discord.com,discordapp.net,discord.gg,gateway.discord.gg
  3. Open http://mitm.it/ in your browser, download certificate. Then go to settings and install it.
  4. (rooted only, non-root can skip this step) Now reboot to set the user cert as a system one
  5. open termux, run mitmdump with the same parameters again (press the up key to fill in previous commands)
  6. ???
  7. Profit

Make sure to turn off your proxy after quitting the game or nothing will work. If you get error 4206, it's likely a problem with your internet connection, not the proxy.

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