Skip to content

Commit 50a125b

Browse files
fix: allow cleartext traffic (#2009)
* fix: allow cleartext traffic * . * fix: allow all http urls * . * Revert "." This reverts commit e4a6534. * fix: cordova issue
1 parent 57ef45c commit 50a125b

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

config.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,31 @@
3838
<preference name="GradlePluginKotlinEnabled" value="true" />
3939
<preference name="android-targetSdkVersion" value="36" />
4040

41-
41+
<!-- Cordova does not merge this unless both of these are present -->
4242
<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application">
4343
<application
44+
android:usesCleartextTraffic="true"
4445
android:networkSecurityConfig="@xml/network_security_config"
4546
android:hardwareAccelerated="true"
4647
android:largeHeap="true"
4748
android:requestLegacyExternalStorage="true"
4849
android:enableOnBackInvokedCallback="false" />
4950
</edit-config>
5051

52+
<!-- Cordova does not merge this unless both of these are present -->
53+
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
54+
<application android:networkSecurityConfig="@xml/network_security_config" />
55+
<application android:usesCleartextTraffic="true" />
56+
<application android:hardwareAccelerated="true" />
57+
<application android:largeHeap="true" />
58+
<application android:requestLegacyExternalStorage="true"/>
59+
<application android:enableOnBackInvokedCallback="false" />
60+
</edit-config>
61+
5162
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:name='MainActivity']">
5263
<activity android:resizeableActivity="true" />
5364
</edit-config>
5465

55-
5666
<config-file parent="./application/activity" target="AndroidManifest.xml">
5767
<intent-filter>
5868
<action android:name="android.intent.action.VIEW" />

res/android/xml/network_security_config.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,4 @@
55
<certificates src="system" />
66
</trust-anchors>
77
</base-config>
8-
9-
<domain-config cleartextTrafficPermitted="true">
10-
<domain includeSubdomains="true">*</domain>
11-
<domain includeSubdomains="true">localhost</domain>
12-
</domain-config>
13-
</network-security-config>
14-
15-
<!-- This file is used to allow the app to load http://localhost in in-app browser, used to run project. DO NOT remove-->
8+
</network-security-config>

0 commit comments

Comments
 (0)