MainSettings: Add setting to control Wii NUS Shop URL for system updates

This commit is contained in:
OatmealDome 2022-05-04 22:54:27 -04:00
parent d0ed09ab6f
commit 8c669efe76
3 changed files with 15 additions and 4 deletions

View file

@ -210,6 +210,9 @@ const Info<bool> MAIN_ENABLE_SAVESTATES{{System::Main, "Core", "EnableSaveStates
const Info<bool> MAIN_REAL_WII_REMOTE_REPEAT_REPORTS{
{System::Main, "Core", "RealWiiRemoteRepeatReports"}, true};
// Empty means use the Dolphin default URL
const Info<std::string> MAIN_WII_NUS_SHOP_URL{{System::Main, "Core", "WiiNusShopUrl"}, ""};
// Main.Display
const Info<std::string> MAIN_FULLSCREEN_DISPLAY_RES{

View file

@ -131,6 +131,7 @@ extern const Info<bool> MAIN_ENABLE_SAVESTATES;
extern const Info<DiscIO::Region> MAIN_FALLBACK_REGION;
extern const Info<bool> MAIN_REAL_WII_REMOTE_REPEAT_REPORTS;
extern const Info<s32> MAIN_OVERRIDE_BOOT_IOS;
extern const Info<std::string> MAIN_WII_NUS_SHOP_URL;
// Main.DSP

View file

@ -458,11 +458,18 @@ OnlineSystemUpdater::Response OnlineSystemUpdater::GetSystemTitles()
doc.save(stream);
const std::string request = stream.str();
// Note: We don't use HTTPS because that would require the user to have
// a device certificate which cannot be redistributed with Dolphin.
// This is fine, because IOS has signature checks.
std::string base_url = Config::Get(Config::MAIN_WII_NUS_SHOP_URL);
if (base_url.empty())
{
// Note: We don't use HTTPS because that would require the user to have
// a device certificate which cannot be redistributed with Dolphin.
// This is fine, because IOS has signature checks.
base_url = "http://nus.shop.wii.com";
}
const std::string url = fmt::format("{}/nus/services/NetUpdateSOAP", base_url);
const Common::HttpRequest::Response response =
m_http.Post("http://nus.shop.wii.com/nus/services/NetUpdateSOAP", request,
m_http.Post(url, request,
{
{"SOAPAction", "urn:nus.wsapi.broadon.com/GetSystemUpdate"},
{"User-Agent", "wii libnup/1.0"},