@devries-cameron20 / t3code-1 / commits / 36aea583bb
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(mobile): trust user-installed Android CA certificates (#25730)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 27, 2026 at 20:10 UTC 36aea583bb65a04a62dea94074bb0ad137811df1
4 files changed +61 -19
apps/mobile/app.config.ts
+1 -1
@@ -425,7 +425,7 @@ const config: ExpoConfig = {
425 ["expo-sensors", { motionPermission: false }],
426 // Mods run in reverse order; expo-widgets must create and wipe the target before assets are added.
427 ...(!isIosPersonalTeamBuild ? ["./plugins/withWidgetLogoAsset.cjs", widgetsPlugin] : []),
428 - "./plugins/withAndroidCleartextTraffic.cjs",
428 + "./plugins/withAndroidNetworkSecurityConfig.cjs",
429 "./plugins/withAndroidGradleHeap.cjs",
430 "./plugins/withAndroidInputBackground.cjs",
431 "./plugins/withAndroidModernPopupMenu.cjs",
apps/mobile/plugins/withAndroidCleartextTraffic.cjs deleted
-18
@@ -1,18 +0,0 @@
1 -const { withAndroidManifest } = require("expo/config-plugins");
2 -
3 -module.exports = function withAndroidCleartextTraffic(config) {
4 - return withAndroidManifest(config, (nextConfig) => {
5 - const application = nextConfig.modResults.manifest.application?.[0];
6 -
7 - if (application == null) {
8 - throw new Error(
9 - "AndroidManifest.xml is missing the application element required for cleartext traffic configuration.",
10 - );
11 - }
12 -
13 - application.$ ??= {};
14 - application.$["android:usesCleartextTraffic"] = "true";
15 -
16 - return nextConfig;
17 - });
18 -};
apps/mobile/plugins/withAndroidNetworkSecurityConfig.cjs new
+56
@@ -0,0 +1,56 @@
1 +const fs = require("node:fs");
2 +const path = require("node:path");
3 +const { withAndroidManifest, withDangerousMod } = require("expo/config-plugins");
4 +
5 +// Environments behind a private CA installed in the user store must work like they do in Chrome.
6 +// Android ignores usesCleartextTraffic once a network security config exists, so permit it here.
7 +const NETWORK_SECURITY_CONFIG = `<?xml version="1.0" encoding="utf-8"?>
8 +<network-security-config>
9 + <base-config cleartextTrafficPermitted="true">
10 + <trust-anchors>
11 + <certificates src="system" />
12 + <certificates src="user" />
13 + </trust-anchors>
14 + </base-config>
15 +</network-security-config>
16 +`;
17 +
18 +function withNetworkSecurityConfigManifest(config) {
19 + return withAndroidManifest(config, (nextConfig) => {
20 + const application = nextConfig.modResults.manifest.application?.[0];
21 +
22 + if (application == null) {
23 + throw new Error(
24 + "AndroidManifest.xml is missing the application element required for network security configuration.",
25 + );
26 + }
27 +
28 + application.$ ??= {};
29 + application.$["android:networkSecurityConfig"] = "@xml/network_security_config";
30 +
31 + return nextConfig;
32 + });
33 +}
34 +
35 +function withNetworkSecurityConfigResource(config) {
36 + return withDangerousMod(config, [
37 + "android",
38 + async (config) => {
39 + const xmlDir = path.join(
40 + config.modRequest.platformProjectRoot,
41 + "app",
42 + "src",
43 + "main",
44 + "res",
45 + "xml",
46 + );
47 + fs.mkdirSync(xmlDir, { recursive: true });
48 + fs.writeFileSync(path.join(xmlDir, "network_security_config.xml"), NETWORK_SECURITY_CONFIG);
49 + return config;
50 + },
51 + ]);
52 +}
53 +
54 +module.exports = function withAndroidNetworkSecurityConfig(config) {
55 + return withNetworkSecurityConfigResource(withNetworkSecurityConfigManifest(config));
56 +};
docs/user/remote-access.md
+4
@@ -62,6 +62,10 @@ On a computer with the desktop app, you can open the printed `t3code://pair`
62 app link instead. The desktop app asks you to confirm the server address, then
63 adds it.
64
65 +If your HTTPS endpoint uses a certificate from your own certificate authority,
66 +install that CA on Android as a **CA certificate** in its security settings; the
67 +Android app then trusts it.
68 +
69 Pairing authorizes that device for future connections. Use a fresh one-time link
70 for each new device; you do not need the original token to reconnect. Links
71 created in Settings can only be copied from the client that created them while