GeckoCodeConfig: Remove HTTPS workaround for Android

This commit is contained in:
OatmealDome 2024-12-22 19:38:19 -05:00
parent 233b939160
commit dbddd5fa8c
3 changed files with 4 additions and 8 deletions

View File

@ -191,7 +191,7 @@ Java_org_dolphinemu_dolphinemu_features_cheats_model_GeckoCheat_downloadCodes(JN
const std::string gametdb_id = GetJString(env, jGameTdbId); const std::string gametdb_id = GetJString(env, jGameTdbId);
bool success = true; bool success = true;
const std::vector<Gecko::GeckoCode> codes = Gecko::DownloadCodes(gametdb_id, &success, false); const std::vector<Gecko::GeckoCode> codes = Gecko::DownloadCodes(gametdb_id, &success);
if (!success) if (!success)
return nullptr; return nullptr;

View File

@ -17,13 +17,10 @@
namespace Gecko namespace Gecko
{ {
std::vector<GeckoCode> DownloadCodes(std::string gametdb_id, bool* succeeded, bool use_https) std::vector<GeckoCode> DownloadCodes(std::string gametdb_id, bool* succeeded)
{ {
// TODO: Fix https://bugs.dolphin-emu.org/issues/11772 so we don't need this workaround
const std::string protocol = use_https ? "https://" : "http://";
// codes.rc24.xyz is a mirror of the now defunct geckocodes.org. // codes.rc24.xyz is a mirror of the now defunct geckocodes.org.
std::string endpoint{protocol + "codes.rc24.xyz/txt.php?txt=" + gametdb_id}; std::string endpoint{"https://codes.rc24.xyz/txt.php?txt=" + gametdb_id};
Common::HttpRequest http; Common::HttpRequest http;
// The server always redirects once to the same location. // The server always redirects once to the same location.

View File

@ -17,8 +17,7 @@ class IniFile;
namespace Gecko namespace Gecko
{ {
std::vector<GeckoCode> LoadCodes(const Common::IniFile& globalIni, const Common::IniFile& localIni); std::vector<GeckoCode> LoadCodes(const Common::IniFile& globalIni, const Common::IniFile& localIni);
std::vector<GeckoCode> DownloadCodes(std::string gametdb_id, bool* succeeded, std::vector<GeckoCode> DownloadCodes(std::string gametdb_id, bool* succeeded);
bool use_https = true);
void SaveCodes(Common::IniFile& inifile, const std::vector<GeckoCode>& gcodes); void SaveCodes(Common::IniFile& inifile, const std::vector<GeckoCode>& gcodes);
std::optional<GeckoCode::Code> DeserializeLine(const std::string& line); std::optional<GeckoCode::Code> DeserializeLine(const std::string& line);