Enable web services on Android in Github build (#6555)

* Enable web services in android

* Fix web services build on android

* clang-format

* Remove unnecessary line

* Set telemetry to be disabled by default on all platforms
This commit is contained in:
Rokkubro 2023-05-24 02:06:14 +10:00 committed by GitHub
parent 2281bf5b0b
commit 72b82ef6ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 9 additions and 8 deletions

View File

@ -106,7 +106,6 @@ android {
cmake { cmake {
arguments "-DENABLE_QT=0", // Don't use QT arguments "-DENABLE_QT=0", // Don't use QT
"-DENABLE_SDL2=0", // Don't use SDL "-DENABLE_SDL2=0", // Don't use SDL
"-DENABLE_WEB_SERVICE=0", // Don't use telemetry
"-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work "-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work
"-DBUNDLE_SPEEX=ON" "-DBUNDLE_SPEEX=ON"

View File

@ -274,7 +274,7 @@ void Config::ReadValues() {
// Web Service // Web Service
NetSettings::values.enable_telemetry = NetSettings::values.enable_telemetry =
sdl2_config->GetBoolean("WebService", "enable_telemetry", true); sdl2_config->GetBoolean("WebService", "enable_telemetry", false);
NetSettings::values.web_api_url = NetSettings::values.web_api_url =
sdl2_config->GetString("WebService", "web_api_url", "https://api.citra-emu.org"); sdl2_config->GetString("WebService", "web_api_url", "https://api.citra-emu.org");
NetSettings::values.citra_username = sdl2_config->GetString("WebService", "citra_username", ""); NetSettings::values.citra_username = sdl2_config->GetString("WebService", "citra_username", "");

View File

@ -334,7 +334,7 @@ gdbstub_port=24689
[WebService] [WebService]
# Whether or not to enable telemetry # Whether or not to enable telemetry
# 0: No, 1 (default): Yes # 0 (default): No, 1: Yes
enable_telemetry = enable_telemetry =
# URL for Web API # URL for Web API
web_api_url = https://api.citra-emu.org web_api_url = https://api.citra-emu.org

View File

@ -313,7 +313,7 @@ void Config::ReadValues() {
// Web Service // Web Service
NetSettings::values.enable_telemetry = NetSettings::values.enable_telemetry =
sdl2_config->GetBoolean("WebService", "enable_telemetry", true); sdl2_config->GetBoolean("WebService", "enable_telemetry", false);
NetSettings::values.web_api_url = NetSettings::values.web_api_url =
sdl2_config->GetString("WebService", "web_api_url", "https://api.citra-emu.org"); sdl2_config->GetString("WebService", "web_api_url", "https://api.citra-emu.org");
NetSettings::values.citra_username = sdl2_config->GetString("WebService", "citra_username", ""); NetSettings::values.citra_username = sdl2_config->GetString("WebService", "citra_username", "");

View File

@ -349,7 +349,7 @@ renderer_debug =
[WebService] [WebService]
# Whether or not to enable telemetry # Whether or not to enable telemetry
# 0: No, 1 (default): Yes # 0 (default): No, 1: Yes
enable_telemetry = enable_telemetry =
# URL for Web API # URL for Web API
web_api_url = https://api.citra-emu.org web_api_url = https://api.citra-emu.org

View File

@ -803,7 +803,7 @@ void Config::ReadWebServiceValues() {
qt_config->beginGroup(QStringLiteral("WebService")); qt_config->beginGroup(QStringLiteral("WebService"));
NetSettings::values.enable_telemetry = NetSettings::values.enable_telemetry =
ReadSetting(QStringLiteral("enable_telemetry"), true).toBool(); ReadSetting(QStringLiteral("enable_telemetry"), false).toBool();
NetSettings::values.web_api_url = NetSettings::values.web_api_url =
ReadSetting(QStringLiteral("web_api_url"), QStringLiteral("https://api.citra-emu.org")) ReadSetting(QStringLiteral("web_api_url"), QStringLiteral("https://api.citra-emu.org"))
.toString() .toString()

View File

@ -145,8 +145,8 @@ void GMainWindow::ShowTelemetryCallout() {
tr("<a href='https://citra-emu.org/entry/telemetry-and-why-thats-a-good-thing/'>Anonymous " tr("<a href='https://citra-emu.org/entry/telemetry-and-why-thats-a-good-thing/'>Anonymous "
"data is collected</a> to help improve Citra. " "data is collected</a> to help improve Citra. "
"<br/><br/>Would you like to share your usage data with us?"); "<br/><br/>Would you like to share your usage data with us?");
if (QMessageBox::question(this, tr("Telemetry"), telemetry_message) != QMessageBox::Yes) { if (QMessageBox::question(this, tr("Telemetry"), telemetry_message) == QMessageBox::Yes) {
NetSettings::values.enable_telemetry = false; NetSettings::values.enable_telemetry = true;
Settings::Apply(); Settings::Apply();
} }
} }

View File

@ -21,6 +21,8 @@ std::optional<std::vector<u8>> Download(const std::string& path) {
httplib::Request request{ httplib::Request request{
.method = "GET", .method = "GET",
.path = path, .path = path,
// Needed when httplib is included on android
.matches = httplib::Match(),
}; };
client->set_follow_location(true); client->set_follow_location(true);