Skip to content

Commit 283c926

Browse files
committed
1.android 9以上系统支持抓包
1 parent d3fcd84 commit 283c926

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
android:icon="@mipmap/ic_launcher"
88
android:name=".App"
99
android:supportsRtl="true"
10-
android:usesCleartextTraffic="true"> <!-- targetSDKVersion 28 开启http请求,避免net::ERR_CLEARTEXT_NOT_PERMITTED错误-->
10+
android:usesCleartextTraffic="true"
11+
android:networkSecurityConfig="@xml/network_security_config"> <!-- targetSDKVersion 28 开启http请求,避免net::ERR_CLEARTEXT_NOT_PERMITTED错误-->
1112

1213
<!--明确引用org.apache.http.legacy库,避免QQ官方open sdk在Android 9上报错 -->
1314
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<network-security-config>
3+
<debug-overrides>
4+
<trust-anchors>
5+
<!-- Trust user added CAs while debuggable only -->
6+
<certificates src="user" />
7+
</trust-anchors>
8+
</debug-overrides>
9+
</network-security-config>

0 commit comments

Comments
 (0)