[Scummvm-git-logs] scummvm master -> 1af55ed1dc3169042ef15d961b6d3fe77f34ede5
lephilousophe
noreply at scummvm.org
Sun Apr 2 09:39:48 UTC 2023
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
5c2252186e ANDROID: Don't set DATA_DIR and PLUGIN_DIRECTORY
ecc050e83c ANDROID: Bundle cacert.pem and don't disable certificate checks
1af55ed1dc ANDROID: Remove ANDROID_PLAIN_PORT defines
Commit: 5c2252186e0e48c104ea2b275bba5b163ef54b68
https://github.com/scummvm/scummvm/commit/5c2252186e0e48c104ea2b275bba5b163ef54b68
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-04-02T11:39:44+02:00
Commit Message:
ANDROID: Don't set DATA_DIR and PLUGIN_DIRECTORY
Android doesn't have the concept of prefix so these pointed to something
invalid
Changed paths:
configure
diff --git a/configure b/configure
index 875762c9ff7..fcedf615f20 100755
--- a/configure
+++ b/configure
@@ -6736,7 +6736,8 @@ test "x$prefix" = xNONE && prefix=/usr/local
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
case $_host_os in
- ds | mingw*)
+ android | ds | mingw*)
+ # Android don't have a fixed prefix
# Windows stores all the external data files in executable file.
;;
*)
@@ -6748,6 +6749,9 @@ case $_host in
3ds)
append_var DEFINES "-DPLUGIN_DIRECTORY=\\\"$datadir/plugins\\\""
;;
+ android-*)
+ # Android don't have a fixed prefix
+ ;;
ds)
;;
openpandora)
Commit: ecc050e83ca698adadf1446b338d1fb0d63b03fd
https://github.com/scummvm/scummvm/commit/ecc050e83ca698adadf1446b338d1fb0d63b03fd
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-04-02T11:39:44+02:00
Commit Message:
ANDROID: Bundle cacert.pem and don't disable certificate checks
Changed paths:
backends/networking/curl/connectionmanager.cpp
backends/networking/curl/networkreadstream.cpp
backends/networking/curl/socket.cpp
backends/platform/android/android.mk
diff --git a/backends/networking/curl/connectionmanager.cpp b/backends/networking/curl/connectionmanager.cpp
index 2091e71de51..230d6a007ef 100644
--- a/backends/networking/curl/connectionmanager.cpp
+++ b/backends/networking/curl/connectionmanager.cpp
@@ -99,7 +99,15 @@ uint32 ConnectionManager::getCloudRequestsPeriodInMicroseconds() {
}
const char *ConnectionManager::getCaCertPath() {
-#if defined(DATA_PATH)
+#if defined(__ANDROID__)
+ Common::ArchiveMemberPtr member = SearchMan.getMember("cacert.pem");
+ Common::FSNode *node = dynamic_cast<Common::FSNode *>(member.get());
+ if (!node) {
+ return nullptr;
+ }
+
+ return node->getPath().c_str();
+#elif defined(DATA_PATH)
static enum {
kNotInitialized,
kFileNotFound,
diff --git a/backends/networking/curl/networkreadstream.cpp b/backends/networking/curl/networkreadstream.cpp
index c7ae1ee9142..9b470787b56 100644
--- a/backends/networking/curl/networkreadstream.cpp
+++ b/backends/networking/curl/networkreadstream.cpp
@@ -92,7 +92,7 @@ void NetworkReadStream::initCurl(const char *url, curl_slist *headersList) {
curl_easy_setopt(_easy, CURLOPT_NOPROGRESS, 0L);
curl_easy_setopt(_easy, CURLOPT_PROGRESSFUNCTION, curlProgressCallbackOlder);
curl_easy_setopt(_easy, CURLOPT_PROGRESSDATA, this);
-#if defined NINTENDO_SWITCH || defined ANDROID_PLAIN_PORT || defined PSP2
+#if defined NINTENDO_SWITCH || defined PSP2
curl_easy_setopt(_easy, CURLOPT_SSL_VERIFYPEER, 0);
#endif
diff --git a/backends/networking/curl/socket.cpp b/backends/networking/curl/socket.cpp
index ff6061a2360..6845905aeab 100644
--- a/backends/networking/curl/socket.cpp
+++ b/backends/networking/curl/socket.cpp
@@ -22,6 +22,7 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include <curl/curl.h>
#include "backends/networking/curl/socket.h"
+#include "backends/networking/curl/connectionmanager.h"
#include "common/debug.h"
#include "common/system.h"
@@ -75,12 +76,18 @@ bool CurlSocket::connect(Common::String url) {
// Just connect to the host, do not do any transfers.
curl_easy_setopt(_easy, CURLOPT_CONNECT_ONLY, 1L);
- // On Android, libcurl won't connect to SSL connections
+ // libcurl won't connect to SSL connections
// with VERIFYPEER enabled because we do not ship
- // with a CA bundle. So let's disable it.
-#ifdef ANDROID_PLAIN_PORT
- curl_easy_setopt(_easy, CURLOPT_SSL_VERIFYPEER, 0L);
+ // with a CA bundle in these platforms.
+ // So let's disable it.
+#if defined NINTENDO_SWITCH || defined PSP2
+ curl_easy_setopt(_easy, CURLOPT_SSL_VERIFYPEER, 0);
#endif
+ const char *caCertPath = ConnMan.getCaCertPath();
+ if (caCertPath) {
+ curl_easy_setopt(_easy, CURLOPT_CAINFO, caCertPath);
+ }
+
CURLcode res = curl_easy_perform(_easy);
if (res != CURLE_OK) {
warning("libcurl: Failed to connect: %s", curl_easy_strerror(res));
diff --git a/backends/platform/android/android.mk b/backends/platform/android/android.mk
index 490f43e7fc3..8ba13deaa87 100644
--- a/backends/platform/android/android.mk
+++ b/backends/platform/android/android.mk
@@ -33,15 +33,28 @@ ifneq ($(DIST_FILES_SHADERS),)
$(INSTALL) -c -m 644 $(DIST_FILES_SHADERS) $(PATH_BUILD_ASSETS)/shaders
endif
+ifdef DIST_ANDROID_CACERT_PEM
+$(PATH_BUILD_ASSETS)/cacert.pem: $(DIST_ANDROID_CACERT_PEM) | $(PATH_BUILD_ASSETS)
+ $(INSTALL) -c -m 644 $(DIST_ANDROID_CACERT_PEM) $(PATH_BUILD_ASSETS)/cacert.pem
+else
+ifdef USE_CURL
+$(PATH_BUILD_ASSETS)/cacert.pem: | $(PATH_BUILD_ASSETS)
+ $(QUIET_CURL)$(CURL) -s https://curl.se/ca/cacert.pem --time-cond $(PATH_BUILD_ASSETS)/cacert.pem --output $(PATH_BUILD_ASSETS)/cacert.pem
+androidcacert: | $(PATH_BUILD_ASSETS)
+ $(QUIET_CURL)$(CURL) -s https://curl.se/ca/cacert.pem --time-cond $(PATH_BUILD_ASSETS)/cacert.pem --output $(PATH_BUILD_ASSETS)/cacert.pem
+.PHONY: androidcacert
+endif
+endif
+
$(PATH_BUILD_LIBSCUMMVM): libscummvm.so | $(PATH_BUILD)
$(INSTALL) -d $(PATH_BUILD_LIB)
$(INSTALL) -c -m 644 libscummvm.so $(PATH_BUILD_LIBSCUMMVM)
-$(APK_MAIN): $(PATH_BUILD_GRADLE) $(PATH_BUILD_ASSETS) $(PATH_BUILD_LIBSCUMMVM) | $(PATH_BUILD)
+$(APK_MAIN): $(PATH_BUILD_GRADLE) $(PATH_BUILD_ASSETS) $(PATH_BUILD_ASSETS)/cacert.pem $(PATH_BUILD_LIBSCUMMVM) | $(PATH_BUILD)
(cd $(PATH_BUILD); ./gradlew assembleDebug)
$(CP) $(PATH_BUILD)/build/outputs/apk/debug/$(APK_MAIN) $@
-$(APK_MAIN_RELEASE): $(PATH_BUILD_GRADLE) $(PATH_BUILD_ASSETS) $(PATH_BUILD_LIBSCUMMVM) | $(PATH_BUILD)
+$(APK_MAIN_RELEASE): $(PATH_BUILD_GRADLE) $(PATH_BUILD_ASSETS) $(PATH_BUILD_ASSETS)/cacert.pem $(PATH_BUILD_LIBSCUMMVM) | $(PATH_BUILD)
(cd $(PATH_BUILD); ./gradlew assembleRelease)
$(CP) $(PATH_BUILD)/build/outputs/apk/release/$(APK_MAIN_RELEASE) $@
Commit: 1af55ed1dc3169042ef15d961b6d3fe77f34ede5
https://github.com/scummvm/scummvm/commit/1af55ed1dc3169042ef15d961b6d3fe77f34ede5
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-04-02T11:39:44+02:00
Commit Message:
ANDROID: Remove ANDROID_PLAIN_PORT defines
They are not used anymore and we don't have any other kind of port
anymore
Changed paths:
configure
diff --git a/configure b/configure
index fcedf615f20..3f4ee0dcd6a 100755
--- a/configure
+++ b/configure
@@ -3377,8 +3377,7 @@ if test -n "$_host"; then
_port_mk="backends/platform/3ds/3ds.mk"
;;
android-arm-v7a | android-arm64-v8a | android-x86 | android-x86_64 | ouya)
- # also __ANDROID__ is defined by Clang in the NDK
- DEFINES="$DEFINES -D__ANDROID_PLAIN_PORT__ -DANDROID_PLAIN_PORT"
+ # __ANDROID__ is defined by Clang in the NDK
# we link a .so as default
append_var LDFLAGS "-shared"
append_var LDFLAGS "-Wl,-Bsymbolic,--no-undefined"
More information about the Scummvm-git-logs
mailing list