Skip to content

Instantly share code, notes, and snippets.

@FoseFx
Last active May 19, 2021 14:04
Show Gist options
  • Save FoseFx/969a061ae25b41619f98b0a0ef918042 to your computer and use it in GitHub Desktop.
Save FoseFx/969a061ae25b41619f98b0a0ef918042 to your computer and use it in GitHub Desktop.
Allow third party proxy patch

Add the following attribute to the in AndroidManifest.xml:

android:networkSecurityConfig': '@xml/nsc_mitm'

Then set up a MITM Proxy and add the cert (Settings -> Security -> Sth with Certificates)

<!-- res/xml/nsc_mitm.xml -->
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<!-- Allow cleartext traffic -->
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<!-- Allow user-added (proxy) certificates -->
<certificates src="user" />
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment