aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanasis Antoniou2019-11-01 18:56:41 +0200
committerThanasis Antoniou2019-11-01 19:13:27 +0200
commit4eecfb8da9ec8d29cf46d6b023f6386a3ec05318 (patch)
tree9a462a4dab16f6c04864b4b2813e877267eea55e
parent0348aa72fd636e64072b0e25c6768193c456fb8b (diff)
downloadscummvm-rg350-4eecfb8da9ec8d29cf46d6b023f6386a3ec05318.tar.gz
scummvm-rg350-4eecfb8da9ec8d29cf46d6b023f6386a3ec05318.tar.bz2
scummvm-rg350-4eecfb8da9ec8d29cf46d6b023f6386a3ec05318.zip
ANDROID: Disable verification of certificates validity for cloud saving
Also added macros for the plain (non-SDL) Android port __ANDROID_PLAIN_PORT__ and ANDROID_PLAIN_PORT The workaround of this commit uses the same logic as for the Nintendo Switch port and should suffice for testing purposes. It should be replaced by more elaborate code of installing and maintaining a certificates pem file.
-rw-r--r--backends/networking/curl/networkreadstream.cpp6
-rwxr-xr-xconfigure1
-rw-r--r--dists/android/AndroidManifest.xml6
-rw-r--r--dists/android/AndroidManifest.xml.in6
4 files changed, 17 insertions, 2 deletions
diff --git a/backends/networking/curl/networkreadstream.cpp b/backends/networking/curl/networkreadstream.cpp
index be9779409b..59d2a5475c 100644
--- a/backends/networking/curl/networkreadstream.cpp
+++ b/backends/networking/curl/networkreadstream.cpp
@@ -84,9 +84,10 @@ void NetworkReadStream::init(const char *url, curl_slist *headersList, const byt
curl_easy_setopt(_easy, CURLOPT_NOPROGRESS, 0L);
curl_easy_setopt(_easy, CURLOPT_PROGRESSFUNCTION, curlProgressCallbackOlder);
curl_easy_setopt(_easy, CURLOPT_PROGRESSDATA, this);
-#ifdef NINTENDO_SWITCH
+#if defined NINTENDO_SWITCH || defined ANDROID_PLAIN_PORT
curl_easy_setopt(_easy, CURLOPT_SSL_VERIFYPEER, 0);
#endif
+
#if LIBCURL_VERSION_NUM >= 0x072000
// CURLOPT_XFERINFOFUNCTION introduced in libcurl 7.32.0
// CURLOPT_PROGRESSFUNCTION is used as a backup plan in case older version is used
@@ -139,9 +140,10 @@ void NetworkReadStream::init(const char *url, curl_slist *headersList, Common::H
curl_easy_setopt(_easy, CURLOPT_NOPROGRESS, 0L);
curl_easy_setopt(_easy, CURLOPT_PROGRESSFUNCTION, curlProgressCallbackOlder);
curl_easy_setopt(_easy, CURLOPT_PROGRESSDATA, this);
-#ifdef NINTENDO_SWITCH
+#if defined NINTENDO_SWITCH || defined ANDROID_PLAIN_PORT
curl_easy_setopt(_easy, CURLOPT_SSL_VERIFYPEER, 0);
#endif
+
#if LIBCURL_VERSION_NUM >= 0x072000
// CURLOPT_XFERINFOFUNCTION introduced in libcurl 7.32.0
// CURLOPT_PROGRESSFUNCTION is used as a backup plan in case older version is used
diff --git a/configure b/configure
index 0277e2017c..a1cdf8aa1d 100755
--- a/configure
+++ b/configure
@@ -3069,6 +3069,7 @@ if test -n "$_host"; then
_port_mk="backends/platform/3ds/3ds.mk"
;;
android | android-arm | android-v7a | android-arm-v7a | android-arm64-v8a | android-mips | android-mips64 | android-x86 | android-x86_64 | ouya)
+ DEFINES="$DEFINES -D__ANDROID_PLAIN_PORT__ -DANDROID_PLAIN_PORT"
# we link a .so as default
append_var LDFLAGS "-shared"
append_var LDFLAGS "-Wl,-Bsymbolic,--no-undefined"
diff --git a/dists/android/AndroidManifest.xml b/dists/android/AndroidManifest.xml
index a344af79fa..0e30097213 100644
--- a/dists/android/AndroidManifest.xml
+++ b/dists/android/AndroidManifest.xml
@@ -21,6 +21,12 @@
<uses-permission
android:name="android.permission.ACCESS_WIFI_STATE"/>
+ <uses-permission
+ android:name="android.permission.INTERNET" />
+
+ <uses-permission
+ android:name="android.permission.ACCESS_NETWORK_STATE" />
+
<uses-feature
android:name="android.hardware.wifi"
android:required="false"/>
diff --git a/dists/android/AndroidManifest.xml.in b/dists/android/AndroidManifest.xml.in
index 6b7ee739db..17757d0a9c 100644
--- a/dists/android/AndroidManifest.xml.in
+++ b/dists/android/AndroidManifest.xml.in
@@ -21,6 +21,12 @@
<uses-permission
android:name="android.permission.ACCESS_WIFI_STATE"/>
+ <uses-permission
+ android:name="android.permission.INTERNET" />
+
+ <uses-permission
+ android:name="android.permission.ACCESS_NETWORK_STATE" />
+
<uses-feature
android:name="android.hardware.wifi"
android:required="false"/>