Skip to content

Instantly share code, notes, and snippets.

@LethalMaus
Last active February 11, 2026 20:00
Show Gist options
  • Select an option

  • Save LethalMaus/70d1ec329d999352785fd664cfaa733e to your computer and use it in GitHub Desktop.

Select an option

Save LethalMaus/70d1ec329d999352785fd664cfaa733e to your computer and use it in GitHub Desktop.
AndroidSecurityTraining_Pinning.xml
<network-security-config>
<!-- Disallow user-added CAs, use only system certs -->
<base-config cleartextTrafficPermitted="false">
<trust-anchors>
<certificates src="system" />
<!-- No user certs in secure profile -->
</trust-anchors>
</base-config>
<!-- Allow user CAs only for debug builds to facilitate MITM demos -->
<debug-overrides>
<trust-anchors>
<certificates src="user" />
</trust-anchors>
</debug-overrides>
<!-- CT-only by default at config level; pinning is controlled in code per demo mode -->
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="true">api.github.com</domain>
<certificateTransparency enabled="true"/>
<!-- No <pin-set> here so we can toggle pins in code (bad/good/mitm) or run CT-only -->
</domain-config>
</network-security-config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment