Skip to content

Commit f4f982e

Browse files
committed
[[ Bug 22400 ]] Allow http connections on Android browser
This patch allows http connections if the user checks the appropriate checkbox in the Android standalone settings.
1 parent dea5fbb commit f4f982e

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

engine/rsrc/android-manifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ ${USES_PERMISSION}${USES_FEATURE}
2020
android:windowSoftInputMode="stateHidden"
2121
android:launchMode="singleTask"
2222
android:hardwareAccelerated="${HARDWARE_ACCELERATED}">
23+
${ALLOW_HTTP_CONNECTIONS}
2324
<intent-filter>
2425
<action android:name="android.intent.action.MAIN" />
2526
<category android:name="android.intent.category.LAUNCHER" />

ide-support/revsaveasandroidstandalone.livecodescript

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,18 @@ private command revSaveAsMobileStandaloneMain pStack, pApkFile, pTarget, pSettin
599599
end if
600600
replace "${HARDWARE_ACCELERATED}" with tHardwareAccelerated in tManifest
601601

602+
// Allow http connections
603+
local tAllowHttpConnections, tHasInternetPermission
604+
if the keys of pSettings["android,application permissions"] contains "Internet" then
605+
put "true" into tHasInternetPermission
606+
end if
607+
if pSettings["android,allow http"] and tHasInternetPermission then
608+
put "android:usesCleartextTraffic=" & quote & "true" & quote into tAllowHttpConnections
609+
else
610+
put empty into tAllowHttpConnections
611+
end if
612+
replace "${ALLOW_HTTP_CONNECTIONS}" with tAllowHttpConnections in tManifest
613+
602614
put tManifest into url ("binfile:" & tManifestFile)
603615

604616
local tAdditional

0 commit comments

Comments
 (0)