From 10a048b416e1db89f963bb9065bdffb9fe6ba20c Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 21 Nov 2023 19:31:32 +0100 Subject: [PATCH] (Android) Added networking support --- CMakeLists.txt | 4 ++++ es-app/src/guis/GuiThemeDownloader.cpp | 7 +++++++ es-app/src/scrapers/ScreenScraper.h | 2 ++ 3 files changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd0ed2692..81e05743d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -284,6 +284,10 @@ if(APPLE) endif() endif() +if(ANDROID) + set(BUNDLED_CERTS ON) +endif() + if(WIN32) set(BUNDLED_CERTS ON) add_compile_definitions(UNICODE) diff --git a/es-app/src/guis/GuiThemeDownloader.cpp b/es-app/src/guis/GuiThemeDownloader.cpp index 6659f329d..018d4ac52 100644 --- a/es-app/src/guis/GuiThemeDownloader.cpp +++ b/es-app/src/guis/GuiThemeDownloader.cpp @@ -162,6 +162,13 @@ GuiThemeDownloader::GuiThemeDownloader(std::function updateCallback) git_libgit2_init(); +#if defined(__ANDROID__) && defined(USE_BUNDLED_CERTIFICATES) + git_libgit2_opts( + GIT_OPT_SET_SSL_CERT_LOCATIONS, + ResourceManager::getInstance().getResourcePath(":/certificates/curl-ca-bundle.crt").c_str(), + nullptr); +#endif + // The promise/future mechanism is used as signaling for the thread to indicate that // repository fetching has been completed. std::promise().swap(mPromise); diff --git a/es-app/src/scrapers/ScreenScraper.h b/es-app/src/scrapers/ScreenScraper.h index dc995cefd..e132ac173 100644 --- a/es-app/src/scrapers/ScreenScraper.h +++ b/es-app/src/scrapers/ScreenScraper.h @@ -57,6 +57,8 @@ public: const std::string platformIdentifier {" S"}; #elif defined(RETRODECK) const std::string platformIdentifier {" R"}; +#elif defined(__ANDROID__) + const std::string platformIdentifier {" G"}; #elif defined(APPIMAGE_BUILD) const std::string platformIdentifier {" A"}; #elif defined(__linux__) && defined(RASPBERRY_PI)