目前就找到这一个:
在res文件夹下创建xml文件夹,在xml里面创建文件network_security_config.xml
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" overridePins="true" />
<certificates src="user" overridePins="true" />
</trust-anchors>
</base-config>
</network-security-config>
然后再清单文件里调用
android:networkSecurityConfig="@xml/network_security_config"