Skip to content

Commit 5c5ea8b

Browse files
evan-masseauclaude
andcommitted
chore(sample): trust user CA in debug builds for MITM proxy testing
Adds a debug-only source set (sample/src/debug) with a network security config trusting system + user-added CAs, plus a manifest overlay wiring it in. Debug builds only; release artifacts are unaffected. Lets an intercepting proxy (e.g. Proxyman) decrypt the sample app's HTTPS for SDK network UAT. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e640883 commit 5c5ea8b

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Debug-only manifest overlay. This source set is compiled into debug builds
4+
ONLY, so release builds never see the networkSecurityConfig below. It opts
5+
the sample into trusting user-added CA certs (see res/xml/network_security_config)
6+
so an intercepting proxy (e.g. Proxyman) can MITM HTTPS during network testing.
7+
-->
8+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
9+
<application android:networkSecurityConfig="@xml/network_security_config" />
10+
</manifest>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Debug-only source set: present in debug builds exclusively (never packaged
4+
into release artifacts). Trust the system CA store plus user-added CAs so an
5+
intercepting proxy (e.g. Proxyman) can decrypt the sample's HTTPS traffic for
6+
network testing.
7+
-->
8+
<network-security-config>
9+
<base-config>
10+
<trust-anchors>
11+
<certificates src="system" />
12+
<certificates src="user" />
13+
</trust-anchors>
14+
</base-config>
15+
</network-security-config>

0 commit comments

Comments
 (0)