将手机更新到 Android 9 后无法使用 Charles 代理

Wil*_*Tse 7 proxy android android-9.0-pie

我将我的测试设备(Samsung Galaxy Note 9 和 Galaxy S9+)更新为 Android 9。现在我无法使用 Charles 代理来grep 任何流量。我已将我的 Charles 代理更新到最新版本 4.2.8 (MAC) 并且我像过去一样在 Wifi 设置上配置了代理。

注意:Charles Proxy 在更新前运行良好(S9​​+ 为 Android 8.0,Note 9 为 8.1)

小智 8

SSL 证书 | 查尔斯

从 Android N 开始,您需要向您的应用添加配置,以使其信任由 Charles SSL 代理生成的 SSL 证书。这意味着您只能对您控制的应用程序使用 SSL 代理。

Add a file res/xml/network_security_config.xml to your app:

<network-security-config> 
  <debug-overrides> 
    <trust-anchors> 
      <!-- Trust user added CAs while debuggable only -->
      <certificates src="user" /> 
    </trust-anchors> 
  </debug-overrides> 
</network-security-config>
Run Code Online (Sandbox Code Playgroud)

Then add a reference to this file in your app's manifest, as follows:

<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
    <application android:networkSecurityConfig="@xml/network_security_config" ... >
        ...
    </application>
</manifest>
Run Code Online (Sandbox Code Playgroud)

After you have reinstalled charles proxy, recreate the certificate.


小智 -1

该问题与 Samsung Note 和 Galaxy 设备上的 Android 操作系统更新(版本 9)有关,他们最近在上次补丁更新中修复了该问题。