首先保證配置一切正確
手機(jī)通過訪問chls.pro/ssl下載.pem證書,如無法安裝,在文件管理器中將后綴名改為.crt
在設(shè)置中安裝該證書
Charles-Proxy - SSL Proxying Setting - Include 添加需要抓包的URL:443即可
以上基本配置結(jié)束后,看下代碼
代碼配置
AndroidManifest.xml文件的中添加android:networkSecurityConfig=“@xml/network_security_config”文章來源:http://www.zghlxwxcb.cn/news/detail-833788.html
<application
```
android:networkSecurityConfig="@xml/network_security_config"
```>
</applicaiton>
在res文件夾中創(chuàng)建xml文件夾保存配置文件,創(chuàng)建network_security_config.xml
network_security_config.xml內(nèi)容文章來源地址http://www.zghlxwxcb.cn/news/detail-833788.html
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<!-- 系統(tǒng)證書 -->
<certificates src="system" />
<!-- 用戶證書 -->
<certificates src="user" />
</trust-anchors>
</base-config>
</network-security-config>
如果還不行,試試重啟Charles~
到了這里,關(guān)于Android 7.0以上charles無法抓取部分https包問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!