From 3f59781bd8d3d36b8728ef7abd0f323311185974 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Wed, 24 Jul 2024 19:13:43 +1000 Subject: [PATCH 001/139] feat(spotpass): Force BOSS policy list refresh on each boot hours in ghidra for a single line of code --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 417e9a3..5e2e4b7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -177,6 +177,10 @@ INITIALIZE_PLUGIN() { for (const auto &patch: url_patches) { write_string(patch.address, patch.url); } + + // IOS-NIM-BOSS GlobalPolicyList->state: poking this forces a refresh after we changed the url + Mocha_IOSUKernelWrite32(0xE24B3D90, 4); + DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches applied successfully."); ShowNotification(get_pretendo_message()); From 538fc25014a4c0ee292182b81ff8e0a4c97af0af Mon Sep 17 00:00:00 2001 From: Ash Date: Thu, 25 Jul 2024 13:20:23 +0000 Subject: [PATCH 002/139] feat(main): Version 2.6.0 --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5e2e4b7..5b199ab 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -49,7 +49,7 @@ #include -#define INKAY_VERSION "v2.5.0" +#define INKAY_VERSION "v2.6.0" /** Mandatory plugin information. @@ -59,7 +59,7 @@ WUPS_PLUGIN_NAME("Inkay"); WUPS_PLUGIN_DESCRIPTION("Pretendo Network Patcher"); WUPS_PLUGIN_VERSION(INKAY_VERSION); WUPS_PLUGIN_AUTHOR("Pretendo contributors"); -WUPS_PLUGIN_LICENSE("ISC"); +WUPS_PLUGIN_LICENSE("GPLv3"); WUPS_USE_STORAGE("inkay"); From 734e5d40c946df16e309aa0543876bad274a1d5d Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Sat, 3 Aug 2024 21:46:46 +1000 Subject: [PATCH 003/139] chore: clean up old includes caused compile issues on latest tools - the curl include is old and the wut headers added C++ templates --- src/main.cpp | 1 - src/utils/logger.h | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5b199ab..7435b60 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -44,7 +44,6 @@ #include #include -#include #include "ca_pem.h" #include diff --git a/src/utils/logger.h b/src/utils/logger.h index ce6b35e..f7278b6 100644 --- a/src/utils/logger.h +++ b/src/utils/logger.h @@ -1,15 +1,15 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__) From 867ea12f17531c912ab19f160c891834dcbae2fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E6=97=B6=20=E4=B8=89=E6=9C=88?= <68946023+littlefive233@users.noreply.github.com> Date: Sat, 3 Aug 2024 21:54:16 +1000 Subject: [PATCH 004/139] feat(i18n): Add Traditional Chinese, Simplified Chinese Closes #25 Co-authored-by: Ash Logan --- src/config.cpp | 25 +++++++++++++++++++++++++ src/main.cpp | 6 ++++++ 2 files changed, 31 insertions(+) diff --git a/src/config.cpp b/src/config.cpp index 863601a..8875106 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -77,6 +77,7 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .restart_to_apply_action = "Redémarrer pour appliquer", .need_menu_action = "Depuis le menu Wii U seulement", }; + case nn::swkbd::LanguageType::Italian: return { .plugin_name = "Inkay", @@ -100,6 +101,30 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .restart_to_apply_action = "Neustarten zum Anwenden", .need_menu_action = "Nur vom Wii U-Menü aus", }; + + case nn::swkbd::LanguageType::SimplifiedChinese: + return { + .plugin_name = "Inkay", + .network_category = "选择网络", + .connect_to_network_setting = "连接到Pretendo network", + .other_category = "其他设置", + .reset_wwp_setting = "重置Wara Wara Plaza", + .press_a_action = "请按 A", + .restart_to_apply_action = "重启以应用设置", + .need_menu_action = "仅来自WiiU Menu" + }; + + case nn::swkbd::LanguageType::TraditionalChinese: + return { + .plugin_name = "Inkay", + .network_category = "選擇網路", + .connect_to_network_setting = "連接到Pretendo network", + .other_category = "其他設定", + .reset_wwp_setting = "重置Wara Wara Plaza", + .press_a_action = "請按 A", + .restart_to_apply_action = "重啓以套用設定", + .need_menu_action = "僅來自WiiU Menu" + }; } } diff --git a/src/main.cpp b/src/main.cpp index 7435b60..6cb308d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -112,6 +112,9 @@ static const char *get_nintendo_network_message() { return "Usando Nintendo Network"; case nn::swkbd::LanguageType::German: return "Nutze Nintendo Network"; + case nn::swkbd::LanguageType::SimplifiedChinese: + case nn::swkbd::LanguageType::TraditionalChinese: + return "使用 Nintendo Network"; } } @@ -131,6 +134,9 @@ static const char *get_pretendo_message() { return "Usando Pretendo Network"; case nn::swkbd::LanguageType::German: return "Nutze Pretendo Network"; + case nn::swkbd::LanguageType::SimplifiedChinese: + case nn::swkbd::LanguageType::TraditionalChinese: + return "使用 Pretendo Network"; } } From a6fd3783f13aecaa1710a4a0d90f192f743088b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs?= <26727089+luissilva1044894@users.noreply.github.com> Date: Sat, 3 Aug 2024 21:57:15 +1000 Subject: [PATCH 005/139] feat(i18n): Add Portuguese translation Closes #31 Co-authored-by: Ash Logan --- src/config.cpp | 12 ++++++++++++ src/main.cpp | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index 8875106..96861e5 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -125,6 +125,18 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .restart_to_apply_action = "重啓以套用設定", .need_menu_action = "僅來自WiiU Menu" }; + + case nn::swkbd::LanguageType::Portuguese: + return { + .plugin_name = "Inkay", + .network_category = "Selecionar rede", + .connect_to_network_setting = "Conecta-se à Pretendo Network", + .other_category = "Outras configurações", + .reset_wwp_setting = "Resetar Wara Wara Plaza", + .press_a_action = "Aperte A", + .restart_to_apply_action = "Reinicie para aplicar", + .need_menu_action = "Apenas no menu do Wii U" + }; } } diff --git a/src/main.cpp b/src/main.cpp index 6cb308d..d3fa11e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -105,11 +105,11 @@ static const char *get_nintendo_network_message() { default: return "Using Nintendo Network"; case nn::swkbd::LanguageType::Spanish: + case nn::swkbd::LanguageType::Portuguese: + case nn::swkbd::LanguageType::Italian: return "Usando Nintendo Network"; case nn::swkbd::LanguageType::French: return "Sur Nintendo Network"; - case nn::swkbd::LanguageType::Italian: - return "Usando Nintendo Network"; case nn::swkbd::LanguageType::German: return "Nutze Nintendo Network"; case nn::swkbd::LanguageType::SimplifiedChinese: @@ -127,11 +127,11 @@ static const char *get_pretendo_message() { default: return "Using Pretendo Network"; case nn::swkbd::LanguageType::Spanish: + case nn::swkbd::LanguageType::Portuguese: + case nn::swkbd::LanguageType::Italian: return "Usando Pretendo Network"; case nn::swkbd::LanguageType::French: return "Sur Pretendo Network"; - case nn::swkbd::LanguageType::Italian: - return "Usando Pretendo Network"; case nn::swkbd::LanguageType::German: return "Nutze Pretendo Network"; case nn::swkbd::LanguageType::SimplifiedChinese: From bdfb6ca859bbbdd16d6b5224af1c00a19bafc87b Mon Sep 17 00:00:00 2001 From: Dekokiyo Date: Sat, 3 Aug 2024 21:59:02 +1000 Subject: [PATCH 006/139] feat(i18n): Add Japanese translation Closes #33 Co-authored-by: Ash Logan --- src/config.cpp | 12 ++++++++++++ src/main.cpp | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/src/config.cpp b/src/config.cpp index 96861e5..173d057 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -137,6 +137,18 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .restart_to_apply_action = "Reinicie para aplicar", .need_menu_action = "Apenas no menu do Wii U" }; + + case nn::swkbd::LanguageType::Japanese: + return { + .plugin_name = "Inkay", + .network_category = "ネットワークの選択", + .connect_to_network_setting = "Pretendoネットワークに接続", + .other_category = "その他の設定", + .reset_wwp_setting = "わらわら広場をリセット", + .press_a_action = "Aボタンを押す", + .restart_to_apply_action = "再起動して適用", + .need_menu_action = "WiiUメニューからのみ実行可能" + }; } } diff --git a/src/main.cpp b/src/main.cpp index d3fa11e..21873df 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -115,6 +115,8 @@ static const char *get_nintendo_network_message() { case nn::swkbd::LanguageType::SimplifiedChinese: case nn::swkbd::LanguageType::TraditionalChinese: return "使用 Nintendo Network"; + case nn::swkbd::LanguageType::Japanese: + return "ニンテンドーネットワークを使用中"; } } @@ -137,6 +139,8 @@ static const char *get_pretendo_message() { case nn::swkbd::LanguageType::SimplifiedChinese: case nn::swkbd::LanguageType::TraditionalChinese: return "使用 Pretendo Network"; + case nn::swkbd::LanguageType::Japanese: + return "Pretendoネットワークを使用中"; } } From 956419a438a046af9efa613d3fad99c78fb5e7bd Mon Sep 17 00:00:00 2001 From: JouriR Date: Sat, 3 Aug 2024 22:00:50 +1000 Subject: [PATCH 007/139] feat(i18n): Add Dutch translation Closes #36 Co-authored-by: Ash Logan --- src/config.cpp | 12 ++++++++++++ src/main.cpp | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/src/config.cpp b/src/config.cpp index 173d057..3ee6328 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -149,6 +149,18 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .restart_to_apply_action = "再起動して適用", .need_menu_action = "WiiUメニューからのみ実行可能" }; + + case nn::swkbd::LanguageType::Dutch: + return { + .plugin_name = "Inkay", + .network_category = "Netwerkselectie", + .connect_to_network_setting = "Verbind met het Pretendo-netwerk", + .other_category = "Overige instellingen", + .reset_wwp_setting = "Reset het Wara Wara Plaza", + .press_a_action = "Druk A", + .restart_to_apply_action = "Herstart om toe te passen", + .need_menu_action = "Alleen vanuit het WiiU-menu" + }; } } diff --git a/src/main.cpp b/src/main.cpp index 21873df..33dbbbc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -117,6 +117,8 @@ static const char *get_nintendo_network_message() { return "使用 Nintendo Network"; case nn::swkbd::LanguageType::Japanese: return "ニンテンドーネットワークを使用中"; + case nn::swkbd::LanguageType::Dutch: + return "Nintendo Network wordt gebruikt"; } } @@ -141,6 +143,8 @@ static const char *get_pretendo_message() { return "使用 Pretendo Network"; case nn::swkbd::LanguageType::Japanese: return "Pretendoネットワークを使用中"; + case nn::swkbd::LanguageType::Dutch: + return "Pretendo Network wordt gebruikt"; } } From 04d723137b0da6b5fa93efec8c3b4cdfad83591c Mon Sep 17 00:00:00 2001 From: yarb00 Date: Sat, 3 Aug 2024 22:05:28 +1000 Subject: [PATCH 008/139] feat(i18n): Add Russian translation Closes #41 Co-authored-by: Ash Logan --- src/config.cpp | 12 ++++++++++++ src/main.cpp | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/src/config.cpp b/src/config.cpp index 3ee6328..77db691 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -161,6 +161,18 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .restart_to_apply_action = "Herstart om toe te passen", .need_menu_action = "Alleen vanuit het WiiU-menu" }; + + case nn::swkbd::LanguageType::Russian: + return { + .plugin_name = "Inkay", + .network_category = "Выбор сети", + .connect_to_network_setting = "Подключиться к Pretendo Network", + .other_category = "Другие настройки", + .reset_wwp_setting = "Сбросить Wara Wara Plaza", + .press_a_action = "Нажмите A", + .restart_to_apply_action = "Перезагрузите для применения изменений", + .need_menu_action = "Только из меню Wii U" + }; } } diff --git a/src/main.cpp b/src/main.cpp index 33dbbbc..2cb0cab 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -119,6 +119,8 @@ static const char *get_nintendo_network_message() { return "ニンテンドーネットワークを使用中"; case nn::swkbd::LanguageType::Dutch: return "Nintendo Network wordt gebruikt"; + case nn::swkbd::LanguageType::Russian: + return "Используется Nintendo Network"; } } @@ -145,6 +147,8 @@ static const char *get_pretendo_message() { return "Pretendoネットワークを使用中"; case nn::swkbd::LanguageType::Dutch: return "Pretendo Network wordt gebruikt"; + case nn::swkbd::LanguageType::Russian: + return "Используется Pretendo Network"; } } From 1a85a45ce3a90e527f55687922447ae41f0193b9 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Sun, 4 Aug 2024 16:24:01 +1000 Subject: [PATCH 009/139] chore: Tighten up logspam and binary size Remove some old stuff to Make Small Inkay --- Makefile | 6 +++--- src/config.cpp | 2 +- src/patches/account_settings.cpp | 12 ++++++------ src/patches/eshop_applet.cpp | 10 +++++----- src/patches/game_matchmaking.cpp | 6 +++--- src/patches/olv_applet.cpp | 27 +++------------------------ src/patches/olv_urls.cpp | 6 +++--- src/utils/replace_mem.cpp | 2 ++ 8 files changed, 26 insertions(+), 45 deletions(-) diff --git a/Makefile b/Makefile index b41ffa0..2d63adc 100644 --- a/Makefile +++ b/Makefile @@ -29,19 +29,19 @@ INCLUDES := src src/ext/inih #------------------------------------------------------------------------------- # options for code generation #------------------------------------------------------------------------------- -CFLAGS := -g -Wall -O2 -ffunction-sections \ +CFLAGS := -Wall -O2 -ffunction-sections -fdata-sections \ $(MACHDEP) CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__ -D__WUPS__ ifeq ($(DEBUG),1) - CFLAGS += -DDEBUG + CFLAGS += -DDEBUG -g endif CXXFLAGS := $(CFLAGS) -std=c++20 ASFLAGS := -g $(ARCH) -LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) +LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -Wl,-gc-sections LDFLAGS += -T$(WUMS_ROOT)/share/libkernel.ld $(WUPSSPECS) diff --git a/src/config.cpp b/src/config.cpp index 77db691..995f351 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -177,7 +177,7 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { } static void connect_to_network_changed(ConfigItemBoolean* item, bool new_value) { - DEBUG_FUNCTION_LINE("connect_to_network changed to: %d", new_value); + DEBUG_FUNCTION_LINE_VERBOSE("connect_to_network changed to: %d", new_value); if (new_value != Config::connect_to_network) { Config::need_relaunch = true; } diff --git a/src/patches/account_settings.cpp b/src/patches/account_settings.cpp index 6476ce6..efea324 100644 --- a/src/patches/account_settings.cpp +++ b/src/patches/account_settings.cpp @@ -62,7 +62,7 @@ DECL_FUNCTION(int, FSOpenFile_accSettings, FSClient *client, FSCmdBlock *block, } if (!Config::connect_to_network) { - DEBUG_FUNCTION_LINE("Inkay: account settings patches skipped."); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: account settings patches skipped."); return real_FSOpenFile_accSettings(client, block, path, mode, handle, error); } @@ -70,7 +70,7 @@ DECL_FUNCTION(int, FSOpenFile_accSettings, FSClient *client, FSCmdBlock *block, if (strcmp("vol/content/browser/rootca.pem", path) == 0) { int ret = real_FSOpenFile_accSettings(client, block, path, mode, handle, error); rootca_pem_handle = *handle; - DEBUG_FUNCTION_LINE("Inkay: Found account settings CA, replacing..."); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: Found account settings CA, replacing..."); return ret; } return real_FSOpenFile_accSettings(client, block, path, mode, handle, error); @@ -116,19 +116,19 @@ bool patchAccountSettings() { } if (!Config::connect_to_network) { - DEBUG_FUNCTION_LINE("Inkay: account settings patches skipped."); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: account settings patches skipped."); return false; } - DEBUG_FUNCTION_LINE("Inkay: hewwo account settings!\n"); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: hewwo account settings!\n"); if (!replace(0x10000000, 0x10000000, wave_original, sizeof(wave_original), wave_new, sizeof(wave_new))) { - DEBUG_FUNCTION_LINE("Inkay: We didn't find the url /)>~<(\\"); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: We didn't find the url /)>~<(\\"); return false; } if (!replace(0x10000000, 0x10000000, whitelist_original, sizeof(whitelist_original), whitelist_new, sizeof(whitelist_new))) { - DEBUG_FUNCTION_LINE("Inkay: We didn't find the whitelist /)>~<(\\"); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: We didn't find the whitelist /)>~<(\\"); return false; } diff --git a/src/patches/eshop_applet.cpp b/src/patches/eshop_applet.cpp index f523860..d3ee43c 100644 --- a/src/patches/eshop_applet.cpp +++ b/src/patches/eshop_applet.cpp @@ -53,7 +53,7 @@ DECL_FUNCTION(int, FSOpenFile_eShop, FSClient *client, FSCmdBlock *block, char * const char *initialOma = "vol/content/initial.oma"; if (!Config::connect_to_network) { - DEBUG_FUNCTION_LINE("Inkay: eShop patches skipped."); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: eShop patches skipped."); return real_FSOpenFile_eShop(client, block, path, mode, handle, error); } @@ -61,19 +61,19 @@ DECL_FUNCTION(int, FSOpenFile_eShop, FSClient *client, FSCmdBlock *block, char * //below is a hacky (yet functional!) way to get Inkay to redirect URLs from the Miiverse applet //we do it when loading this file since it should only load once, preventing massive lag spikes as it searches all of MEM2 xD - DEBUG_FUNCTION_LINE("Inkay: hewwo eShop!\n"); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: hewwo eShop!\n"); if (!replace(0x10000000, 0x10000000, wave_original, sizeof(wave_original), wave_new, sizeof(wave_new))) - DEBUG_FUNCTION_LINE("Inkay: We didn't find the url /)>~<(\\"); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: We didn't find the url /)>~<(\\"); if (!replace(0x10000000, 0x10000000, whitelist_original, sizeof(whitelist_original), whitelist_new, sizeof(whitelist_new))) - DEBUG_FUNCTION_LINE("Inkay: We didn't find the whitelist /)>~<(\\"); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: We didn't find the whitelist /)>~<(\\"); // Check for root CA file and take note of its handle } else if (strcmp("vol/content/browser/rootca.pem", path) == 0) { int ret = real_FSOpenFile_eShop(client, block, path, mode, handle, error); rootca_pem_handle = *handle; - DEBUG_FUNCTION_LINE("Inkay: Found eShop CA, replacing..."); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: Found eShop CA, replacing..."); return ret; } diff --git a/src/patches/game_matchmaking.cpp b/src/patches/game_matchmaking.cpp index 40cb100..c78d56c 100644 --- a/src/patches/game_matchmaking.cpp +++ b/src/patches/game_matchmaking.cpp @@ -58,7 +58,7 @@ static int handler(void *user, const char *section, const char *name, const char static void check_modpack() { modpack mod; if (ini_parse("fs:/vol/content/pretendo.ini", handler, &mod)) { - DEBUG_FUNCTION_LINE("Inkay/MK8: Doesn't look like a modpack"); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay/MK8: Doesn't look like a modpack"); } DEBUG_FUNCTION_LINE("Inkay/MK8: Playing %s (%08x)", mod.name.c_str(), mod.dlc_id); @@ -72,7 +72,7 @@ DECL_FUNCTION(void, mk8_MatchmakeSessionSearchCriteria_SetAttribute, void *_this const int dlc_id = dlc_modpack->dlc_id; if (dlc_id != -1) { - DEBUG_FUNCTION_LINE("Inkay/MK8: Searching for %s session (%08x)", dlc_modpack->name.c_str(), dlc_id); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay/MK8: Searching for %s session (%08x)", dlc_modpack->name.c_str(), dlc_id); attributeValue = dlc_id; } } @@ -86,7 +86,7 @@ DECL_FUNCTION(void, mk8_MatchmakeSession_SetAttribute, void *_this, uint32_t att const int dlc_id = dlc_modpack->dlc_id; if (dlc_id != -1) { - DEBUG_FUNCTION_LINE("Inkay/MK8: Creating %s session (%08x)", dlc_modpack->name.c_str(), dlc_id); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay/MK8: Creating %s session (%08x)", dlc_modpack->name.c_str(), dlc_id); attributeValue = dlc_id; } } diff --git a/src/patches/olv_applet.cpp b/src/patches/olv_applet.cpp index 18b1f37..9bafd44 100644 --- a/src/patches/olv_applet.cpp +++ b/src/patches/olv_applet.cpp @@ -71,7 +71,7 @@ DECL_FUNCTION(int, FSOpenFile, FSClient *client, FSCmdBlock *block, char *path, const char *initialOma = "vol/content/initial.oma"; if (!Config::connect_to_network) { - DEBUG_FUNCTION_LINE("Inkay: Miiverse patches skipped."); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: Miiverse patches skipped."); return real_FSOpenFile(client, block, path, mode, handle, error); } @@ -80,7 +80,7 @@ DECL_FUNCTION(int, FSOpenFile, FSClient *client, FSCmdBlock *block, char *path, //we do it when loading this file since it should only load once, preventing massive lag spikes as it searches all of MEM2 xD //WHBLogUdpInit(); - DEBUG_FUNCTION_LINE("Inkay: hewwo!\n"); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: hewwo!\n"); auto olv_ok = setup_olv_libs(); // Patch applet binary too @@ -90,7 +90,7 @@ DECL_FUNCTION(int, FSOpenFile, FSClient *client, FSCmdBlock *block, char *path, } else if (strcmp("vol/content/browser/rootca.pem", path) == 0) { int ret = real_FSOpenFile(client, block, path, mode, handle, error); rootca_pem_handle = *handle; - DEBUG_FUNCTION_LINE("Inkay: Found Miiverse CA, replacing..."); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: Found Miiverse CA, replacing..."); return ret; } @@ -123,27 +123,6 @@ DECL_FUNCTION(FSStatus, FSCloseFile, FSClient *client, FSCmdBlock *block, FSFile return real_FSCloseFile(client, block, handle, errorMask); } -DECL_FUNCTION(uint32_t, NSSLExportInternalServerCertificate, NSSLServerCertId cert, int unk, void *unk2, void *unk3) { - if (cert == NSSL_SERVER_CERT_THAWTE_PREMIUM_SERVER_CA) { // Martini patches - OSFatal("[598-0069] Please uninstall Martini patches to continue.\n" \ - "See pretendo.network/docs/search for more info.\n\n" \ - "Hold the POWER button for 4 seconds to shut down.\n\n" - " .\n" - ".---------.'---.\n" - "'. : .'\n" - " '. .::: .'\n" - " '.'::'.'\n" - " '||'\n" - " ||\n" - " ||\n" - "mrz ||\n" - " ---====---"); - } - return real_NSSLExportInternalServerCertificate(cert, unk, unk2, unk3); -} - WUPS_MUST_REPLACE_FOR_PROCESS(FSOpenFile, WUPS_LOADER_LIBRARY_COREINIT, FSOpenFile, WUPS_FP_TARGET_PROCESS_MIIVERSE); WUPS_MUST_REPLACE_FOR_PROCESS(FSReadFile, WUPS_LOADER_LIBRARY_COREINIT, FSReadFile, WUPS_FP_TARGET_PROCESS_MIIVERSE); WUPS_MUST_REPLACE_FOR_PROCESS(FSCloseFile, WUPS_LOADER_LIBRARY_COREINIT, FSCloseFile, WUPS_FP_TARGET_PROCESS_MIIVERSE); -WUPS_MUST_REPLACE_FOR_PROCESS(NSSLExportInternalServerCertificate, WUPS_LOADER_LIBRARY_NSYSNET, - NSSLExportInternalServerCertificate, WUPS_FP_TARGET_PROCESS_MIIVERSE); diff --git a/src/patches/olv_urls.cpp b/src/patches/olv_urls.cpp index 5ffe22c..a4e6198 100644 --- a/src/patches/olv_urls.cpp +++ b/src/patches/olv_urls.cpp @@ -51,7 +51,7 @@ bool path_is_olv(const char* path) { void new_rpl_loaded(OSDynLoad_Module module, void* ctx, OSDynLoad_NotifyReason reason, OSDynLoad_NotifyData* rpl) { if (!Config::connect_to_network) { - DEBUG_FUNCTION_LINE("Inkay: Miiverse patches skipped."); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: Miiverse patches skipped."); return; } @@ -64,7 +64,7 @@ void new_rpl_loaded(OSDynLoad_Module module, void* ctx, OSDynLoad_NotifyReason r bool setup_olv_libs() { if (!Config::connect_to_network) { - DEBUG_FUNCTION_LINE("Inkay: Miiverse patches skipped."); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: Miiverse patches skipped."); return false; } @@ -72,7 +72,7 @@ bool setup_olv_libs() { auto olvLoaded = check_olv_libs(); if (!olvLoaded) { - DEBUG_FUNCTION_LINE("Inkay: no olv, quitting for now\n"); + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: no olv, quitting for now\n"); return false; } diff --git a/src/utils/replace_mem.cpp b/src/utils/replace_mem.cpp index a588417..1879519 100644 --- a/src/utils/replace_mem.cpp +++ b/src/utils/replace_mem.cpp @@ -65,7 +65,9 @@ void replaceBulk(uint32_t start, uint32_t size, std::span rep } } } +#ifdef DEBUG for (auto c: counts) { DEBUG_FUNCTION_LINE("replaced %d times", c); } +#endif } From c6d80bd550ac78a78e3cd9102a044044cd1a237a Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Sun, 4 Aug 2024 17:44:24 +1000 Subject: [PATCH 010/139] chore(config): Refactor error handling and remove exceptions Honestly kinda feeling like the C++ API isn't worth it --- src/config.cpp | 85 +++++++++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index 995f351..88a1633 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -176,15 +176,25 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { } } +static WUPSConfigAPICallbackStatus report_error(WUPSConfigAPIStatus err) { + DEBUG_FUNCTION_LINE_VERBOSE("WUPS config error: %s", WUPSConfigAPI_GetStatusStr(err)); + return WUPSCONFIG_API_CALLBACK_RESULT_ERROR; +} + +static void report_storage_error(WUPSStorageError err) { + DEBUG_FUNCTION_LINE_VERBOSE("WUPS storage error: %s", WUPSStorageAPI_GetStatusStr(err)); +} + static void connect_to_network_changed(ConfigItemBoolean* item, bool new_value) { DEBUG_FUNCTION_LINE_VERBOSE("connect_to_network changed to: %d", new_value); if (new_value != Config::connect_to_network) { Config::need_relaunch = true; } Config::connect_to_network = new_value; - if (WUPSStorageAPI::Store("connect_to_network", Config::connect_to_network) != WUPS_STORAGE_ERROR_SUCCESS) { - DEBUG_FUNCTION_LINE("Failed to save \"connect_to_network\" value (%d)", Config::connect_to_network); - } + + WUPSStorageError res; + res = WUPSStorageAPI::Store("connect_to_network", Config::connect_to_network); + if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); } static void unregister_task_item_on_input_cb(void *context, WUPSConfigSimplePadData input) { @@ -231,6 +241,9 @@ static int32_t unregister_task_item_get_display_value(void *context, char *out_b } static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHandle rootHandle) { + WUPSConfigAPIStatus err; + bool res; + uint64_t current_title_id = OSGetTitleID(); uint64_t wiiu_menu_tid = _SYSGetSystemApplicationTitleId(SYSTEM_APP_ID_WII_U_MENU); Config::is_wiiu_menu = (current_title_id == wiiu_menu_tid); @@ -241,13 +254,21 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa // create root config category WUPSConfigCategory root = WUPSConfigCategory(rootHandle); - auto patching_cat = WUPSConfigCategory::Create(strings.network_category); + auto network_cat = WUPSConfigCategory::Create(strings.network_category, err); + if (!network_cat) return report_error(err); // config id display name default current value changed callback - patching_cat.add(WUPSConfigItemBoolean::Create("connect_to_network", strings.connect_to_network_setting, true, Config::connect_to_network, &connect_to_network_changed)); - root.add(std::move(patching_cat)); + auto connect_item = WUPSConfigItemBoolean::Create("connect_to_network", strings.connect_to_network_setting, true, Config::connect_to_network, &connect_to_network_changed, err); + if (!connect_item) return report_error(err); - auto other_cat = WUPSConfigCategory::Create(strings.other_category); + res = network_cat->add(std::move(*connect_item), err); + if (!res) return report_error(err); + + res = root.add(std::move(*network_cat), err); + if (!res) return report_error(err); + + auto other_cat = WUPSConfigCategory::Create(strings.other_category, err); + if (!other_cat) return report_error(err); WUPSConfigAPIItemCallbacksV2 unregisterTasksItemCallbacks = { .getCurrentValueDisplay = unregister_task_item_get_display_value, @@ -268,26 +289,23 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa }; WUPSConfigItemHandle unregisterTasksItem; - WUPSConfigAPIStatus err; - if ((err = WUPSConfigAPI_Item_Create(unregisterTasksItemOptions, &unregisterTasksItem)) != WUPSCONFIG_API_RESULT_SUCCESS) { - DEBUG_FUNCTION_LINE("Creating config menu failed: %s", WUPSConfigAPI_GetStatusStr(err)); - return WUPSCONFIG_API_CALLBACK_RESULT_ERROR; - } - if ((err = WUPSConfigAPI_Category_AddItem(other_cat.getHandle(), unregisterTasksItem)) != WUPSCONFIG_API_RESULT_SUCCESS) { - DEBUG_FUNCTION_LINE("Creating config menu failed: %s", WUPSConfigAPI_GetStatusStr(err)); - return WUPSCONFIG_API_CALLBACK_RESULT_ERROR; - } + err = WUPSConfigAPI_Item_Create(unregisterTasksItemOptions, &unregisterTasksItem); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); - root.add(std::move(other_cat)); + err = WUPSConfigAPI_Category_AddItem(other_cat->getHandle(), unregisterTasksItem); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + + res = root.add(std::move(*other_cat), err); + if (!res) return report_error(err); return WUPSCONFIG_API_CALLBACK_RESULT_SUCCESS; } static void ConfigMenuClosedCallback() { // Save all changes - if (WUPSStorageAPI::SaveStorage() != WUPS_STORAGE_ERROR_SUCCESS) { - DEBUG_FUNCTION_LINE("Failed to save storage"); - } + WUPSStorageError res; + res = WUPSStorageAPI::SaveStorage(); + if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); if (Config::need_relaunch) { // Need to reload the console so the patches reset @@ -298,16 +316,17 @@ static void ConfigMenuClosedCallback() { } void Config::Init() { + WUPSConfigAPIStatus cres; + // Init the config api WUPSConfigAPIOptionsV1 configOptions = { .name = "Inkay" }; - if (WUPSConfigAPI_Init(configOptions, ConfigMenuOpenedCallback, ConfigMenuClosedCallback) != WUPSCONFIG_API_RESULT_SUCCESS) { - DEBUG_FUNCTION_LINE("Failed to initialize WUPS Config API"); - return; - } + cres = WUPSConfigAPI_Init(configOptions, ConfigMenuOpenedCallback, ConfigMenuClosedCallback); + if (cres != WUPSCONFIG_API_RESULT_SUCCESS) return (void)report_error(cres); - WUPSStorageError storageRes; + WUPSStorageError res; // Try to get value from storage - if ((storageRes = WUPSStorageAPI::Get("connect_to_network", Config::connect_to_network)) == WUPS_STORAGE_ERROR_NOT_FOUND) { + res = WUPSStorageAPI::Get("connect_to_network", Config::connect_to_network); + if (res == WUPS_STORAGE_ERROR_NOT_FOUND) { DEBUG_FUNCTION_LINE("Connect to network value not found, attempting to migrate/create"); bool skipPatches = false; @@ -318,16 +337,12 @@ void Config::Init() { } // Add the value to the storage if it's missing. - if (WUPSStorageAPI::Store("connect_to_network", connect_to_network) != WUPS_STORAGE_ERROR_SUCCESS) { - DEBUG_FUNCTION_LINE("Failed to store bool"); - } - } - else if (storageRes != WUPS_STORAGE_ERROR_SUCCESS) { - DEBUG_FUNCTION_LINE("Failed to get bool %s (%d)", WUPSStorageAPI_GetStatusStr(storageRes), storageRes); + res = WUPSStorageAPI::Store("connect_to_network", connect_to_network); + if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); } + else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); // Save storage - if (WUPSStorageAPI::SaveStorage() != WUPS_STORAGE_ERROR_SUCCESS) { - DEBUG_FUNCTION_LINE("Failed to save storage"); - } + res = WUPSStorageAPI::SaveStorage(); + if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); } From aedd02b0d181bf00b83ddab38bd061e2bdd96731 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Sun, 4 Aug 2024 18:15:16 +1000 Subject: [PATCH 011/139] chore(config): Switch to string_view for translated strings Elides about 100 strlen calls by allowing the length to be calculated at compile time ofc the WUPS backend doesn't USE this info but, y'know. --- src/Notification.cpp | 4 ++-- src/Notification.h | 4 +--- src/config.cpp | 20 ++++++++++++++------ src/config.h | 16 +++++++++------- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/Notification.cpp b/src/Notification.cpp index 43f08df..cc6177e 100644 --- a/src/Notification.cpp +++ b/src/Notification.cpp @@ -18,7 +18,7 @@ #include #include -void ShowNotification(std::string_view notification) { +void ShowNotification(const char* notification) { auto err1 = NotificationModule_SetDefaultValue(NOTIFICATION_MODULE_NOTIFICATION_TYPE_INFO, NOTIFICATION_MODULE_DEFAULT_OPTION_KEEP_UNTIL_SHOWN, true); auto err2 = NotificationModule_SetDefaultValue(NOTIFICATION_MODULE_NOTIFICATION_TYPE_INFO, @@ -27,5 +27,5 @@ void ShowNotification(std::string_view notification) { if (err1 != NOTIFICATION_MODULE_RESULT_SUCCESS || err2 != NOTIFICATION_MODULE_RESULT_SUCCESS) return; - NotificationModule_AddInfoNotification(notification.data()); + NotificationModule_AddInfoNotification(notification); } diff --git a/src/Notification.h b/src/Notification.h index 879f729..ebdc7a3 100644 --- a/src/Notification.h +++ b/src/Notification.h @@ -1,5 +1,3 @@ #pragma once -#include - -void ShowNotification(std::string_view notification); \ No newline at end of file +void ShowNotification(const char* notification); diff --git a/src/config.cpp b/src/config.cpp index 88a1633..da01d1b 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -37,7 +37,7 @@ bool Config::need_relaunch = false; bool Config::unregister_task_item_pressed = false; bool Config::is_wiiu_menu = false; -config_strings strings; +static config_strings strings; constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { switch (language) { @@ -232,10 +232,18 @@ static void unregister_task_item_on_input_cb(void *context, WUPSConfigSimplePadD } static int32_t unregister_task_item_get_display_value(void *context, char *out_buf, int32_t out_size) { - if (!Config::is_wiiu_menu) - strncpy(out_buf, strings.need_menu_action, out_size); - else - strncpy(out_buf, Config::unregister_task_item_pressed ? strings.restart_to_apply_action : strings.press_a_action, out_size); + auto string = strings.need_menu_action; + if (Config::is_wiiu_menu) { + if (Config::unregister_task_item_pressed) { + string = strings.restart_to_apply_action; + } else { + string = strings.press_a_action; + } + } + + if ((int)string.length() > out_size - 1) return -1; + string.copy(out_buf, string.length()); + out_buf[string.length()] = '\0'; return 0; } @@ -283,7 +291,7 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa }; WUPSConfigAPIItemOptionsV2 unregisterTasksItemOptions = { - .displayName = strings.reset_wwp_setting, + .displayName = strings.reset_wwp_setting.data(), .context = nullptr, .callbacks = unregisterTasksItemCallbacks, }; diff --git a/src/config.h b/src/config.h index a83e178..ae11129 100644 --- a/src/config.h +++ b/src/config.h @@ -5,6 +5,8 @@ #ifndef INKAY_CONFIG_H #define INKAY_CONFIG_H +#include + class Config { public: static void Init(); @@ -23,13 +25,13 @@ public: struct config_strings { const char *plugin_name; - const char *network_category; - const char *connect_to_network_setting; - const char *other_category; - const char *reset_wwp_setting; - const char *press_a_action; - const char *restart_to_apply_action; - const char *need_menu_action; + std::string_view network_category; + std::string_view connect_to_network_setting; + std::string_view other_category; + std::string_view reset_wwp_setting; + std::string_view press_a_action; + std::string_view restart_to_apply_action; + std::string_view need_menu_action; }; #endif //INKAY_CONFIG_H From b16237417c0c40193d397d170913e252a37d460e Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Wed, 11 Sep 2024 13:07:29 +1000 Subject: [PATCH 012/139] fix(olv): Allow RPLs with null names CafeGLSL is an offender here --- src/patches/olv_urls.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/patches/olv_urls.cpp b/src/patches/olv_urls.cpp index a4e6198..862453d 100644 --- a/src/patches/olv_urls.cpp +++ b/src/patches/olv_urls.cpp @@ -57,7 +57,7 @@ void new_rpl_loaded(OSDynLoad_Module module, void* ctx, OSDynLoad_NotifyReason r // Loaded olv? if (reason != OS_DYNLOAD_NOTIFY_LOADED) return; - if (!path_is_olv(rpl->name)) return; + if (!rpl->name || !path_is_olv(rpl->name)) return; replace(rpl->dataAddr, rpl->dataSize, original_url, sizeof(original_url), new_url, sizeof(new_url)); } From 1d1e094257901cc6d78ec6e59856a6c5b1283257 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Wed, 2 Oct 2024 23:46:35 +1000 Subject: [PATCH 013/139] feat(i18n): Move NN/PN messages to main config_strings struct --- src/config.cpp | 38 ++++++++++++++++++++++++++++++-------- src/config.h | 5 +++++ src/main.cpp | 46 ++-------------------------------------------- 3 files changed, 37 insertions(+), 52 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index da01d1b..d282174 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -39,7 +39,7 @@ bool Config::is_wiiu_menu = false; static config_strings strings; -constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { +config_strings get_config_strings(nn::swkbd::LanguageType language) { switch (language) { case nn::swkbd::LanguageType::English: default: @@ -51,7 +51,9 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .reset_wwp_setting = "Reset Wara Wara Plaza", .press_a_action = "Press A", .restart_to_apply_action = "Restart to apply", - .need_menu_action = "From WiiU menu only" + .need_menu_action = "From WiiU menu only", + .using_nintendo_network = "Using Nintendo Network", + .using_pretendo_network = "Using Pretendo Network", }; case nn::swkbd::LanguageType::Spanish: @@ -64,6 +66,8 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .press_a_action = "Pulsa A", .restart_to_apply_action = "Reinicia para confirmar", .need_menu_action = "Sólo desde el menú de WiiU", + .using_nintendo_network = "Usando Nintendo Network", + .using_pretendo_network = "Usando Pretendo Network", }; case nn::swkbd::LanguageType::French: @@ -76,6 +80,8 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .press_a_action = "Appuyez sur A", .restart_to_apply_action = "Redémarrer pour appliquer", .need_menu_action = "Depuis le menu Wii U seulement", + .using_nintendo_network = "Sur Nintendo Network", + .using_pretendo_network = "Sur Pretendo Network", }; case nn::swkbd::LanguageType::Italian: @@ -88,6 +94,8 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .press_a_action = "Premi A", .restart_to_apply_action = "Riavvia per applicare", .need_menu_action = "Solo dal menu WiiU", + .using_nintendo_network = "Usando Nintendo Network", + .using_pretendo_network = "Usando Pretendo Network", }; case nn::swkbd::LanguageType::German: @@ -100,6 +108,8 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .press_a_action = "Drücke A", .restart_to_apply_action = "Neustarten zum Anwenden", .need_menu_action = "Nur vom Wii U-Menü aus", + .using_nintendo_network = "Nutze Nintendo Network", + .using_pretendo_network = "Nutze Pretendo Network", }; case nn::swkbd::LanguageType::SimplifiedChinese: @@ -111,7 +121,9 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .reset_wwp_setting = "重置Wara Wara Plaza", .press_a_action = "请按 A", .restart_to_apply_action = "重启以应用设置", - .need_menu_action = "仅来自WiiU Menu" + .need_menu_action = "仅来自WiiU Menu", + .using_nintendo_network = "使用 Nintendo Network", + .using_pretendo_network = "使用 Pretendo Network", }; case nn::swkbd::LanguageType::TraditionalChinese: @@ -123,7 +135,9 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .reset_wwp_setting = "重置Wara Wara Plaza", .press_a_action = "請按 A", .restart_to_apply_action = "重啓以套用設定", - .need_menu_action = "僅來自WiiU Menu" + .need_menu_action = "僅來自WiiU Menu", + .using_nintendo_network = "使用 Nintendo Network", + .using_pretendo_network = "使用 Pretendo Network", }; case nn::swkbd::LanguageType::Portuguese: @@ -135,7 +149,9 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .reset_wwp_setting = "Resetar Wara Wara Plaza", .press_a_action = "Aperte A", .restart_to_apply_action = "Reinicie para aplicar", - .need_menu_action = "Apenas no menu do Wii U" + .need_menu_action = "Apenas no menu do Wii U", + .using_nintendo_network = "Usando Nintendo Network", + .using_pretendo_network = "Usando Pretendo Network", }; case nn::swkbd::LanguageType::Japanese: @@ -147,7 +163,9 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .reset_wwp_setting = "わらわら広場をリセット", .press_a_action = "Aボタンを押す", .restart_to_apply_action = "再起動して適用", - .need_menu_action = "WiiUメニューからのみ実行可能" + .need_menu_action = "WiiUメニューからのみ実行可能", + .using_nintendo_network = "ニンテンドーネットワークを使用中", + .using_pretendo_network = "Pretendoネットワークを使用中", }; case nn::swkbd::LanguageType::Dutch: @@ -159,7 +177,9 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .reset_wwp_setting = "Reset het Wara Wara Plaza", .press_a_action = "Druk A", .restart_to_apply_action = "Herstart om toe te passen", - .need_menu_action = "Alleen vanuit het WiiU-menu" + .need_menu_action = "Alleen vanuit het WiiU-menu", + .using_nintendo_network = "Nintendo Network wordt gebruikt", + .using_pretendo_network = "Pretendo Network wordt gebruikt", }; case nn::swkbd::LanguageType::Russian: @@ -171,7 +191,9 @@ constexpr config_strings get_config_strings(nn::swkbd::LanguageType language) { .reset_wwp_setting = "Сбросить Wara Wara Plaza", .press_a_action = "Нажмите A", .restart_to_apply_action = "Перезагрузите для применения изменений", - .need_menu_action = "Только из меню Wii U" + .need_menu_action = "Только из меню Wii U", + .using_nintendo_network = "Используется Nintendo Network", + .using_pretendo_network = "Используется Pretendo Network", }; } } diff --git a/src/config.h b/src/config.h index ae11129..2fa9812 100644 --- a/src/config.h +++ b/src/config.h @@ -6,6 +6,7 @@ #define INKAY_CONFIG_H #include +#include class Config { public: @@ -32,6 +33,10 @@ struct config_strings { std::string_view press_a_action; std::string_view restart_to_apply_action; std::string_view need_menu_action; + std::string_view using_nintendo_network; + std::string_view using_pretendo_network; }; +config_strings get_config_strings(nn::swkbd::LanguageType language); + #endif //INKAY_CONFIG_H diff --git a/src/main.cpp b/src/main.cpp index 2cb0cab..8270d80 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -100,56 +100,14 @@ static const char *get_nintendo_network_message() { // TL note: "Nintendo Network" is a proper noun - "Network" is part of the name // TL note: "Using" instead of "Connected" is deliberate - we don't know if a successful connection exists, we are // only specifying what we'll *attempt* to connect to - switch (get_system_language()) { - case nn::swkbd::LanguageType::English: - default: - return "Using Nintendo Network"; - case nn::swkbd::LanguageType::Spanish: - case nn::swkbd::LanguageType::Portuguese: - case nn::swkbd::LanguageType::Italian: - return "Usando Nintendo Network"; - case nn::swkbd::LanguageType::French: - return "Sur Nintendo Network"; - case nn::swkbd::LanguageType::German: - return "Nutze Nintendo Network"; - case nn::swkbd::LanguageType::SimplifiedChinese: - case nn::swkbd::LanguageType::TraditionalChinese: - return "使用 Nintendo Network"; - case nn::swkbd::LanguageType::Japanese: - return "ニンテンドーネットワークを使用中"; - case nn::swkbd::LanguageType::Dutch: - return "Nintendo Network wordt gebruikt"; - case nn::swkbd::LanguageType::Russian: - return "Используется Nintendo Network"; - } + return get_config_strings(get_system_language()).using_nintendo_network.data(); } static const char *get_pretendo_message() { // TL note: "Pretendo Network" is also a proper noun - though "Pretendo" alone can refer to us as a project // TL note: "Using" instead of "Connected" is deliberate - we don't know if a successful connection exists, we are // only specifying what we'll *attempt* to connect to - switch (get_system_language()) { - case nn::swkbd::LanguageType::English: - default: - return "Using Pretendo Network"; - case nn::swkbd::LanguageType::Spanish: - case nn::swkbd::LanguageType::Portuguese: - case nn::swkbd::LanguageType::Italian: - return "Usando Pretendo Network"; - case nn::swkbd::LanguageType::French: - return "Sur Pretendo Network"; - case nn::swkbd::LanguageType::German: - return "Nutze Pretendo Network"; - case nn::swkbd::LanguageType::SimplifiedChinese: - case nn::swkbd::LanguageType::TraditionalChinese: - return "使用 Pretendo Network"; - case nn::swkbd::LanguageType::Japanese: - return "Pretendoネットワークを使用中"; - case nn::swkbd::LanguageType::Dutch: - return "Pretendo Network wordt gebruikt"; - case nn::swkbd::LanguageType::Russian: - return "Используется Pretendo Network"; - } + return get_config_strings(get_system_language()).using_pretendo_network.data(); } INITIALIZE_PLUGIN() { From 6baee13685e5aedcf1022e96a43eae473ae1081c Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Thu, 3 Oct 2024 00:00:56 +1000 Subject: [PATCH 014/139] feat(i18n): Move all texts into .lang files which are actually Java properties and C structs at the same time no further comment --- src/config.cpp | 186 ++++++++---------------------------------- src/lang/de_DE.lang | 10 +++ src/lang/en_US.lang | 10 +++ src/lang/es_ES.lang | 10 +++ src/lang/fr_FR.lang | 10 +++ src/lang/it_IT.lang | 10 +++ src/lang/ja_JP.lang | 10 +++ src/lang/nl_NL.lang | 10 +++ src/lang/pt_BR.lang | 10 +++ src/lang/ru_RU.lang | 10 +++ src/lang/zh_CN.lang | 10 +++ src/lang/zh_Hant.lang | 10 +++ 12 files changed, 143 insertions(+), 153 deletions(-) create mode 100644 src/lang/de_DE.lang create mode 100644 src/lang/en_US.lang create mode 100644 src/lang/es_ES.lang create mode 100644 src/lang/fr_FR.lang create mode 100644 src/lang/it_IT.lang create mode 100644 src/lang/ja_JP.lang create mode 100644 src/lang/nl_NL.lang create mode 100644 src/lang/pt_BR.lang create mode 100644 src/lang/ru_RU.lang create mode 100644 src/lang/zh_CN.lang create mode 100644 src/lang/zh_Hant.lang diff --git a/src/config.cpp b/src/config.cpp index d282174..5f3b12a 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -42,159 +42,39 @@ static config_strings strings; config_strings get_config_strings(nn::swkbd::LanguageType language) { switch (language) { case nn::swkbd::LanguageType::English: - default: - return { - .plugin_name = "Inkay", - .network_category = "Network selection", - .connect_to_network_setting = "Connect to the Pretendo network", - .other_category = "Other settings", - .reset_wwp_setting = "Reset Wara Wara Plaza", - .press_a_action = "Press A", - .restart_to_apply_action = "Restart to apply", - .need_menu_action = "From WiiU menu only", - .using_nintendo_network = "Using Nintendo Network", - .using_pretendo_network = "Using Pretendo Network", - }; - - case nn::swkbd::LanguageType::Spanish: - return { - .plugin_name = "Inkay", - .network_category = "Selección de red", - .connect_to_network_setting = "Conectar a la red Pretendo", - .other_category = "Otros ajustes", - .reset_wwp_setting = "Restablecer Wara Wara Plaza", - .press_a_action = "Pulsa A", - .restart_to_apply_action = "Reinicia para confirmar", - .need_menu_action = "Sólo desde el menú de WiiU", - .using_nintendo_network = "Usando Nintendo Network", - .using_pretendo_network = "Usando Pretendo Network", - }; - - case nn::swkbd::LanguageType::French: - return { - .plugin_name = "Inkay", - .network_category = "Sélection du réseau", - .connect_to_network_setting = "Connexion à Pretendo", - .other_category = "Autres paramètres", - .reset_wwp_setting = "Réinitialiser la place WaraWara", - .press_a_action = "Appuyez sur A", - .restart_to_apply_action = "Redémarrer pour appliquer", - .need_menu_action = "Depuis le menu Wii U seulement", - .using_nintendo_network = "Sur Nintendo Network", - .using_pretendo_network = "Sur Pretendo Network", - }; - - case nn::swkbd::LanguageType::Italian: - return { - .plugin_name = "Inkay", - .network_category = "Selezione della rete", - .connect_to_network_setting = "Connettiti alla rete Pretendo", - .other_category = "Altre categorie", - .reset_wwp_setting = "Ripristina Wara Wara Plaza", - .press_a_action = "Premi A", - .restart_to_apply_action = "Riavvia per applicare", - .need_menu_action = "Solo dal menu WiiU", - .using_nintendo_network = "Usando Nintendo Network", - .using_pretendo_network = "Usando Pretendo Network", - }; - - case nn::swkbd::LanguageType::German: - return { - .plugin_name = "Inkay", - .network_category = "Netzwerkauswahl", - .connect_to_network_setting = "Verbinde zum Pretendo Network", - .other_category = "Andere Einstellungen", - .reset_wwp_setting = "Wara Wara Plaza zurücksetzen", - .press_a_action = "Drücke A", - .restart_to_apply_action = "Neustarten zum Anwenden", - .need_menu_action = "Nur vom Wii U-Menü aus", - .using_nintendo_network = "Nutze Nintendo Network", - .using_pretendo_network = "Nutze Pretendo Network", - }; - - case nn::swkbd::LanguageType::SimplifiedChinese: - return { - .plugin_name = "Inkay", - .network_category = "选择网络", - .connect_to_network_setting = "连接到Pretendo network", - .other_category = "其他设置", - .reset_wwp_setting = "重置Wara Wara Plaza", - .press_a_action = "请按 A", - .restart_to_apply_action = "重启以应用设置", - .need_menu_action = "仅来自WiiU Menu", - .using_nintendo_network = "使用 Nintendo Network", - .using_pretendo_network = "使用 Pretendo Network", - }; - - case nn::swkbd::LanguageType::TraditionalChinese: - return { - .plugin_name = "Inkay", - .network_category = "選擇網路", - .connect_to_network_setting = "連接到Pretendo network", - .other_category = "其他設定", - .reset_wwp_setting = "重置Wara Wara Plaza", - .press_a_action = "請按 A", - .restart_to_apply_action = "重啓以套用設定", - .need_menu_action = "僅來自WiiU Menu", - .using_nintendo_network = "使用 Nintendo Network", - .using_pretendo_network = "使用 Pretendo Network", - }; - - case nn::swkbd::LanguageType::Portuguese: - return { - .plugin_name = "Inkay", - .network_category = "Selecionar rede", - .connect_to_network_setting = "Conecta-se à Pretendo Network", - .other_category = "Outras configurações", - .reset_wwp_setting = "Resetar Wara Wara Plaza", - .press_a_action = "Aperte A", - .restart_to_apply_action = "Reinicie para aplicar", - .need_menu_action = "Apenas no menu do Wii U", - .using_nintendo_network = "Usando Nintendo Network", - .using_pretendo_network = "Usando Pretendo Network", - }; - - case nn::swkbd::LanguageType::Japanese: - return { - .plugin_name = "Inkay", - .network_category = "ネットワークの選択", - .connect_to_network_setting = "Pretendoネットワークに接続", - .other_category = "その他の設定", - .reset_wwp_setting = "わらわら広場をリセット", - .press_a_action = "Aボタンを押す", - .restart_to_apply_action = "再起動して適用", - .need_menu_action = "WiiUメニューからのみ実行可能", - .using_nintendo_network = "ニンテンドーネットワークを使用中", - .using_pretendo_network = "Pretendoネットワークを使用中", - }; - - case nn::swkbd::LanguageType::Dutch: - return { - .plugin_name = "Inkay", - .network_category = "Netwerkselectie", - .connect_to_network_setting = "Verbind met het Pretendo-netwerk", - .other_category = "Overige instellingen", - .reset_wwp_setting = "Reset het Wara Wara Plaza", - .press_a_action = "Druk A", - .restart_to_apply_action = "Herstart om toe te passen", - .need_menu_action = "Alleen vanuit het WiiU-menu", - .using_nintendo_network = "Nintendo Network wordt gebruikt", - .using_pretendo_network = "Pretendo Network wordt gebruikt", - }; - - case nn::swkbd::LanguageType::Russian: - return { - .plugin_name = "Inkay", - .network_category = "Выбор сети", - .connect_to_network_setting = "Подключиться к Pretendo Network", - .other_category = "Другие настройки", - .reset_wwp_setting = "Сбросить Wara Wara Plaza", - .press_a_action = "Нажмите A", - .restart_to_apply_action = "Перезагрузите для применения изменений", - .need_menu_action = "Только из меню Wii U", - .using_nintendo_network = "Используется Nintendo Network", - .using_pretendo_network = "Используется Pretendo Network", - }; + default: return { +#include "lang/en_US.lang" + }; + case nn::swkbd::LanguageType::Spanish: return { +#include "lang/es_ES.lang" + }; + case nn::swkbd::LanguageType::French: return { +#include "lang/fr_FR.lang" + }; + case nn::swkbd::LanguageType::Italian: return { +#include "lang/it_IT.lang" + }; + case nn::swkbd::LanguageType::German: return { +#include "lang/de_DE.lang" + }; + case nn::swkbd::LanguageType::SimplifiedChinese: return { +#include "lang/zh_CN.lang" + }; + case nn::swkbd::LanguageType::TraditionalChinese: return { +#include "lang/zh_Hant.lang" + }; + case nn::swkbd::LanguageType::Portuguese: return { +#include "lang/pt_BR.lang" + }; + case nn::swkbd::LanguageType::Japanese: return { +#include "lang/ja_JP.lang" + }; + case nn::swkbd::LanguageType::Dutch: return { +#include "lang/nl_NL.lang" + }; + case nn::swkbd::LanguageType::Russian: return { +#include "lang/ru_RU.lang" + }; } } diff --git a/src/lang/de_DE.lang b/src/lang/de_DE.lang new file mode 100644 index 0000000..1bfb5e8 --- /dev/null +++ b/src/lang/de_DE.lang @@ -0,0 +1,10 @@ +.plugin_name = "Inkay" +,.network_category = "Netzwerkauswahl" +,.connect_to_network_setting = "Verbinde zum Pretendo Network" +,.other_category = "Andere Einstellungen" +,.reset_wwp_setting = "Wara Wara Plaza zurücksetzen" +,.press_a_action = "Drücke A" +,.restart_to_apply_action = "Neustarten zum Anwenden" +,.need_menu_action = "Nur vom Wii U-Menü aus" +,.using_nintendo_network = "Nutze Nintendo Network" +,.using_pretendo_network = "Nutze Pretendo Network" diff --git a/src/lang/en_US.lang b/src/lang/en_US.lang new file mode 100644 index 0000000..a50a37c --- /dev/null +++ b/src/lang/en_US.lang @@ -0,0 +1,10 @@ +.plugin_name = "Inkay" +,.network_category = "Network selection" +,.connect_to_network_setting = "Connect to the Pretendo network" +,.other_category = "Other settings" +,.reset_wwp_setting = "Reset Wara Wara Plaza" +,.press_a_action = "Press A" +,.restart_to_apply_action = "Restart to apply" +,.need_menu_action = "From WiiU menu only" +,.using_nintendo_network = "Using Nintendo Network" +,.using_pretendo_network = "Using Pretendo Network" diff --git a/src/lang/es_ES.lang b/src/lang/es_ES.lang new file mode 100644 index 0000000..833f16a --- /dev/null +++ b/src/lang/es_ES.lang @@ -0,0 +1,10 @@ +.plugin_name = "Inkay" +,.network_category = "Selección de red" +,.connect_to_network_setting = "Conectar a la red Pretendo" +,.other_category = "Otros ajustes" +,.reset_wwp_setting = "Restablecer Wara Wara Plaza" +,.press_a_action = "Pulsa A" +,.restart_to_apply_action = "Reinicia para confirmar" +,.need_menu_action = "Sólo desde el menú de WiiU" +,.using_nintendo_network = "Usando Nintendo Network" +,.using_pretendo_network = "Usando Pretendo Network" diff --git a/src/lang/fr_FR.lang b/src/lang/fr_FR.lang new file mode 100644 index 0000000..1f8eda7 --- /dev/null +++ b/src/lang/fr_FR.lang @@ -0,0 +1,10 @@ +.plugin_name = "Inkay" +,.network_category = "Sélection du réseau" +,.connect_to_network_setting = "Connexion à Pretendo" +,.other_category = "Autres paramètres" +,.reset_wwp_setting = "Réinitialiser la place WaraWara" +,.press_a_action = "Appuyez sur A" +,.restart_to_apply_action = "Redémarrer pour appliquer" +,.need_menu_action = "Depuis le menu Wii U seulement" +,.using_nintendo_network = "Sur Nintendo Network" +,.using_pretendo_network = "Sur Pretendo Network" diff --git a/src/lang/it_IT.lang b/src/lang/it_IT.lang new file mode 100644 index 0000000..7dbf2ff --- /dev/null +++ b/src/lang/it_IT.lang @@ -0,0 +1,10 @@ +.plugin_name = "Inkay" +,.network_category = "Selezione della rete" +,.connect_to_network_setting = "Connettiti alla rete Pretendo" +,.other_category = "Altre categorie" +,.reset_wwp_setting = "Ripristina Wara Wara Plaza" +,.press_a_action = "Premi A" +,.restart_to_apply_action = "Riavvia per applicare" +,.need_menu_action = "Solo dal menu WiiU" +,.using_nintendo_network = "Usando Nintendo Network" +,.using_pretendo_network = "Usando Pretendo Network" diff --git a/src/lang/ja_JP.lang b/src/lang/ja_JP.lang new file mode 100644 index 0000000..1e88f5a --- /dev/null +++ b/src/lang/ja_JP.lang @@ -0,0 +1,10 @@ +.plugin_name = "Inkay" +,.network_category = "ネットワークの選択" +,.connect_to_network_setting = "Pretendoネットワークに接続" +,.other_category = "その他の設定" +,.reset_wwp_setting = "わらわら広場をリセット" +,.press_a_action = "Aボタンを押す" +,.restart_to_apply_action = "再起動して適用" +,.need_menu_action = "WiiUメニューからのみ実行可能" +,.using_nintendo_network = "ニンテンドーネットワークを使用中" +,.using_pretendo_network = "Pretendoネットワークを使用中" diff --git a/src/lang/nl_NL.lang b/src/lang/nl_NL.lang new file mode 100644 index 0000000..6d15650 --- /dev/null +++ b/src/lang/nl_NL.lang @@ -0,0 +1,10 @@ +.plugin_name = "Inkay" +,.network_category = "Netwerkselectie" +,.connect_to_network_setting = "Verbind met het Pretendo-netwerk" +,.other_category = "Overige instellingen" +,.reset_wwp_setting = "Reset het Wara Wara Plaza" +,.press_a_action = "Druk A" +,.restart_to_apply_action = "Herstart om toe te passen" +,.need_menu_action = "Alleen vanuit het WiiU-menu" +,.using_nintendo_network = "Nintendo Network wordt gebruikt" +,.using_pretendo_network = "Pretendo Network wordt gebruikt" diff --git a/src/lang/pt_BR.lang b/src/lang/pt_BR.lang new file mode 100644 index 0000000..5e60a59 --- /dev/null +++ b/src/lang/pt_BR.lang @@ -0,0 +1,10 @@ +.plugin_name = "Inkay" +,.network_category = "Selecionar rede" +,.connect_to_network_setting = "Conecta-se à Pretendo Network" +,.other_category = "Outras configurações" +,.reset_wwp_setting = "Resetar Wara Wara Plaza" +,.press_a_action = "Aperte A" +,.restart_to_apply_action = "Reinicie para aplicar" +,.need_menu_action = "Apenas no menu do Wii U" +,.using_nintendo_network = "Usando Nintendo Network" +,.using_pretendo_network = "Usando Pretendo Network" diff --git a/src/lang/ru_RU.lang b/src/lang/ru_RU.lang new file mode 100644 index 0000000..966166b --- /dev/null +++ b/src/lang/ru_RU.lang @@ -0,0 +1,10 @@ +.plugin_name = "Inkay" +,.network_category = "Выбор сети" +,.connect_to_network_setting = "Подключиться к Pretendo Network" +,.other_category = "Другие настройки" +,.reset_wwp_setting = "Сбросить Wara Wara Plaza" +,.press_a_action = "Нажмите A" +,.restart_to_apply_action = "Перезагрузите для применения изменений" +,.need_menu_action = "Только из меню Wii U" +,.using_nintendo_network = "Используется Nintendo Network" +,.using_pretendo_network = "Используется Pretendo Network" diff --git a/src/lang/zh_CN.lang b/src/lang/zh_CN.lang new file mode 100644 index 0000000..df1bc5a --- /dev/null +++ b/src/lang/zh_CN.lang @@ -0,0 +1,10 @@ +.plugin_name = "Inkay" +,.network_category = "选择网络" +,.connect_to_network_setting = "连接到Pretendo network" +,.other_category = "其他设置" +,.reset_wwp_setting = "重置Wara Wara Plaza" +,.press_a_action = "请按 A" +,.restart_to_apply_action = "重启以应用设置" +,.need_menu_action = "仅来自WiiU Menu" +,.using_nintendo_network = "使用 Nintendo Network" +,.using_pretendo_network = "使用 Pretendo Network" diff --git a/src/lang/zh_Hant.lang b/src/lang/zh_Hant.lang new file mode 100644 index 0000000..ec3a0ad --- /dev/null +++ b/src/lang/zh_Hant.lang @@ -0,0 +1,10 @@ +.plugin_name = "Inkay" +,.network_category = "選擇網路" +,.connect_to_network_setting = "連接到Pretendo network" +,.other_category = "其他設定" +,.reset_wwp_setting = "重置Wara Wara Plaza" +,.press_a_action = "請按 A" +,.restart_to_apply_action = "重啓以套用設定" +,.need_menu_action = "僅來自WiiU Menu" +,.using_nintendo_network = "使用 Nintendo Network" +,.using_pretendo_network = "使用 Pretendo Network" From 9d29ad78fd3ef84b150b8831f49d1ae64f029155 Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Sun, 6 Oct 2024 04:33:51 +0200 Subject: [PATCH 015/139] Translated using Weblate (Spanish) (#47) Currently translated at 100.0% (10 of 10 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/es/ Co-authored-by: gallegonovato --- src/lang/es_ES.lang | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lang/es_ES.lang b/src/lang/es_ES.lang index 833f16a..0a55bcd 100644 --- a/src/lang/es_ES.lang +++ b/src/lang/es_ES.lang @@ -1,10 +1,10 @@ -.plugin_name = "Inkay" -,.network_category = "Selección de red" -,.connect_to_network_setting = "Conectar a la red Pretendo" -,.other_category = "Otros ajustes" -,.reset_wwp_setting = "Restablecer Wara Wara Plaza" -,.press_a_action = "Pulsa A" -,.restart_to_apply_action = "Reinicia para confirmar" -,.need_menu_action = "Sólo desde el menú de WiiU" -,.using_nintendo_network = "Usando Nintendo Network" -,.using_pretendo_network = "Usando Pretendo Network" +.plugin_name="Inkay" +,.network_category="Selección de red" +,.connect_to_network_setting="Conectar a la red Pretendo" +,.other_category="Otros ajustes" +,.reset_wwp_setting="Restablecer Wara Wara Plaza" +,.press_a_action="Pulsa A" +,.restart_to_apply_action="Reinicia para confirmar" +,.need_menu_action="Solo desde el menú de WiiU" +,.using_nintendo_network="Usando Nintendo Network" +,.using_pretendo_network="Usando Pretendo Network" From a1375ca6088f264df4309a70305603fc4554a227 Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Tue, 5 Nov 2024 14:41:54 +0100 Subject: [PATCH 016/139] Translations update from Hosted Weblate (#52) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Translated using Weblate (Spanish) Currently translated at 100.0% (10 of 10 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/es/ * Translated using Weblate (Spanish) Currently translated at 100.0% (10 of 10 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/es/ --------- Co-authored-by: Arnau Bàrcia --- src/lang/es_ES.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/es_ES.lang b/src/lang/es_ES.lang index 0a55bcd..c6e9188 100644 --- a/src/lang/es_ES.lang +++ b/src/lang/es_ES.lang @@ -2,9 +2,9 @@ ,.network_category="Selección de red" ,.connect_to_network_setting="Conectar a la red Pretendo" ,.other_category="Otros ajustes" -,.reset_wwp_setting="Restablecer Wara Wara Plaza" +,.reset_wwp_setting="Restablecer Plaza Wara Wara" ,.press_a_action="Pulsa A" ,.restart_to_apply_action="Reinicia para confirmar" -,.need_menu_action="Solo desde el menú de WiiU" +,.need_menu_action="Solo desde el Menú de Wii U" ,.using_nintendo_network="Usando Nintendo Network" ,.using_pretendo_network="Usando Pretendo Network" From 22bebff027f4e7cfe8e5ad6fd96b0647df7c9cd9 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Sun, 17 Nov 2024 23:34:46 +1100 Subject: [PATCH 017/139] feat(p2p): Allow overriding the p2p udp port for Minecraft the idea is that you might port forward this in your router and give yourself NAT type A for free --- src/main.cpp | 20 ++------ src/patches/game_peertopeer.cpp | 73 +++++++++++++++++++++++++++ src/patches/game_peertopeer.h | 16 ++++++ src/utils/replace_mem.cpp | 16 ++++++ src/utils/replace_mem.h | 2 + src/utils/rpl_info.cpp | 39 +++++++++++++++ src/utils/rpl_info.h | 28 +++++++++++ src/utils/scope_exit.h | 13 +++++ src/utils/sysconfig.cpp | 88 ++++++++++++++++++++++++--------- src/utils/sysconfig.h | 3 ++ 10 files changed, 258 insertions(+), 40 deletions(-) create mode 100644 src/patches/game_peertopeer.cpp create mode 100644 src/patches/game_peertopeer.h create mode 100644 src/utils/rpl_info.cpp create mode 100644 src/utils/rpl_info.h create mode 100644 src/utils/scope_exit.h diff --git a/src/main.cpp b/src/main.cpp index 8270d80..560ec42 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -68,6 +68,7 @@ WUPS_USE_WUT_DEVOPTAB(); #include #include #include "patches/account_settings.h" +#include "patches/game_peertopeer.h" #include "utils/sysconfig.h" //thanks @Gary#4139 :p @@ -127,23 +128,9 @@ INITIALIZE_PLUGIN() { DEBUG_FUNCTION_LINE("NotificationModule_InitLibrary failed"); } - //get os version - MCPSystemVersion os_version; - int mcp = MCP_Open(); - int ret = MCP_GetSystemVersion(mcp, &os_version); - if (ret < 0) { - DEBUG_FUNCTION_LINE("getting system version failed (%d/%d)!", mcp, ret); - os_version = (MCPSystemVersion) { - .major = 5, .minor = 5, .patch = 5, .region = 'E' - }; - } - DEBUG_FUNCTION_LINE_VERBOSE("Running on %d.%d.%d%c", - os_version.major, os_version.minor, os_version.patch, os_version.region - ); - // if using pretendo then (try to) apply the ssl patches if (Config::connect_to_network) { - if (is555(os_version)) { + if (is555(get_console_os_version())) { Mocha_IOSUKernelWrite32(0xE1019F78, 0xE3A00001); // mov r0, #1 } else { Mocha_IOSUKernelWrite32(0xE1019E84, 0xE3A00001); // mov r0, #1 @@ -165,8 +152,6 @@ INITIALIZE_PLUGIN() { ShowNotification(get_nintendo_network_message()); } - MCP_Close(mcp); - if (FunctionPatcher_InitLibrary() == FUNCTION_PATCHER_RESULT_SUCCESS) { install_matchmaking_patches(); } @@ -187,6 +172,7 @@ ON_APPLICATION_START() { DEBUG_FUNCTION_LINE_VERBOSE("Inkay " INKAY_VERSION " starting up...\n"); setup_olv_libs(); + peertopeer_patch(); matchmaking_notify_titleswitch(); patchAccountSettings(); } diff --git a/src/patches/game_peertopeer.cpp b/src/patches/game_peertopeer.cpp new file mode 100644 index 0000000..e51f2a2 --- /dev/null +++ b/src/patches/game_peertopeer.cpp @@ -0,0 +1,73 @@ +/* Copyright 2024 Pretendo Network contributors + Copyright 2024 Ash Logan + + Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby + granted, provided that the above copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. +*/ + +#include +#include +#include "game_peertopeer.h" + +#include "utils/sysconfig.h" +#include "utils/logger.h" +#include "utils/rpl_info.h" +#include "utils/replace_mem.h" + +#include + +static inline int digit(char a) { + if (a < '0' || a > '9') return 0; + return a - '0'; +} + +static unsigned short peertopeer_port() { + const char * serial = get_console_serial(); + + unsigned short port = 50000 + + (digit(serial[4]) * 1000) + + (digit(serial[5]) * 100 ) + + (digit(serial[6]) * 10 ) + + (digit(serial[7]) * 1 ); + + return port; +} + +static void minecraft_peertopeer_patch() { + std::optional minecraft = search_for_rpl("Minecraft.Client.rpx"); + if (!minecraft) { + DEBUG_FUNCTION_LINE("Couldn't find minecraft rpx!"); + return; + } + + auto port = peertopeer_port(); + DEBUG_FUNCTION_LINE_VERBOSE("Will use port %d. %08x", port, minecraft->textAddr); + + uint32_t *target_func = rpl_addr(*minecraft, 0x03579530); + replace_instruction(&target_func[0], 0x3c600001, 0x3c600000); // li r3, 0 + replace_instruction(&target_func[1], 0x3863c000, 0x60630000 | port); // ori r3, r3, port + // blr + + target_func = rpl_addr(*minecraft, 0x0357953c); + replace_instruction(&target_func[0], 0x3c600001, 0x3c600000); // li r3, 0 + replace_instruction(&target_func[1], 0x3863ffff, 0x60630000 | port); // ori r3, r3, port + // blr +} + +void peertopeer_patch() { + uint64_t tid = OSGetTitleID(); + if (tid == 0x00050000'101D7500 || // EUR + tid == 0x00050000'101D9D00 || // USA + tid == 0x00050000'101DBE00) { // JPN + + minecraft_peertopeer_patch(); + } else { + DEBUG_FUNCTION_LINE_VERBOSE("Game has no p2p patches, will skip.\n"); + } +} diff --git a/src/patches/game_peertopeer.h b/src/patches/game_peertopeer.h new file mode 100644 index 0000000..8211c00 --- /dev/null +++ b/src/patches/game_peertopeer.h @@ -0,0 +1,16 @@ +/* Copyright 2024 Pretendo Network contributors + Copyright 2024 Ash Logan + + Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby + granted, provided that the above copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. +*/ + +#pragma once + +void peertopeer_patch(); diff --git a/src/utils/replace_mem.cpp b/src/utils/replace_mem.cpp index 1879519..b1f6ba0 100644 --- a/src/utils/replace_mem.cpp +++ b/src/utils/replace_mem.cpp @@ -22,6 +22,7 @@ #include #include #include +#include bool replace(uint32_t start, uint32_t size, const char *original_val, size_t original_val_sz, const char *new_val, size_t new_val_sz) { @@ -71,3 +72,18 @@ void replaceBulk(uint32_t start, uint32_t size, std::span rep } #endif } + +bool replace_instruction(uint32_t *inst, uint32_t orignal_value, uint32_t new_value) { + if (*inst != orignal_value) return false; + + KernelCopyData( + OSEffectiveToPhysical((uint32_t) inst), + OSEffectiveToPhysical((uint32_t) &new_value), + sizeof(new_value) + ); + DCFlushRange(inst, sizeof(new_value)); + ICInvalidateRange(inst, sizeof(new_value)); + + DEBUG_FUNCTION_LINE_VERBOSE("%08x is now %08x", inst, *inst); + return *inst == new_value; +} diff --git a/src/utils/replace_mem.h b/src/utils/replace_mem.h index 377f2ac..dbf8eb6 100644 --- a/src/utils/replace_mem.h +++ b/src/utils/replace_mem.h @@ -27,3 +27,5 @@ struct replacement { }; void replaceBulk(uint32_t start, uint32_t size, std::span replacements); + +bool replace_instruction(uint32_t *inst, uint32_t orignal_value, uint32_t new_value); diff --git a/src/utils/rpl_info.cpp b/src/utils/rpl_info.cpp new file mode 100644 index 0000000..2148e1e --- /dev/null +++ b/src/utils/rpl_info.cpp @@ -0,0 +1,39 @@ +/* Copyright 2024 Pretendo Network contributors + Copyright 2024 Ash Logan + + Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby + granted, provided that the above copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. +*/ + +#include "rpl_info.h" + +#include +#include +#include + +// if we get more than like.. two callsites for this, it should really be refactored out rather than doing a fresh +// search every time +std::optional search_for_rpl(std::string_view name) { + int num_rpls = OSDynLoad_GetNumberOfRPLs(); + if (!num_rpls) + return std::nullopt; + + // allocates but we free it at return + std::vector rpls(num_rpls); + if (!OSDynLoad_GetRPLInfo(0, num_rpls, rpls.data())) + return std::nullopt; + + auto rpl = std::find_if(rpls.begin(), rpls.end(), [=](const OSDynLoad_NotifyData &rpl) { + return std::string_view(rpl.name).ends_with(name); + }); + if (rpl == rpls.end()) + return std::nullopt; + + return *rpl; +} diff --git a/src/utils/rpl_info.h b/src/utils/rpl_info.h new file mode 100644 index 0000000..5eebe7a --- /dev/null +++ b/src/utils/rpl_info.h @@ -0,0 +1,28 @@ +/* Copyright 2024 Pretendo Network contributors + Copyright 2024 Ash Logan + + Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby + granted, provided that the above copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. +*/ + +#pragma once + +#include +#include +#include + +std::optional search_for_rpl(std::string_view name); + +constexpr uint32_t *rpl_addr(OSDynLoad_NotifyData rpl, uint32_t cemu_addr) { + if (cemu_addr < 0x1000'0000) { + return (uint32_t *)(rpl.textAddr + cemu_addr - 0x0200'0000); + } else { + return (uint32_t *)(rpl.dataAddr + cemu_addr - 0x1000'0000); + } +} diff --git a/src/utils/scope_exit.h b/src/utils/scope_exit.h new file mode 100644 index 0000000..c9a357c --- /dev/null +++ b/src/utils/scope_exit.h @@ -0,0 +1,13 @@ +#pragma once +#include + +// https://stackoverflow.com/a/61242721 +template +struct scope_exit +{ + F func; + explicit scope_exit(F&& f): func(std::forward(f)) {} + ~scope_exit() { func(); } +}; + +template scope_exit(F&& frv) -> scope_exit; diff --git a/src/utils/sysconfig.cpp b/src/utils/sysconfig.cpp index cef6d78..97ae4a3 100644 --- a/src/utils/sysconfig.cpp +++ b/src/utils/sysconfig.cpp @@ -1,5 +1,6 @@ /* Copyright 2024 Pretendo Network contributors Copyright 2024 Ash Logan + Copyright 2023 Maschell Copyright 2020-2022 V10lator Copyright 2022 Xpl0itU @@ -19,7 +20,9 @@ #include "sysconfig.h" #include "utils/logger.h" +#include "utils/scope_exit.h" +#include #include #include @@ -28,30 +31,69 @@ nn::swkbd::LanguageType get_system_language() { if (cached_language) return *cached_language; UCHandle handle = UCOpen(); - if (handle >= 0) { - nn::swkbd::LanguageType language; - - UCSysConfig settings __attribute__((__aligned__(0x40))) = { - .name = "cafe.language", - .access = 0, - .dataType = UC_DATATYPE_UNSIGNED_INT, - .error = UC_ERROR_OK, - .dataSize = sizeof(language), - .data = &language, - }; - - UCError err = UCReadSysConfig(handle, 1, &settings); - UCClose(handle); - if (err != UC_ERROR_OK) { - DEBUG_FUNCTION_LINE("Error reading UC: %d!", err); - return nn::swkbd::LanguageType::English; - } else { - DEBUG_FUNCTION_LINE_VERBOSE("System language found: %d", language); - cached_language = language; - return language; - } - } else { + if (handle < 0) { DEBUG_FUNCTION_LINE("Error opening UC: %d", handle); return nn::swkbd::LanguageType::English; } + scope_exit uc_c([&] { UCClose(handle); }); + + nn::swkbd::LanguageType language; + + alignas(0x40) UCSysConfig settings = { + .name = "cafe.language", + .access = 0, + .dataType = UC_DATATYPE_UNSIGNED_INT, + .error = UC_ERROR_OK, + .dataSize = sizeof(language), + .data = &language, + }; + + UCError err = UCReadSysConfig(handle, 1, &settings); + if (err != UC_ERROR_OK) { + DEBUG_FUNCTION_LINE("Error reading UC: %d!", err); + return nn::swkbd::LanguageType::English; + } + + DEBUG_FUNCTION_LINE_VERBOSE("System language found: %d", language); + cached_language = language; + return language; +} + +static std::optional mcp_config; +static std::optional mcp_os_version; +static void get_mcp_config() { + int mcp = MCP_Open(); + scope_exit mcp_c([&] { MCP_Close(mcp); }); + + alignas(0x40) MCPSysProdSettings config {}; + if (MCP_GetSysProdSettings(mcp, &config)) { + DEBUG_FUNCTION_LINE("Could not get MCP system config!"); + return; + } + mcp_config = config; + + //get os version + MCPSystemVersion os_version; + if (MCP_GetSystemVersion(mcp, &os_version)) { + DEBUG_FUNCTION_LINE("Could not get MCP system config!"); + return; + } + mcp_os_version = os_version; + + DEBUG_FUNCTION_LINE_VERBOSE("Running on %d.%d.%d%c; %s%s", + os_version.major, os_version.minor, os_version.patch, os_version.region + config.code_id, config.serial_id + ); +} + +const char * get_console_serial() { + if (!mcp_config) get_mcp_config(); + + return mcp_config ? mcp_config->serial_id : "123456789"; +} + +MCPSystemVersion get_console_os_version() { + if (!mcp_os_version) get_mcp_config(); + + return mcp_os_version.value_or((MCPSystemVersion) { .major = 5, .minor = 5, .patch = 5, .region = 'E' }); } diff --git a/src/utils/sysconfig.h b/src/utils/sysconfig.h index 3bac817..3b3e075 100644 --- a/src/utils/sysconfig.h +++ b/src/utils/sysconfig.h @@ -6,7 +6,10 @@ #define INKAY_SYSCONFIG_H #include +#include nn::swkbd::LanguageType get_system_language(); +const char * get_console_serial(); +MCPSystemVersion get_console_os_version(); #endif //INKAY_SYSCONFIG_H From cc967126fe553d204706abd4ab5883d0e372d902 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Sun, 17 Nov 2024 23:58:10 +1100 Subject: [PATCH 018/139] feat(p2p): Show p2p port in the config menu with love to my weblate people --- src/config.cpp | 10 ++++++++++ src/config.h | 1 + src/lang/en_US.lang | 1 + src/patches/game_peertopeer.cpp | 2 +- src/patches/game_peertopeer.h | 1 + 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/config.cpp b/src/config.cpp index 5f3b12a..d7e6ffc 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -20,11 +20,13 @@ #include "wut_extra.h" #include "utils/logger.h" #include "utils/sysconfig.h" +#include "patches/game_peertopeer.h" #include #include #include #include +#include #include #include @@ -32,6 +34,8 @@ #include #include +#include + bool Config::connect_to_network = true; bool Config::need_relaunch = false; bool Config::unregister_task_item_pressed = false; @@ -174,6 +178,12 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa res = network_cat->add(std::move(*connect_item), err); if (!res) return report_error(err); + { + std::string multiplayer_port_text = std::vformat(strings.multiplayer_port_display, std::make_format_args(peertopeer_port())); + res = network_cat->add(WUPSConfigItemStub::Create(multiplayer_port_text), err); + if (!res) return report_error(err); + } + res = root.add(std::move(*network_cat), err); if (!res) return report_error(err); diff --git a/src/config.h b/src/config.h index 2fa9812..51c888b 100644 --- a/src/config.h +++ b/src/config.h @@ -35,6 +35,7 @@ struct config_strings { std::string_view need_menu_action; std::string_view using_nintendo_network; std::string_view using_pretendo_network; + std::string_view multiplayer_port_display; }; config_strings get_config_strings(nn::swkbd::LanguageType language); diff --git a/src/lang/en_US.lang b/src/lang/en_US.lang index a50a37c..ed0e423 100644 --- a/src/lang/en_US.lang +++ b/src/lang/en_US.lang @@ -8,3 +8,4 @@ ,.need_menu_action = "From WiiU menu only" ,.using_nintendo_network = "Using Nintendo Network" ,.using_pretendo_network = "Using Pretendo Network" +,.multiplayer_port_display = "Using UDP port {} for multiplayer" diff --git a/src/patches/game_peertopeer.cpp b/src/patches/game_peertopeer.cpp index e51f2a2..01a6fc6 100644 --- a/src/patches/game_peertopeer.cpp +++ b/src/patches/game_peertopeer.cpp @@ -27,7 +27,7 @@ static inline int digit(char a) { return a - '0'; } -static unsigned short peertopeer_port() { +unsigned short peertopeer_port() { const char * serial = get_console_serial(); unsigned short port = 50000 + diff --git a/src/patches/game_peertopeer.h b/src/patches/game_peertopeer.h index 8211c00..e26862b 100644 --- a/src/patches/game_peertopeer.h +++ b/src/patches/game_peertopeer.h @@ -14,3 +14,4 @@ #pragma once void peertopeer_patch(); +unsigned short peertopeer_port(); From f4aeee80341a5272af303fc21a26a24ed63a751e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Sat, 19 Oct 2024 19:10:08 +0100 Subject: [PATCH 019/139] feat!: Split Inkay into a module and a plugin This is necessary for a future Aroma feature. This also makes more clear the immutability of the patches that Pretendo requires, since they cannot be reverted easily. All patching code is now managed inside the module, which the plugin triggers by calling an exported function from it. The WWP reset code remains within the plugin as it isn't strictly tied to the patches. --- .github/workflows/ci.yml | 6 +- .gitignore | 6 +- Dockerfile | 3 +- Makefile | 45 +++--- plugin/Makefile | 148 ++++++++++++++++++ plugin/src/Notification.cpp | 31 ++++ plugin/src/Notification.h | 3 + plugin/src/config.cpp | 258 +++++++++++++++++++++++++++++++ plugin/src/config.h | 42 +++++ plugin/src/main.cpp | 92 +++++++++++ plugin/src/module.cpp | 38 +++++ plugin/src/module.h | 19 +++ plugin/src/utils/logger.h | 36 +++++ plugin/src/utils/sysconfig.cpp | 57 +++++++ plugin/src/utils/sysconfig.h | 12 ++ plugin/src/wut_extra.h | 41 +++++ src/config.cpp | 209 +------------------------ src/config.h | 11 -- src/main.cpp | 78 ++++++---- src/patches/account_settings.cpp | 27 +++- src/patches/account_settings.h | 3 +- src/patches/dns_hooks.cpp | 35 ++++- src/patches/dns_hooks.h | 20 +++ src/patches/eshop_applet.cpp | 29 +++- src/patches/eshop_applet.h | 20 +++ src/patches/game_matchmaking.cpp | 2 +- src/patches/olv_applet.cpp | 29 +++- src/patches/olv_applet.h | 20 +++ src/patches/olv_urls.cpp | 2 +- src/utils/logger.h | 6 +- 30 files changed, 1034 insertions(+), 294 deletions(-) create mode 100644 plugin/Makefile create mode 100644 plugin/src/Notification.cpp create mode 100644 plugin/src/Notification.h create mode 100644 plugin/src/config.cpp create mode 100644 plugin/src/config.h create mode 100644 plugin/src/main.cpp create mode 100644 plugin/src/module.cpp create mode 100644 plugin/src/module.h create mode 100644 plugin/src/utils/logger.h create mode 100644 plugin/src/utils/sysconfig.cpp create mode 100644 plugin/src/utils/sysconfig.h create mode 100644 plugin/src/wut_extra.h create mode 100644 src/patches/dns_hooks.h create mode 100644 src/patches/eshop_applet.h create mode 100644 src/patches/olv_applet.h diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adfbbeb..60c8bf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,13 +6,13 @@ jobs: build-inkay: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: build toolchain container run: docker build . -t builder - uses: ammaraskar/gcc-problem-matcher@master - name: build Inkay run: docker run --rm -v ${PWD}:/app -w /app builder - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: inkay - path: "*.wps" + path: dist/ diff --git a/.gitignore b/.gitignore index 982b963..3f9ac48 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,11 @@ +.cache/ .vscode/ .idea/ /build +/plugin/build +/dist *.elf +*.wms *.wps certs/ -*.lst \ No newline at end of file +*.lst diff --git a/Dockerfile b/Dockerfile index 4147038..0f51ffa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,8 @@ COPY --from=ghcr.io/wiiu-env/libnotifications:20240426 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libkernel:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libmocha:20231127 /artifacts $DEVKITPRO +COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20240424 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/wiiupluginsystem:20240505 /artifacts $DEVKITPRO WORKDIR /app -CMD make -f Makefile -j$(nproc) \ No newline at end of file +CMD make -f Makefile -j$(nproc) diff --git a/Makefile b/Makefile index 2d63adc..c645f43 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,10 @@ endif TOPDIR ?= $(CURDIR) -include $(DEVKITPRO)/wups/share/wups_rules +include $(DEVKITPRO)/wums/share/wums_rules -WUT_ROOT := $(DEVKITPRO)/wut WUMS_ROOT := $(DEVKITPRO)/wums +WUT_ROOT := $(DEVKITPRO)/wut #------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -24,34 +24,32 @@ BUILD := build SOURCES := src src/patches src/utils src/ext/inih DATA := data INCLUDES := src src/ext/inih -#DEBUG := 1 #------------------------------------------------------------------------------- # options for code generation #------------------------------------------------------------------------------- -CFLAGS := -Wall -O2 -ffunction-sections -fdata-sections \ +CFLAGS := -Wall -Wextra -O2 -ffunction-sections\ $(MACHDEP) -CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__ -D__WUPS__ - -ifeq ($(DEBUG),1) - CFLAGS += -DDEBUG -g -endif +CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__ CXXFLAGS := $(CFLAGS) -std=c++20 ASFLAGS := -g $(ARCH) -LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -Wl,-gc-sections +LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -T$(WUMS_ROOT)/share/libkernel.ld $(WUMSSPECS) -LDFLAGS += -T$(WUMS_ROOT)/share/libkernel.ld $(WUPSSPECS) +ifeq ($(DEBUG),1) +CXXFLAGS += -DDEBUG -g +CFLAGS += -DDEBUG -g +endif -LIBS := -lwups -lmocha -lkernel -lwut -lnotifications -lfunctionpatcher +LIBS := -lwums -lmocha -lkernel -lwut -lfunctionpatcher -lnotifications #------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level # containing include and lib #------------------------------------------------------------------------------- -LIBDIRS := $(PORTLIBS) $(WUMS_ROOT) $(WUPS_ROOT) $(WUT_ROOT) $(WUT_ROOT)/usr +LIBDIRS := $(PORTLIBS) $(WUT_ROOT) $(WUMS_ROOT) $(WUT_ROOT)/usr #------------------------------------------------------------------------------- # no real need to edit anything past this point unless you need to add additional @@ -103,14 +101,20 @@ export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) #------------------------------------------------------------------------------- all: $(BUILD) + $(BUILD): - @$(shell [ ! -d $(BUILD) ] && mkdir -p $(BUILD)) + @[ -d $@ ] || mkdir -p $@ @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + @$(MAKE) --no-print-directory -C $(CURDIR)/plugin -f $(CURDIR)/plugin/Makefile + mkdir -p dist/ + cp *.wms dist/ + cp plugin/*.wps dist/ #------------------------------------------------------------------------------- clean: @echo clean ... - @rm -fr $(BUILD) $(TARGET).wps $(TARGET).elf + @rm -fr dist $(BUILD) $(TARGET).wms $(TARGET).elf + @$(MAKE) --no-print-directory -C $(CURDIR)/plugin -f $(CURDIR)/plugin/Makefile clean #------------------------------------------------------------------------------- else @@ -121,10 +125,10 @@ DEPENDS := $(OFILES:.o=.d) #------------------------------------------------------------------------------- # main targets #------------------------------------------------------------------------------- -all : $(OUTPUT).wps +all : $(OUTPUT).wms -$(OUTPUT).wps : $(OUTPUT).elf -$(OUTPUT).elf : $(OFILES) +$(OUTPUT).wms : $(OUTPUT).elf +$(OUTPUT).elf : $(OFILES) $(OFILES_SRC) : $(HFILES_BIN) @@ -141,6 +145,11 @@ $(OFILES_SRC) : $(HFILES_BIN) @echo $(notdir $<) @$(bin2o) +#--------------------------------------------------------------------------------- +%.o: %.s + @echo $(notdir $<) + @$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER) + -include $(DEPENDS) #------------------------------------------------------------------------------- diff --git a/plugin/Makefile b/plugin/Makefile new file mode 100644 index 0000000..125fb0c --- /dev/null +++ b/plugin/Makefile @@ -0,0 +1,148 @@ +#------------------------------------------------------------------------------- +.SUFFIXES: +#------------------------------------------------------------------------------- + +ifeq ($(strip $(DEVKITPRO)),) +$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=/devkitpro") +endif + +TOPDIR ?= $(CURDIR) + +include $(DEVKITPRO)/wups/share/wups_rules + +WUT_ROOT := $(DEVKITPRO)/wut +WUMS_ROOT := $(DEVKITPRO)/wums +#------------------------------------------------------------------------------- +# TARGET is the name of the output +# BUILD is the directory where object files & intermediate files will be placed +# SOURCES is a list of directories containing source code +# DATA is a list of directories containing data files +# INCLUDES is a list of directories containing header files +#------------------------------------------------------------------------------- +TARGET := Inkay-pretendo +BUILD := build +SOURCES := src src/utils +DATA := data +INCLUDES := src ../src/lang +#DEBUG := 1 + +#------------------------------------------------------------------------------- +# options for code generation +#------------------------------------------------------------------------------- +CFLAGS := -Wall -O2 -ffunction-sections -fdata-sections \ + $(MACHDEP) + +CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__ -D__WUPS__ + +ifeq ($(DEBUG),1) + CFLAGS += -DDEBUG -g +endif + +CXXFLAGS := $(CFLAGS) -std=c++20 + +ASFLAGS := -g $(ARCH) +LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -Wl,-gc-sections + +LDFLAGS += $(WUPSSPECS) + +LIBS := -lwups -lwut -lnotifications + +#------------------------------------------------------------------------------- +# list of directories containing libraries, this must be the top level +# containing include and lib +#------------------------------------------------------------------------------- +LIBDIRS := $(PORTLIBS) $(WUMS_ROOT) $(WUPS_ROOT) $(WUT_ROOT) + +#------------------------------------------------------------------------------- +# no real need to edit anything past this point unless you need to add additional +# rules for different file extensions +#------------------------------------------------------------------------------- +ifneq ($(BUILD),$(notdir $(CURDIR))) +#------------------------------------------------------------------------------- + +export OUTPUT := $(CURDIR)/$(TARGET) +export TOPDIR := $(CURDIR) + +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ + $(foreach dir,$(DATA),$(CURDIR)/$(dir)) + +export DEPSDIR := $(CURDIR)/$(BUILD) + +CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) +CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) +SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) +BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) + +#------------------------------------------------------------------------------- +# use CXX for linking C++ projects, CC for standard C +#------------------------------------------------------------------------------- +ifeq ($(strip $(CPPFILES)),) +#------------------------------------------------------------------------------- + export LD := $(CC) +#------------------------------------------------------------------------------- +else +#------------------------------------------------------------------------------- + export LD := $(CXX) +#------------------------------------------------------------------------------- +endif +#------------------------------------------------------------------------------- + +export OFILES_BIN := $(addsuffix .o,$(BINFILES)) +export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) +export OFILES := $(OFILES_BIN) $(OFILES_SRC) +export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES))) + +export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ + $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ + -I$(CURDIR)/$(BUILD) + +export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) + +.PHONY: $(BUILD) clean all + +#------------------------------------------------------------------------------- +all: $(BUILD) + +$(BUILD): + @$(shell [ ! -d $(BUILD) ] && mkdir -p $(BUILD)) + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + +#------------------------------------------------------------------------------- +clean: + @echo clean ... + @rm -fr $(BUILD) $(TARGET).wps $(TARGET).elf + +#------------------------------------------------------------------------------- +else +.PHONY: all + +DEPENDS := $(OFILES:.o=.d) + +#------------------------------------------------------------------------------- +# main targets +#------------------------------------------------------------------------------- +all : $(OUTPUT).wps + +$(OUTPUT).wps : $(OUTPUT).elf +$(OUTPUT).elf : $(OFILES) + +$(OFILES_SRC) : $(HFILES_BIN) + +#------------------------------------------------------------------------------- +# you need a rule like this for each extension you use as binary data +#------------------------------------------------------------------------------- +%.bin.o %_bin.h : %.bin +#------------------------------------------------------------------------------- + @echo $(notdir $<) + @$(bin2o) + +%.pem.o %_pem.h : %.pem +#------------------------------------------------------------------------------- + @echo $(notdir $<) + @$(bin2o) + +-include $(DEPENDS) + +#------------------------------------------------------------------------------- +endif +#------------------------------------------------------------------------------- diff --git a/plugin/src/Notification.cpp b/plugin/src/Notification.cpp new file mode 100644 index 0000000..cc6177e --- /dev/null +++ b/plugin/src/Notification.cpp @@ -0,0 +1,31 @@ +/* Copyright 2024 Pretendo Network contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "Notification.h" +#include +#include + +void ShowNotification(const char* notification) { + auto err1 = NotificationModule_SetDefaultValue(NOTIFICATION_MODULE_NOTIFICATION_TYPE_INFO, + NOTIFICATION_MODULE_DEFAULT_OPTION_KEEP_UNTIL_SHOWN, true); + auto err2 = NotificationModule_SetDefaultValue(NOTIFICATION_MODULE_NOTIFICATION_TYPE_INFO, + NOTIFICATION_MODULE_DEFAULT_OPTION_DURATION_BEFORE_FADE_OUT, + 15.0f); + + if (err1 != NOTIFICATION_MODULE_RESULT_SUCCESS || err2 != NOTIFICATION_MODULE_RESULT_SUCCESS) return; + + NotificationModule_AddInfoNotification(notification); +} diff --git a/plugin/src/Notification.h b/plugin/src/Notification.h new file mode 100644 index 0000000..ebdc7a3 --- /dev/null +++ b/plugin/src/Notification.h @@ -0,0 +1,3 @@ +#pragma once + +void ShowNotification(const char* notification); diff --git a/plugin/src/config.cpp b/plugin/src/config.cpp new file mode 100644 index 0000000..a0fc590 --- /dev/null +++ b/plugin/src/config.cpp @@ -0,0 +1,258 @@ +/* Copyright 2022 Pretendo Network contributors + Copyright 2022 Ash Logan + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "config.h" + +#include "wut_extra.h" +#include "utils/logger.h" +#include "utils/sysconfig.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +bool Config::connect_to_network = true; +bool Config::need_relaunch = false; +bool Config::unregister_task_item_pressed = false; +bool Config::is_wiiu_menu = false; + +static config_strings strings; + +config_strings get_config_strings(nn::swkbd::LanguageType language) { + switch (language) { + case nn::swkbd::LanguageType::English: + default: return { +#include "en_US.lang" + }; + case nn::swkbd::LanguageType::Spanish: return { +#include "es_ES.lang" + }; + case nn::swkbd::LanguageType::French: return { +#include "fr_FR.lang" + }; + case nn::swkbd::LanguageType::Italian: return { +#include "it_IT.lang" + }; + case nn::swkbd::LanguageType::German: return { +#include "de_DE.lang" + }; + case nn::swkbd::LanguageType::SimplifiedChinese: return { +#include "zh_CN.lang" + }; + case nn::swkbd::LanguageType::TraditionalChinese: return { +#include "zh_Hant.lang" + }; + case nn::swkbd::LanguageType::Portuguese: return { +#include "pt_BR.lang" + }; + case nn::swkbd::LanguageType::Japanese: return { +#include "ja_JP.lang" + }; + case nn::swkbd::LanguageType::Dutch: return { +#include "nl_NL.lang" + }; + case nn::swkbd::LanguageType::Russian: return { +#include "ru_RU.lang" + }; + } +} + +static WUPSConfigAPICallbackStatus report_error(WUPSConfigAPIStatus err) { + DEBUG_FUNCTION_LINE_VERBOSE("WUPS config error: %s", WUPSConfigAPI_GetStatusStr(err)); + return WUPSCONFIG_API_CALLBACK_RESULT_ERROR; +} + +static void report_storage_error(WUPSStorageError err) { + DEBUG_FUNCTION_LINE_VERBOSE("WUPS storage error: %s", WUPSStorageAPI_GetStatusStr(err)); +} + +static void connect_to_network_changed(ConfigItemBoolean* item, bool new_value) { + DEBUG_FUNCTION_LINE_VERBOSE("connect_to_network changed to: %d", new_value); + if (new_value != Config::connect_to_network) { + Config::need_relaunch = true; + } + Config::connect_to_network = new_value; + + WUPSStorageError res; + res = WUPSStorageAPI::Store("connect_to_network", Config::connect_to_network); + if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); +} + +static void unregister_task_item_on_input_cb(void *context, WUPSConfigSimplePadData input) { + if (!Config::unregister_task_item_pressed && Config::is_wiiu_menu && ((input.buttons_d & WUPS_CONFIG_BUTTON_A) == WUPS_CONFIG_BUTTON_A)) { + + nn::act::Initialize(); + Initialize__Q2_2nn4bossFv(); + + for (uint8_t i = 1; i <= nn::act::GetNumOfAccounts(); i++) + { + if (nn::act::IsSlotOccupied(i) && nn::act::IsNetworkAccountEx(i)) + { + nn::boss::Task task{}; + nn::act::PersistentId persistentId = nn::act::GetPersistentIdEx(i); + + __ct__Q3_2nn4boss4TaskFv(&task); + Initialize__Q3_2nn4boss4TaskFPCcUi(&task, "oltopic", persistentId); + + // bypasses compiler warning about unused variable + #ifdef DEBUG + uint32_t res = Unregister__Q3_2nn4boss4TaskFv(&task); + DEBUG_FUNCTION_LINE_VERBOSE("Unregistered oltopic for: SlotNo %d | Persistent ID %08x -> 0x%08x", i, persistentId, res); + #else + Unregister__Q3_2nn4boss4TaskFv(&task); + #endif + } + } + + Finalize__Q2_2nn4bossFv(); + nn::act::Finalize(); + + Config::unregister_task_item_pressed = !Config::unregister_task_item_pressed; + Config::need_relaunch = true; + } +} + +static int32_t unregister_task_item_get_display_value(void *context, char *out_buf, int32_t out_size) { + auto string = strings.need_menu_action; + if (Config::is_wiiu_menu) { + if (Config::unregister_task_item_pressed) { + string = strings.restart_to_apply_action; + } else { + string = strings.press_a_action; + } + } + + if ((int)string.length() > out_size - 1) return -1; + string.copy(out_buf, string.length()); + out_buf[string.length()] = '\0'; + + return 0; +} + +static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHandle rootHandle) { + WUPSConfigAPIStatus err; + bool res; + + uint64_t current_title_id = OSGetTitleID(); + uint64_t wiiu_menu_tid = _SYSGetSystemApplicationTitleId(SYSTEM_APP_ID_WII_U_MENU); + Config::is_wiiu_menu = (current_title_id == wiiu_menu_tid); + + // get translation strings + strings = get_config_strings(get_system_language()); + + // create root config category + WUPSConfigCategory root = WUPSConfigCategory(rootHandle); + + auto network_cat = WUPSConfigCategory::Create(strings.network_category, err); + if (!network_cat) return report_error(err); + + // config id display name default current value changed callback + auto connect_item = WUPSConfigItemBoolean::Create("connect_to_network", strings.connect_to_network_setting, true, Config::connect_to_network, &connect_to_network_changed, err); + if (!connect_item) return report_error(err); + + res = network_cat->add(std::move(*connect_item), err); + if (!res) return report_error(err); + + res = root.add(std::move(*network_cat), err); + if (!res) return report_error(err); + + auto other_cat = WUPSConfigCategory::Create(strings.other_category, err); + if (!other_cat) return report_error(err); + + WUPSConfigAPIItemCallbacksV2 unregisterTasksItemCallbacks = { + .getCurrentValueDisplay = unregister_task_item_get_display_value, + .getCurrentValueSelectedDisplay = unregister_task_item_get_display_value, + .onSelected = nullptr, + .restoreDefault = nullptr, + .isMovementAllowed = nullptr, + .onCloseCallback = nullptr, + .onInput = unregister_task_item_on_input_cb, + .onInputEx = nullptr, + .onDelete = nullptr + }; + + WUPSConfigAPIItemOptionsV2 unregisterTasksItemOptions = { + .displayName = strings.reset_wwp_setting.data(), + .context = nullptr, + .callbacks = unregisterTasksItemCallbacks, + }; + + WUPSConfigItemHandle unregisterTasksItem; + err = WUPSConfigAPI_Item_Create(unregisterTasksItemOptions, &unregisterTasksItem); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + + err = WUPSConfigAPI_Category_AddItem(other_cat->getHandle(), unregisterTasksItem); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + + res = root.add(std::move(*other_cat), err); + if (!res) return report_error(err); + + return WUPSCONFIG_API_CALLBACK_RESULT_SUCCESS; +} + +static void ConfigMenuClosedCallback() { + // Save all changes + WUPSStorageError res; + res = WUPSStorageAPI::SaveStorage(); + if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); + + if (Config::need_relaunch) { + // Need to reload the console so the patches reset + OSForceFullRelaunch(); + SYSLaunchMenu(); + Config::need_relaunch = false; + } +} + +void Config::Init() { + WUPSConfigAPIStatus cres; + + // Init the config api + WUPSConfigAPIOptionsV1 configOptions = { .name = "Inkay" }; + cres = WUPSConfigAPI_Init(configOptions, ConfigMenuOpenedCallback, ConfigMenuClosedCallback); + if (cres != WUPSCONFIG_API_RESULT_SUCCESS) return (void)report_error(cres); + + WUPSStorageError res; + // Try to get value from storage + res = WUPSStorageAPI::Get("connect_to_network", Config::connect_to_network); + if (res == WUPS_STORAGE_ERROR_NOT_FOUND) { + DEBUG_FUNCTION_LINE("Connect to network value not found, attempting to migrate/create"); + + bool skipPatches = false; + if (WUPSStorageAPI::Get("skipPatches", skipPatches) == WUPS_STORAGE_ERROR_SUCCESS) { + // Migrate old config value + Config::connect_to_network = !skipPatches; + WUPSStorageAPI::DeleteItem("skipPatches"); + } + + // Add the value to the storage if it's missing. + res = WUPSStorageAPI::Store("connect_to_network", connect_to_network); + if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); + } + else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); + + // Save storage + res = WUPSStorageAPI::SaveStorage(); + if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); +} diff --git a/plugin/src/config.h b/plugin/src/config.h new file mode 100644 index 0000000..2fa9812 --- /dev/null +++ b/plugin/src/config.h @@ -0,0 +1,42 @@ +// +// Created by ash on 10/12/22. +// + +#ifndef INKAY_CONFIG_H +#define INKAY_CONFIG_H + +#include +#include + +class Config { +public: + static void Init(); + + // wups config items + static bool connect_to_network; + + // private stuff + static bool need_relaunch; + + // private stuff + static bool is_wiiu_menu; + + static bool unregister_task_item_pressed; +}; + +struct config_strings { + const char *plugin_name; + std::string_view network_category; + std::string_view connect_to_network_setting; + std::string_view other_category; + std::string_view reset_wwp_setting; + std::string_view press_a_action; + std::string_view restart_to_apply_action; + std::string_view need_menu_action; + std::string_view using_nintendo_network; + std::string_view using_pretendo_network; +}; + +config_strings get_config_strings(nn::swkbd::LanguageType language); + +#endif //INKAY_CONFIG_H diff --git a/plugin/src/main.cpp b/plugin/src/main.cpp new file mode 100644 index 0000000..5cb5b19 --- /dev/null +++ b/plugin/src/main.cpp @@ -0,0 +1,92 @@ +/* Copyright 2022 Pretendo Network contributors + Copyright 2022 Ash Logan + Copyright 2019 Maschell + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "config.h" +#include "module.h" +#include "Notification.h" + +#include +#include +#include +#include +#include + +#include + +#define INKAY_VERSION "v2.6.0" + +/** + Mandatory plugin information. + If not set correctly, the loader will refuse to use the plugin. +**/ +WUPS_PLUGIN_NAME("Inkay"); +WUPS_PLUGIN_DESCRIPTION("Pretendo Network Patcher"); +WUPS_PLUGIN_VERSION(INKAY_VERSION); +WUPS_PLUGIN_AUTHOR("Pretendo contributors"); +WUPS_PLUGIN_LICENSE("GPLv3"); + +WUPS_USE_STORAGE("inkay"); + +WUPS_USE_WUT_DEVOPTAB(); + +#include "utils/sysconfig.h" + +INITIALIZE_PLUGIN() { + WHBLogCafeInit(); + WHBLogUdpInit(); + + Config::Init(); + + if (NotificationModule_InitLibrary() != NOTIFICATION_MODULE_RESULT_SUCCESS) { + DEBUG_FUNCTION_LINE("NotificationModule_InitLibrary failed"); + } + + // if using pretendo then (try to) apply the ssl patches + Inkay_Initialize(Config::connect_to_network); +} + +DEINITIALIZE_PLUGIN() { + NotificationModule_DeInitLibrary(); + + WHBLogCafeDeinit(); + WHBLogUdpDeinit(); +} + +ON_APPLICATION_START() { + +} + +ON_APPLICATION_ENDS() { + +} diff --git a/plugin/src/module.cpp b/plugin/src/module.cpp new file mode 100644 index 0000000..6a201fa --- /dev/null +++ b/plugin/src/module.cpp @@ -0,0 +1,38 @@ +/* Copyright 2024 Pretendo Network contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include + +#include "utils/logger.h" + +void Inkay_Initialize(bool apply_patches) { + OSDynLoad_Module module; + void (*moduleInitialize)(bool) = nullptr; + + if (OSDynLoad_Acquire("inkay", &module) != OS_DYNLOAD_OK) { + DEBUG_FUNCTION_LINE("Failed to acquire module"); + return; + } + + if (OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_Initialize", reinterpret_cast(&moduleInitialize)) != OS_DYNLOAD_OK) { + DEBUG_FUNCTION_LINE("Failed to find initialization function"); + return; + } + + moduleInitialize(apply_patches); + + OSDynLoad_Release(module); +} diff --git a/plugin/src/module.h b/plugin/src/module.h new file mode 100644 index 0000000..3da8b0a --- /dev/null +++ b/plugin/src/module.h @@ -0,0 +1,19 @@ +/* Copyright 2024 Pretendo Network contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#pragma once + +void Inkay_Initialize(bool apply_patches); diff --git a/plugin/src/utils/logger.h b/plugin/src/utils/logger.h new file mode 100644 index 0000000..f7278b6 --- /dev/null +++ b/plugin/src/utils/logger.h @@ -0,0 +1,36 @@ +#pragma once + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) +#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__) + +#define OSFATAL_FUNCTION_LINE(FMT, ARGS...)do { \ + OSFatal_printf("[(P) Inkay][%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \ + } while (0) + +#define DEBUG_FUNCTION_LINE(FMT, ARGS...)do { \ + WHBLogPrintf("[(P) Inkay][%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \ + } while (0); + +#define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...)do { \ + WHBLogWritef("[(P) Inkay][%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \ + } while (0); + +#ifdef DEBUG +#define DEBUG_FUNCTION_LINE_VERBOSE(FMT, ARGS...) DEBUG_FUNCTION_LINE(FMT, ##ARGS) +#else +#define DEBUG_FUNCTION_LINE_VERBOSE(FMT, ARGS...) while (0); +#endif + +#ifdef __cplusplus +} +#endif diff --git a/plugin/src/utils/sysconfig.cpp b/plugin/src/utils/sysconfig.cpp new file mode 100644 index 0000000..cef6d78 --- /dev/null +++ b/plugin/src/utils/sysconfig.cpp @@ -0,0 +1,57 @@ +/* Copyright 2024 Pretendo Network contributors + Copyright 2024 Ash Logan + Copyright 2020-2022 V10lator + Copyright 2022 Xpl0itU + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "sysconfig.h" +#include "utils/logger.h" + +#include +#include + +nn::swkbd::LanguageType get_system_language() { + static std::optional cached_language{}; + if (cached_language) return *cached_language; + + UCHandle handle = UCOpen(); + if (handle >= 0) { + nn::swkbd::LanguageType language; + + UCSysConfig settings __attribute__((__aligned__(0x40))) = { + .name = "cafe.language", + .access = 0, + .dataType = UC_DATATYPE_UNSIGNED_INT, + .error = UC_ERROR_OK, + .dataSize = sizeof(language), + .data = &language, + }; + + UCError err = UCReadSysConfig(handle, 1, &settings); + UCClose(handle); + if (err != UC_ERROR_OK) { + DEBUG_FUNCTION_LINE("Error reading UC: %d!", err); + return nn::swkbd::LanguageType::English; + } else { + DEBUG_FUNCTION_LINE_VERBOSE("System language found: %d", language); + cached_language = language; + return language; + } + } else { + DEBUG_FUNCTION_LINE("Error opening UC: %d", handle); + return nn::swkbd::LanguageType::English; + } +} diff --git a/plugin/src/utils/sysconfig.h b/plugin/src/utils/sysconfig.h new file mode 100644 index 0000000..3bac817 --- /dev/null +++ b/plugin/src/utils/sysconfig.h @@ -0,0 +1,12 @@ +// +// Created by ash on 9/04/24. +// + +#ifndef INKAY_SYSCONFIG_H +#define INKAY_SYSCONFIG_H + +#include + +nn::swkbd::LanguageType get_system_language(); + +#endif //INKAY_SYSCONFIG_H diff --git a/plugin/src/wut_extra.h b/plugin/src/wut_extra.h new file mode 100644 index 0000000..b6a65c3 --- /dev/null +++ b/plugin/src/wut_extra.h @@ -0,0 +1,41 @@ +#pragma once + +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +namespace nn::boss { + class Task { + public: + nn::act::PersistentId persistentId; + uint32_t unk1; + char task_name[8]; + uint64_t title_id; + uint32_t unk2; + uint32_t unk3; + }; + + static_assert(sizeof(Task) == 32, "nn::boss::Task must be 32 bytes."); +} + +extern "C" uint32_t Initialize__Q2_2nn4bossFv(); +extern "C" uint32_t Finalize__Q2_2nn4bossFv(); + +extern "C" void __ct__Q3_2nn4boss4TaskFv(nn::boss::Task *task); +extern "C" uint32_t Initialize__Q3_2nn4boss4TaskFPCcUi(nn::boss::Task *task, char const *, unsigned int); +extern "C" uint32_t Unregister__Q3_2nn4boss4TaskFv(nn::boss::Task *task); +extern "C" void __dt__Q3_2nn4boss4TaskFv(nn::boss::Task *task); +extern "C" uint32_t StartScheduling__Q3_2nn4boss4TaskFb(nn::boss::Task *task, bool queueTaskOnCall); +extern "C" uint32_t GetState__Q3_2nn4boss4TaskCFPUi(nn::boss::Task *task, uint32_t *outExecCount); +extern "C" uint32_t Run__Q3_2nn4boss4TaskFb(nn::boss::Task *task, bool unk); +extern "C" uint32_t UpdateIntervalSec__Q3_2nn4boss4TaskFUi(nn::boss::Task *task, uint32_t seconds); +extern "C" bool IsRegistered__Q3_2nn4boss4TaskCFv(nn::boss::Task *task); + +#ifdef __cplusplus +} +#endif diff --git a/src/config.cpp b/src/config.cpp index d7e6ffc..4923515 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -17,29 +17,7 @@ #include "config.h" -#include "wut_extra.h" -#include "utils/logger.h" -#include "utils/sysconfig.h" -#include "patches/game_peertopeer.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -bool Config::connect_to_network = true; -bool Config::need_relaunch = false; -bool Config::unregister_task_item_pressed = false; -bool Config::is_wiiu_menu = false; +bool Config::connect_to_network = false; static config_strings strings; @@ -81,188 +59,3 @@ config_strings get_config_strings(nn::swkbd::LanguageType language) { }; } } - -static WUPSConfigAPICallbackStatus report_error(WUPSConfigAPIStatus err) { - DEBUG_FUNCTION_LINE_VERBOSE("WUPS config error: %s", WUPSConfigAPI_GetStatusStr(err)); - return WUPSCONFIG_API_CALLBACK_RESULT_ERROR; -} - -static void report_storage_error(WUPSStorageError err) { - DEBUG_FUNCTION_LINE_VERBOSE("WUPS storage error: %s", WUPSStorageAPI_GetStatusStr(err)); -} - -static void connect_to_network_changed(ConfigItemBoolean* item, bool new_value) { - DEBUG_FUNCTION_LINE_VERBOSE("connect_to_network changed to: %d", new_value); - if (new_value != Config::connect_to_network) { - Config::need_relaunch = true; - } - Config::connect_to_network = new_value; - - WUPSStorageError res; - res = WUPSStorageAPI::Store("connect_to_network", Config::connect_to_network); - if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); -} - -static void unregister_task_item_on_input_cb(void *context, WUPSConfigSimplePadData input) { - if (!Config::unregister_task_item_pressed && Config::is_wiiu_menu && ((input.buttons_d & WUPS_CONFIG_BUTTON_A) == WUPS_CONFIG_BUTTON_A)) { - - nn::act::Initialize(); - Initialize__Q2_2nn4bossFv(); - - for (uint8_t i = 1; i <= nn::act::GetNumOfAccounts(); i++) - { - if (nn::act::IsSlotOccupied(i) && nn::act::IsNetworkAccountEx(i)) - { - nn::boss::Task task{}; - nn::act::PersistentId persistentId = nn::act::GetPersistentIdEx(i); - - __ct__Q3_2nn4boss4TaskFv(&task); - Initialize__Q3_2nn4boss4TaskFPCcUi(&task, "oltopic", persistentId); - - // bypasses compiler warning about unused variable - #ifdef DEBUG - uint32_t res = Unregister__Q3_2nn4boss4TaskFv(&task); - DEBUG_FUNCTION_LINE_VERBOSE("Unregistered oltopic for: SlotNo %d | Persistent ID %08x -> 0x%08x", i, persistentId, res); - #else - Unregister__Q3_2nn4boss4TaskFv(&task); - #endif - } - } - - Finalize__Q2_2nn4bossFv(); - nn::act::Finalize(); - - Config::unregister_task_item_pressed = !Config::unregister_task_item_pressed; - Config::need_relaunch = true; - } -} - -static int32_t unregister_task_item_get_display_value(void *context, char *out_buf, int32_t out_size) { - auto string = strings.need_menu_action; - if (Config::is_wiiu_menu) { - if (Config::unregister_task_item_pressed) { - string = strings.restart_to_apply_action; - } else { - string = strings.press_a_action; - } - } - - if ((int)string.length() > out_size - 1) return -1; - string.copy(out_buf, string.length()); - out_buf[string.length()] = '\0'; - - return 0; -} - -static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHandle rootHandle) { - WUPSConfigAPIStatus err; - bool res; - - uint64_t current_title_id = OSGetTitleID(); - uint64_t wiiu_menu_tid = _SYSGetSystemApplicationTitleId(SYSTEM_APP_ID_WII_U_MENU); - Config::is_wiiu_menu = (current_title_id == wiiu_menu_tid); - - // get translation strings - strings = get_config_strings(get_system_language()); - - // create root config category - WUPSConfigCategory root = WUPSConfigCategory(rootHandle); - - auto network_cat = WUPSConfigCategory::Create(strings.network_category, err); - if (!network_cat) return report_error(err); - - // config id display name default current value changed callback - auto connect_item = WUPSConfigItemBoolean::Create("connect_to_network", strings.connect_to_network_setting, true, Config::connect_to_network, &connect_to_network_changed, err); - if (!connect_item) return report_error(err); - - res = network_cat->add(std::move(*connect_item), err); - if (!res) return report_error(err); - - { - std::string multiplayer_port_text = std::vformat(strings.multiplayer_port_display, std::make_format_args(peertopeer_port())); - res = network_cat->add(WUPSConfigItemStub::Create(multiplayer_port_text), err); - if (!res) return report_error(err); - } - - res = root.add(std::move(*network_cat), err); - if (!res) return report_error(err); - - auto other_cat = WUPSConfigCategory::Create(strings.other_category, err); - if (!other_cat) return report_error(err); - - WUPSConfigAPIItemCallbacksV2 unregisterTasksItemCallbacks = { - .getCurrentValueDisplay = unregister_task_item_get_display_value, - .getCurrentValueSelectedDisplay = unregister_task_item_get_display_value, - .onSelected = nullptr, - .restoreDefault = nullptr, - .isMovementAllowed = nullptr, - .onCloseCallback = nullptr, - .onInput = unregister_task_item_on_input_cb, - .onInputEx = nullptr, - .onDelete = nullptr - }; - - WUPSConfigAPIItemOptionsV2 unregisterTasksItemOptions = { - .displayName = strings.reset_wwp_setting.data(), - .context = nullptr, - .callbacks = unregisterTasksItemCallbacks, - }; - - WUPSConfigItemHandle unregisterTasksItem; - err = WUPSConfigAPI_Item_Create(unregisterTasksItemOptions, &unregisterTasksItem); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); - - err = WUPSConfigAPI_Category_AddItem(other_cat->getHandle(), unregisterTasksItem); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); - - res = root.add(std::move(*other_cat), err); - if (!res) return report_error(err); - - return WUPSCONFIG_API_CALLBACK_RESULT_SUCCESS; -} - -static void ConfigMenuClosedCallback() { - // Save all changes - WUPSStorageError res; - res = WUPSStorageAPI::SaveStorage(); - if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); - - if (Config::need_relaunch) { - // Need to reload the console so the patches reset - OSForceFullRelaunch(); - SYSLaunchMenu(); - Config::need_relaunch = false; - } -} - -void Config::Init() { - WUPSConfigAPIStatus cres; - - // Init the config api - WUPSConfigAPIOptionsV1 configOptions = { .name = "Inkay" }; - cres = WUPSConfigAPI_Init(configOptions, ConfigMenuOpenedCallback, ConfigMenuClosedCallback); - if (cres != WUPSCONFIG_API_RESULT_SUCCESS) return (void)report_error(cres); - - WUPSStorageError res; - // Try to get value from storage - res = WUPSStorageAPI::Get("connect_to_network", Config::connect_to_network); - if (res == WUPS_STORAGE_ERROR_NOT_FOUND) { - DEBUG_FUNCTION_LINE("Connect to network value not found, attempting to migrate/create"); - - bool skipPatches = false; - if (WUPSStorageAPI::Get("skipPatches", skipPatches) == WUPS_STORAGE_ERROR_SUCCESS) { - // Migrate old config value - Config::connect_to_network = !skipPatches; - WUPSStorageAPI::DeleteItem("skipPatches"); - } - - // Add the value to the storage if it's missing. - res = WUPSStorageAPI::Store("connect_to_network", connect_to_network); - if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); - } - else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); - - // Save storage - res = WUPSStorageAPI::SaveStorage(); - if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); -} diff --git a/src/config.h b/src/config.h index 51c888b..99b2bdc 100644 --- a/src/config.h +++ b/src/config.h @@ -10,18 +10,7 @@ class Config { public: - static void Init(); - - // wups config items static bool connect_to_network; - - // private stuff - static bool need_relaunch; - - // private stuff - static bool is_wiiu_menu; - - static bool unregister_task_item_pressed; }; struct config_strings { diff --git a/src/main.cpp b/src/main.cpp index 560ec42..c3bf833 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -54,20 +54,23 @@ Mandatory plugin information. If not set correctly, the loader will refuse to use the plugin. **/ -WUPS_PLUGIN_NAME("Inkay"); -WUPS_PLUGIN_DESCRIPTION("Pretendo Network Patcher"); -WUPS_PLUGIN_VERSION(INKAY_VERSION); -WUPS_PLUGIN_AUTHOR("Pretendo contributors"); -WUPS_PLUGIN_LICENSE("GPLv3"); +WUMS_MODULE_EXPORT_NAME("inkay"); +WUMS_MODULE_DESCRIPTION("Pretendo Network Patcher"); +WUMS_MODULE_VERSION(INKAY_VERSION); +WUMS_MODULE_AUTHOR("Pretendo contributors"); +WUMS_MODULE_LICENSE("GPLv3"); WUPS_USE_STORAGE("inkay"); -WUPS_USE_WUT_DEVOPTAB(); +WUMS_USE_WUT_DEVOPTAB(); #include #include #include #include "patches/account_settings.h" +#include "patches/dns_hooks.h" +#include "patches/eshop_applet.h" +#include "patches/olv_applet.h" #include "patches/game_peertopeer.h" #include "utils/sysconfig.h" @@ -111,25 +114,11 @@ static const char *get_pretendo_message() { return get_config_strings(get_system_language()).using_pretendo_network.data(); } -INITIALIZE_PLUGIN() { - WHBLogCafeInit(); - WHBLogUdpInit(); - - Config::Init(); - - auto res = Mocha_InitLibrary(); - - if (res != MOCHA_RESULT_SUCCESS) { - DEBUG_FUNCTION_LINE("Mocha init failed with code %d!", res); - return; - } - - if (NotificationModule_InitLibrary() != NOTIFICATION_MODULE_RESULT_SUCCESS) { - DEBUG_FUNCTION_LINE("NotificationModule_InitLibrary failed"); - } - +static void Inkay_Initialize(bool apply_patches) { // if using pretendo then (try to) apply the ssl patches - if (Config::connect_to_network) { + if (apply_patches) { + Config::connect_to_network = true; + if (is555(get_console_os_version())) { Mocha_IOSUKernelWrite32(0xE1019F78, 0xE3A00001); // mov r0, #1 } else { @@ -150,14 +139,40 @@ INITIALIZE_PLUGIN() { DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches skipped."); ShowNotification(get_nintendo_network_message()); + return; } if (FunctionPatcher_InitLibrary() == FUNCTION_PATCHER_RESULT_SUCCESS) { + patchDNS(); + patchEshop(); + patchOlvApplet(); install_matchmaking_patches(); + } else { + DEBUG_FUNCTION_LINE("FunctionPatcher_InitLibrary failed"); } } -DEINITIALIZE_PLUGIN() { +WUMS_INITIALIZE() { + WHBLogCafeInit(); + WHBLogUdpInit(); + + auto res = Mocha_InitLibrary(); + + if (res != MOCHA_RESULT_SUCCESS) { + DEBUG_FUNCTION_LINE("Mocha init failed with code %d!", res); + return; + } + + if (NotificationModule_InitLibrary() != NOTIFICATION_MODULE_RESULT_SUCCESS) { + DEBUG_FUNCTION_LINE("NotificationModule_InitLibrary failed"); + } +} + +WUMS_DEINITIALIZE() { + unpatchDNS(); + unpatchEshop(); + unpatchOlvApplet(); + unpatchAccountSettings(); remove_matchmaking_patches(); Mocha_DeInitLibrary(); @@ -168,15 +183,20 @@ DEINITIALIZE_PLUGIN() { WHBLogUdpDeinit(); } -ON_APPLICATION_START() { +WUMS_APPLICATION_STARTS() { DEBUG_FUNCTION_LINE_VERBOSE("Inkay " INKAY_VERSION " starting up...\n"); setup_olv_libs(); peertopeer_patch(); matchmaking_notify_titleswitch(); - patchAccountSettings(); + + if (isAccountSettingsTitle()) { + patchAccountSettings(); + } } -ON_APPLICATION_ENDS() { +WUMS_APPLICATION_ENDS() { } + +WUMS_EXPORT_FUNCTION(Inkay_Initialize); diff --git a/src/patches/account_settings.cpp b/src/patches/account_settings.cpp index efea324..57af0b9 100644 --- a/src/patches/account_settings.cpp +++ b/src/patches/account_settings.cpp @@ -22,7 +22,8 @@ #include "utils/logger.h" #include "utils/replace_mem.h" -#include +#include +#include #include #include #include @@ -54,6 +55,7 @@ const char wave_new[] = "saccount.pretendo.cc"; bool isAccountSettingsTitle(); static std::optional rootca_pem_handle{}; +std::vector account_patches; DECL_FUNCTION(int, FSOpenFile_accSettings, FSClient *client, FSCmdBlock *block, char *path, const char *mode, uint32_t *handle, int error) { @@ -131,10 +133,27 @@ bool patchAccountSettings() { DEBUG_FUNCTION_LINE_VERBOSE("Inkay: We didn't find the whitelist /)>~<(\\"); return false; } + + account_patches.reserve(3); + + auto add_patch = [](function_replacement_data_t repl, const char *name) { + PatchedFunctionHandle handle = 0; + if (FunctionPatcher_AddFunctionPatch(&repl, &handle, nullptr) != FUNCTION_PATCHER_RESULT_SUCCESS) { + DEBUG_FUNCTION_LINE("Inkay/Account: Failed to patch %s!", name); + } + account_patches.push_back(handle); + }; + + add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSOpenFile_accSettings, LIBRARY_COREINIT, FSOpenFile, FP_TARGET_PROCESS_GAME), "FSOpenFile_accSettings"); + add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSReadFile_accSettings, LIBRARY_COREINIT, FSReadFile, FP_TARGET_PROCESS_GAME), "FSReadFile_accSettings"); + add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSCloseFile_accSettings, LIBRARY_COREINIT, FSReadFile, FP_TARGET_PROCESS_GAME), "FSCloseFile_accSettings"); return true; } -WUPS_MUST_REPLACE_FOR_PROCESS(FSOpenFile_accSettings, WUPS_LOADER_LIBRARY_COREINIT, FSOpenFile, WUPS_FP_TARGET_PROCESS_GAME); -WUPS_MUST_REPLACE_FOR_PROCESS(FSReadFile_accSettings, WUPS_LOADER_LIBRARY_COREINIT, FSReadFile, WUPS_FP_TARGET_PROCESS_GAME); -WUPS_MUST_REPLACE_FOR_PROCESS(FSCloseFile_accSettings, WUPS_LOADER_LIBRARY_COREINIT, FSCloseFile, WUPS_FP_TARGET_PROCESS_GAME); +void unpatchAccountSettings() { + for (auto handle: account_patches) { + FunctionPatcher_RemoveFunctionPatch(handle); + } + account_patches.clear(); +} diff --git a/src/patches/account_settings.h b/src/patches/account_settings.h index 6d09e68..4cc77be 100644 --- a/src/patches/account_settings.h +++ b/src/patches/account_settings.h @@ -17,4 +17,5 @@ bool isAccountSettingsTitle(); -bool patchAccountSettings(); \ No newline at end of file +bool patchAccountSettings(); +void unpatchAccountSettings(); diff --git a/src/patches/dns_hooks.cpp b/src/patches/dns_hooks.cpp index d832a57..d51520b 100644 --- a/src/patches/dns_hooks.cpp +++ b/src/patches/dns_hooks.cpp @@ -15,12 +15,16 @@ along with this program. If not, see . */ -#include #include -#include "utils/logger.h" + #include "config.h" +#include "utils/logger.h" #include +#include +#include + +std::vector dns_patches; const std::pair dns_replacements[] = { // NNCS servers @@ -42,10 +46,31 @@ static const char * replace_dns_name(const char *dns_name) { DECL_FUNCTION(struct hostent *, gethostbyname, const char *dns_name) { return real_gethostbyname(replace_dns_name(dns_name)); } -// might need a WUPS_MUST_REPLACE_FOR_PROCESS for Friends -WUPS_MUST_REPLACE(gethostbyname, WUPS_LOADER_LIBRARY_NSYSNET, gethostbyname); DECL_FUNCTION(int, getaddrinfo, const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res) { return real_getaddrinfo(replace_dns_name(node), service, hints, res); } -WUPS_MUST_REPLACE(getaddrinfo, WUPS_LOADER_LIBRARY_NSYSNET, getaddrinfo); \ No newline at end of file + +void patchDNS() { + dns_patches.reserve(2); + + auto add_patch = [](function_replacement_data_t repl, const char *name) { + PatchedFunctionHandle handle = 0; + if (FunctionPatcher_AddFunctionPatch(&repl, &handle, nullptr) != FUNCTION_PATCHER_RESULT_SUCCESS) { + DEBUG_FUNCTION_LINE("Inkay/DNS: Failed to patch %s!", name); + } + dns_patches.push_back(handle); + }; + + // might need a REPLACE_FUNCTION_FOR_PROCESS for Friends + add_patch(REPLACE_FUNCTION(gethostbyname, LIBRARY_NSYSNET, gethostbyname), "gethostbyname"); + + add_patch(REPLACE_FUNCTION(getaddrinfo, LIBRARY_NSYSNET, getaddrinfo), "getaddrinfo"); +} + +void unpatchDNS() { + for (auto handle: dns_patches) { + FunctionPatcher_RemoveFunctionPatch(handle); + } + dns_patches.clear(); +} diff --git a/src/patches/dns_hooks.h b/src/patches/dns_hooks.h new file mode 100644 index 0000000..9bbc216 --- /dev/null +++ b/src/patches/dns_hooks.h @@ -0,0 +1,20 @@ +/* Copyright 2024 Pretendo Network contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#pragma once + +void patchDNS(); +void unpatchDNS(); diff --git a/src/patches/eshop_applet.cpp b/src/patches/eshop_applet.cpp index d3ee43c..33467ac 100644 --- a/src/patches/eshop_applet.cpp +++ b/src/patches/eshop_applet.cpp @@ -21,7 +21,8 @@ #include "utils/logger.h" #include "utils/replace_mem.h" -#include +#include +#include #include #include #include @@ -47,6 +48,7 @@ const char whitelist_new[] = { }; static std::optional rootca_pem_handle{}; +std::vector eshop_patches; DECL_FUNCTION(int, FSOpenFile_eShop, FSClient *client, FSCmdBlock *block, char *path, const char *mode, uint32_t *handle, int error) { @@ -102,6 +104,25 @@ DECL_FUNCTION(FSStatus, FSCloseFile_eShop, FSClient *client, FSCmdBlock *block, return real_FSCloseFile_eShop(client, block, handle, errorMask); } -WUPS_MUST_REPLACE_FOR_PROCESS(FSOpenFile_eShop, WUPS_LOADER_LIBRARY_COREINIT, FSOpenFile, WUPS_FP_TARGET_PROCESS_ESHOP); -WUPS_MUST_REPLACE_FOR_PROCESS(FSReadFile_eShop, WUPS_LOADER_LIBRARY_COREINIT, FSReadFile, WUPS_FP_TARGET_PROCESS_ESHOP); -WUPS_MUST_REPLACE_FOR_PROCESS(FSCloseFile_eShop, WUPS_LOADER_LIBRARY_COREINIT, FSCloseFile, WUPS_FP_TARGET_PROCESS_ESHOP); +void patchEshop() { + eshop_patches.reserve(3); + + auto add_patch = [](function_replacement_data_t repl, const char *name) { + PatchedFunctionHandle handle = 0; + if (FunctionPatcher_AddFunctionPatch(&repl, &handle, nullptr) != FUNCTION_PATCHER_RESULT_SUCCESS) { + DEBUG_FUNCTION_LINE("Inkay/eShop: Failed to patch %s!", name); + } + eshop_patches.push_back(handle); + }; + + add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSOpenFile_eShop, LIBRARY_COREINIT, FSOpenFile, FP_TARGET_PROCESS_ESHOP), "FSOpenFile_eShop"); + add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSReadFile_eShop, LIBRARY_COREINIT, FSReadFile, FP_TARGET_PROCESS_ESHOP), "FSReadFile_eShop"); + add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSCloseFile_eShop, LIBRARY_COREINIT, FSCloseFile, FP_TARGET_PROCESS_ESHOP), "FSCloseFile_eShop"); +} + +void unpatchEshop() { + for (auto handle: eshop_patches) { + FunctionPatcher_RemoveFunctionPatch(handle); + } + eshop_patches.clear(); +} diff --git a/src/patches/eshop_applet.h b/src/patches/eshop_applet.h new file mode 100644 index 0000000..6f978ea --- /dev/null +++ b/src/patches/eshop_applet.h @@ -0,0 +1,20 @@ +/* Copyright 2024 Pretendo Network contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#pragma once + +void patchEshop(); +void unpatchEshop(); diff --git a/src/patches/game_matchmaking.cpp b/src/patches/game_matchmaking.cpp index c78d56c..fe26eed 100644 --- a/src/patches/game_matchmaking.cpp +++ b/src/patches/game_matchmaking.cpp @@ -16,8 +16,8 @@ along with this program. If not, see . */ -#include "game_matchmaking.h" #include "config.h" +#include "game_matchmaking.h" #include "utils/logger.h" #include "ini.h" diff --git a/src/patches/olv_applet.cpp b/src/patches/olv_applet.cpp index 9bafd44..256b3fd 100644 --- a/src/patches/olv_applet.cpp +++ b/src/patches/olv_applet.cpp @@ -21,11 +21,12 @@ #include "utils/logger.h" #include "utils/replace_mem.h" -#include +#include #include #include #include #include +#include #include "ca_pem.h" // generated at buildtime @@ -65,6 +66,7 @@ const replacement replacements[] = { }; static std::optional rootca_pem_handle{}; +std::vector olv_patches; DECL_FUNCTION(int, FSOpenFile, FSClient *client, FSCmdBlock *block, char *path, const char *mode, uint32_t *handle, int error) { @@ -123,6 +125,25 @@ DECL_FUNCTION(FSStatus, FSCloseFile, FSClient *client, FSCmdBlock *block, FSFile return real_FSCloseFile(client, block, handle, errorMask); } -WUPS_MUST_REPLACE_FOR_PROCESS(FSOpenFile, WUPS_LOADER_LIBRARY_COREINIT, FSOpenFile, WUPS_FP_TARGET_PROCESS_MIIVERSE); -WUPS_MUST_REPLACE_FOR_PROCESS(FSReadFile, WUPS_LOADER_LIBRARY_COREINIT, FSReadFile, WUPS_FP_TARGET_PROCESS_MIIVERSE); -WUPS_MUST_REPLACE_FOR_PROCESS(FSCloseFile, WUPS_LOADER_LIBRARY_COREINIT, FSCloseFile, WUPS_FP_TARGET_PROCESS_MIIVERSE); +void patchOlvApplet() { + olv_patches.reserve(3); + + auto add_patch = [](function_replacement_data_t repl, const char *name) { + PatchedFunctionHandle handle = 0; + if (FunctionPatcher_AddFunctionPatch(&repl, &handle, nullptr) != FUNCTION_PATCHER_RESULT_SUCCESS) { + DEBUG_FUNCTION_LINE("Inkay/OLV: Failed to patch %s!", name); + } + olv_patches.push_back(handle); + }; + + add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSOpenFile, LIBRARY_COREINIT, FSOpenFile, FP_TARGET_PROCESS_MIIVERSE), "FSOpenFile"); + add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSReadFile, LIBRARY_COREINIT, FSReadFile, FP_TARGET_PROCESS_MIIVERSE), "FSReadFile"); + add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSCloseFile, LIBRARY_COREINIT, FSCloseFile, FP_TARGET_PROCESS_MIIVERSE), "FSCloseFile"); +} + +void unpatchOlvApplet() { + for (auto handle: olv_patches) { + FunctionPatcher_RemoveFunctionPatch(handle); + } + olv_patches.clear(); +} diff --git a/src/patches/olv_applet.h b/src/patches/olv_applet.h new file mode 100644 index 0000000..4f307c7 --- /dev/null +++ b/src/patches/olv_applet.h @@ -0,0 +1,20 @@ +/* Copyright 2024 Pretendo Network contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#pragma once + +void patchOlvApplet(); +void unpatchOlvApplet(); diff --git a/src/patches/olv_urls.cpp b/src/patches/olv_urls.cpp index 862453d..849d29b 100644 --- a/src/patches/olv_urls.cpp +++ b/src/patches/olv_urls.cpp @@ -16,8 +16,8 @@ along with this program. If not, see . */ -#include "olv_urls.h" #include "config.h" +#include "olv_urls.h" #include "utils/logger.h" #include "utils/replace_mem.h" diff --git a/src/utils/logger.h b/src/utils/logger.h index f7278b6..e26a487 100644 --- a/src/utils/logger.h +++ b/src/utils/logger.h @@ -14,15 +14,15 @@ extern "C" { #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__) #define OSFATAL_FUNCTION_LINE(FMT, ARGS...)do { \ - OSFatal_printf("[(P) Inkay][%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \ + OSFatal_printf("[(M) Inkay][%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \ } while (0) #define DEBUG_FUNCTION_LINE(FMT, ARGS...)do { \ - WHBLogPrintf("[(P) Inkay][%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \ + WHBLogPrintf("[(M) Inkay][%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \ } while (0); #define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...)do { \ - WHBLogWritef("[(P) Inkay][%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \ + WHBLogWritef("[(M) Inkay][%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \ } while (0); #ifdef DEBUG From 3460feeeafd212380c791c1b9c26a37e7acb4938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Tue, 29 Oct 2024 18:21:40 +0000 Subject: [PATCH 020/139] fix(Makefile): Replicate original compiler settings --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c645f43..8c961de 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ INCLUDES := src src/ext/inih #------------------------------------------------------------------------------- # options for code generation #------------------------------------------------------------------------------- -CFLAGS := -Wall -Wextra -O2 -ffunction-sections\ +CFLAGS := -Wall -O2 -ffunction-sections\ $(MACHDEP) CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__ @@ -36,7 +36,7 @@ CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__ CXXFLAGS := $(CFLAGS) -std=c++20 ASFLAGS := -g $(ARCH) -LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -T$(WUMS_ROOT)/share/libkernel.ld $(WUMSSPECS) +LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -Wl,-gc-sections -T$(WUMS_ROOT)/share/libkernel.ld $(WUMSSPECS) ifeq ($(DEBUG),1) CXXFLAGS += -DDEBUG -g From d3ff378cc49d782b41a15bec048499fce98c2b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Tue, 29 Oct 2024 18:22:37 +0000 Subject: [PATCH 021/139] chore: Remove unnecesary file `wut_extra.h` is only used in the plugin, not in the module. --- src/wut_extra.h | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 src/wut_extra.h diff --git a/src/wut_extra.h b/src/wut_extra.h deleted file mode 100644 index b6a65c3..0000000 --- a/src/wut_extra.h +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -#include -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -namespace nn::boss { - class Task { - public: - nn::act::PersistentId persistentId; - uint32_t unk1; - char task_name[8]; - uint64_t title_id; - uint32_t unk2; - uint32_t unk3; - }; - - static_assert(sizeof(Task) == 32, "nn::boss::Task must be 32 bytes."); -} - -extern "C" uint32_t Initialize__Q2_2nn4bossFv(); -extern "C" uint32_t Finalize__Q2_2nn4bossFv(); - -extern "C" void __ct__Q3_2nn4boss4TaskFv(nn::boss::Task *task); -extern "C" uint32_t Initialize__Q3_2nn4boss4TaskFPCcUi(nn::boss::Task *task, char const *, unsigned int); -extern "C" uint32_t Unregister__Q3_2nn4boss4TaskFv(nn::boss::Task *task); -extern "C" void __dt__Q3_2nn4boss4TaskFv(nn::boss::Task *task); -extern "C" uint32_t StartScheduling__Q3_2nn4boss4TaskFb(nn::boss::Task *task, bool queueTaskOnCall); -extern "C" uint32_t GetState__Q3_2nn4boss4TaskCFPUi(nn::boss::Task *task, uint32_t *outExecCount); -extern "C" uint32_t Run__Q3_2nn4boss4TaskFb(nn::boss::Task *task, bool unk); -extern "C" uint32_t UpdateIntervalSec__Q3_2nn4boss4TaskFUi(nn::boss::Task *task, uint32_t seconds); -extern "C" bool IsRegistered__Q3_2nn4boss4TaskCFv(nn::boss::Task *task); - -#ifdef __cplusplus -} -#endif From 7958373394bb6574cb09f67a535d481e49ef1ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Tue, 29 Oct 2024 18:24:13 +0000 Subject: [PATCH 022/139] feat: Improvements in module exports Add new `Inkay_GetStatus` which can be used for retrieving the status of the module. Also add better handling of module initialization, and show a notification from the plugin if the module can't be found. --- plugin/src/main.cpp | 1 + plugin/src/module.cpp | 37 +++++++++++++++++++++++++++++++++---- plugin/src/module.h | 10 ++++++++++ src/config.cpp | 2 ++ src/config.h | 4 ++++ src/export.h | 25 +++++++++++++++++++++++++ src/main.cpp | 31 ++++++++++++++++++++++++++++++- 7 files changed, 105 insertions(+), 5 deletions(-) create mode 100644 src/export.h diff --git a/plugin/src/main.cpp b/plugin/src/main.cpp index 5cb5b19..dfb4ba6 100644 --- a/plugin/src/main.cpp +++ b/plugin/src/main.cpp @@ -77,6 +77,7 @@ INITIALIZE_PLUGIN() { } DEINITIALIZE_PLUGIN() { + Inkay_Finalize(); NotificationModule_DeInitLibrary(); WHBLogCafeDeinit(); diff --git a/plugin/src/module.cpp b/plugin/src/module.cpp index 6a201fa..4e3fb8e 100644 --- a/plugin/src/module.cpp +++ b/plugin/src/module.cpp @@ -14,25 +14,54 @@ along with this program. If not, see . */ +#include "module.h" #include +#include "Notification.h" #include "utils/logger.h" +static OSDynLoad_Module module; +static void (*moduleInitialize)(bool) = nullptr; +static InkayStatus (*moduleGetStatus)() = nullptr; + void Inkay_Initialize(bool apply_patches) { - OSDynLoad_Module module; - void (*moduleInitialize)(bool) = nullptr; + if (module) { + return; + } if (OSDynLoad_Acquire("inkay", &module) != OS_DYNLOAD_OK) { DEBUG_FUNCTION_LINE("Failed to acquire module"); + ShowNotification("Cannot find Inkay module. Ensure the Inkay module is properly installed"); return; } if (OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_Initialize", reinterpret_cast(&moduleInitialize)) != OS_DYNLOAD_OK) { DEBUG_FUNCTION_LINE("Failed to find initialization function"); + ShowNotification("Cannot find Inkay module initialization function. Ensure the Inkay module is properly installed"); + OSDynLoad_Release(module); return; } moduleInitialize(apply_patches); - - OSDynLoad_Release(module); +} + +void Inkay_Finalize() { + if (module) { + OSDynLoad_Release(module); + moduleInitialize = nullptr; + moduleGetStatus = nullptr; + } +} + +InkayStatus Inkay_GetStatus() { + if (!module) { + return InkayStatus::Error; + } + + if (!moduleGetStatus && OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_GetStatus", reinterpret_cast(&moduleGetStatus)) != OS_DYNLOAD_OK) { + DEBUG_FUNCTION_LINE("Failed to find status function"); + return InkayStatus::Error; + } + + return moduleGetStatus(); } diff --git a/plugin/src/module.h b/plugin/src/module.h index 3da8b0a..b6247a4 100644 --- a/plugin/src/module.h +++ b/plugin/src/module.h @@ -16,4 +16,14 @@ #pragma once +enum class InkayStatus { + Uninitialized, ///< The module isn't initialized + Nintendo, ///< The module is initialized but hasn't applied any patches + Pretendo, ///< The module is initialized and has applied the Pretendo patches + + Error = -1 ///< Failed to retrieve the module status +}; + void Inkay_Initialize(bool apply_patches); +void Inkay_Finalize(); +InkayStatus Inkay_GetStatus(); diff --git a/src/config.cpp b/src/config.cpp index 4923515..67519c8 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -18,6 +18,8 @@ #include "config.h" bool Config::connect_to_network = false; +bool Config::initialized = false; +bool Config::shown_uninitialized_warning = false; static config_strings strings; diff --git a/src/config.h b/src/config.h index 99b2bdc..b816876 100644 --- a/src/config.h +++ b/src/config.h @@ -11,6 +11,10 @@ class Config { public: static bool connect_to_network; + + static bool initialized; + + static bool shown_uninitialized_warning; }; struct config_strings { diff --git a/src/export.h b/src/export.h new file mode 100644 index 0000000..ecc7d99 --- /dev/null +++ b/src/export.h @@ -0,0 +1,25 @@ +/* Copyright 2024 Pretendo Network contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#pragma once + +enum class InkayStatus { + Uninitialized, ///< The module isn't initialized + Nintendo, ///< The module is initialized but hasn't applied any patches + Pretendo, ///< The module is initialized and has applied the Pretendo patches + + Error = -1 ///< Failed to retrieve the module status +}; diff --git a/src/main.cpp b/src/main.cpp index c3bf833..0d2c066 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -32,6 +32,7 @@ #include #include #include +#include "export.h" #include "iosu_url_patches.h" #include "config.h" #include "Notification.h" @@ -60,7 +61,9 @@ WUMS_MODULE_VERSION(INKAY_VERSION); WUMS_MODULE_AUTHOR("Pretendo contributors"); WUMS_MODULE_LICENSE("GPLv3"); -WUPS_USE_STORAGE("inkay"); +WUMS_DEPENDS_ON(homebrew_functionpatcher); +WUMS_DEPENDS_ON(homebrew_kernel); +WUMS_DEPENDS_ON(homebrew_notifications); WUMS_USE_WUT_DEVOPTAB(); @@ -114,7 +117,21 @@ static const char *get_pretendo_message() { return get_config_strings(get_system_language()).using_pretendo_network.data(); } +static InkayStatus Inkay_GetStatus() { + if (!Config::initialized) + return InkayStatus::Uninitialized; + + if (Config::connect_to_network) { + return InkayStatus::Pretendo; + } else { + return InkayStatus::Nintendo; + } +} + static void Inkay_Initialize(bool apply_patches) { + if (Config::initialized) + return; + // if using pretendo then (try to) apply the ssl patches if (apply_patches) { Config::connect_to_network = true; @@ -135,10 +152,12 @@ static void Inkay_Initialize(bool apply_patches) { DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches applied successfully."); ShowNotification(get_pretendo_message()); + Config::initialized = true; } else { DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches skipped."); ShowNotification(get_nintendo_network_message()); + Config::initialized = true; return; } @@ -186,6 +205,15 @@ WUMS_DEINITIALIZE() { WUMS_APPLICATION_STARTS() { DEBUG_FUNCTION_LINE_VERBOSE("Inkay " INKAY_VERSION " starting up...\n"); + // TODO - Add a way to reliably check this. We can't do it here since this path gets triggered before + // the plugin gets initialized. + // + // if (!Config::initialized && !Config::shown_uninitialized_warning) { + // DEBUG_FUNCTION_LINE("Inkay module not initialized"); + // ShowNotification("Inkay module was not initialized. Ensure you have the Inkay plugin loaded"); + // Config::shown_uninitialized_warning = true; + // } + setup_olv_libs(); peertopeer_patch(); matchmaking_notify_titleswitch(); @@ -200,3 +228,4 @@ WUMS_APPLICATION_ENDS() { } WUMS_EXPORT_FUNCTION(Inkay_Initialize); +WUMS_EXPORT_FUNCTION(Inkay_GetStatus); From 68bc066c7bb06a9f69a76e5d5ca0febbfb026b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Tue, 29 Oct 2024 19:00:22 +0000 Subject: [PATCH 023/139] feat: Add translation for module not found errors --- plugin/src/config.h | 2 ++ plugin/src/module.cpp | 14 ++++++++++++-- src/config.h | 2 ++ src/lang/de_DE.lang | 2 ++ src/lang/en_US.lang | 2 ++ src/lang/es_ES.lang | 2 ++ src/lang/fr_FR.lang | 2 ++ src/lang/it_IT.lang | 2 ++ src/lang/ja_JP.lang | 2 ++ src/lang/nl_NL.lang | 2 ++ src/lang/pt_BR.lang | 2 ++ src/lang/ru_RU.lang | 2 ++ src/lang/zh_CN.lang | 2 ++ src/lang/zh_Hant.lang | 2 ++ 14 files changed, 38 insertions(+), 2 deletions(-) diff --git a/plugin/src/config.h b/plugin/src/config.h index 2fa9812..845f9f5 100644 --- a/plugin/src/config.h +++ b/plugin/src/config.h @@ -35,6 +35,8 @@ struct config_strings { std::string_view need_menu_action; std::string_view using_nintendo_network; std::string_view using_pretendo_network; + std::string_view module_not_found; + std::string_view module_init_not_found; }; config_strings get_config_strings(nn::swkbd::LanguageType language); diff --git a/plugin/src/module.cpp b/plugin/src/module.cpp index 4e3fb8e..77a2249 100644 --- a/plugin/src/module.cpp +++ b/plugin/src/module.cpp @@ -17,13 +17,23 @@ #include "module.h" #include +#include "config.h" #include "Notification.h" #include "utils/logger.h" +#include "utils/sysconfig.h" static OSDynLoad_Module module; static void (*moduleInitialize)(bool) = nullptr; static InkayStatus (*moduleGetStatus)() = nullptr; +static const char *get_module_not_found_message() { + return get_config_strings(get_system_language()).module_not_found.data(); +} + +static const char *get_module_init_not_found_message() { + return get_config_strings(get_system_language()).module_init_not_found.data(); +} + void Inkay_Initialize(bool apply_patches) { if (module) { return; @@ -31,13 +41,13 @@ void Inkay_Initialize(bool apply_patches) { if (OSDynLoad_Acquire("inkay", &module) != OS_DYNLOAD_OK) { DEBUG_FUNCTION_LINE("Failed to acquire module"); - ShowNotification("Cannot find Inkay module. Ensure the Inkay module is properly installed"); + ShowNotification(get_module_not_found_message()); return; } if (OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_Initialize", reinterpret_cast(&moduleInitialize)) != OS_DYNLOAD_OK) { DEBUG_FUNCTION_LINE("Failed to find initialization function"); - ShowNotification("Cannot find Inkay module initialization function. Ensure the Inkay module is properly installed"); + ShowNotification(get_module_init_not_found_message()); OSDynLoad_Release(module); return; } diff --git a/src/config.h b/src/config.h index b816876..3d6f08f 100644 --- a/src/config.h +++ b/src/config.h @@ -29,6 +29,8 @@ struct config_strings { std::string_view using_nintendo_network; std::string_view using_pretendo_network; std::string_view multiplayer_port_display; + std::string_view module_not_found; + std::string_view module_init_not_found; }; config_strings get_config_strings(nn::swkbd::LanguageType language); diff --git a/src/lang/de_DE.lang b/src/lang/de_DE.lang index 1bfb5e8..a3485cb 100644 --- a/src/lang/de_DE.lang +++ b/src/lang/de_DE.lang @@ -8,3 +8,5 @@ ,.need_menu_action = "Nur vom Wii U-Menü aus" ,.using_nintendo_network = "Nutze Nintendo Network" ,.using_pretendo_network = "Nutze Pretendo Network" +,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" +,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/en_US.lang b/src/lang/en_US.lang index ed0e423..aa02d40 100644 --- a/src/lang/en_US.lang +++ b/src/lang/en_US.lang @@ -9,3 +9,5 @@ ,.using_nintendo_network = "Using Nintendo Network" ,.using_pretendo_network = "Using Pretendo Network" ,.multiplayer_port_display = "Using UDP port {} for multiplayer" +,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" +,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/es_ES.lang b/src/lang/es_ES.lang index c6e9188..e03dd7f 100644 --- a/src/lang/es_ES.lang +++ b/src/lang/es_ES.lang @@ -8,3 +8,5 @@ ,.need_menu_action="Solo desde el Menú de Wii U" ,.using_nintendo_network="Usando Nintendo Network" ,.using_pretendo_network="Usando Pretendo Network" +,.module_not_found="No se pudo encontrar el módulo Inkay. Confirme que el módulo Inkay está instalado correctamente" +,.module_init_not_found="No se pudo inicializar el módulo Inkay. Confirme que el módulo Inkay está instalado correctamente" diff --git a/src/lang/fr_FR.lang b/src/lang/fr_FR.lang index 1f8eda7..88776de 100644 --- a/src/lang/fr_FR.lang +++ b/src/lang/fr_FR.lang @@ -8,3 +8,5 @@ ,.need_menu_action = "Depuis le menu Wii U seulement" ,.using_nintendo_network = "Sur Nintendo Network" ,.using_pretendo_network = "Sur Pretendo Network" +,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" +,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/it_IT.lang b/src/lang/it_IT.lang index 7dbf2ff..d77bc19 100644 --- a/src/lang/it_IT.lang +++ b/src/lang/it_IT.lang @@ -8,3 +8,5 @@ ,.need_menu_action = "Solo dal menu WiiU" ,.using_nintendo_network = "Usando Nintendo Network" ,.using_pretendo_network = "Usando Pretendo Network" +,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" +,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/ja_JP.lang b/src/lang/ja_JP.lang index 1e88f5a..8740611 100644 --- a/src/lang/ja_JP.lang +++ b/src/lang/ja_JP.lang @@ -8,3 +8,5 @@ ,.need_menu_action = "WiiUメニューからのみ実行可能" ,.using_nintendo_network = "ニンテンドーネットワークを使用中" ,.using_pretendo_network = "Pretendoネットワークを使用中" +,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" +,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/nl_NL.lang b/src/lang/nl_NL.lang index 6d15650..ef23280 100644 --- a/src/lang/nl_NL.lang +++ b/src/lang/nl_NL.lang @@ -8,3 +8,5 @@ ,.need_menu_action = "Alleen vanuit het WiiU-menu" ,.using_nintendo_network = "Nintendo Network wordt gebruikt" ,.using_pretendo_network = "Pretendo Network wordt gebruikt" +,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" +,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/pt_BR.lang b/src/lang/pt_BR.lang index 5e60a59..17a4714 100644 --- a/src/lang/pt_BR.lang +++ b/src/lang/pt_BR.lang @@ -8,3 +8,5 @@ ,.need_menu_action = "Apenas no menu do Wii U" ,.using_nintendo_network = "Usando Nintendo Network" ,.using_pretendo_network = "Usando Pretendo Network" +,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" +,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/ru_RU.lang b/src/lang/ru_RU.lang index 966166b..575c06d 100644 --- a/src/lang/ru_RU.lang +++ b/src/lang/ru_RU.lang @@ -8,3 +8,5 @@ ,.need_menu_action = "Только из меню Wii U" ,.using_nintendo_network = "Используется Nintendo Network" ,.using_pretendo_network = "Используется Pretendo Network" +,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" +,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/zh_CN.lang b/src/lang/zh_CN.lang index df1bc5a..671122d 100644 --- a/src/lang/zh_CN.lang +++ b/src/lang/zh_CN.lang @@ -8,3 +8,5 @@ ,.need_menu_action = "仅来自WiiU Menu" ,.using_nintendo_network = "使用 Nintendo Network" ,.using_pretendo_network = "使用 Pretendo Network" +,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" +,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/zh_Hant.lang b/src/lang/zh_Hant.lang index ec3a0ad..d831cc2 100644 --- a/src/lang/zh_Hant.lang +++ b/src/lang/zh_Hant.lang @@ -8,3 +8,5 @@ ,.need_menu_action = "僅來自WiiU Menu" ,.using_nintendo_network = "使用 Nintendo Network" ,.using_pretendo_network = "使用 Pretendo Network" +,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" +,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" From ea71879bb1246cb7bee614add70ce059e292d8b0 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Thu, 21 Nov 2024 13:19:06 +1100 Subject: [PATCH 024/139] chore: Introduce common directory to deduplicate shared code --- Makefile | 6 +-- {plugin/src => common}/Notification.cpp | 0 {plugin/src => common}/Notification.h | 0 common/lang.cpp | 44 +++++++++++++++++++ common/lang.h | 22 ++++++++++ {src/utils => common}/sysconfig.cpp | 22 ++++++++-- {src/utils => common}/sysconfig.h | 1 + {src => common}/utils/scope_exit.h | 0 plugin/Makefile | 4 +- plugin/src/config.cpp | 54 ++++++----------------- plugin/src/config.h | 20 --------- plugin/src/main.cpp | 25 +---------- plugin/src/module.cpp | 3 +- plugin/src/utils/sysconfig.cpp | 57 ------------------------- plugin/src/utils/sysconfig.h | 12 ------ src/Notification.cpp | 31 -------------- src/Notification.h | 3 -- src/config.cpp | 41 ------------------ src/config.h | 18 -------- src/main.cpp | 3 +- src/patches/game_peertopeer.cpp | 21 +-------- src/patches/game_peertopeer.h | 1 - 22 files changed, 110 insertions(+), 278 deletions(-) rename {plugin/src => common}/Notification.cpp (100%) rename {plugin/src => common}/Notification.h (100%) create mode 100644 common/lang.cpp create mode 100644 common/lang.h rename {src/utils => common}/sysconfig.cpp (83%) rename {src/utils => common}/sysconfig.h (86%) rename {src => common}/utils/scope_exit.h (100%) delete mode 100644 plugin/src/utils/sysconfig.cpp delete mode 100644 plugin/src/utils/sysconfig.h delete mode 100644 src/Notification.cpp delete mode 100644 src/Notification.h diff --git a/Makefile b/Makefile index 8c961de..72a3a66 100644 --- a/Makefile +++ b/Makefile @@ -21,9 +21,9 @@ WUT_ROOT := $(DEVKITPRO)/wut #------------------------------------------------------------------------------- TARGET := Inkay-pretendo BUILD := build -SOURCES := src src/patches src/utils src/ext/inih +SOURCES := src src/patches src/utils src/ext/inih common DATA := data -INCLUDES := src src/ext/inih +INCLUDES := src src/ext/inih src/lang common #------------------------------------------------------------------------------- # options for code generation @@ -103,7 +103,7 @@ all: $(BUILD) $(BUILD): - @[ -d $@ ] || mkdir -p $@ + @$(shell [ ! -d $(BUILD) ] && mkdir -p $(BUILD)) @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile @$(MAKE) --no-print-directory -C $(CURDIR)/plugin -f $(CURDIR)/plugin/Makefile mkdir -p dist/ diff --git a/plugin/src/Notification.cpp b/common/Notification.cpp similarity index 100% rename from plugin/src/Notification.cpp rename to common/Notification.cpp diff --git a/plugin/src/Notification.h b/common/Notification.h similarity index 100% rename from plugin/src/Notification.h rename to common/Notification.h diff --git a/common/lang.cpp b/common/lang.cpp new file mode 100644 index 0000000..3f32b17 --- /dev/null +++ b/common/lang.cpp @@ -0,0 +1,44 @@ +// +// Created by ash on 21/11/24. +// + +#include "lang.h" + +config_strings get_config_strings(nn::swkbd::LanguageType language) { + switch (language) { + case nn::swkbd::LanguageType::English: + default: return { +#include "en_US.lang" + }; + case nn::swkbd::LanguageType::Spanish: return { +#include "es_ES.lang" + }; + case nn::swkbd::LanguageType::French: return { +#include "fr_FR.lang" + }; + case nn::swkbd::LanguageType::Italian: return { +#include "it_IT.lang" + }; + case nn::swkbd::LanguageType::German: return { +#include "de_DE.lang" + }; + case nn::swkbd::LanguageType::SimplifiedChinese: return { +#include "zh_CN.lang" + }; + case nn::swkbd::LanguageType::TraditionalChinese: return { +#include "zh_Hant.lang" + }; + case nn::swkbd::LanguageType::Portuguese: return { +#include "pt_BR.lang" + }; + case nn::swkbd::LanguageType::Japanese: return { +#include "ja_JP.lang" + }; + case nn::swkbd::LanguageType::Dutch: return { +#include "nl_NL.lang" + }; + case nn::swkbd::LanguageType::Russian: return { +#include "ru_RU.lang" + }; + } +} diff --git a/common/lang.h b/common/lang.h new file mode 100644 index 0000000..6e557fe --- /dev/null +++ b/common/lang.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include + +struct config_strings { + const char *plugin_name; + std::string_view network_category; + std::string_view connect_to_network_setting; + std::string_view other_category; + std::string_view reset_wwp_setting; + std::string_view press_a_action; + std::string_view restart_to_apply_action; + std::string_view need_menu_action; + std::string_view using_nintendo_network; + std::string_view using_pretendo_network; + std::string_view multiplayer_port_display; + std::string_view module_not_found; + std::string_view module_init_not_found; +}; + +config_strings get_config_strings(nn::swkbd::LanguageType language); diff --git a/src/utils/sysconfig.cpp b/common/sysconfig.cpp similarity index 83% rename from src/utils/sysconfig.cpp rename to common/sysconfig.cpp index 97ae4a3..102a3cf 100644 --- a/src/utils/sysconfig.cpp +++ b/common/sysconfig.cpp @@ -1,6 +1,5 @@ /* Copyright 2024 Pretendo Network contributors Copyright 2024 Ash Logan - Copyright 2023 Maschell Copyright 2020-2022 V10lator Copyright 2022 Xpl0itU @@ -81,8 +80,8 @@ static void get_mcp_config() { mcp_os_version = os_version; DEBUG_FUNCTION_LINE_VERBOSE("Running on %d.%d.%d%c; %s%s", - os_version.major, os_version.minor, os_version.patch, os_version.region - config.code_id, config.serial_id + os_version.major, os_version.minor, os_version.patch, os_version.region + config.code_id, config.serial_id ); } @@ -97,3 +96,20 @@ MCPSystemVersion get_console_os_version() { return mcp_os_version.value_or((MCPSystemVersion) { .major = 5, .minor = 5, .patch = 5, .region = 'E' }); } + +static inline int digit(char a) { + if (a < '0' || a > '9') return 0; + return a - '0'; +} + +unsigned short get_console_peertopeer_port() { + const char * serial = get_console_serial(); + + unsigned short port = 50000 + + (digit(serial[4]) * 1000) + + (digit(serial[5]) * 100 ) + + (digit(serial[6]) * 10 ) + + (digit(serial[7]) * 1 ); + + return port; +} diff --git a/src/utils/sysconfig.h b/common/sysconfig.h similarity index 86% rename from src/utils/sysconfig.h rename to common/sysconfig.h index 3b3e075..d517fc7 100644 --- a/src/utils/sysconfig.h +++ b/common/sysconfig.h @@ -11,5 +11,6 @@ nn::swkbd::LanguageType get_system_language(); const char * get_console_serial(); MCPSystemVersion get_console_os_version(); +unsigned short get_console_peertopeer_port(); #endif //INKAY_SYSCONFIG_H diff --git a/src/utils/scope_exit.h b/common/utils/scope_exit.h similarity index 100% rename from src/utils/scope_exit.h rename to common/utils/scope_exit.h diff --git a/plugin/Makefile b/plugin/Makefile index 125fb0c..fee7a0b 100644 --- a/plugin/Makefile +++ b/plugin/Makefile @@ -21,9 +21,9 @@ WUMS_ROOT := $(DEVKITPRO)/wums #------------------------------------------------------------------------------- TARGET := Inkay-pretendo BUILD := build -SOURCES := src src/utils +SOURCES := src src/utils ../common DATA := data -INCLUDES := src ../src/lang +INCLUDES := src ../src/lang ../common #DEBUG := 1 #------------------------------------------------------------------------------- diff --git a/plugin/src/config.cpp b/plugin/src/config.cpp index a0fc590..5ce07a8 100644 --- a/plugin/src/config.cpp +++ b/plugin/src/config.cpp @@ -19,65 +19,29 @@ #include "wut_extra.h" #include "utils/logger.h" -#include "utils/sysconfig.h" +#include "sysconfig.h" +#include "lang.h" #include #include #include #include +#include #include #include #include #include #include +#include + +static config_strings strings; bool Config::connect_to_network = true; bool Config::need_relaunch = false; bool Config::unregister_task_item_pressed = false; bool Config::is_wiiu_menu = false; -static config_strings strings; - -config_strings get_config_strings(nn::swkbd::LanguageType language) { - switch (language) { - case nn::swkbd::LanguageType::English: - default: return { -#include "en_US.lang" - }; - case nn::swkbd::LanguageType::Spanish: return { -#include "es_ES.lang" - }; - case nn::swkbd::LanguageType::French: return { -#include "fr_FR.lang" - }; - case nn::swkbd::LanguageType::Italian: return { -#include "it_IT.lang" - }; - case nn::swkbd::LanguageType::German: return { -#include "de_DE.lang" - }; - case nn::swkbd::LanguageType::SimplifiedChinese: return { -#include "zh_CN.lang" - }; - case nn::swkbd::LanguageType::TraditionalChinese: return { -#include "zh_Hant.lang" - }; - case nn::swkbd::LanguageType::Portuguese: return { -#include "pt_BR.lang" - }; - case nn::swkbd::LanguageType::Japanese: return { -#include "ja_JP.lang" - }; - case nn::swkbd::LanguageType::Dutch: return { -#include "nl_NL.lang" - }; - case nn::swkbd::LanguageType::Russian: return { -#include "ru_RU.lang" - }; - } -} - static WUPSConfigAPICallbackStatus report_error(WUPSConfigAPIStatus err) { DEBUG_FUNCTION_LINE_VERBOSE("WUPS config error: %s", WUPSConfigAPI_GetStatusStr(err)); return WUPSCONFIG_API_CALLBACK_RESULT_ERROR; @@ -174,6 +138,12 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa res = network_cat->add(std::move(*connect_item), err); if (!res) return report_error(err); + { + std::string multiplayer_port_text = std::vformat(strings.multiplayer_port_display, std::make_format_args(get_console_peertopeer_port())); + res = network_cat->add(WUPSConfigItemStub::Create(multiplayer_port_text), err); + if (!res) return report_error(err); + } + res = root.add(std::move(*network_cat), err); if (!res) return report_error(err); diff --git a/plugin/src/config.h b/plugin/src/config.h index 845f9f5..0928d5e 100644 --- a/plugin/src/config.h +++ b/plugin/src/config.h @@ -5,9 +5,6 @@ #ifndef INKAY_CONFIG_H #define INKAY_CONFIG_H -#include -#include - class Config { public: static void Init(); @@ -24,21 +21,4 @@ public: static bool unregister_task_item_pressed; }; -struct config_strings { - const char *plugin_name; - std::string_view network_category; - std::string_view connect_to_network_setting; - std::string_view other_category; - std::string_view reset_wwp_setting; - std::string_view press_a_action; - std::string_view restart_to_apply_action; - std::string_view need_menu_action; - std::string_view using_nintendo_network; - std::string_view using_pretendo_network; - std::string_view module_not_found; - std::string_view module_init_not_found; -}; - -config_strings get_config_strings(nn::swkbd::LanguageType language); - #endif //INKAY_CONFIG_H diff --git a/plugin/src/main.cpp b/plugin/src/main.cpp index dfb4ba6..4845a38 100644 --- a/plugin/src/main.cpp +++ b/plugin/src/main.cpp @@ -16,33 +16,12 @@ along with this program. If not, see . */ -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + #include #include #include "config.h" #include "module.h" -#include "Notification.h" - -#include -#include -#include -#include -#include - -#include #define INKAY_VERSION "v2.6.0" @@ -60,8 +39,6 @@ WUPS_USE_STORAGE("inkay"); WUPS_USE_WUT_DEVOPTAB(); -#include "utils/sysconfig.h" - INITIALIZE_PLUGIN() { WHBLogCafeInit(); WHBLogUdpInit(); diff --git a/plugin/src/module.cpp b/plugin/src/module.cpp index 77a2249..5fd9c2a 100644 --- a/plugin/src/module.cpp +++ b/plugin/src/module.cpp @@ -20,7 +20,8 @@ #include "config.h" #include "Notification.h" #include "utils/logger.h" -#include "utils/sysconfig.h" +#include "sysconfig.h" +#include "lang.h" static OSDynLoad_Module module; static void (*moduleInitialize)(bool) = nullptr; diff --git a/plugin/src/utils/sysconfig.cpp b/plugin/src/utils/sysconfig.cpp deleted file mode 100644 index cef6d78..0000000 --- a/plugin/src/utils/sysconfig.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright 2024 Pretendo Network contributors - Copyright 2024 Ash Logan - Copyright 2020-2022 V10lator - Copyright 2022 Xpl0itU - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "sysconfig.h" -#include "utils/logger.h" - -#include -#include - -nn::swkbd::LanguageType get_system_language() { - static std::optional cached_language{}; - if (cached_language) return *cached_language; - - UCHandle handle = UCOpen(); - if (handle >= 0) { - nn::swkbd::LanguageType language; - - UCSysConfig settings __attribute__((__aligned__(0x40))) = { - .name = "cafe.language", - .access = 0, - .dataType = UC_DATATYPE_UNSIGNED_INT, - .error = UC_ERROR_OK, - .dataSize = sizeof(language), - .data = &language, - }; - - UCError err = UCReadSysConfig(handle, 1, &settings); - UCClose(handle); - if (err != UC_ERROR_OK) { - DEBUG_FUNCTION_LINE("Error reading UC: %d!", err); - return nn::swkbd::LanguageType::English; - } else { - DEBUG_FUNCTION_LINE_VERBOSE("System language found: %d", language); - cached_language = language; - return language; - } - } else { - DEBUG_FUNCTION_LINE("Error opening UC: %d", handle); - return nn::swkbd::LanguageType::English; - } -} diff --git a/plugin/src/utils/sysconfig.h b/plugin/src/utils/sysconfig.h deleted file mode 100644 index 3bac817..0000000 --- a/plugin/src/utils/sysconfig.h +++ /dev/null @@ -1,12 +0,0 @@ -// -// Created by ash on 9/04/24. -// - -#ifndef INKAY_SYSCONFIG_H -#define INKAY_SYSCONFIG_H - -#include - -nn::swkbd::LanguageType get_system_language(); - -#endif //INKAY_SYSCONFIG_H diff --git a/src/Notification.cpp b/src/Notification.cpp deleted file mode 100644 index cc6177e..0000000 --- a/src/Notification.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2024 Pretendo Network contributors - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "Notification.h" -#include -#include - -void ShowNotification(const char* notification) { - auto err1 = NotificationModule_SetDefaultValue(NOTIFICATION_MODULE_NOTIFICATION_TYPE_INFO, - NOTIFICATION_MODULE_DEFAULT_OPTION_KEEP_UNTIL_SHOWN, true); - auto err2 = NotificationModule_SetDefaultValue(NOTIFICATION_MODULE_NOTIFICATION_TYPE_INFO, - NOTIFICATION_MODULE_DEFAULT_OPTION_DURATION_BEFORE_FADE_OUT, - 15.0f); - - if (err1 != NOTIFICATION_MODULE_RESULT_SUCCESS || err2 != NOTIFICATION_MODULE_RESULT_SUCCESS) return; - - NotificationModule_AddInfoNotification(notification); -} diff --git a/src/Notification.h b/src/Notification.h deleted file mode 100644 index ebdc7a3..0000000 --- a/src/Notification.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -void ShowNotification(const char* notification); diff --git a/src/config.cpp b/src/config.cpp index 67519c8..56c8740 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -20,44 +20,3 @@ bool Config::connect_to_network = false; bool Config::initialized = false; bool Config::shown_uninitialized_warning = false; - -static config_strings strings; - -config_strings get_config_strings(nn::swkbd::LanguageType language) { - switch (language) { - case nn::swkbd::LanguageType::English: - default: return { -#include "lang/en_US.lang" - }; - case nn::swkbd::LanguageType::Spanish: return { -#include "lang/es_ES.lang" - }; - case nn::swkbd::LanguageType::French: return { -#include "lang/fr_FR.lang" - }; - case nn::swkbd::LanguageType::Italian: return { -#include "lang/it_IT.lang" - }; - case nn::swkbd::LanguageType::German: return { -#include "lang/de_DE.lang" - }; - case nn::swkbd::LanguageType::SimplifiedChinese: return { -#include "lang/zh_CN.lang" - }; - case nn::swkbd::LanguageType::TraditionalChinese: return { -#include "lang/zh_Hant.lang" - }; - case nn::swkbd::LanguageType::Portuguese: return { -#include "lang/pt_BR.lang" - }; - case nn::swkbd::LanguageType::Japanese: return { -#include "lang/ja_JP.lang" - }; - case nn::swkbd::LanguageType::Dutch: return { -#include "lang/nl_NL.lang" - }; - case nn::swkbd::LanguageType::Russian: return { -#include "lang/ru_RU.lang" - }; - } -} diff --git a/src/config.h b/src/config.h index 3d6f08f..96f6775 100644 --- a/src/config.h +++ b/src/config.h @@ -17,22 +17,4 @@ public: static bool shown_uninitialized_warning; }; -struct config_strings { - const char *plugin_name; - std::string_view network_category; - std::string_view connect_to_network_setting; - std::string_view other_category; - std::string_view reset_wwp_setting; - std::string_view press_a_action; - std::string_view restart_to_apply_action; - std::string_view need_menu_action; - std::string_view using_nintendo_network; - std::string_view using_pretendo_network; - std::string_view multiplayer_port_display; - std::string_view module_not_found; - std::string_view module_init_not_found; -}; - -config_strings get_config_strings(nn::swkbd::LanguageType language); - #endif //INKAY_CONFIG_H diff --git a/src/main.cpp b/src/main.cpp index 0d2c066..12ba0e8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -75,7 +75,8 @@ WUMS_USE_WUT_DEVOPTAB(); #include "patches/eshop_applet.h" #include "patches/olv_applet.h" #include "patches/game_peertopeer.h" -#include "utils/sysconfig.h" +#include "sysconfig.h" +#include "lang.h" //thanks @Gary#4139 :p static void write_string(uint32_t addr, const char *str) { diff --git a/src/patches/game_peertopeer.cpp b/src/patches/game_peertopeer.cpp index 01a6fc6..c464117 100644 --- a/src/patches/game_peertopeer.cpp +++ b/src/patches/game_peertopeer.cpp @@ -15,30 +15,13 @@ #include #include "game_peertopeer.h" -#include "utils/sysconfig.h" +#include "sysconfig.h" #include "utils/logger.h" #include "utils/rpl_info.h" #include "utils/replace_mem.h" #include -static inline int digit(char a) { - if (a < '0' || a > '9') return 0; - return a - '0'; -} - -unsigned short peertopeer_port() { - const char * serial = get_console_serial(); - - unsigned short port = 50000 + - (digit(serial[4]) * 1000) + - (digit(serial[5]) * 100 ) + - (digit(serial[6]) * 10 ) + - (digit(serial[7]) * 1 ); - - return port; -} - static void minecraft_peertopeer_patch() { std::optional minecraft = search_for_rpl("Minecraft.Client.rpx"); if (!minecraft) { @@ -46,7 +29,7 @@ static void minecraft_peertopeer_patch() { return; } - auto port = peertopeer_port(); + auto port = get_console_peertopeer_port(); DEBUG_FUNCTION_LINE_VERBOSE("Will use port %d. %08x", port, minecraft->textAddr); uint32_t *target_func = rpl_addr(*minecraft, 0x03579530); diff --git a/src/patches/game_peertopeer.h b/src/patches/game_peertopeer.h index e26862b..8211c00 100644 --- a/src/patches/game_peertopeer.h +++ b/src/patches/game_peertopeer.h @@ -14,4 +14,3 @@ #pragma once void peertopeer_patch(); -unsigned short peertopeer_port(); From a710bd985a1af9bfee2479856f569af5eb787b62 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Thu, 21 Nov 2024 13:45:47 +1100 Subject: [PATCH 025/139] feat(lang): Tell users how to fix module-related errors Realistically, 99% of people will not know how to "ensure the inkay module is properly installed" - Aroma updater is designed to automatically fix random stuff like this It hashes every individual file so it will pick up SD card corruption, partial installs, etc --- src/lang/de_DE.lang | 2 -- src/lang/en_US.lang | 4 ++-- src/lang/es_ES.lang | 2 -- src/lang/fr_FR.lang | 2 -- src/lang/it_IT.lang | 2 -- src/lang/ja_JP.lang | 2 -- src/lang/nl_NL.lang | 2 -- src/lang/pt_BR.lang | 2 -- src/lang/ru_RU.lang | 2 -- src/lang/zh_CN.lang | 2 -- src/lang/zh_Hant.lang | 2 -- 11 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/lang/de_DE.lang b/src/lang/de_DE.lang index a3485cb..1bfb5e8 100644 --- a/src/lang/de_DE.lang +++ b/src/lang/de_DE.lang @@ -8,5 +8,3 @@ ,.need_menu_action = "Nur vom Wii U-Menü aus" ,.using_nintendo_network = "Nutze Nintendo Network" ,.using_pretendo_network = "Nutze Pretendo Network" -,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" -,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/en_US.lang b/src/lang/en_US.lang index aa02d40..29fb991 100644 --- a/src/lang/en_US.lang +++ b/src/lang/en_US.lang @@ -9,5 +9,5 @@ ,.using_nintendo_network = "Using Nintendo Network" ,.using_pretendo_network = "Using Pretendo Network" ,.multiplayer_port_display = "Using UDP port {} for multiplayer" -,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" -,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" +,.module_not_found = "Pretendo patch failed - use Aroma Updater to repair (686-1001 Module missing)" +,.module_init_not_found = "Pretendo patch failed - use Aroma Updater to repair (686-1002 Module init)" diff --git a/src/lang/es_ES.lang b/src/lang/es_ES.lang index e03dd7f..c6e9188 100644 --- a/src/lang/es_ES.lang +++ b/src/lang/es_ES.lang @@ -8,5 +8,3 @@ ,.need_menu_action="Solo desde el Menú de Wii U" ,.using_nintendo_network="Usando Nintendo Network" ,.using_pretendo_network="Usando Pretendo Network" -,.module_not_found="No se pudo encontrar el módulo Inkay. Confirme que el módulo Inkay está instalado correctamente" -,.module_init_not_found="No se pudo inicializar el módulo Inkay. Confirme que el módulo Inkay está instalado correctamente" diff --git a/src/lang/fr_FR.lang b/src/lang/fr_FR.lang index 88776de..1f8eda7 100644 --- a/src/lang/fr_FR.lang +++ b/src/lang/fr_FR.lang @@ -8,5 +8,3 @@ ,.need_menu_action = "Depuis le menu Wii U seulement" ,.using_nintendo_network = "Sur Nintendo Network" ,.using_pretendo_network = "Sur Pretendo Network" -,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" -,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/it_IT.lang b/src/lang/it_IT.lang index d77bc19..7dbf2ff 100644 --- a/src/lang/it_IT.lang +++ b/src/lang/it_IT.lang @@ -8,5 +8,3 @@ ,.need_menu_action = "Solo dal menu WiiU" ,.using_nintendo_network = "Usando Nintendo Network" ,.using_pretendo_network = "Usando Pretendo Network" -,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" -,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/ja_JP.lang b/src/lang/ja_JP.lang index 8740611..1e88f5a 100644 --- a/src/lang/ja_JP.lang +++ b/src/lang/ja_JP.lang @@ -8,5 +8,3 @@ ,.need_menu_action = "WiiUメニューからのみ実行可能" ,.using_nintendo_network = "ニンテンドーネットワークを使用中" ,.using_pretendo_network = "Pretendoネットワークを使用中" -,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" -,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/nl_NL.lang b/src/lang/nl_NL.lang index ef23280..6d15650 100644 --- a/src/lang/nl_NL.lang +++ b/src/lang/nl_NL.lang @@ -8,5 +8,3 @@ ,.need_menu_action = "Alleen vanuit het WiiU-menu" ,.using_nintendo_network = "Nintendo Network wordt gebruikt" ,.using_pretendo_network = "Pretendo Network wordt gebruikt" -,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" -,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/pt_BR.lang b/src/lang/pt_BR.lang index 17a4714..5e60a59 100644 --- a/src/lang/pt_BR.lang +++ b/src/lang/pt_BR.lang @@ -8,5 +8,3 @@ ,.need_menu_action = "Apenas no menu do Wii U" ,.using_nintendo_network = "Usando Nintendo Network" ,.using_pretendo_network = "Usando Pretendo Network" -,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" -,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/ru_RU.lang b/src/lang/ru_RU.lang index 575c06d..966166b 100644 --- a/src/lang/ru_RU.lang +++ b/src/lang/ru_RU.lang @@ -8,5 +8,3 @@ ,.need_menu_action = "Только из меню Wii U" ,.using_nintendo_network = "Используется Nintendo Network" ,.using_pretendo_network = "Используется Pretendo Network" -,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" -,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/zh_CN.lang b/src/lang/zh_CN.lang index 671122d..df1bc5a 100644 --- a/src/lang/zh_CN.lang +++ b/src/lang/zh_CN.lang @@ -8,5 +8,3 @@ ,.need_menu_action = "仅来自WiiU Menu" ,.using_nintendo_network = "使用 Nintendo Network" ,.using_pretendo_network = "使用 Pretendo Network" -,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" -,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" diff --git a/src/lang/zh_Hant.lang b/src/lang/zh_Hant.lang index d831cc2..ec3a0ad 100644 --- a/src/lang/zh_Hant.lang +++ b/src/lang/zh_Hant.lang @@ -8,5 +8,3 @@ ,.need_menu_action = "僅來自WiiU Menu" ,.using_nintendo_network = "使用 Nintendo Network" ,.using_pretendo_network = "使用 Pretendo Network" -,.module_not_found = "Could not find Inkay module. Ensure the Inkay module is properly installed" -,.module_init_not_found = "Could not initialize Inkay module. Ensure the Inkay module is properly installed" From 06847b21e55c4ec74ab41f84bc1330ab6dcdb22f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Thu, 21 Nov 2024 20:39:51 +0000 Subject: [PATCH 026/139] fix(p2p): Fix compilation error in multiplayer port text GCC complains about std::make_format_args using non-const references, so we can't pass along the `get_console_peertopeer_port` directly. Also replace `unsigned short` with `uint16_t` for clarity. --- common/sysconfig.cpp | 12 ++++++------ plugin/src/config.cpp | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/common/sysconfig.cpp b/common/sysconfig.cpp index 102a3cf..ec56614 100644 --- a/common/sysconfig.cpp +++ b/common/sysconfig.cpp @@ -102,14 +102,14 @@ static inline int digit(char a) { return a - '0'; } -unsigned short get_console_peertopeer_port() { +uint16_t get_console_peertopeer_port() { const char * serial = get_console_serial(); - unsigned short port = 50000 + - (digit(serial[4]) * 1000) + - (digit(serial[5]) * 100 ) + - (digit(serial[6]) * 10 ) + - (digit(serial[7]) * 1 ); + uint16_t port = 50000 + + (digit(serial[4]) * 1000) + + (digit(serial[5]) * 100 ) + + (digit(serial[6]) * 10 ) + + (digit(serial[7]) * 1 ); return port; } diff --git a/plugin/src/config.cpp b/plugin/src/config.cpp index 5ce07a8..1ca4be4 100644 --- a/plugin/src/config.cpp +++ b/plugin/src/config.cpp @@ -139,7 +139,8 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa if (!res) return report_error(err); { - std::string multiplayer_port_text = std::vformat(strings.multiplayer_port_display, std::make_format_args(get_console_peertopeer_port())); + uint16_t port = get_console_peertopeer_port(); + std::string multiplayer_port_text = std::vformat(strings.multiplayer_port_display, std::make_format_args(port)); res = network_cat->add(WUPSConfigItemStub::Create(multiplayer_port_text), err); if (!res) return report_error(err); } From 0f3115a40295f008fcefd2bd2890158cdf2eeb1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Thu, 21 Nov 2024 20:43:17 +0000 Subject: [PATCH 027/139] fix(p2p): Don't apply patches when not using Pretendo --- src/patches/game_peertopeer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/patches/game_peertopeer.cpp b/src/patches/game_peertopeer.cpp index c464117..e0e0fa3 100644 --- a/src/patches/game_peertopeer.cpp +++ b/src/patches/game_peertopeer.cpp @@ -15,6 +15,7 @@ #include #include "game_peertopeer.h" +#include "config.h" #include "sysconfig.h" #include "utils/logger.h" #include "utils/rpl_info.h" @@ -44,6 +45,10 @@ static void minecraft_peertopeer_patch() { } void peertopeer_patch() { + if (!Config::connect_to_network) { + return; + } + uint64_t tid = OSGetTitleID(); if (tid == 0x00050000'101D7500 || // EUR tid == 0x00050000'101D9D00 || // USA From cd1d530da9e41ac8f6e34ca866b062fb488c6ca0 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Fri, 22 Nov 2024 11:44:20 +1100 Subject: [PATCH 028/139] fix(config): Switch to snprintf for formatting while vformat is closer to modern string-formatting sensibilities, it added 400KiB to our binaries, whereas snprintf has no noticeable impact. so... suffer, and hope the translators know what's up --- plugin/src/config.cpp | 5 +++-- src/lang/en_US.lang | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin/src/config.cpp b/plugin/src/config.cpp index 1ca4be4..d01ba92 100644 --- a/plugin/src/config.cpp +++ b/plugin/src/config.cpp @@ -140,8 +140,9 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa { uint16_t port = get_console_peertopeer_port(); - std::string multiplayer_port_text = std::vformat(strings.multiplayer_port_display, std::make_format_args(port)); - res = network_cat->add(WUPSConfigItemStub::Create(multiplayer_port_text), err); + char buffer[256]; + snprintf(buffer, sizeof(buffer), strings.multiplayer_port_display.data(), port); + res = network_cat->add(WUPSConfigItemStub::Create(buffer), err); if (!res) return report_error(err); } diff --git a/src/lang/en_US.lang b/src/lang/en_US.lang index 29fb991..7b3cdb9 100644 --- a/src/lang/en_US.lang +++ b/src/lang/en_US.lang @@ -8,6 +8,6 @@ ,.need_menu_action = "From WiiU menu only" ,.using_nintendo_network = "Using Nintendo Network" ,.using_pretendo_network = "Using Pretendo Network" -,.multiplayer_port_display = "Using UDP port {} for multiplayer" +,.multiplayer_port_display = "Using UDP port %hu for multiplayer" ,.module_not_found = "Pretendo patch failed - use Aroma Updater to repair (686-1001 Module missing)" ,.module_init_not_found = "Pretendo patch failed - use Aroma Updater to repair (686-1002 Module init)" From 4b0e298b8ef67e9a399622e7eea417e46b977054 Mon Sep 17 00:00:00 2001 From: Ash Date: Mon, 25 Nov 2024 18:24:29 +1100 Subject: [PATCH 029/139] Update README.md --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a1a8f80..3762726 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,21 @@ [![Pretendo network logo](https://github.com/PretendoNetwork/website/raw/master/public/assets/images/opengraph/opengraph-image.png)](https://pretendo.network) -Inkay is an Aroma/WUPS plugin that patches various Nintendo Network URLs on a Wii U to use Pretendo Network instead. It also (for the time being) bypasses SSL verification in most cases. +Inkay is an Aroma/WUPS plugin that patches various Nintendo Network URLs on a Wii U to use Pretendo Network instead. It also (for the time being) bypasses SSL verification in most cases. It redirects Nintendo Network in: -Inkay does not currently include the game-specific patches present in [Nimble](https://github.com/PretendoNetwork/Nimble). These will be implemented soon™. +- IOSU-side connections (Friends, SpotPass, accounts etc.) +- Account Settings +- NNCS +- Nintendo eShop +- Miiverse (in-game) +- Miiverse applet + +Inkay also includes game-specific patches to add extra features: +- Modpack-specific matchmaking for global, regional rooms (by simulating extra DLC) - **Mario Kart 8** +- P2P port override for better connection stability (if you port forward) - **Minecraft: Wii U Edition** ## Dependencies -Inkay is only supported on the release version of Aroma configured for autoboot/coldboot. For Tiramisu, see [Nimble](https://github.com/PretendoNetwork/Nimble). +Inkay is only supported on the release version of Aroma configured for autoboot/coldboot. Other configurations (specifically lacking coldboot) may cause issues with SpotPass. ## Safety Inkay's patches are all temporary, and only applied in-memory without modifying your console. The SSL patch, while also temporary, could reduce the overall security of your console while active - this is because it no longer checks if a server is verified. However, this does not apply to the Internet Browser, where SSL still works as expected. From dbb648729a3df9eef1f10975a3147744a1d47d34 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Fri, 22 Nov 2024 23:07:57 +1100 Subject: [PATCH 030/139] fix(config): Use noexcept version of WupsConfigItemStub::create --- plugin/src/config.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/src/config.cpp b/plugin/src/config.cpp index d01ba92..0b99ffa 100644 --- a/plugin/src/config.cpp +++ b/plugin/src/config.cpp @@ -142,7 +142,10 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa uint16_t port = get_console_peertopeer_port(); char buffer[256]; snprintf(buffer, sizeof(buffer), strings.multiplayer_port_display.data(), port); - res = network_cat->add(WUPSConfigItemStub::Create(buffer), err); + auto multiplayer_port_display = WUPSConfigItemStub::Create(buffer, err); + if (!multiplayer_port_display) return report_error(err); + + res = network_cat->add(std::move(*multiplayer_port_display), err); if (!res) return report_error(err); } From 727f11d04dad1ed915c218e5775c810c8f72ede8 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Fri, 29 Nov 2024 20:55:53 +1100 Subject: [PATCH 031/139] feat: Compile flags for binary size Small binaries load faster, work better on Aroma Updater, and break the website less --- Makefile | 7 ++++--- plugin/Makefile | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 72a3a66..fa5360d 100644 --- a/Makefile +++ b/Makefile @@ -28,15 +28,16 @@ INCLUDES := src src/ext/inih src/lang common #------------------------------------------------------------------------------- # options for code generation #------------------------------------------------------------------------------- -CFLAGS := -Wall -O2 -ffunction-sections\ - $(MACHDEP) +OPT := -Os -fno-exceptions -fno-asynchronous-unwind-tables +CFLAGS := -Wall -ffunction-sections -fdata-sections \ + $(MACHDEP) $(OPT) CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__ CXXFLAGS := $(CFLAGS) -std=c++20 ASFLAGS := -g $(ARCH) -LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -Wl,-gc-sections -T$(WUMS_ROOT)/share/libkernel.ld $(WUMSSPECS) +LDFLAGS = -g $(ARCH) $(OPT) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -Wl,-gc-sections -T$(WUMS_ROOT)/share/libkernel.ld $(WUMSSPECS) ifeq ($(DEBUG),1) CXXFLAGS += -DDEBUG -g diff --git a/plugin/Makefile b/plugin/Makefile index fee7a0b..dfcda53 100644 --- a/plugin/Makefile +++ b/plugin/Makefile @@ -29,8 +29,9 @@ INCLUDES := src ../src/lang ../common #------------------------------------------------------------------------------- # options for code generation #------------------------------------------------------------------------------- -CFLAGS := -Wall -O2 -ffunction-sections -fdata-sections \ - $(MACHDEP) +OPT := -Os -fno-exceptions -fno-asynchronous-unwind-tables +CFLAGS := -Wall -ffunction-sections -fdata-sections \ + $(MACHDEP) $(OPT) CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__ -D__WUPS__ @@ -41,7 +42,7 @@ endif CXXFLAGS := $(CFLAGS) -std=c++20 ASFLAGS := -g $(ARCH) -LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -Wl,-gc-sections +LDFLAGS = -g $(ARCH) $(OPT) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -Wl,-gc-sections -Wl,--discard-all LDFLAGS += $(WUPSSPECS) From a6b91be935875e13b6986cae4bda4aec181319aa Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Fri, 29 Nov 2024 21:39:50 +1100 Subject: [PATCH 032/139] feat(p2p): Port overrides for Splatoon and MK8 --- src/patches/game_peertopeer.cpp | 55 ++++++++++++++++++++++++++++++--- src/utils/replace_mem.cpp | 25 +++++++++++---- src/utils/replace_mem.h | 6 +++- src/utils/rpl_info.h | 6 ++-- 4 files changed, 78 insertions(+), 14 deletions(-) diff --git a/src/patches/game_peertopeer.cpp b/src/patches/game_peertopeer.cpp index e0e0fa3..2651156 100644 --- a/src/patches/game_peertopeer.cpp +++ b/src/patches/game_peertopeer.cpp @@ -22,9 +22,56 @@ #include "utils/replace_mem.h" #include +#include +#include +using namespace std::string_view_literals; + +static struct { + std::array tid; + uint32_t min_port_addr; + uint32_t max_port_addr; + std::string_view rpx; +} generic_patch_games [] = { + { // MARIO KART 8 + { 0x00050000'1010ec00, 0x00050000'1010ed00, 0x00050000'1010eb00 }, + 0x101a9a52, + 0x101a9a54, + "Turbo.rpx"sv, + }, + { // Splatoon + { 0x00050000'10176900, 0x00050000'10176a00, 0x00050000'10162b00 }, + 0x101e8952, + 0x101e8954, + "Gambit.rpx"sv, + }, +}; + +static void generic_peertopeer_patch() { + uint64_t tid = OSGetTitleID(); + + for (const auto& patch : generic_patch_games) { + if (std::ranges::find(patch.tid, tid) == patch.tid.end()) continue; + + std::optional game = search_for_rpl(patch.rpx); + if (!game) { + DEBUG_FUNCTION_LINE("Couldn't find game rpx! (%s)", patch.rpx.data()); + return; + } + + auto port = get_console_peertopeer_port(); + DEBUG_FUNCTION_LINE_VERBOSE("Will use port %d. %08x", port, game->textAddr); + + auto target = (uint16_t *)rpl_addr(*game, patch.min_port_addr); + replace_unsigned(target, 0xc000, port); + + target = (uint16_t *)rpl_addr(*game, patch.max_port_addr); + replace_unsigned(target, 0xffff, port); + break; + } +} static void minecraft_peertopeer_patch() { - std::optional minecraft = search_for_rpl("Minecraft.Client.rpx"); + std::optional minecraft = search_for_rpl("Minecraft.Client.rpx"sv); if (!minecraft) { DEBUG_FUNCTION_LINE("Couldn't find minecraft rpx!"); return; @@ -33,12 +80,12 @@ static void minecraft_peertopeer_patch() { auto port = get_console_peertopeer_port(); DEBUG_FUNCTION_LINE_VERBOSE("Will use port %d. %08x", port, minecraft->textAddr); - uint32_t *target_func = rpl_addr(*minecraft, 0x03579530); + auto target_func = (uint32_t *)rpl_addr(*minecraft, 0x03579530); replace_instruction(&target_func[0], 0x3c600001, 0x3c600000); // li r3, 0 replace_instruction(&target_func[1], 0x3863c000, 0x60630000 | port); // ori r3, r3, port // blr - target_func = rpl_addr(*minecraft, 0x0357953c); + target_func = (uint32_t *)rpl_addr(*minecraft, 0x0357953c); replace_instruction(&target_func[0], 0x3c600001, 0x3c600000); // li r3, 0 replace_instruction(&target_func[1], 0x3863ffff, 0x60630000 | port); // ori r3, r3, port // blr @@ -56,6 +103,6 @@ void peertopeer_patch() { minecraft_peertopeer_patch(); } else { - DEBUG_FUNCTION_LINE_VERBOSE("Game has no p2p patches, will skip.\n"); + generic_peertopeer_patch(); } } diff --git a/src/utils/replace_mem.cpp b/src/utils/replace_mem.cpp index b1f6ba0..03e94b2 100644 --- a/src/utils/replace_mem.cpp +++ b/src/utils/replace_mem.cpp @@ -73,17 +73,30 @@ void replaceBulk(uint32_t start, uint32_t size, std::span rep #endif } -bool replace_instruction(uint32_t *inst, uint32_t orignal_value, uint32_t new_value) { - if (*inst != orignal_value) return false; +template + requires std::integral +bool replace_unsigned(U *addr, U original_value, U new_value) { + if (*addr != original_value) return false; KernelCopyData( - OSEffectiveToPhysical((uint32_t) inst), + OSEffectiveToPhysical((uint32_t) addr), OSEffectiveToPhysical((uint32_t) &new_value), sizeof(new_value) ); - DCFlushRange(inst, sizeof(new_value)); - ICInvalidateRange(inst, sizeof(new_value)); + DCFlushRange(addr, sizeof(new_value)); DEBUG_FUNCTION_LINE_VERBOSE("%08x is now %08x", inst, *inst); - return *inst == new_value; + return *addr == new_value; +} +template bool replace_unsigned(uint64_t *, uint64_t, uint64_t); +template bool replace_unsigned(uint32_t *, uint32_t, uint32_t); +template bool replace_unsigned(uint16_t *, uint16_t, uint16_t); +template bool replace_unsigned(uint8_t *, uint8_t, uint8_t); + +bool replace_instruction(uint32_t *inst, uint32_t original_value, uint32_t new_value) { + bool res = replace_unsigned(inst, original_value, new_value); + if (!res) return res; + + ICInvalidateRange(inst, sizeof(new_value)); + return true; } diff --git a/src/utils/replace_mem.h b/src/utils/replace_mem.h index dbf8eb6..8557985 100644 --- a/src/utils/replace_mem.h +++ b/src/utils/replace_mem.h @@ -28,4 +28,8 @@ struct replacement { void replaceBulk(uint32_t start, uint32_t size, std::span replacements); -bool replace_instruction(uint32_t *inst, uint32_t orignal_value, uint32_t new_value); +template + requires std::integral +bool replace_unsigned(U *addr, U original_value, U new_value); + +bool replace_instruction(uint32_t *inst, uint32_t original_value, uint32_t new_value); diff --git a/src/utils/rpl_info.h b/src/utils/rpl_info.h index 5eebe7a..15f59c7 100644 --- a/src/utils/rpl_info.h +++ b/src/utils/rpl_info.h @@ -19,10 +19,10 @@ std::optional search_for_rpl(std::string_view name); -constexpr uint32_t *rpl_addr(OSDynLoad_NotifyData rpl, uint32_t cemu_addr) { +constexpr void *rpl_addr(OSDynLoad_NotifyData rpl, uint32_t cemu_addr) { if (cemu_addr < 0x1000'0000) { - return (uint32_t *)(rpl.textAddr + cemu_addr - 0x0200'0000); + return (void *)(rpl.textAddr + cemu_addr - 0x0200'0000); } else { - return (uint32_t *)(rpl.dataAddr + cemu_addr - 0x1000'0000); + return (void *)(rpl.dataAddr + cemu_addr - 0x1000'0000); } } From e6edcec5a5c6e99b7876ca0d9c5a514af4574486 Mon Sep 17 00:00:00 2001 From: Ash Tails Date: Fri, 29 Nov 2024 09:31:58 +0100 Subject: [PATCH 033/139] Added translation using Weblate (English (en@uwu)) --- src/lang/en@uwu.lang | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/lang/en@uwu.lang diff --git a/src/lang/en@uwu.lang b/src/lang/en@uwu.lang new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/lang/en@uwu.lang @@ -0,0 +1 @@ + From 4009d44a975e9b9b860d4f2ddf9417706683acb1 Mon Sep 17 00:00:00 2001 From: Ash Tails Date: Fri, 29 Nov 2024 09:34:47 +0100 Subject: [PATCH 034/139] Deleted translation using Weblate (English (en@uwu)) --- src/lang/en@uwu.lang | 1 - 1 file changed, 1 deletion(-) delete mode 100644 src/lang/en@uwu.lang diff --git a/src/lang/en@uwu.lang b/src/lang/en@uwu.lang deleted file mode 100644 index 8b13789..0000000 --- a/src/lang/en@uwu.lang +++ /dev/null @@ -1 +0,0 @@ - From 2510c691f1c3db960e050263e9ab0e02cb6f26e1 Mon Sep 17 00:00:00 2001 From: Ash Tails Date: Fri, 29 Nov 2024 09:35:26 +0100 Subject: [PATCH 035/139] Added translation using Weblate (English (en@uwu)) --- src/lang/en@uwu.lang | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/lang/en@uwu.lang diff --git a/src/lang/en@uwu.lang b/src/lang/en@uwu.lang new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/lang/en@uwu.lang @@ -0,0 +1 @@ + From 0f1e05b02147f1e2659074e52edce0a4de5ba4e7 Mon Sep 17 00:00:00 2001 From: redmine4404 Date: Fri, 29 Nov 2024 09:25:13 +0000 Subject: [PATCH 036/139] Translated using Weblate (French) Currently translated at 84.6% (11 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/fr/ --- src/lang/fr_FR.lang | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/lang/fr_FR.lang b/src/lang/fr_FR.lang index 1f8eda7..c227466 100644 --- a/src/lang/fr_FR.lang +++ b/src/lang/fr_FR.lang @@ -1,10 +1,11 @@ -.plugin_name = "Inkay" -,.network_category = "Sélection du réseau" -,.connect_to_network_setting = "Connexion à Pretendo" -,.other_category = "Autres paramètres" -,.reset_wwp_setting = "Réinitialiser la place WaraWara" -,.press_a_action = "Appuyez sur A" -,.restart_to_apply_action = "Redémarrer pour appliquer" -,.need_menu_action = "Depuis le menu Wii U seulement" -,.using_nintendo_network = "Sur Nintendo Network" -,.using_pretendo_network = "Sur Pretendo Network" +.plugin_name="Inkay" +,.network_category="Sélection du réseau" +,.connect_to_network_setting="Connexion à Pretendo" +,.other_category="Autres paramètres" +,.reset_wwp_setting="Réinitialiser la place WaraWara" +,.press_a_action="Appuyez sur A" +,.restart_to_apply_action="Redémarrer pour appliquer" +,.need_menu_action="Depuis le menu Wii U seulement" +,.using_nintendo_network="Sur Nintendo Network" +,.using_pretendo_network="Sur Pretendo Network" +,.multiplayer_port_display="Utilisation du port UDP %hu pour le multijoueur" From 8d7df27d420898cc17f0c8404da42a7d95d92194 Mon Sep 17 00:00:00 2001 From: Ash Tails Date: Fri, 29 Nov 2024 08:35:57 +0000 Subject: [PATCH 037/139] Translated using Weblate (English (en@uwu)) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/en@uwu/ --- src/lang/en@uwu.lang | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lang/en@uwu.lang b/src/lang/en@uwu.lang index 8b13789..3e55000 100644 --- a/src/lang/en@uwu.lang +++ b/src/lang/en@uwu.lang @@ -1 +1,15 @@ + +.plugin_name="Inky ^w^" +,.network_category="Newowk sewectiown! :3" +,.connect_to_network_setting="use dah pretender!!!!" +,.other_category="oth3r stuffzz" +,.reset_wwp_setting="warah wara go BYEBYE x3c" +,.press_a_action="Press A plz?" +,.restart_to_apply_action="ima restart ur consoel >:3c" +,.need_menu_action="no menu?? only menu -w-" +,.using_nintendo_network="meanie network!!!" +,.using_pretendo_network="pretender netw3rk >:D" +,.multiplayer_port_display="mah secret word is %hu... ur modem will know" +,.module_not_found="oh noez! pls get aroma updater help :( (686-1001 Module missing)" +,.module_init_not_found="oh noez! pls get aroma updater help :( (686-1002 Module init)" From 6c78a95872de0ddca837e5af37d6a01a5fac7d45 Mon Sep 17 00:00:00 2001 From: "Dimitri A." Date: Sun, 15 Dec 2024 00:23:27 +0100 Subject: [PATCH 038/139] fix(account_settings): Avoid mixing up FSReadFile / FSCloseFile patches This copy-and-paste error was a culprit of the bug described in issue #55. It made the Account Settings applet on Wii U softlock during its initialisation, forcing the user to power off the system. The applet now works again. However, trying to access it a second time without rebooting still freezes the Wii U, which is another regression listed in issue #55. --- src/patches/account_settings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/patches/account_settings.cpp b/src/patches/account_settings.cpp index 57af0b9..eef820f 100644 --- a/src/patches/account_settings.cpp +++ b/src/patches/account_settings.cpp @@ -146,7 +146,7 @@ bool patchAccountSettings() { add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSOpenFile_accSettings, LIBRARY_COREINIT, FSOpenFile, FP_TARGET_PROCESS_GAME), "FSOpenFile_accSettings"); add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSReadFile_accSettings, LIBRARY_COREINIT, FSReadFile, FP_TARGET_PROCESS_GAME), "FSReadFile_accSettings"); - add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSCloseFile_accSettings, LIBRARY_COREINIT, FSReadFile, FP_TARGET_PROCESS_GAME), "FSCloseFile_accSettings"); + add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSCloseFile_accSettings, LIBRARY_COREINIT, FSCloseFile, FP_TARGET_PROCESS_GAME), "FSCloseFile_accSettings"); return true; } From 38f1b1848ed4e1e7c1418a0c81f3fcda2b704e58 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Tue, 17 Dec 2024 15:13:39 +1100 Subject: [PATCH 039/139] fix(account-settings): Don't re-add function patches on every application boot libfunctionpatcher stuff is persistent from plugin init time to plugin teardown time. but the memory replacements DO need to happen on every launch, so rearrange things a bit. --- src/main.cpp | 6 ++--- src/patches/account_settings.cpp | 46 +++++++++++++++++--------------- src/patches/account_settings.h | 3 +-- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 12ba0e8..7c4612d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -166,6 +166,7 @@ static void Inkay_Initialize(bool apply_patches) { patchDNS(); patchEshop(); patchOlvApplet(); + patchAccountSettings(); install_matchmaking_patches(); } else { DEBUG_FUNCTION_LINE("FunctionPatcher_InitLibrary failed"); @@ -218,10 +219,7 @@ WUMS_APPLICATION_STARTS() { setup_olv_libs(); peertopeer_patch(); matchmaking_notify_titleswitch(); - - if (isAccountSettingsTitle()) { - patchAccountSettings(); - } + hotpatchAccountSettings(); } WUMS_APPLICATION_ENDS() { diff --git a/src/patches/account_settings.cpp b/src/patches/account_settings.cpp index eef820f..232782f 100644 --- a/src/patches/account_settings.cpp +++ b/src/patches/account_settings.cpp @@ -52,7 +52,13 @@ const char wave_original[] = "saccount.nintendo.net"; const char wave_new[] = "saccount.pretendo.cc"; -bool isAccountSettingsTitle(); +static bool isAccountSettingsTitle() { + return (OSGetTitleID() != 0 && ( + OSGetTitleID() == ACCOUNT_SETTINGS_TID_J || + OSGetTitleID() == ACCOUNT_SETTINGS_TID_U || + OSGetTitleID() == ACCOUNT_SETTINGS_TID_E + )); +} static std::optional rootca_pem_handle{}; std::vector account_patches; @@ -104,15 +110,25 @@ DECL_FUNCTION(FSStatus, FSCloseFile_accSettings, FSClient *client, FSCmdBlock *b return real_FSCloseFile_accSettings(client, block, handle, errorMask); } -bool isAccountSettingsTitle() { - return (OSGetTitleID() != 0 && ( - OSGetTitleID() == ACCOUNT_SETTINGS_TID_J || - OSGetTitleID() == ACCOUNT_SETTINGS_TID_U || - OSGetTitleID() == ACCOUNT_SETTINGS_TID_E - )); +bool patchAccountSettings() { + account_patches.reserve(3); + + auto add_patch = [](function_replacement_data_t repl, const char *name) { + PatchedFunctionHandle handle = 0; + if (FunctionPatcher_AddFunctionPatch(&repl, &handle, nullptr) != FUNCTION_PATCHER_RESULT_SUCCESS) { + DEBUG_FUNCTION_LINE("Inkay/Account: Failed to patch %s!", name); + } + account_patches.push_back(handle); + }; + + add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSOpenFile_accSettings, LIBRARY_COREINIT, FSOpenFile, FP_TARGET_PROCESS_GAME), "FSOpenFile_accSettings"); + add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSReadFile_accSettings, LIBRARY_COREINIT, FSReadFile, FP_TARGET_PROCESS_GAME), "FSReadFile_accSettings"); + add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSCloseFile_accSettings, LIBRARY_COREINIT, FSCloseFile, FP_TARGET_PROCESS_GAME), "FSCloseFile_accSettings"); + + return true; } -bool patchAccountSettings() { +bool hotpatchAccountSettings() { if(!isAccountSettingsTitle()) { return false; } @@ -134,20 +150,6 @@ bool patchAccountSettings() { return false; } - account_patches.reserve(3); - - auto add_patch = [](function_replacement_data_t repl, const char *name) { - PatchedFunctionHandle handle = 0; - if (FunctionPatcher_AddFunctionPatch(&repl, &handle, nullptr) != FUNCTION_PATCHER_RESULT_SUCCESS) { - DEBUG_FUNCTION_LINE("Inkay/Account: Failed to patch %s!", name); - } - account_patches.push_back(handle); - }; - - add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSOpenFile_accSettings, LIBRARY_COREINIT, FSOpenFile, FP_TARGET_PROCESS_GAME), "FSOpenFile_accSettings"); - add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSReadFile_accSettings, LIBRARY_COREINIT, FSReadFile, FP_TARGET_PROCESS_GAME), "FSReadFile_accSettings"); - add_patch(REPLACE_FUNCTION_FOR_PROCESS(FSCloseFile_accSettings, LIBRARY_COREINIT, FSCloseFile, FP_TARGET_PROCESS_GAME), "FSCloseFile_accSettings"); - return true; } diff --git a/src/patches/account_settings.h b/src/patches/account_settings.h index 4cc77be..c38d1b0 100644 --- a/src/patches/account_settings.h +++ b/src/patches/account_settings.h @@ -15,7 +15,6 @@ #pragma once -bool isAccountSettingsTitle(); - bool patchAccountSettings(); +bool hotpatchAccountSettings(); void unpatchAccountSettings(); From 9e376f7839b41d1811b6851f96aefc7712929bc2 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Tue, 17 Dec 2024 16:44:59 +1100 Subject: [PATCH 040/139] feat: Move all URL defines into a central location --- .gitignore | 1 + common/inkay_config.h | 21 +++++++++++++++++++ src/patches/account_settings.cpp | 35 ++++++++++++++++++++------------ src/patches/dns_hooks.cpp | 8 ++++---- src/patches/eshop_applet.cpp | 34 +++++++++++++++++++------------ src/patches/olv_applet.cpp | 29 ++++++++++++++++++-------- src/patches/olv_urls.h | 5 +++-- 7 files changed, 92 insertions(+), 41 deletions(-) create mode 100644 common/inkay_config.h diff --git a/.gitignore b/.gitignore index 3f9ac48..c753597 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ *.wps certs/ *.lst +inkay_config.local.h diff --git a/common/inkay_config.h b/common/inkay_config.h new file mode 100644 index 0000000..0293c20 --- /dev/null +++ b/common/inkay_config.h @@ -0,0 +1,21 @@ +// +// Created by ash on 17/12/24. +// + +#ifndef INKAY_INKAY_CONFIG_H +#define INKAY_INKAY_CONFIG_H + +#ifdef __has_include +#if __has_include("inkay_config.local.h") + +#include "inkay_config.local.h" +#define INKAY_CUSTOM 1 + +#endif +#endif + +#ifndef NETWORK_BASEURL +#define NETWORK_BASEURL "pretendo.cc" +#endif + +#endif //INKAY_INKAY_CONFIG_H diff --git a/src/patches/account_settings.cpp b/src/patches/account_settings.cpp index 232782f..3a0e7bb 100644 --- a/src/patches/account_settings.cpp +++ b/src/patches/account_settings.cpp @@ -21,6 +21,7 @@ #include "olv_urls.h" #include "utils/logger.h" #include "utils/replace_mem.h" +#include "inkay_config.h" #include #include @@ -36,21 +37,29 @@ #define ACCOUNT_SETTINGS_TID_U 0x000500101004B100 #define ACCOUNT_SETTINGS_TID_E 0x000500101004B200 -const char whitelist_original[] = { - 0x68, 0x74, 0x74, 0x70, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x61, 0x63, 0x63, 0x6F, 0x75, 0x6E, 0x74, 0x2E, - 0x6E, 0x69, 0x6E, 0x74, 0x65, 0x6E, 0x64, 0x6F, 0x2E, 0x6E, 0x65, 0x74 +struct account_settings_allowlist { + char scheme[16]; + char domain[128]; + char path[128]; // unverified + uint32_t flags; }; -const char whitelist_new[] = { - 0x68, 0x74, 0x74, 0x70, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x61, 0x63, 0x63, 0x6F, 0x75, 0x6E, 0x74, 0x2E, - 0x70, 0x72, 0x65, 0x74, 0x65, 0x6E, 0x64, 0x6F, 0x2E, 0x63, 0x63, 0x00 +constexpr struct account_settings_allowlist original_entry = { + .scheme = "https", + .domain = "account.nintendo.net", + .path = "", + .flags = 0x01010101, }; -const char wave_original[] = "saccount.nintendo.net"; +constexpr struct account_settings_allowlist new_entry = { + .scheme = "https", + .domain = "account." NETWORK_BASEURL, + .path = "", + .flags = 0x01010101, +}; +constexpr char wave_original[] = "saccount.nintendo.net"; -const char wave_new[] = "saccount.pretendo.cc"; +constexpr char wave_new[] = "saccount." NETWORK_BASEURL; static bool isAccountSettingsTitle() { return (OSGetTitleID() != 0 && ( @@ -141,12 +150,12 @@ bool hotpatchAccountSettings() { DEBUG_FUNCTION_LINE_VERBOSE("Inkay: hewwo account settings!\n"); if (!replace(0x10000000, 0x10000000, wave_original, sizeof(wave_original), wave_new, sizeof(wave_new))) { - DEBUG_FUNCTION_LINE_VERBOSE("Inkay: We didn't find the url /)>~<(\\"); + DEBUG_FUNCTION_LINE("Inkay: We didn't find the url /)>~<(\\"); return false; } - if (!replace(0x10000000, 0x10000000, whitelist_original, sizeof(whitelist_original), whitelist_new, sizeof(whitelist_new))) { - DEBUG_FUNCTION_LINE_VERBOSE("Inkay: We didn't find the whitelist /)>~<(\\"); + if (!replace(0x10000000, 0x10000000, (const char *)&original_entry, sizeof(original_entry), (const char *)&new_entry, sizeof(new_entry))) { + DEBUG_FUNCTION_LINE("Inkay: We didn't find the whitelist /)>~<(\\"); return false; } diff --git a/src/patches/dns_hooks.cpp b/src/patches/dns_hooks.cpp index d51520b..a4f0840 100644 --- a/src/patches/dns_hooks.cpp +++ b/src/patches/dns_hooks.cpp @@ -17,19 +17,19 @@ #include - #include "config.h" #include "utils/logger.h" +#include "inkay_config.h" #include #include #include std::vector dns_patches; -const std::pair dns_replacements[] = { +constexpr std::pair dns_replacements[] = { // NNCS servers - { "nncs1.app.nintendowifi.net", "nncs1.app.pretendo.cc" }, - { "nncs2.app.nintendowifi.net", "nncs2.app.pretendo.cc" }, + { "nncs1.app.nintendowifi.net", "nncs1.app." NETWORK_BASEURL }, + { "nncs2.app.nintendowifi.net", "nncs2.app." NETWORK_BASEURL }, }; static const char * replace_dns_name(const char *dns_name) { diff --git a/src/patches/eshop_applet.cpp b/src/patches/eshop_applet.cpp index 33467ac..9ae5e2e 100644 --- a/src/patches/eshop_applet.cpp +++ b/src/patches/eshop_applet.cpp @@ -20,6 +20,7 @@ #include "olv_urls.h" #include "utils/logger.h" #include "utils/replace_mem.h" +#include "inkay_config.h" #include #include @@ -30,21 +31,28 @@ #include "ca_pem.h" // generated at buildtime -const char wave_original[] = "https://ninja.wup.shop.nintendo.net/ninja/wood_index.html?"; -const char wave_new[] = "http://samurai.wup.shop.pretendo.cc/ninja/wood_index.html?"; +constexpr char wave_original[] = "https://ninja.wup.shop.nintendo.net/ninja/wood_index.html?"; +constexpr char wave_new[] = "http://samurai.wup.shop." NETWORK_BASEURL "/ninja/wood_index.html?"; -const char whitelist_original[] = { - 0x68, 0x74, 0x74, 0x70, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x73, 0x61, 0x6D, 0x75, 0x72, 0x61, 0x69, 0x2E, - 0x77, 0x75, 0x70, 0x2E, 0x73, 0x68, 0x6F, 0x70, 0x2E, 0x6E, 0x69, 0x6E, - 0x74, 0x65, 0x6E, 0x64, 0x6F, 0x2E, 0x6E, 0x65, 0x74 +struct eshop_allowlist { + char scheme[16]; + char domain[128]; + char path[128]; // unverified + unsigned char flags[5]; }; -const char whitelist_new[] = { - 0x68, 0x74, 0x74, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x73, 0x61, 0x6D, 0x75, 0x72, 0x61, 0x69, 0x2E, - 0x77, 0x75, 0x70, 0x2E, 0x73, 0x68, 0x6F, 0x70, 0x2E, 0x70, 0x72, 0x65, - 0x74, 0x65, 0x6E, 0x64, 0x6F, 0x2E, 0x63, 0x63, 0x00 +constexpr struct eshop_allowlist original_entry = { + .scheme = "https", + .domain = "samurai.wup.shop.nintendo.net", + .path = "", + .flags = {1, 1, 1, 1, 0}, +}; + +constexpr struct eshop_allowlist new_entry = { + .scheme = "http", + .domain = "samurai.wup.shop." NETWORK_BASEURL, + .path = "", + .flags = {1, 1, 1, 1, 0}, }; static std::optional rootca_pem_handle{}; @@ -68,7 +76,7 @@ DECL_FUNCTION(int, FSOpenFile_eShop, FSClient *client, FSCmdBlock *block, char * if (!replace(0x10000000, 0x10000000, wave_original, sizeof(wave_original), wave_new, sizeof(wave_new))) DEBUG_FUNCTION_LINE_VERBOSE("Inkay: We didn't find the url /)>~<(\\"); - if (!replace(0x10000000, 0x10000000, whitelist_original, sizeof(whitelist_original), whitelist_new, sizeof(whitelist_new))) + if (!replace(0x10000000, 0x10000000, (const char *)&original_entry, sizeof(original_entry), (const char *)&new_entry, sizeof(new_entry))) DEBUG_FUNCTION_LINE_VERBOSE("Inkay: We didn't find the whitelist /)>~<(\\"); // Check for root CA file and take note of its handle diff --git a/src/patches/olv_applet.cpp b/src/patches/olv_applet.cpp index 256b3fd..8f97a79 100644 --- a/src/patches/olv_applet.cpp +++ b/src/patches/olv_applet.cpp @@ -30,16 +30,27 @@ #include "ca_pem.h" // generated at buildtime -const char wave_original[] = { - 0x68, 0x74, 0x74, 0x70, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x2E, 0x6E, 0x69, 0x6E, 0x74, 0x65, 0x6E, 0x64, - 0x6F, 0x2E, 0x6E, 0x65, 0x74 +struct olv_allowlist { + char scheme[16]; + char domain[128]; + char path[128]; // unverified + unsigned char flags[5]; }; -const char wave_new[] = { - 0x68, 0x74, 0x74, 0x70, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x2E, 0x70, 0x72, 0x65, 0x74, 0x65, 0x6E, 0x64, - 0x6F, 0x2E, 0x63, 0x63, 0x00 + +constexpr struct olv_allowlist original_entry = { + .scheme = "https", + .domain = ".nintendo.net", + .path = "", + .flags = {1, 1, 1, 1, 1}, }; + +constexpr struct olv_allowlist new_entry = { + .scheme = "https", + .domain = "." NETWORK_BASEURL, + .path = "", + .flags = {1, 1, 1, 1, 1}, +}; + const unsigned char miiverse_green_highlight[] = { 0x82, 0xff, 0x05, 0xff, 0x82, 0xff, 0x05, 0xff, 0x1d, 0xff, 0x04, 0xff, 0x1d, 0xff, 0x04, 0xff }; @@ -87,7 +98,7 @@ DECL_FUNCTION(int, FSOpenFile, FSClient *client, FSCmdBlock *block, char *path, auto olv_ok = setup_olv_libs(); // Patch applet binary too if (olv_ok) - replace(0x10000000, 0x10000000, wave_original, sizeof(wave_original), wave_new, sizeof(wave_new)); + replace(0x10000000, 0x10000000, (const char *)&original_entry, sizeof(original_entry), (const char *)&new_entry, sizeof(new_entry)); // Check for root CA file and take note of its handle } else if (strcmp("vol/content/browser/rootca.pem", path) == 0) { int ret = real_FSOpenFile(client, block, path, mode, handle, error); diff --git a/src/patches/olv_urls.h b/src/patches/olv_urls.h index 3224b0e..323498f 100644 --- a/src/patches/olv_urls.h +++ b/src/patches/olv_urls.h @@ -15,9 +15,10 @@ #pragma once #include +#include "inkay_config.h" -const char original_url[] = "discovery.olv.nintendo.net/v1/endpoint"; -const char new_url[] = "discovery.olv.pretendo.cc/v1/endpoint"; +constexpr char original_url[] = "discovery.olv.nintendo.net/v1/endpoint"; +constexpr char new_url[] = "discovery.olv." NETWORK_BASEURL "/v1/endpoint"; _Static_assert(sizeof(original_url) > sizeof(new_url), "new_url too long! Must be less than 38chars."); From e1d7cb56c2f46edee2ba10148e7965f09d7fd5af Mon Sep 17 00:00:00 2001 From: Ash Date: Sat, 21 Dec 2024 22:34:35 +1100 Subject: [PATCH 041/139] Create dependabot.yml --- .github/dependabot.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d41cd8e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "docker" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + commit-message: + prefix: "chore: " From cf6ad917339c2f61d61e3f5ef41211f862d8e612 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 21 Dec 2024 11:35:09 +0000 Subject: [PATCH 042/139] chore: bump wiiu-env/devkitppc from 20240505 to 20241128 Bumps wiiu-env/devkitppc from 20240505 to 20241128. --- updated-dependencies: - dependency-name: wiiu-env/devkitppc dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0f51ffa..f746cda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/wiiu-env/devkitppc:20240505 +FROM ghcr.io/wiiu-env/devkitppc:20241128 COPY --from=ghcr.io/wiiu-env/libnotifications:20240426 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO From eea33cbd18295a80271305fa5695455180745410 Mon Sep 17 00:00:00 2001 From: Ash Date: Sat, 21 Dec 2024 22:42:05 +1100 Subject: [PATCH 043/139] chore: Run CI builds for pull requests too --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60c8bf2..d8e0464 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,8 @@ name: Inkay-CI -on: push +on: +- push +- pull_request jobs: build-inkay: From fa59526cd062cf98314f9b23e1a64adbf500e065 Mon Sep 17 00:00:00 2001 From: Ash Date: Sat, 21 Dec 2024 23:17:05 +1100 Subject: [PATCH 044/139] docs: Add some basic compilation instructions --- README.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3762726..5e42d0b 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,33 @@ Inkay is an Aroma/WUPS plugin that patches various Nintendo Network URLs on a Wi Inkay also includes game-specific patches to add extra features: - Modpack-specific matchmaking for global, regional rooms (by simulating extra DLC) - **Mario Kart 8** -- P2P port override for better connection stability (if you port forward) - **Minecraft: Wii U Edition** +- P2P port override for better connection stability (if you port forward) - **Minecraft: Wii U Edition**, **Mario Kart 8**, **Splatoon** -## Dependencies +## Requirements Inkay is only supported on the release version of Aroma configured for autoboot/coldboot. Other configurations (specifically lacking coldboot) may cause issues with SpotPass. ## Safety Inkay's patches are all temporary, and only applied in-memory without modifying your console. The SSL patch, while also temporary, could reduce the overall security of your console while active - this is because it no longer checks if a server is verified. However, this does not apply to the Internet Browser, where SSL still works as expected. +## Compiling - Docker +Inkay's dependencies and build tooling can be handled as a container, which is recommended for WUPS plugins. Using `docker` or `podman`: +```shell +docker build -t inkay . +docker run --rm -v $(pwd):/app inkay make +# you can replace "make" with other commands - e.g. make clean +``` +If using `podman` on SELinux systems (like Fedora Linux), you might need to use `$(pwd):/app:Z` instead of `$(pwd):/app`. + +## Compiling - System +Inkay has the following dependencies aside from devkitPPC and wut: +- [WiiUPluginSystem](https://github.com/wiiu-env/WiiUPluginSystem) +- [WiiUModuleSystem](https://github.com/wiiu-env/WiiUModuleSystem) +- [libmocha](https://github.com/wiiu-env/libmocha) +- [libkernel](https://github.com/wiiu-env/libkernel/) +- [libnotifications](https://github.com/wiiu-env/libnotifications/) +- [libfunctionpatcher](https://github.com/wiiu-env/libfunctionpatcher) + +Each of these should be `make install`-able. After that, you can compile Inkay with `make`. + ## TODO See [Issues](https://github.com/PretendoNetwork/Inkay/issues). From 08fa9ec2690b5b2a52369fcf31cf7c854ff543ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Sat, 30 Nov 2024 15:54:17 +0000 Subject: [PATCH 045/139] Translated using Weblate (Spanish) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/es/ --- src/lang/es_ES.lang | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lang/es_ES.lang b/src/lang/es_ES.lang index c6e9188..901264d 100644 --- a/src/lang/es_ES.lang +++ b/src/lang/es_ES.lang @@ -8,3 +8,6 @@ ,.need_menu_action="Solo desde el Menú de Wii U" ,.using_nintendo_network="Usando Nintendo Network" ,.using_pretendo_network="Usando Pretendo Network" +,.multiplayer_port_display="Usando puerto UDP %hu para multijugador" +,.module_not_found="Falló el parche Pretendo - use Aroma Updater para reparar (686-1001 Falta módulo)" +,.module_init_not_found="Falló el parche Pretendo - use Aroma Updater para reparar (686-1002 Init módulo)" From abc2e53c6ea33252024216ce9fd133f3db72691c Mon Sep 17 00:00:00 2001 From: Dimitri A Date: Sun, 8 Dec 2024 21:58:23 +0000 Subject: [PATCH 046/139] Translated using Weblate (French) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/fr/ --- src/lang/fr_FR.lang | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lang/fr_FR.lang b/src/lang/fr_FR.lang index c227466..665d4f6 100644 --- a/src/lang/fr_FR.lang +++ b/src/lang/fr_FR.lang @@ -1,11 +1,13 @@ .plugin_name="Inkay" ,.network_category="Sélection du réseau" -,.connect_to_network_setting="Connexion à Pretendo" +,.connect_to_network_setting="Se connecter au réseau Pretendo" ,.other_category="Autres paramètres" ,.reset_wwp_setting="Réinitialiser la place WaraWara" ,.press_a_action="Appuyez sur A" ,.restart_to_apply_action="Redémarrer pour appliquer" ,.need_menu_action="Depuis le menu Wii U seulement" -,.using_nintendo_network="Sur Nintendo Network" -,.using_pretendo_network="Sur Pretendo Network" +,.using_nintendo_network="Réseau sélectionné : Nintendo Network" +,.using_pretendo_network="Réseau sélectionné : Pretendo Network" ,.multiplayer_port_display="Utilisation du port UDP %hu pour le multijoueur" +,.module_init_not_found="Le patch Pretendo a échoué, veuillez le réparer avec Aroma Updater (686-1002)" +,.module_not_found="Le patch Pretendo a échoué, veuillez le réparer avec Aroma Updater (686-1001: Module introuvable)" From 3a79f3228fcdc048a942aa3d3a1a7bac2ea4c7ba Mon Sep 17 00:00:00 2001 From: Dimitri A Date: Wed, 11 Dec 2024 15:57:01 +0000 Subject: [PATCH 047/139] Translated using Weblate (French) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/fr/ --- src/lang/fr_FR.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/fr_FR.lang b/src/lang/fr_FR.lang index 665d4f6..4b678f6 100644 --- a/src/lang/fr_FR.lang +++ b/src/lang/fr_FR.lang @@ -1,6 +1,6 @@ .plugin_name="Inkay" ,.network_category="Sélection du réseau" -,.connect_to_network_setting="Se connecter au réseau Pretendo" +,.connect_to_network_setting="Se connecter au Pretendo Network" ,.other_category="Autres paramètres" ,.reset_wwp_setting="Réinitialiser la place WaraWara" ,.press_a_action="Appuyez sur A" From 5b4fbd0521bf921de3366ef2aa3b90a1548371f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnau=20B=C3=A0rcia?= Date: Fri, 13 Dec 2024 23:48:51 +0000 Subject: [PATCH 048/139] Translated using Weblate (Spanish) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/es/ --- src/lang/es_ES.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/es_ES.lang b/src/lang/es_ES.lang index 901264d..d728d29 100644 --- a/src/lang/es_ES.lang +++ b/src/lang/es_ES.lang @@ -9,5 +9,5 @@ ,.using_nintendo_network="Usando Nintendo Network" ,.using_pretendo_network="Usando Pretendo Network" ,.multiplayer_port_display="Usando puerto UDP %hu para multijugador" -,.module_not_found="Falló el parche Pretendo - use Aroma Updater para reparar (686-1001 Falta módulo)" -,.module_init_not_found="Falló el parche Pretendo - use Aroma Updater para reparar (686-1002 Init módulo)" +,.module_not_found="Falló el parche Pretendo - usa Aroma Updater para reparar (686-1001 Falta un módulo)" +,.module_init_not_found="Falló el parche Pretendo - usa Aroma Updater para reparar (686-1002 Inicialización del módulo)" From f5e136704b286fa37b473efac39c253eb0fc6a12 Mon Sep 17 00:00:00 2001 From: mathijn wismeijer Date: Mon, 16 Dec 2024 15:50:26 +0000 Subject: [PATCH 049/139] Translated using Weblate (Dutch) Currently translated at 92.3% (12 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/nl/ --- src/lang/nl_NL.lang | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/lang/nl_NL.lang b/src/lang/nl_NL.lang index 6d15650..81f06be 100644 --- a/src/lang/nl_NL.lang +++ b/src/lang/nl_NL.lang @@ -1,10 +1,12 @@ -.plugin_name = "Inkay" -,.network_category = "Netwerkselectie" -,.connect_to_network_setting = "Verbind met het Pretendo-netwerk" -,.other_category = "Overige instellingen" -,.reset_wwp_setting = "Reset het Wara Wara Plaza" -,.press_a_action = "Druk A" -,.restart_to_apply_action = "Herstart om toe te passen" -,.need_menu_action = "Alleen vanuit het WiiU-menu" -,.using_nintendo_network = "Nintendo Network wordt gebruikt" -,.using_pretendo_network = "Pretendo Network wordt gebruikt" +.plugin_name="Inkay" +,.network_category="Netwerkselectie" +,.connect_to_network_setting="Verbind met het Pretendo-netwerk" +,.other_category="Overige instellingen" +,.reset_wwp_setting="Reset het Wara Wara Plaza" +,.press_a_action="Druk A" +,.restart_to_apply_action="Herstart om toe te passen" +,.need_menu_action="Alleen vanuit het WiiU-menu" +,.using_nintendo_network="Nintendo Network wordt gebruikt" +,.using_pretendo_network="Pretendo Network wordt gebruikt" +,.module_init_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1002 Module init)" +,.module_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1001 Module ontbreekt)" From 4c4f8ae3554445f1735b01c206a1d132ea0937e4 Mon Sep 17 00:00:00 2001 From: Dimitri A Date: Wed, 18 Dec 2024 18:16:21 +0000 Subject: [PATCH 050/139] Translated using Weblate (French) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/fr/ --- src/lang/fr_FR.lang | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lang/fr_FR.lang b/src/lang/fr_FR.lang index 4b678f6..a9e3b28 100644 --- a/src/lang/fr_FR.lang +++ b/src/lang/fr_FR.lang @@ -1,13 +1,13 @@ .plugin_name="Inkay" ,.network_category="Sélection du réseau" -,.connect_to_network_setting="Se connecter au Pretendo Network" +,.connect_to_network_setting="Connexion au Pretendo Network" ,.other_category="Autres paramètres" ,.reset_wwp_setting="Réinitialiser la place WaraWara" ,.press_a_action="Appuyez sur A" -,.restart_to_apply_action="Redémarrer pour appliquer" -,.need_menu_action="Depuis le menu Wii U seulement" +,.restart_to_apply_action="(prendra effet au redémarrage)" +,.need_menu_action="(retournez d'abord au menu Wii U)" ,.using_nintendo_network="Réseau sélectionné : Nintendo Network" ,.using_pretendo_network="Réseau sélectionné : Pretendo Network" -,.multiplayer_port_display="Utilisation du port UDP %hu pour le multijoueur" -,.module_init_not_found="Le patch Pretendo a échoué, veuillez le réparer avec Aroma Updater (686-1002)" -,.module_not_found="Le patch Pretendo a échoué, veuillez le réparer avec Aroma Updater (686-1001: Module introuvable)" +,.multiplayer_port_display="Le port UDP %hu sera utilisé pour le multijoueur" +,.module_init_not_found="Le patch Pretendo a échoué, veuillez le réparer avec Aroma Updater (686-1002 Point d'entrée du module)" +,.module_not_found="Le patch Pretendo a échoué, veuillez le réparer avec Aroma Updater (686-1001 Module introuvable)" From 85e64547d3f111c11cd3d95c1af87b1e222099e9 Mon Sep 17 00:00:00 2001 From: Dimitri A Date: Wed, 18 Dec 2024 23:16:36 +0000 Subject: [PATCH 051/139] Translated using Weblate (Japanese) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/ja/ --- src/lang/ja_JP.lang | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/lang/ja_JP.lang b/src/lang/ja_JP.lang index 1e88f5a..9fa5ec8 100644 --- a/src/lang/ja_JP.lang +++ b/src/lang/ja_JP.lang @@ -1,10 +1,13 @@ -.plugin_name = "Inkay" -,.network_category = "ネットワークの選択" -,.connect_to_network_setting = "Pretendoネットワークに接続" -,.other_category = "その他の設定" -,.reset_wwp_setting = "わらわら広場をリセット" -,.press_a_action = "Aボタンを押す" -,.restart_to_apply_action = "再起動して適用" -,.need_menu_action = "WiiUメニューからのみ実行可能" -,.using_nintendo_network = "ニンテンドーネットワークを使用中" -,.using_pretendo_network = "Pretendoネットワークを使用中" +.plugin_name="Inkay" +,.network_category="ネットワークの選択" +,.connect_to_network_setting="Pretendoネットワークに接続する" +,.other_category="その他の設定" +,.reset_wwp_setting="わらわら広場をリセット" +,.press_a_action="Aボタンを押そう" +,.restart_to_apply_action="再起動後に反映されます" +,.need_menu_action="Wii Uメニューからのみ実行可能" +,.using_nintendo_network="ニンテンドーネットワークを選択中" +,.using_pretendo_network="Pretendo ネットワークを選択中" +,.multiplayer_port_display=マルチプレイにとって UDPポート %hu を使用します +,.module_init_not_found=Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1002 Module init) +,.module_not_found=Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1001 Module missing) From e6fd32cf7a3ef6eb7c4b8c7e297067af07fbc850 Mon Sep 17 00:00:00 2001 From: Ash Tails Date: Sat, 21 Dec 2024 11:11:37 +0000 Subject: [PATCH 052/139] Translated using Weblate (Japanese) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/ja/ --- src/lang/ja_JP.lang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lang/ja_JP.lang b/src/lang/ja_JP.lang index 9fa5ec8..9ecda2e 100644 --- a/src/lang/ja_JP.lang +++ b/src/lang/ja_JP.lang @@ -8,6 +8,6 @@ ,.need_menu_action="Wii Uメニューからのみ実行可能" ,.using_nintendo_network="ニンテンドーネットワークを選択中" ,.using_pretendo_network="Pretendo ネットワークを選択中" -,.multiplayer_port_display=マルチプレイにとって UDPポート %hu を使用します -,.module_init_not_found=Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1002 Module init) -,.module_not_found=Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1001 Module missing) +,.multiplayer_port_display="マルチプレイにとって UDPポート %hu を使用します" +,.module_init_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1002 Module init)" +,.module_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1001 Module missing)" From bb34ab259c3266db714cd96d78afcf4650a754af Mon Sep 17 00:00:00 2001 From: Dimitri A Date: Sat, 21 Dec 2024 14:23:11 +0000 Subject: [PATCH 053/139] Translated using Weblate (Japanese) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/ja/ --- src/lang/ja_JP.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/ja_JP.lang b/src/lang/ja_JP.lang index 9ecda2e..6b4339e 100644 --- a/src/lang/ja_JP.lang +++ b/src/lang/ja_JP.lang @@ -8,6 +8,6 @@ ,.need_menu_action="Wii Uメニューからのみ実行可能" ,.using_nintendo_network="ニンテンドーネットワークを選択中" ,.using_pretendo_network="Pretendo ネットワークを選択中" -,.multiplayer_port_display="マルチプレイにとって UDPポート %hu を使用します" +,.multiplayer_port_display="マルチプレイに UDPポート %hu を使用します" ,.module_init_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1002 Module init)" ,.module_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1001 Module missing)" From b4c4cf424b4b3b748e9eada0eb7db6eaccfc1fff Mon Sep 17 00:00:00 2001 From: Dimitri A Date: Sat, 21 Dec 2024 14:39:57 +0000 Subject: [PATCH 054/139] Translated using Weblate (Japanese) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/ja/ --- src/lang/ja_JP.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/ja_JP.lang b/src/lang/ja_JP.lang index 6b4339e..c486b7b 100644 --- a/src/lang/ja_JP.lang +++ b/src/lang/ja_JP.lang @@ -6,8 +6,8 @@ ,.press_a_action="Aボタンを押そう" ,.restart_to_apply_action="再起動後に反映されます" ,.need_menu_action="Wii Uメニューからのみ実行可能" -,.using_nintendo_network="ニンテンドーネットワークを選択中" -,.using_pretendo_network="Pretendo ネットワークを選択中" +,.using_nintendo_network="選択済み:ニンテンドーネットワーク" +,.using_pretendo_network="選択済み:Pretendo ネットワーク" ,.multiplayer_port_display="マルチプレイに UDPポート %hu を使用します" ,.module_init_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1002 Module init)" ,.module_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1001 Module missing)" From 816b34473bad3cfb84605df627208a4304ef08f9 Mon Sep 17 00:00:00 2001 From: Ellie Rosa Maiella Date: Mon, 23 Dec 2024 23:42:15 +0000 Subject: [PATCH 055/139] Translated using Weblate (Italian) Currently translated at 76.9% (10 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/it/ --- src/lang/it_IT.lang | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lang/it_IT.lang b/src/lang/it_IT.lang index 7dbf2ff..c0002ae 100644 --- a/src/lang/it_IT.lang +++ b/src/lang/it_IT.lang @@ -1,10 +1,10 @@ -.plugin_name = "Inkay" -,.network_category = "Selezione della rete" -,.connect_to_network_setting = "Connettiti alla rete Pretendo" -,.other_category = "Altre categorie" -,.reset_wwp_setting = "Ripristina Wara Wara Plaza" -,.press_a_action = "Premi A" -,.restart_to_apply_action = "Riavvia per applicare" -,.need_menu_action = "Solo dal menu WiiU" -,.using_nintendo_network = "Usando Nintendo Network" -,.using_pretendo_network = "Usando Pretendo Network" +.plugin_name="Inkay" +,.network_category="Selezione della rete" +,.connect_to_network_setting="Connettiti alla rete Pretendo" +,.other_category="Altre impostazioni" +,.reset_wwp_setting="Ripristina Wara Wara Plaza" +,.press_a_action="Premi A" +,.restart_to_apply_action="Riavvia per applicare" +,.need_menu_action="Solo dal menu WiiU" +,.using_nintendo_network="Usando Nintendo Network" +,.using_pretendo_network="Usando Pretendo Network" From a6e1fae40284e4eb0c19a4ee1d97b6020349d5bb Mon Sep 17 00:00:00 2001 From: Eduardo Toebe Date: Mon, 23 Dec 2024 05:20:25 +0000 Subject: [PATCH 056/139] Translated using Weblate (Portuguese (Brazil)) Currently translated at 92.3% (12 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/pt_BR/ --- src/lang/pt_BR.lang | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/lang/pt_BR.lang b/src/lang/pt_BR.lang index 5e60a59..2d9483d 100644 --- a/src/lang/pt_BR.lang +++ b/src/lang/pt_BR.lang @@ -1,10 +1,12 @@ -.plugin_name = "Inkay" -,.network_category = "Selecionar rede" -,.connect_to_network_setting = "Conecta-se à Pretendo Network" -,.other_category = "Outras configurações" -,.reset_wwp_setting = "Resetar Wara Wara Plaza" -,.press_a_action = "Aperte A" -,.restart_to_apply_action = "Reinicie para aplicar" -,.need_menu_action = "Apenas no menu do Wii U" -,.using_nintendo_network = "Usando Nintendo Network" -,.using_pretendo_network = "Usando Pretendo Network" +.plugin_name="Inkay" +,.network_category="Selecionar rede" +,.connect_to_network_setting="Conecta-se à Pretendo Network" +,.other_category="Outras configurações" +,.reset_wwp_setting="Resetar Wara Wara Plaza" +,.press_a_action="Aperte A" +,.restart_to_apply_action="Reinicie para aplicar" +,.need_menu_action="Apenas no menu do Wii U" +,.using_nintendo_network="Usando Nintendo Network" +,.using_pretendo_network="Usando Pretendo Network" +,.module_not_found="Atualização do Pretendo falhou - use o Aroma Updater para corrigir (686-1001 Módulo faltando)" +,.module_init_not_found="Atualização do Pretendo falhou - use o Aroma Updater para corrigir (686-1002 Módulo de início)" From 4adf1f267d9d29700165d8add887fd11c9569efb Mon Sep 17 00:00:00 2001 From: Alex Wang Date: Thu, 2 Jan 2025 05:03:36 +0000 Subject: [PATCH 057/139] Translated using Weblate (Chinese (Simplified Han script)) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/zh_Hans/ --- src/lang/zh_CN.lang | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/lang/zh_CN.lang b/src/lang/zh_CN.lang index df1bc5a..39736b1 100644 --- a/src/lang/zh_CN.lang +++ b/src/lang/zh_CN.lang @@ -1,10 +1,13 @@ -.plugin_name = "Inkay" -,.network_category = "选择网络" -,.connect_to_network_setting = "连接到Pretendo network" -,.other_category = "其他设置" -,.reset_wwp_setting = "重置Wara Wara Plaza" -,.press_a_action = "请按 A" -,.restart_to_apply_action = "重启以应用设置" -,.need_menu_action = "仅来自WiiU Menu" -,.using_nintendo_network = "使用 Nintendo Network" -,.using_pretendo_network = "使用 Pretendo Network" +.plugin_name="Inkay" +,.network_category="选择网络" +,.connect_to_network_setting="连接到Pretendo network" +,.other_category="其他设置" +,.reset_wwp_setting="重置Wara Wara Plaza" +,.press_a_action="请按 A" +,.restart_to_apply_action="重启以应用设置" +,.need_menu_action="仅来自WiiU Menu" +,.using_nintendo_network="使用 Nintendo Network" +,.using_pretendo_network="使用 Pretendo Network" +,.module_not_found="Pretendo 补丁失败 - 使用 Aroma Updater 修复(686-1001 模块丢失)" +,.multiplayer_port_display="多人游戏使用 UDP 端口 %hu" +,.module_init_not_found="Pretendo 补丁失败 - 使用 Aroma Updater 修复(686-1002 模块初始化)" From f02eacad889320580516588948fb19f8c62cc63e Mon Sep 17 00:00:00 2001 From: almi05 Date: Sat, 18 Jan 2025 11:10:57 +0000 Subject: [PATCH 058/139] Translated using Weblate (Italian) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/it/ --- src/lang/it_IT.lang | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lang/it_IT.lang b/src/lang/it_IT.lang index c0002ae..6c673f2 100644 --- a/src/lang/it_IT.lang +++ b/src/lang/it_IT.lang @@ -1,10 +1,13 @@ .plugin_name="Inkay" -,.network_category="Selezione della rete" +,.network_category="Seleziona la rete" ,.connect_to_network_setting="Connettiti alla rete Pretendo" ,.other_category="Altre impostazioni" ,.reset_wwp_setting="Ripristina Wara Wara Plaza" ,.press_a_action="Premi A" ,.restart_to_apply_action="Riavvia per applicare" ,.need_menu_action="Solo dal menu WiiU" -,.using_nintendo_network="Usando Nintendo Network" -,.using_pretendo_network="Usando Pretendo Network" +,.using_nintendo_network="In uso Nintendo Network" +,.using_pretendo_network="In uso Pretendo Network" +,.multiplayer_port_display="È in uso la porta UDP %hu per il multigiocatore" +,.module_not_found="Patch di Pretendo fallita - usa Aroma Updater per correggere (686-1001 Modulo mancante)" +,.module_init_not_found="Patch di Pretendo fallita - usa Aroma Updater per correggere (686-1002 Module init)" From 0afd60d7f6b3dfb20cbf077edaeeb91dd1f1fb17 Mon Sep 17 00:00:00 2001 From: Nervi05 Date: Tue, 21 Jan 2025 21:46:03 +0000 Subject: [PATCH 059/139] Translated using Weblate (German) Currently translated at 92.3% (12 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/de/ --- src/lang/de_DE.lang | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/lang/de_DE.lang b/src/lang/de_DE.lang index 1bfb5e8..5b192c1 100644 --- a/src/lang/de_DE.lang +++ b/src/lang/de_DE.lang @@ -1,10 +1,12 @@ -.plugin_name = "Inkay" -,.network_category = "Netzwerkauswahl" -,.connect_to_network_setting = "Verbinde zum Pretendo Network" -,.other_category = "Andere Einstellungen" -,.reset_wwp_setting = "Wara Wara Plaza zurücksetzen" -,.press_a_action = "Drücke A" -,.restart_to_apply_action = "Neustarten zum Anwenden" -,.need_menu_action = "Nur vom Wii U-Menü aus" -,.using_nintendo_network = "Nutze Nintendo Network" -,.using_pretendo_network = "Nutze Pretendo Network" +.plugin_name="Inkay" +,.network_category="Netzwerkauswahl" +,.connect_to_network_setting="Verbinde zum Pretendo Network" +,.other_category="Andere Einstellungen" +,.reset_wwp_setting="Wara Wara Plaza zurücksetzen" +,.press_a_action="Drücke A" +,.restart_to_apply_action="Neustarten zum Anwenden" +,.need_menu_action="Nur vom Wii U-Menü aus" +,.using_nintendo_network="Nutze Nintendo Network" +,.using_pretendo_network="Nutze Pretendo Network" +,.multiplayer_port_display="Nutze UDP Port %hu für Mehrspieler" +,.module_not_found="Pretendo Patch fehlgeschlagen - Nutze Aroma Updater zum reparieren (Modul 686-1001 fehlt)" From 1acb60ff4937e452660e7d492056bf9be18209d4 Mon Sep 17 00:00:00 2001 From: Lacey Anaya Date: Tue, 21 Jan 2025 21:48:21 +0000 Subject: [PATCH 060/139] Translated using Weblate (German) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/de/ --- src/lang/de_DE.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/de_DE.lang b/src/lang/de_DE.lang index 5b192c1..dc580d7 100644 --- a/src/lang/de_DE.lang +++ b/src/lang/de_DE.lang @@ -9,4 +9,4 @@ ,.using_nintendo_network="Nutze Nintendo Network" ,.using_pretendo_network="Nutze Pretendo Network" ,.multiplayer_port_display="Nutze UDP Port %hu für Mehrspieler" -,.module_not_found="Pretendo Patch fehlgeschlagen - Nutze Aroma Updater zum reparieren (Modul 686-1001 fehlt)" +,.module_not_found="Pretendo Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1001 Module missing)" From a9ee61babe9240cb6be81642dd979e6f0202693a Mon Sep 17 00:00:00 2001 From: Nervi05 Date: Tue, 21 Jan 2025 21:48:30 +0000 Subject: [PATCH 061/139] Translated using Weblate (German) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/de/ --- src/lang/de_DE.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lang/de_DE.lang b/src/lang/de_DE.lang index dc580d7..46b823b 100644 --- a/src/lang/de_DE.lang +++ b/src/lang/de_DE.lang @@ -10,3 +10,4 @@ ,.using_pretendo_network="Nutze Pretendo Network" ,.multiplayer_port_display="Nutze UDP Port %hu für Mehrspieler" ,.module_not_found="Pretendo Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1001 Module missing)" +,.module_init_not_found="Pretendo Patch fehlgeschlagen - Nutze Aroma Updater zum reparieren (Modul 686-1002 initialisieren)" From b5cf02bb90538a26ac36b58a2627eedfca0ab43b Mon Sep 17 00:00:00 2001 From: Lacey Anaya Date: Tue, 21 Jan 2025 21:49:12 +0000 Subject: [PATCH 062/139] Translated using Weblate (German) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/de/ --- src/lang/de_DE.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/de_DE.lang b/src/lang/de_DE.lang index 46b823b..19a57dd 100644 --- a/src/lang/de_DE.lang +++ b/src/lang/de_DE.lang @@ -10,4 +10,4 @@ ,.using_pretendo_network="Nutze Pretendo Network" ,.multiplayer_port_display="Nutze UDP Port %hu für Mehrspieler" ,.module_not_found="Pretendo Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1001 Module missing)" -,.module_init_not_found="Pretendo Patch fehlgeschlagen - Nutze Aroma Updater zum reparieren (Modul 686-1002 initialisieren)" +,.module_init_not_found="Pretendo Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1002 Module init)" From eef3580fcad1e52b004c4de59ef15489929b8afd Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Thu, 23 Jan 2025 22:24:25 +0000 Subject: [PATCH 063/139] Translated using Weblate (Russian) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/ru/ --- src/lang/ru_RU.lang | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/lang/ru_RU.lang b/src/lang/ru_RU.lang index 966166b..3dc9c9c 100644 --- a/src/lang/ru_RU.lang +++ b/src/lang/ru_RU.lang @@ -1,10 +1,13 @@ -.plugin_name = "Inkay" -,.network_category = "Выбор сети" -,.connect_to_network_setting = "Подключиться к Pretendo Network" -,.other_category = "Другие настройки" -,.reset_wwp_setting = "Сбросить Wara Wara Plaza" -,.press_a_action = "Нажмите A" -,.restart_to_apply_action = "Перезагрузите для применения изменений" -,.need_menu_action = "Только из меню Wii U" -,.using_nintendo_network = "Используется Nintendo Network" -,.using_pretendo_network = "Используется Pretendo Network" +.plugin_name="Inkay" +,.network_category="Выбор сети" +,.connect_to_network_setting="Подключиться к Pretendo Network" +,.other_category="Другие настройки" +,.reset_wwp_setting="Сбросить Wara Wara Plaza" +,.press_a_action="Нажмите A" +,.restart_to_apply_action="Перезагрузите для применения изменений" +,.need_menu_action="Только из меню Wii U" +,.using_nintendo_network="Используется Nintendo Network" +,.using_pretendo_network="Используется Pretendo Network" +,.multiplayer_port_display="Используем UDP-порт %hu для сетевой игры" +,.module_not_found="Ошибка установки патча Pretendo - для восстановления, запустите Aroma Updater (686-1001 Модуль отсутствует)" +,.module_init_not_found="Ошибка установки патча Pretendo - для восстановления, запустите Aroma Updater (686-1002 Инициализация модуля)" From f6bb2805f6d3e6f64e88bef710266346aa91fe6f Mon Sep 17 00:00:00 2001 From: Deleted User Date: Wed, 29 Jan 2025 09:57:38 +0000 Subject: [PATCH 064/139] Translated using Weblate (Spanish) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/es/ --- src/lang/es_ES.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/es_ES.lang b/src/lang/es_ES.lang index d728d29..b585373 100644 --- a/src/lang/es_ES.lang +++ b/src/lang/es_ES.lang @@ -1,10 +1,10 @@ .plugin_name="Inkay" -,.network_category="Selección de red" +,.network_category="Seleccionar red" ,.connect_to_network_setting="Conectar a la red Pretendo" ,.other_category="Otros ajustes" ,.reset_wwp_setting="Restablecer Plaza Wara Wara" ,.press_a_action="Pulsa A" -,.restart_to_apply_action="Reinicia para confirmar" +,.restart_to_apply_action="Reiniciar para aplicar" ,.need_menu_action="Solo desde el Menú de Wii U" ,.using_nintendo_network="Usando Nintendo Network" ,.using_pretendo_network="Usando Pretendo Network" From 1ffb9cf65afe20257c39f3d5a36ca38fc108d381 Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 30 Jan 2025 18:26:01 +0100 Subject: [PATCH 065/139] feat: Show notification is plugin is missing or module was never initialized --- Dockerfile | 2 +- plugin/src/main.cpp | 3 ++- plugin/src/module.cpp | 19 +++++++++++++++++-- plugin/src/module.h | 1 + src/config.cpp | 1 + src/config.h | 2 ++ src/main.cpp | 34 +++++++++++++++++++++------------- 7 files changed, 45 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index f746cda..24f8a62 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ COPY --from=ghcr.io/wiiu-env/libnotifications:20240426 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libkernel:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libmocha:20231127 /artifacts $DEVKITPRO -COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20240424 /artifacts $DEVKITPRO +COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:0.3.3-dev-20250130-474ef70 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/wiiupluginsystem:20240505 /artifacts $DEVKITPRO WORKDIR /app diff --git a/plugin/src/main.cpp b/plugin/src/main.cpp index 4845a38..73968ea 100644 --- a/plugin/src/main.cpp +++ b/plugin/src/main.cpp @@ -62,7 +62,8 @@ DEINITIALIZE_PLUGIN() { } ON_APPLICATION_START() { - + // Tell the module the plugin is running! + Inkay_SetPluginRunning(); } ON_APPLICATION_ENDS() { diff --git a/plugin/src/module.cpp b/plugin/src/module.cpp index 5fd9c2a..c20d980 100644 --- a/plugin/src/module.cpp +++ b/plugin/src/module.cpp @@ -15,17 +15,18 @@ */ #include "module.h" -#include -#include "config.h" #include "Notification.h" #include "utils/logger.h" #include "sysconfig.h" #include "lang.h" +#include + static OSDynLoad_Module module; static void (*moduleInitialize)(bool) = nullptr; static InkayStatus (*moduleGetStatus)() = nullptr; +static void (*moduleSetPluginRunning)() = nullptr; static const char *get_module_not_found_message() { return get_config_strings(get_system_language()).module_not_found.data(); @@ -61,6 +62,7 @@ void Inkay_Finalize() { OSDynLoad_Release(module); moduleInitialize = nullptr; moduleGetStatus = nullptr; + moduleSetPluginRunning = nullptr; } } @@ -76,3 +78,16 @@ InkayStatus Inkay_GetStatus() { return moduleGetStatus(); } + +void Inkay_SetPluginRunning() { + if (!module) { + return; + } + + if (!moduleSetPluginRunning && OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_SetPluginRunning", reinterpret_cast(&moduleSetPluginRunning)) != OS_DYNLOAD_OK) { + DEBUG_FUNCTION_LINE("Failed to find \"Inkay_SetPluginRunning\" function"); + return; + } + + moduleSetPluginRunning(); +} diff --git a/plugin/src/module.h b/plugin/src/module.h index b6247a4..ab7836d 100644 --- a/plugin/src/module.h +++ b/plugin/src/module.h @@ -27,3 +27,4 @@ enum class InkayStatus { void Inkay_Initialize(bool apply_patches); void Inkay_Finalize(); InkayStatus Inkay_GetStatus(); +void Inkay_SetPluginRunning(); diff --git a/src/config.cpp b/src/config.cpp index 56c8740..06e1a8f 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -20,3 +20,4 @@ bool Config::connect_to_network = false; bool Config::initialized = false; bool Config::shown_uninitialized_warning = false; +bool Config::plugin_is_loaded = false; diff --git a/src/config.h b/src/config.h index 96f6775..0d4da6b 100644 --- a/src/config.h +++ b/src/config.h @@ -15,6 +15,8 @@ public: static bool initialized; static bool shown_uninitialized_warning; + + static bool plugin_is_loaded; }; #endif //INKAY_CONFIG_H diff --git a/src/main.cpp b/src/main.cpp index 7c4612d..fa9b9d4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -118,6 +118,10 @@ static const char *get_pretendo_message() { return get_config_strings(get_system_language()).using_pretendo_network.data(); } +static void Inkay_SetPluginRunning() { + Config::plugin_is_loaded = true; +} + static InkayStatus Inkay_GetStatus() { if (!Config::initialized) return InkayStatus::Uninitialized; @@ -131,7 +135,7 @@ static InkayStatus Inkay_GetStatus() { static void Inkay_Initialize(bool apply_patches) { if (Config::initialized) - return; + return; // if using pretendo then (try to) apply the ssl patches if (apply_patches) { @@ -177,9 +181,7 @@ WUMS_INITIALIZE() { WHBLogCafeInit(); WHBLogUdpInit(); - auto res = Mocha_InitLibrary(); - - if (res != MOCHA_RESULT_SUCCESS) { + if (const auto res = Mocha_InitLibrary(); res != MOCHA_RESULT_SUCCESS) { DEBUG_FUNCTION_LINE("Mocha init failed with code %d!", res); return; } @@ -207,14 +209,8 @@ WUMS_DEINITIALIZE() { WUMS_APPLICATION_STARTS() { DEBUG_FUNCTION_LINE_VERBOSE("Inkay " INKAY_VERSION " starting up...\n"); - // TODO - Add a way to reliably check this. We can't do it here since this path gets triggered before - // the plugin gets initialized. - // - // if (!Config::initialized && !Config::shown_uninitialized_warning) { - // DEBUG_FUNCTION_LINE("Inkay module not initialized"); - // ShowNotification("Inkay module was not initialized. Ensure you have the Inkay plugin loaded"); - // Config::shown_uninitialized_warning = true; - // } + // Reset plugin loaded flag + Config::plugin_is_loaded = false; setup_olv_libs(); peertopeer_patch(); @@ -222,9 +218,21 @@ WUMS_APPLICATION_STARTS() { hotpatchAccountSettings(); } -WUMS_APPLICATION_ENDS() { +WUMS_ALL_APPLICATION_STARTS_DONE() { + if (Config::initialized && !Config::plugin_is_loaded) { + DEBUG_FUNCTION_LINE("Inkay is running but the plugin got unloaded"); + ShowNotification("Inkay module is still running. Please restart the console to disable Pretendo."); + Config::shown_uninitialized_warning = true; + } else if (!Config::initialized && !Config::shown_uninitialized_warning) { + DEBUG_FUNCTION_LINE("Inkay module not initialized"); + ShowNotification("Inkay module was not initialized. Ensure you have the Inkay plugin loaded"); + Config::shown_uninitialized_warning = true; + } +} +WUMS_APPLICATION_ENDS() { } WUMS_EXPORT_FUNCTION(Inkay_Initialize); WUMS_EXPORT_FUNCTION(Inkay_GetStatus); +WUMS_EXPORT_FUNCTION(Inkay_SetPluginRunning); From cc3fac1cc77ebbbe4606cf262f7d0dd7650f20de Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 30 Jan 2025 18:27:20 +0100 Subject: [PATCH 066/139] (chore): clean up includes --- plugin/src/config.cpp | 1 + src/main.cpp | 35 ++++++++++++----------------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/plugin/src/config.cpp b/plugin/src/config.cpp index 0b99ffa..98c2323 100644 --- a/plugin/src/config.cpp +++ b/plugin/src/config.cpp @@ -33,6 +33,7 @@ #include #include #include + #include static config_strings strings; diff --git a/src/main.cpp b/src/main.cpp index fa9b9d4..502aab8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,22 +16,6 @@ along with this program. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "export.h" #include "iosu_url_patches.h" #include "config.h" @@ -39,16 +23,22 @@ #include "patches/olv_urls.h" #include "patches/game_matchmaking.h" -#include -#include +#include + +#include +#include + +#include +#include + #include -#include -#include +#include + +#include +#include #include "ca_pem.h" -#include - #define INKAY_VERSION "v2.6.0" /** @@ -67,7 +57,6 @@ WUMS_DEPENDS_ON(homebrew_notifications); WUMS_USE_WUT_DEVOPTAB(); -#include #include #include #include "patches/account_settings.h" From f9b0477c4ed03ecc44b80b101ead965c914728a3 Mon Sep 17 00:00:00 2001 From: kaio mesquita fragoso Date: Sun, 2 Feb 2025 17:57:22 +0000 Subject: [PATCH 067/139] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/pt_BR/ --- src/lang/pt_BR.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lang/pt_BR.lang b/src/lang/pt_BR.lang index 2d9483d..5b4333b 100644 --- a/src/lang/pt_BR.lang +++ b/src/lang/pt_BR.lang @@ -10,3 +10,4 @@ ,.using_pretendo_network="Usando Pretendo Network" ,.module_not_found="Atualização do Pretendo falhou - use o Aroma Updater para corrigir (686-1001 Módulo faltando)" ,.module_init_not_found="Atualização do Pretendo falhou - use o Aroma Updater para corrigir (686-1002 Módulo de início)" +,.multiplayer_port_display="Usando UDP port %hu para a jogatina multiplayer" From 24f680c6fbe0d47f9155622ff867200d0b44b148 Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 3 Feb 2025 12:44:29 +0100 Subject: [PATCH 068/139] fix: Only do function patches if the plugin had to to update init Inkay --- src/config.cpp | 1 + src/config.h | 2 ++ src/main.cpp | 12 +++++++----- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index 06e1a8f..5fdb3f0 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -17,6 +17,7 @@ #include "config.h" +bool Config::internal_init_done = false; bool Config::connect_to_network = false; bool Config::initialized = false; bool Config::shown_uninitialized_warning = false; diff --git a/src/config.h b/src/config.h index 0d4da6b..6e82ff7 100644 --- a/src/config.h +++ b/src/config.h @@ -10,6 +10,8 @@ class Config { public: + static bool internal_init_done; + static bool connect_to_network; static bool initialized; diff --git a/src/main.cpp b/src/main.cpp index 502aab8..0c189be 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -200,14 +200,16 @@ WUMS_APPLICATION_STARTS() { // Reset plugin loaded flag Config::plugin_is_loaded = false; - - setup_olv_libs(); - peertopeer_patch(); - matchmaking_notify_titleswitch(); - hotpatchAccountSettings(); } WUMS_ALL_APPLICATION_STARTS_DONE() { + if (!Config::internal_init_done) { + setup_olv_libs(); + peertopeer_patch(); + matchmaking_notify_titleswitch(); + hotpatchAccountSettings(); + Config::internal_init_done = true; + } if (Config::initialized && !Config::plugin_is_loaded) { DEBUG_FUNCTION_LINE("Inkay is running but the plugin got unloaded"); ShowNotification("Inkay module is still running. Please restart the console to disable Pretendo."); From e2cf529b3fcd7da7d78e8525777e6d9e15d70ff6 Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 3 Feb 2025 12:45:17 +0100 Subject: [PATCH 069/139] fix: Only allow the plugin to init Inkay at boot to avoid potential crashes --- src/config.cpp | 1 + src/config.h | 2 ++ src/main.cpp | 12 +++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/config.cpp b/src/config.cpp index 5fdb3f0..9201ffd 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -22,3 +22,4 @@ bool Config::connect_to_network = false; bool Config::initialized = false; bool Config::shown_uninitialized_warning = false; bool Config::plugin_is_loaded = false; +bool Config::block_initialize = false; diff --git a/src/config.h b/src/config.h index 6e82ff7..64a2c6c 100644 --- a/src/config.h +++ b/src/config.h @@ -19,6 +19,8 @@ public: static bool shown_uninitialized_warning; static bool plugin_is_loaded; + + static bool block_initialize; }; #endif //INKAY_CONFIG_H diff --git a/src/main.cpp b/src/main.cpp index 0c189be..b06dde2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -126,6 +126,11 @@ static void Inkay_Initialize(bool apply_patches) { if (Config::initialized) return; + if (Config::block_initialize) { + ShowNotification("Failed to init Inkay. Please restart the console to use Pretendo"); + return; + } + // if using pretendo then (try to) apply the ssl patches if (apply_patches) { Config::connect_to_network = true; @@ -212,13 +217,18 @@ WUMS_ALL_APPLICATION_STARTS_DONE() { } if (Config::initialized && !Config::plugin_is_loaded) { DEBUG_FUNCTION_LINE("Inkay is running but the plugin got unloaded"); - ShowNotification("Inkay module is still running. Please restart the console to disable Pretendo."); + if (!Config::block_initialize) { + ShowNotification("Inkay module is still running. Please restart the console to disable Pretendo."); + } Config::shown_uninitialized_warning = true; } else if (!Config::initialized && !Config::shown_uninitialized_warning) { DEBUG_FUNCTION_LINE("Inkay module not initialized"); ShowNotification("Inkay module was not initialized. Ensure you have the Inkay plugin loaded"); Config::shown_uninitialized_warning = true; } + if (!Config::initialized) { + Config::block_initialize = true; + } } WUMS_APPLICATION_ENDS() { From 429d55ba9faaba9df32b65ee1dd7b21079296411 Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 3 Feb 2025 19:38:44 +0100 Subject: [PATCH 070/139] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Daniel López Guimaraes <112760654+DaniElectra@users.noreply.github.com> --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b06dde2..8f8dcd4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -127,7 +127,7 @@ static void Inkay_Initialize(bool apply_patches) { return; if (Config::block_initialize) { - ShowNotification("Failed to init Inkay. Please restart the console to use Pretendo"); + ShowNotification("Cannot load Inkay while the system is running. Please restart the console"); return; } @@ -218,7 +218,7 @@ WUMS_ALL_APPLICATION_STARTS_DONE() { if (Config::initialized && !Config::plugin_is_loaded) { DEBUG_FUNCTION_LINE("Inkay is running but the plugin got unloaded"); if (!Config::block_initialize) { - ShowNotification("Inkay module is still running. Please restart the console to disable Pretendo."); + ShowNotification("Inkay module is still running. Please restart the console"); } Config::shown_uninitialized_warning = true; } else if (!Config::initialized && !Config::shown_uninitialized_warning) { From ed75702ac58a8e9389849894f2dd2d71a8a24282 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 8 Feb 2025 23:04:53 +0100 Subject: [PATCH 071/139] Review fixes and update dockerfile --- Dockerfile | 2 +- src/config.cpp | 2 +- src/config.h | 2 +- src/main.cpp | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 24f8a62..46c49d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ COPY --from=ghcr.io/wiiu-env/libnotifications:20240426 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libkernel:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libmocha:20231127 /artifacts $DEVKITPRO -COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:0.3.3-dev-20250130-474ef70 /artifacts $DEVKITPRO +COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20250208 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/wiiupluginsystem:20240505 /artifacts $DEVKITPRO WORKDIR /app diff --git a/src/config.cpp b/src/config.cpp index 9201ffd..d246580 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -20,6 +20,6 @@ bool Config::internal_init_done = false; bool Config::connect_to_network = false; bool Config::initialized = false; -bool Config::shown_uninitialized_warning = false; +bool Config::shown_warning = false; bool Config::plugin_is_loaded = false; bool Config::block_initialize = false; diff --git a/src/config.h b/src/config.h index 64a2c6c..966a655 100644 --- a/src/config.h +++ b/src/config.h @@ -16,7 +16,7 @@ public: static bool initialized; - static bool shown_uninitialized_warning; + static bool shown_warning; static bool plugin_is_loaded; diff --git a/src/main.cpp b/src/main.cpp index 8f8dcd4..9e3b085 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -220,11 +220,11 @@ WUMS_ALL_APPLICATION_STARTS_DONE() { if (!Config::block_initialize) { ShowNotification("Inkay module is still running. Please restart the console"); } - Config::shown_uninitialized_warning = true; - } else if (!Config::initialized && !Config::shown_uninitialized_warning) { + Config::shown_warning = true; + } else if (!Config::initialized && !Config::shown_warning) { DEBUG_FUNCTION_LINE("Inkay module not initialized"); ShowNotification("Inkay module was not initialized. Ensure you have the Inkay plugin loaded"); - Config::shown_uninitialized_warning = true; + Config::shown_warning = true; } if (!Config::initialized) { Config::block_initialize = true; From 79ccad1fd40a91b22895dceb6c718aa79cc009f2 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 9 Feb 2025 10:26:09 +0100 Subject: [PATCH 072/139] fix: Do title specific patches more than once --- src/config.cpp | 1 - src/config.h | 4 ---- src/main.cpp | 13 ++++++------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index d246580..66a78c4 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -17,7 +17,6 @@ #include "config.h" -bool Config::internal_init_done = false; bool Config::connect_to_network = false; bool Config::initialized = false; bool Config::shown_warning = false; diff --git a/src/config.h b/src/config.h index 966a655..8455bb0 100644 --- a/src/config.h +++ b/src/config.h @@ -5,12 +5,8 @@ #ifndef INKAY_CONFIG_H #define INKAY_CONFIG_H -#include -#include - class Config { public: - static bool internal_init_done; static bool connect_to_network; diff --git a/src/main.cpp b/src/main.cpp index 9e3b085..7e6d196 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -208,13 +208,12 @@ WUMS_APPLICATION_STARTS() { } WUMS_ALL_APPLICATION_STARTS_DONE() { - if (!Config::internal_init_done) { - setup_olv_libs(); - peertopeer_patch(); - matchmaking_notify_titleswitch(); - hotpatchAccountSettings(); - Config::internal_init_done = true; - } + // we need to do the patches here because otherwise the Config::connect_to_network flag might be set yet + setup_olv_libs(); + peertopeer_patch(); + matchmaking_notify_titleswitch(); + hotpatchAccountSettings(); + if (Config::initialized && !Config::plugin_is_loaded) { DEBUG_FUNCTION_LINE("Inkay is running but the plugin got unloaded"); if (!Config::block_initialize) { From 4a880c1a2e52ad591416e6289e9e84d4db541ad4 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 9 Feb 2025 10:26:48 +0100 Subject: [PATCH 073/139] feat: Check title version before doing game specific patches --- src/patches/account_settings.cpp | 10 ++++----- src/patches/game_peertopeer.cpp | 35 ++++++++++++++++++++++++++------ src/utils/rpl_info.cpp | 25 +++++++++++++++++++++++ src/utils/rpl_info.h | 2 ++ 4 files changed, 61 insertions(+), 11 deletions(-) diff --git a/src/patches/account_settings.cpp b/src/patches/account_settings.cpp index 3a0e7bb..cac45ba 100644 --- a/src/patches/account_settings.cpp +++ b/src/patches/account_settings.cpp @@ -24,12 +24,12 @@ #include "inkay_config.h" #include -#include -#include -#include + #include #include -#include + +#include +#include #include "ca_pem.h" // generated at buildtime @@ -163,7 +163,7 @@ bool hotpatchAccountSettings() { } void unpatchAccountSettings() { - for (auto handle: account_patches) { + for (const auto handle: account_patches) { FunctionPatcher_RemoveFunctionPatch(handle); } account_patches.clear(); diff --git a/src/patches/game_peertopeer.cpp b/src/patches/game_peertopeer.cpp index 2651156..d986f36 100644 --- a/src/patches/game_peertopeer.cpp +++ b/src/patches/game_peertopeer.cpp @@ -28,18 +28,23 @@ using namespace std::string_view_literals; static struct { std::array tid; + uint16_t version; uint32_t min_port_addr; uint32_t max_port_addr; std::string_view rpx; -} generic_patch_games [] = { - { // MARIO KART 8 - { 0x00050000'1010ec00, 0x00050000'1010ed00, 0x00050000'1010eb00 }, +} generic_patch_games[] = { + { + // MARIO KART 8 + {0x00050000'1010ec00, 0x00050000'1010ed00, 0x00050000'1010eb00}, + 81, 0x101a9a52, 0x101a9a54, "Turbo.rpx"sv, }, - { // Splatoon - { 0x00050000'10176900, 0x00050000'10176a00, 0x00050000'10162b00 }, + { + // Splatoon + {0x00050000'10176900, 0x00050000'10176a00, 0x00050000'10162b00}, + 288, 0x101e8952, 0x101e8954, "Gambit.rpx"sv, @@ -48,8 +53,16 @@ static struct { static void generic_peertopeer_patch() { uint64_t tid = OSGetTitleID(); + uint16_t title_version = 0; + if (const auto version_opt = get_current_title_version(); !version_opt) { + DEBUG_FUNCTION_LINE("Failed to detect current title version"); + return; + } else { + title_version = *version_opt; + DEBUG_FUNCTION_LINE("Title version detected: %d", title_version); + } - for (const auto& patch : generic_patch_games) { + for (const auto &patch: generic_patch_games) { if (std::ranges::find(patch.tid, tid) == patch.tid.end()) continue; std::optional game = search_for_rpl(patch.rpx); @@ -58,6 +71,12 @@ static void generic_peertopeer_patch() { return; } + if (title_version != patch.version) { + DEBUG_FUNCTION_LINE("Unexpected title version. Expected %d but got %d (%s)", patch.version, title_version, + patch.rpx.data()); + continue; + } + auto port = get_console_peertopeer_port(); DEBUG_FUNCTION_LINE_VERBOSE("Will use port %d. %08x", port, game->textAddr); @@ -76,6 +95,10 @@ static void minecraft_peertopeer_patch() { DEBUG_FUNCTION_LINE("Couldn't find minecraft rpx!"); return; } + if (const auto version_opt = get_current_title_version(); !version_opt || *version_opt != 688) { + DEBUG_FUNCTION_LINE("Wrong mincecraft version detected"); + return; + } auto port = get_console_peertopeer_port(); DEBUG_FUNCTION_LINE_VERBOSE("Will use port %d. %08x", port, minecraft->textAddr); diff --git a/src/utils/rpl_info.cpp b/src/utils/rpl_info.cpp index 2148e1e..1bfe9fb 100644 --- a/src/utils/rpl_info.cpp +++ b/src/utils/rpl_info.cpp @@ -16,6 +16,10 @@ #include #include #include +#include +#include + +#include "logger.h" // if we get more than like.. two callsites for this, it should really be refactored out rather than doing a fresh // search every time @@ -37,3 +41,24 @@ std::optional search_for_rpl(std::string_view name) { return *rpl; } + +std::optional get_current_title_version() { + const auto mcpHandle = MCP_Open(); + MCPTitleListType titleInfo; + int32_t res = -1; + const uint64_t curTitleId = OSGetTitleID(); + if ((curTitleId & 0x0000000F00000000) == 0) { + res = MCP_GetTitleInfo(mcpHandle, curTitleId | 0x0000000E00000000, &titleInfo); + } + if (res != 0) { + res = MCP_GetTitleInfo(mcpHandle, curTitleId, &titleInfo); + } + MCP_Close(mcpHandle); + if (res != 0) { + DEBUG_FUNCTION_LINE("Failed to get title version of %016llX.", curTitleId); + return {}; + } + MCP_Close(mcpHandle); + const auto tmp_result = titleInfo.titleVersion; // make the compiler happy because we access a packed struct + return tmp_result; +} diff --git a/src/utils/rpl_info.h b/src/utils/rpl_info.h index 15f59c7..c290fe8 100644 --- a/src/utils/rpl_info.h +++ b/src/utils/rpl_info.h @@ -26,3 +26,5 @@ constexpr void *rpl_addr(OSDynLoad_NotifyData rpl, uint32_t cemu_addr) { return (void *)(rpl.dataAddr + cemu_addr - 0x1000'0000); } } + +std::optional get_current_title_version(); \ No newline at end of file From 97167e0dabd7fc79b9b1c6f78adb20f3c8ed64cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Sat, 15 Feb 2025 12:18:50 +0000 Subject: [PATCH 074/139] fix(lang): Fix translation entries order --- src/lang/fr_FR.lang | 2 +- src/lang/ja_JP.lang | 2 +- src/lang/nl_NL.lang | 2 +- src/lang/pt_BR.lang | 2 +- src/lang/zh_CN.lang | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lang/fr_FR.lang b/src/lang/fr_FR.lang index a9e3b28..f875601 100644 --- a/src/lang/fr_FR.lang +++ b/src/lang/fr_FR.lang @@ -9,5 +9,5 @@ ,.using_nintendo_network="Réseau sélectionné : Nintendo Network" ,.using_pretendo_network="Réseau sélectionné : Pretendo Network" ,.multiplayer_port_display="Le port UDP %hu sera utilisé pour le multijoueur" -,.module_init_not_found="Le patch Pretendo a échoué, veuillez le réparer avec Aroma Updater (686-1002 Point d'entrée du module)" ,.module_not_found="Le patch Pretendo a échoué, veuillez le réparer avec Aroma Updater (686-1001 Module introuvable)" +,.module_init_not_found="Le patch Pretendo a échoué, veuillez le réparer avec Aroma Updater (686-1002 Point d'entrée du module)" diff --git a/src/lang/ja_JP.lang b/src/lang/ja_JP.lang index c486b7b..77214c5 100644 --- a/src/lang/ja_JP.lang +++ b/src/lang/ja_JP.lang @@ -9,5 +9,5 @@ ,.using_nintendo_network="選択済み:ニンテンドーネットワーク" ,.using_pretendo_network="選択済み:Pretendo ネットワーク" ,.multiplayer_port_display="マルチプレイに UDPポート %hu を使用します" -,.module_init_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1002 Module init)" ,.module_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1001 Module missing)" +,.module_init_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1002 Module init)" diff --git a/src/lang/nl_NL.lang b/src/lang/nl_NL.lang index 81f06be..ec155e5 100644 --- a/src/lang/nl_NL.lang +++ b/src/lang/nl_NL.lang @@ -8,5 +8,5 @@ ,.need_menu_action="Alleen vanuit het WiiU-menu" ,.using_nintendo_network="Nintendo Network wordt gebruikt" ,.using_pretendo_network="Pretendo Network wordt gebruikt" -,.module_init_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1002 Module init)" ,.module_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1001 Module ontbreekt)" +,.module_init_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1002 Module init)" diff --git a/src/lang/pt_BR.lang b/src/lang/pt_BR.lang index 5b4333b..511d5ab 100644 --- a/src/lang/pt_BR.lang +++ b/src/lang/pt_BR.lang @@ -8,6 +8,6 @@ ,.need_menu_action="Apenas no menu do Wii U" ,.using_nintendo_network="Usando Nintendo Network" ,.using_pretendo_network="Usando Pretendo Network" +,.multiplayer_port_display="Usando UDP port %hu para a jogatina multiplayer" ,.module_not_found="Atualização do Pretendo falhou - use o Aroma Updater para corrigir (686-1001 Módulo faltando)" ,.module_init_not_found="Atualização do Pretendo falhou - use o Aroma Updater para corrigir (686-1002 Módulo de início)" -,.multiplayer_port_display="Usando UDP port %hu para a jogatina multiplayer" diff --git a/src/lang/zh_CN.lang b/src/lang/zh_CN.lang index 39736b1..93383b8 100644 --- a/src/lang/zh_CN.lang +++ b/src/lang/zh_CN.lang @@ -8,6 +8,6 @@ ,.need_menu_action="仅来自WiiU Menu" ,.using_nintendo_network="使用 Nintendo Network" ,.using_pretendo_network="使用 Pretendo Network" -,.module_not_found="Pretendo 补丁失败 - 使用 Aroma Updater 修复(686-1001 模块丢失)" ,.multiplayer_port_display="多人游戏使用 UDP 端口 %hu" +,.module_not_found="Pretendo 补丁失败 - 使用 Aroma Updater 修复(686-1001 模块丢失)" ,.module_init_not_found="Pretendo 补丁失败 - 使用 Aroma Updater 修复(686-1002 模块初始化)" From 4cf3b7446e39e0ec419efb34345051d62134453f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Sat, 15 Feb 2025 12:38:27 +0000 Subject: [PATCH 075/139] chore: Add fallback translations to English --- src/lang/nl_NL.lang | 1 + src/lang/zh_Hant.lang | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/lang/nl_NL.lang b/src/lang/nl_NL.lang index ec155e5..b4239d0 100644 --- a/src/lang/nl_NL.lang +++ b/src/lang/nl_NL.lang @@ -8,5 +8,6 @@ ,.need_menu_action="Alleen vanuit het WiiU-menu" ,.using_nintendo_network="Nintendo Network wordt gebruikt" ,.using_pretendo_network="Pretendo Network wordt gebruikt" +,.multiplayer_port_display = "Using UDP port %hu for multiplayer" ,.module_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1001 Module ontbreekt)" ,.module_init_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1002 Module init)" diff --git a/src/lang/zh_Hant.lang b/src/lang/zh_Hant.lang index ec3a0ad..1e1781f 100644 --- a/src/lang/zh_Hant.lang +++ b/src/lang/zh_Hant.lang @@ -8,3 +8,6 @@ ,.need_menu_action = "僅來自WiiU Menu" ,.using_nintendo_network = "使用 Nintendo Network" ,.using_pretendo_network = "使用 Pretendo Network" +,.multiplayer_port_display = "Using UDP port %hu for multiplayer" +,.module_not_found = "Pretendo patch failed - use Aroma Updater to repair (686-1001 Module missing)" +,.module_init_not_found = "Pretendo patch failed - use Aroma Updater to repair (686-1002 Module init)" From add1d2c2e2dbbef6e67eb4831125474bcc3d538f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Sat, 15 Feb 2025 21:09:10 +0000 Subject: [PATCH 076/139] chore: Bump to version 3.0.0 --- plugin/src/main.cpp | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/src/main.cpp b/plugin/src/main.cpp index 73968ea..e95eaac 100644 --- a/plugin/src/main.cpp +++ b/plugin/src/main.cpp @@ -23,7 +23,7 @@ #include "config.h" #include "module.h" -#define INKAY_VERSION "v2.6.0" +#define INKAY_VERSION "v3.0.0" /** Mandatory plugin information. diff --git a/src/main.cpp b/src/main.cpp index 7e6d196..4930ac0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,7 +39,7 @@ #include "ca_pem.h" -#define INKAY_VERSION "v2.6.0" +#define INKAY_VERSION "v3.0.0" /** Mandatory plugin information. From ea41e73d8d244f23097a54a57ee751dd64180212 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 07:39:05 +0000 Subject: [PATCH 077/139] chore: bump wiiu-env/devkitppc from 20241128 to 20250608 Bumps wiiu-env/devkitppc from 20241128 to 20250608. --- updated-dependencies: - dependency-name: wiiu-env/devkitppc dependency-version: '20250608' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 46c49d4..a195fbc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/wiiu-env/devkitppc:20241128 +FROM ghcr.io/wiiu-env/devkitppc:20250608 COPY --from=ghcr.io/wiiu-env/libnotifications:20240426 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO From c1430e5a8cb00de1480f5f476368c6332623f805 Mon Sep 17 00:00:00 2001 From: SMU8 Date: Mon, 9 Jun 2025 14:05:48 +0200 Subject: [PATCH 078/139] Translated using Weblate (Dutch) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/nl/ --- src/lang/nl_NL.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lang/nl_NL.lang b/src/lang/nl_NL.lang index 81f06be..b359f5a 100644 --- a/src/lang/nl_NL.lang +++ b/src/lang/nl_NL.lang @@ -10,3 +10,4 @@ ,.using_pretendo_network="Pretendo Network wordt gebruikt" ,.module_init_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1002 Module init)" ,.module_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1001 Module ontbreekt)" +,.multiplayer_port_display=Gebruikt UDP port %hu voor multiplayer From 2db5735085c58dc477c70016c174d6b2850b9db1 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 30 Jun 2025 16:09:06 +0200 Subject: [PATCH 079/139] Translated using Weblate (English) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/en/ --- src/lang/en_US.lang | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lang/en_US.lang b/src/lang/en_US.lang index 7b3cdb9..95f83e5 100644 --- a/src/lang/en_US.lang +++ b/src/lang/en_US.lang @@ -1,13 +1,13 @@ -.plugin_name = "Inkay" -,.network_category = "Network selection" -,.connect_to_network_setting = "Connect to the Pretendo network" -,.other_category = "Other settings" -,.reset_wwp_setting = "Reset Wara Wara Plaza" -,.press_a_action = "Press A" -,.restart_to_apply_action = "Restart to apply" -,.need_menu_action = "From WiiU menu only" -,.using_nintendo_network = "Using Nintendo Network" -,.using_pretendo_network = "Using Pretendo Network" -,.multiplayer_port_display = "Using UDP port %hu for multiplayer" -,.module_not_found = "Pretendo patch failed - use Aroma Updater to repair (686-1001 Module missing)" -,.module_init_not_found = "Pretendo patch failed - use Aroma Updater to repair (686-1002 Module init)" +.plugin_name="Inkay" +,.network_category="Network selection" +,.connect_to_network_setting="Connect to the Pretendo Network" +,.other_category="Other settings" +,.reset_wwp_setting="Reset Wara Wara Plaza" +,.press_a_action="Press A" +,.restart_to_apply_action="Restart to apply" +,.need_menu_action="From WiiU menu only" +,.using_nintendo_network="Using Nintendo Network" +,.using_pretendo_network="Using Pretendo Network" +,.multiplayer_port_display="Using UDP port %hu for multiplayer" +,.module_not_found="Pretendo patch failed - use Aroma Updater to repair (686-1001 Module missing)" +,.module_init_not_found="Pretendo patch failed - use Aroma Updater to repair (686-1002 Module init)" From 6a54c86d0652b529c9823cfadb36861767a9ab14 Mon Sep 17 00:00:00 2001 From: Ash Tails Date: Mon, 30 Jun 2025 16:09:22 +0200 Subject: [PATCH 080/139] Translated using Weblate (English) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/en/ --- src/lang/en_US.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/en_US.lang b/src/lang/en_US.lang index 95f83e5..6bf32a3 100644 --- a/src/lang/en_US.lang +++ b/src/lang/en_US.lang @@ -1,6 +1,6 @@ .plugin_name="Inkay" ,.network_category="Network selection" -,.connect_to_network_setting="Connect to the Pretendo Network" +,.connect_to_network_setting="Connect to Pretendo Network" ,.other_category="Other settings" ,.reset_wwp_setting="Reset Wara Wara Plaza" ,.press_a_action="Press A" From 724060d1c7b50de5b9bb5d728c14e250aa35e760 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 30 Jun 2025 16:09:07 +0200 Subject: [PATCH 081/139] Translated using Weblate (Chinese (Traditional Han script)) Currently translated at 92.3% (12 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/zh_Hant/ --- src/lang/zh_Hant.lang | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lang/zh_Hant.lang b/src/lang/zh_Hant.lang index 1e1781f..ad95136 100644 --- a/src/lang/zh_Hant.lang +++ b/src/lang/zh_Hant.lang @@ -1,13 +1,13 @@ -.plugin_name = "Inkay" -,.network_category = "選擇網路" -,.connect_to_network_setting = "連接到Pretendo network" -,.other_category = "其他設定" -,.reset_wwp_setting = "重置Wara Wara Plaza" -,.press_a_action = "請按 A" -,.restart_to_apply_action = "重啓以套用設定" -,.need_menu_action = "僅來自WiiU Menu" -,.using_nintendo_network = "使用 Nintendo Network" -,.using_pretendo_network = "使用 Pretendo Network" -,.multiplayer_port_display = "Using UDP port %hu for multiplayer" -,.module_not_found = "Pretendo patch failed - use Aroma Updater to repair (686-1001 Module missing)" -,.module_init_not_found = "Pretendo patch failed - use Aroma Updater to repair (686-1002 Module init)" +.plugin_name="Inkay" +,.network_category="選擇網路" +,.connect_to_network_setting="連接到Pretendo network" +,.other_category="其他設定" +,.reset_wwp_setting="重置Wara Wara Plaza" +,.press_a_action="請按 A" +,.restart_to_apply_action="重啓以套用設定" +,.need_menu_action="僅來自WiiU Menu" +,.using_nintendo_network="使用 Nintendo Network" +,.using_pretendo_network="使用 Pretendo Network" +,.multiplayer_port_display="Using UDP port %hu for multiplayer" +,.module_not_found="Pretendo patch failed - use Aroma Updater to repair (686-1001 Module missing)" +,.module_init_not_found="Pretendo patch failed - use Aroma Updater to repair (686-1002 Module init)" From 889794f23963bdd13773749edad4bfb9b9ec2bed Mon Sep 17 00:00:00 2001 From: Ash Tails Date: Tue, 1 Jul 2025 05:32:13 +0200 Subject: [PATCH 082/139] Translated using Weblate (English) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/en/ --- src/lang/en_US.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/en_US.lang b/src/lang/en_US.lang index 6bf32a3..09ebe6a 100644 --- a/src/lang/en_US.lang +++ b/src/lang/en_US.lang @@ -9,5 +9,5 @@ ,.using_nintendo_network="Using Nintendo Network" ,.using_pretendo_network="Using Pretendo Network" ,.multiplayer_port_display="Using UDP port %hu for multiplayer" -,.module_not_found="Pretendo patch failed - use Aroma Updater to repair (686-1001 Module missing)" -,.module_init_not_found="Pretendo patch failed - use Aroma Updater to repair (686-1002 Module init)" +,.module_not_found="Pretendo Network patch failed - use Aroma Updater to repair (686-1001 Module missing)" +,.module_init_not_found="Pretendo Network patch failed - use Aroma Updater to repair (686-1002 Module init)" From d1b5ba61136411edf0e9c77c10abe418cdd9bfe9 Mon Sep 17 00:00:00 2001 From: Maxime Tourneur Date: Tue, 1 Jul 2025 04:56:22 +0200 Subject: [PATCH 083/139] Translated using Weblate (French) Currently translated at 84.6% (11 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/fr/ --- src/lang/fr_FR.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/fr_FR.lang b/src/lang/fr_FR.lang index f875601..e3c922c 100644 --- a/src/lang/fr_FR.lang +++ b/src/lang/fr_FR.lang @@ -4,7 +4,7 @@ ,.other_category="Autres paramètres" ,.reset_wwp_setting="Réinitialiser la place WaraWara" ,.press_a_action="Appuyez sur A" -,.restart_to_apply_action="(prendra effet au redémarrage)" +,.restart_to_apply_action="Redémarrer pour appliquer" ,.need_menu_action="(retournez d'abord au menu Wii U)" ,.using_nintendo_network="Réseau sélectionné : Nintendo Network" ,.using_pretendo_network="Réseau sélectionné : Pretendo Network" From e62f921d718850e12d357f656d077c9864af8314 Mon Sep 17 00:00:00 2001 From: Ash Tails Date: Tue, 1 Jul 2025 05:35:24 +0200 Subject: [PATCH 084/139] Translated using Weblate (Chinese (Simplified Han script)) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/zh_Hans/ --- src/lang/zh_CN.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/zh_CN.lang b/src/lang/zh_CN.lang index 93383b8..b35080d 100644 --- a/src/lang/zh_CN.lang +++ b/src/lang/zh_CN.lang @@ -1,6 +1,6 @@ .plugin_name="Inkay" ,.network_category="选择网络" -,.connect_to_network_setting="连接到Pretendo network" +,.connect_to_network_setting="连接到Pretendo Network" ,.other_category="其他设置" ,.reset_wwp_setting="重置Wara Wara Plaza" ,.press_a_action="请按 A" From f3522fb5ac65804005e07f595ce47b2129042fba Mon Sep 17 00:00:00 2001 From: Ash Tails Date: Tue, 1 Jul 2025 05:36:12 +0200 Subject: [PATCH 085/139] Translated using Weblate (Chinese (Simplified Han script)) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/zh_Hans/ --- src/lang/zh_CN.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/zh_CN.lang b/src/lang/zh_CN.lang index b35080d..5191686 100644 --- a/src/lang/zh_CN.lang +++ b/src/lang/zh_CN.lang @@ -9,5 +9,5 @@ ,.using_nintendo_network="使用 Nintendo Network" ,.using_pretendo_network="使用 Pretendo Network" ,.multiplayer_port_display="多人游戏使用 UDP 端口 %hu" -,.module_not_found="Pretendo 补丁失败 - 使用 Aroma Updater 修复(686-1001 模块丢失)" -,.module_init_not_found="Pretendo 补丁失败 - 使用 Aroma Updater 修复(686-1002 模块初始化)" +,.module_not_found="Pretendo Network 补丁失败 - 使用 Aroma Updater 修复(686-1001 模块丢失)" +,.module_init_not_found="Pretendo Network 补丁失败 - 使用 Aroma Updater 修复(686-1002 模块初始化)" From 364772552724c8803591a9d96cc0cdacac07bfd5 Mon Sep 17 00:00:00 2001 From: Ash Tails Date: Tue, 1 Jul 2025 05:33:55 +0200 Subject: [PATCH 086/139] Translated using Weblate (Chinese (Traditional Han script)) Currently translated at 76.9% (10 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/zh_Hant/ --- src/lang/zh_Hant.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/zh_Hant.lang b/src/lang/zh_Hant.lang index ad95136..45f423b 100644 --- a/src/lang/zh_Hant.lang +++ b/src/lang/zh_Hant.lang @@ -1,6 +1,6 @@ .plugin_name="Inkay" ,.network_category="選擇網路" -,.connect_to_network_setting="連接到Pretendo network" +,.connect_to_network_setting="連接到Pretendo Network" ,.other_category="其他設定" ,.reset_wwp_setting="重置Wara Wara Plaza" ,.press_a_action="請按 A" From 194dc90f59ec9d2bc9fc50edf0fd0da03a776a2c Mon Sep 17 00:00:00 2001 From: Ash Tails Date: Tue, 1 Jul 2025 05:34:38 +0200 Subject: [PATCH 087/139] Translated using Weblate (Chinese (Traditional Han script)) Currently translated at 76.9% (10 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/zh_Hant/ --- src/lang/zh_Hant.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/zh_Hant.lang b/src/lang/zh_Hant.lang index 45f423b..f68d3a2 100644 --- a/src/lang/zh_Hant.lang +++ b/src/lang/zh_Hant.lang @@ -9,5 +9,5 @@ ,.using_nintendo_network="使用 Nintendo Network" ,.using_pretendo_network="使用 Pretendo Network" ,.multiplayer_port_display="Using UDP port %hu for multiplayer" -,.module_not_found="Pretendo patch failed - use Aroma Updater to repair (686-1001 Module missing)" -,.module_init_not_found="Pretendo patch failed - use Aroma Updater to repair (686-1002 Module init)" +,.module_not_found="Pretendo Network patch failed - use Aroma Updater to repair (686-1001 Module missing)" +,.module_init_not_found="Pretendo Network patch failed - use Aroma Updater to repair (686-1002 Module init)" From 979d9de91ae6ad26916a9a5bcba0f95cf9931007 Mon Sep 17 00:00:00 2001 From: ADev531 Date: Mon, 21 Jul 2025 20:58:20 +0900 Subject: [PATCH 088/139] feat: added korean --- src/lang/ko_KR.lang | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/lang/ko_KR.lang diff --git a/src/lang/ko_KR.lang b/src/lang/ko_KR.lang new file mode 100644 index 0000000..de04939 --- /dev/null +++ b/src/lang/ko_KR.lang @@ -0,0 +1,13 @@ +.plugin_name="Inkay" +,.network_category="네트워크 선택" +,.connect_to_network_setting="Pretendo Network 사용" +,.other_category="기타 설정" +,.reset_wwp_setting="Wara Wara Plaza 초기화" +,.press_a_action="A 버튼을 누르세요" +,.restart_to_apply_action="재시작 후 적용" +,.need_menu_action="Wii U 메뉴에서만" +,.using_nintendo_network="Nintendo Network 사용 중" +,.using_pretendo_network="Pretendo Network 사용 중" +,.multiplayer_port_display="멀티플레이어에 UDP 포트 %hu을(를) 사용합니다" +,.module_not_found="패치를 적용하는 데 실패했습니다. Aroma Updater로 복구해 주세요. (686-1001 모듈 없음)" +,.module_init_not_found="패치를 적용하는 데 실패했습니다. Aroma Updater로 복구해 주세요. (686-1002 모듈 초기화)" From 907de64376d0fde58776b1e819f687dad992c9d3 Mon Sep 17 00:00:00 2001 From: ADev531 Date: Mon, 21 Jul 2025 20:59:55 +0900 Subject: [PATCH 089/139] feat: added language changing --- common/lang.cpp | 24 +++++++++--------- common/lang.h | 22 ++++++++++++++-- plugin/src/config.cpp | 59 ++++++++++++++++++++++++++++++++++++++++++- plugin/src/config.h | 5 ++++ plugin/src/module.cpp | 10 ++++---- src/main.cpp | 14 +++++----- 6 files changed, 107 insertions(+), 27 deletions(-) diff --git a/common/lang.cpp b/common/lang.cpp index 3f32b17..d22c07f 100644 --- a/common/lang.cpp +++ b/common/lang.cpp @@ -4,40 +4,40 @@ #include "lang.h" -config_strings get_config_strings(nn::swkbd::LanguageType language) { +config_strings get_config_strings(inkay_language language) { switch (language) { - case nn::swkbd::LanguageType::English: + case inkay_language::English: default: return { #include "en_US.lang" }; - case nn::swkbd::LanguageType::Spanish: return { + case inkay_language::Spanish: return { #include "es_ES.lang" }; - case nn::swkbd::LanguageType::French: return { + case inkay_language::French: return { #include "fr_FR.lang" }; - case nn::swkbd::LanguageType::Italian: return { + case inkay_language::Italian: return { #include "it_IT.lang" }; - case nn::swkbd::LanguageType::German: return { + case inkay_language::German: return { #include "de_DE.lang" }; - case nn::swkbd::LanguageType::SimplifiedChinese: return { + case inkay_language::SimplifiedChinese: return { #include "zh_CN.lang" }; - case nn::swkbd::LanguageType::TraditionalChinese: return { + case inkay_language::TraditionalChinese: return { #include "zh_Hant.lang" }; - case nn::swkbd::LanguageType::Portuguese: return { + case inkay_language::Portuguese: return { #include "pt_BR.lang" }; - case nn::swkbd::LanguageType::Japanese: return { + case inkay_language::Japanese: return { #include "ja_JP.lang" }; - case nn::swkbd::LanguageType::Dutch: return { + case inkay_language::Dutch: return { #include "nl_NL.lang" }; - case nn::swkbd::LanguageType::Russian: return { + case inkay_language::Russian: return { #include "ru_RU.lang" }; } diff --git a/common/lang.h b/common/lang.h index 6e557fe..7fdbe24 100644 --- a/common/lang.h +++ b/common/lang.h @@ -1,7 +1,25 @@ #pragma once #include -#include + +enum inkay_language { + Japanese = 0, + English, + French, + German, + Italian, + Spanish, + SimplifiedChinese, + Korean, + Dutch, + Portuguese, + Russian, + TraditionalChinese, + Invalid, + // custom ones + System, + EnUwU, +}; struct config_strings { const char *plugin_name; @@ -19,4 +37,4 @@ struct config_strings { std::string_view module_init_not_found; }; -config_strings get_config_strings(nn::swkbd::LanguageType language); +config_strings get_config_strings(inkay_language language); diff --git a/plugin/src/config.cpp b/plugin/src/config.cpp index 98c2323..3079bc8 100644 --- a/plugin/src/config.cpp +++ b/plugin/src/config.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -42,6 +43,8 @@ bool Config::connect_to_network = true; bool Config::need_relaunch = false; bool Config::unregister_task_item_pressed = false; bool Config::is_wiiu_menu = false; +uint32_t Config::language = 13; +inkay_language Config::current_language = English; static WUPSConfigAPICallbackStatus report_error(WUPSConfigAPIStatus err) { DEBUG_FUNCTION_LINE_VERBOSE("WUPS config error: %s", WUPSConfigAPI_GetStatusStr(err)); @@ -64,6 +67,21 @@ static void connect_to_network_changed(ConfigItemBoolean* item, bool new_value) if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); } +static void language_changed(ConfigItemMultipleValues* item, uint32_t new_value) { + DEBUG_FUNCTION_LINE_VERBOSE("language changed to: %d", new_value); + if (new_value != Config::language) { + if (new_value == inkay_language::System) + Config::current_language = (inkay_language)get_system_language(); + else + Config::current_language = (inkay_language)new_value; + } + Config::language = new_value; + + WUPSStorageError res; + res = WUPSStorageAPI::Store("language", Config::language); + if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); +} + static void unregister_task_item_on_input_cb(void *context, WUPSConfigSimplePadData input) { if (!Config::unregister_task_item_pressed && Config::is_wiiu_menu && ((input.buttons_d & WUPS_CONFIG_BUTTON_A) == WUPS_CONFIG_BUTTON_A)) { @@ -124,7 +142,7 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa Config::is_wiiu_menu = (current_title_id == wiiu_menu_tid); // get translation strings - strings = get_config_strings(get_system_language()); + strings = get_config_strings(Config::current_language); // create root config category WUPSConfigCategory root = WUPSConfigCategory(rootHandle); @@ -181,6 +199,29 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa err = WUPSConfigAPI_Category_AddItem(other_cat->getHandle(), unregisterTasksItem); if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + constexpr WUPSConfigItemMultipleValues::ValuePair languages[] = { + {0, "Japanese"}, + {1, "English"}, + {2, "French"}, + {3, "German"}, + {4, "Spanish"}, + {5, "Italian"}, + {6, "Simplified Chinese"}, + {7, "Korean"}, + {8, "Dutch"}, + {9, "Portuguese"}, + {10, "Russian"}, + {11, "Traditional Chinese"}, + {13, "System"}, + {14, "English (UwU)"}, + }; + + auto language_item = WUPSConfigItemMultipleValues::CreateFromValue("language", "Language", 13, Config::language, languages, &language_changed, err); + if (!language_item) return report_error(err); + + res = other_cat->add(std::move(*language_item), err); + if (!res) report_error(err); + res = root.add(std::move(*other_cat), err); if (!res) return report_error(err); @@ -228,6 +269,22 @@ void Config::Init() { } else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); + res = WUPSStorageAPI::Get("language", Config::language); + if (res == WUPS_STORAGE_ERROR_NOT_FOUND) { + DEBUG_FUNCTION_LINE("Language value not found, attempting to create"); + + // Add the value to the storage. + res = WUPSStorageAPI::Store("language", Config::language); + if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); + } + else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); + + // Set the language that's currently used + if (Config::language == inkay_language::System) + Config::current_language = (inkay_language)get_system_language(); + else + Config::current_language = (inkay_language)Config::language; + // Save storage res = WUPSStorageAPI::SaveStorage(); if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); diff --git a/plugin/src/config.h b/plugin/src/config.h index 0928d5e..fc84610 100644 --- a/plugin/src/config.h +++ b/plugin/src/config.h @@ -5,12 +5,16 @@ #ifndef INKAY_CONFIG_H #define INKAY_CONFIG_H +#include +#include "lang.h" + class Config { public: static void Init(); // wups config items static bool connect_to_network; + static uint32_t language; // private stuff static bool need_relaunch; @@ -18,6 +22,7 @@ public: // private stuff static bool is_wiiu_menu; + static inkay_language current_language; static bool unregister_task_item_pressed; }; diff --git a/plugin/src/module.cpp b/plugin/src/module.cpp index c20d980..586a4c7 100644 --- a/plugin/src/module.cpp +++ b/plugin/src/module.cpp @@ -18,22 +18,22 @@ #include "Notification.h" #include "utils/logger.h" -#include "sysconfig.h" +#include "config.h" #include "lang.h" #include static OSDynLoad_Module module; -static void (*moduleInitialize)(bool) = nullptr; +static void (*moduleInitialize)(bool, inkay_language) = nullptr; static InkayStatus (*moduleGetStatus)() = nullptr; static void (*moduleSetPluginRunning)() = nullptr; static const char *get_module_not_found_message() { - return get_config_strings(get_system_language()).module_not_found.data(); + return get_config_strings(Config::current_language).module_not_found.data(); } static const char *get_module_init_not_found_message() { - return get_config_strings(get_system_language()).module_init_not_found.data(); + return get_config_strings(Config::current_language).module_init_not_found.data(); } void Inkay_Initialize(bool apply_patches) { @@ -54,7 +54,7 @@ void Inkay_Initialize(bool apply_patches) { return; } - moduleInitialize(apply_patches); + moduleInitialize(apply_patches, Config::current_language); } void Inkay_Finalize() { diff --git a/src/main.cpp b/src/main.cpp index 4930ac0..008c976 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -93,18 +93,18 @@ static bool is555(MCPSystemVersion version) { return (version.major == 5) && (version.minor == 5) && (version.patch >= 5); } -static const char *get_nintendo_network_message() { +static const char *get_nintendo_network_message(inkay_language language) { // TL note: "Nintendo Network" is a proper noun - "Network" is part of the name // TL note: "Using" instead of "Connected" is deliberate - we don't know if a successful connection exists, we are // only specifying what we'll *attempt* to connect to - return get_config_strings(get_system_language()).using_nintendo_network.data(); + return get_config_strings(language).using_nintendo_network.data(); } -static const char *get_pretendo_message() { +static const char *get_pretendo_message(inkay_language language) { // TL note: "Pretendo Network" is also a proper noun - though "Pretendo" alone can refer to us as a project // TL note: "Using" instead of "Connected" is deliberate - we don't know if a successful connection exists, we are // only specifying what we'll *attempt* to connect to - return get_config_strings(get_system_language()).using_pretendo_network.data(); + return get_config_strings(language).using_pretendo_network.data(); } static void Inkay_SetPluginRunning() { @@ -122,7 +122,7 @@ static InkayStatus Inkay_GetStatus() { } } -static void Inkay_Initialize(bool apply_patches) { +static void Inkay_Initialize(bool apply_patches, inkay_language language) { if (Config::initialized) return; @@ -150,12 +150,12 @@ static void Inkay_Initialize(bool apply_patches) { DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches applied successfully."); - ShowNotification(get_pretendo_message()); + ShowNotification(get_pretendo_message(language)); Config::initialized = true; } else { DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches skipped."); - ShowNotification(get_nintendo_network_message()); + ShowNotification(get_nintendo_network_message(language)); Config::initialized = true; return; } From 6e1122e1b3a2cfe92a7877512ebad2a961e775ba Mon Sep 17 00:00:00 2001 From: ADev531 Date: Mon, 21 Jul 2025 21:15:09 +0900 Subject: [PATCH 090/139] fix: added Korean and UwU to language changer --- common/lang.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/lang.cpp b/common/lang.cpp index d22c07f..ac39d15 100644 --- a/common/lang.cpp +++ b/common/lang.cpp @@ -40,5 +40,11 @@ config_strings get_config_strings(inkay_language language) { case inkay_language::Russian: return { #include "ru_RU.lang" }; + case inkay_language::Korean: return { +#include "ko_KR.lang" + }; + case inkay_language::EnUwU: return { +#include "en@uwu.lang" + }; } } From 4ad4666272c606d1ec1c9bdf5b8e897886762961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnau=20B=C3=A0rcia?= Date: Tue, 5 Aug 2025 02:16:39 +0200 Subject: [PATCH 091/139] Translated using Weblate (Spanish) Currently translated at 84.6% (11 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/es/ --- src/lang/es_ES.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/es_ES.lang b/src/lang/es_ES.lang index b585373..20acae9 100644 --- a/src/lang/es_ES.lang +++ b/src/lang/es_ES.lang @@ -10,4 +10,4 @@ ,.using_pretendo_network="Usando Pretendo Network" ,.multiplayer_port_display="Usando puerto UDP %hu para multijugador" ,.module_not_found="Falló el parche Pretendo - usa Aroma Updater para reparar (686-1001 Falta un módulo)" -,.module_init_not_found="Falló el parche Pretendo - usa Aroma Updater para reparar (686-1002 Inicialización del módulo)" +,.module_init_not_found="Ha fallado el parche Pretendo Network - usa Aroma Updater para repararlo (686-1002 Inicialización del módulo)" From 0b0fbfc742a249682201c06cf26e38d5cae0bb4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnau=20B=C3=A0rcia?= Date: Wed, 20 Aug 2025 14:15:35 +0200 Subject: [PATCH 092/139] Translated using Weblate (Spanish) Currently translated at 92.3% (12 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/es/ --- src/lang/es_ES.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/es_ES.lang b/src/lang/es_ES.lang index 20acae9..b62b649 100644 --- a/src/lang/es_ES.lang +++ b/src/lang/es_ES.lang @@ -1,6 +1,6 @@ .plugin_name="Inkay" ,.network_category="Seleccionar red" -,.connect_to_network_setting="Conectar a la red Pretendo" +,.connect_to_network_setting="Conectar a Pretendo Network" ,.other_category="Otros ajustes" ,.reset_wwp_setting="Restablecer Plaza Wara Wara" ,.press_a_action="Pulsa A" From d0985dd17a4d399b1499fc45bfd45d0f6a5a5e42 Mon Sep 17 00:00:00 2001 From: Dimitri A Date: Thu, 21 Aug 2025 21:14:40 +0200 Subject: [PATCH 093/139] Translated using Weblate (Italian) Currently translated at 84.6% (11 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/it/ --- src/lang/it_IT.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/it_IT.lang b/src/lang/it_IT.lang index 6c673f2..6702add 100644 --- a/src/lang/it_IT.lang +++ b/src/lang/it_IT.lang @@ -1,6 +1,6 @@ .plugin_name="Inkay" ,.network_category="Seleziona la rete" -,.connect_to_network_setting="Connettiti alla rete Pretendo" +,.connect_to_network_setting="Connettiti a Pretendo Network" ,.other_category="Altre impostazioni" ,.reset_wwp_setting="Ripristina Wara Wara Plaza" ,.press_a_action="Premi A" From eb26bc32d87e8c76ed2cabdd29d16379ecfc29dc Mon Sep 17 00:00:00 2001 From: Apueblar Date: Wed, 10 Sep 2025 01:07:33 +0200 Subject: [PATCH 094/139] Translated using Weblate (Spanish) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/es/ --- src/lang/es_ES.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/es_ES.lang b/src/lang/es_ES.lang index b62b649..f84b918 100644 --- a/src/lang/es_ES.lang +++ b/src/lang/es_ES.lang @@ -9,5 +9,5 @@ ,.using_nintendo_network="Usando Nintendo Network" ,.using_pretendo_network="Usando Pretendo Network" ,.multiplayer_port_display="Usando puerto UDP %hu para multijugador" -,.module_not_found="Falló el parche Pretendo - usa Aroma Updater para reparar (686-1001 Falta un módulo)" +,.module_not_found="Ha fallado el parche Pretendo Network - usa Aroma Updater para repararlo (686-1001 Falta un módulo)" ,.module_init_not_found="Ha fallado el parche Pretendo Network - usa Aroma Updater para repararlo (686-1002 Inicialización del módulo)" From cfd4c01896e83f7335257dd667737cc74053f7f7 Mon Sep 17 00:00:00 2001 From: Dimitri A Date: Sun, 14 Sep 2025 22:41:08 +0200 Subject: [PATCH 095/139] Translated using Weblate (French) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/fr/ --- src/lang/fr_FR.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/fr_FR.lang b/src/lang/fr_FR.lang index e3c922c..901a2a2 100644 --- a/src/lang/fr_FR.lang +++ b/src/lang/fr_FR.lang @@ -9,5 +9,5 @@ ,.using_nintendo_network="Réseau sélectionné : Nintendo Network" ,.using_pretendo_network="Réseau sélectionné : Pretendo Network" ,.multiplayer_port_display="Le port UDP %hu sera utilisé pour le multijoueur" -,.module_not_found="Le patch Pretendo a échoué, veuillez le réparer avec Aroma Updater (686-1001 Module introuvable)" -,.module_init_not_found="Le patch Pretendo a échoué, veuillez le réparer avec Aroma Updater (686-1002 Point d'entrée du module)" +,.module_not_found="Le patch Pretendo Network a rencontré un problème, veuillez le réparer avec Aroma Updater (686-1001 Module missing)" +,.module_init_not_found="Le patch Pretendo Network a rencontré un problème, veuillez le réparer avec Aroma Updater (686-1002 Module init)" From 79bc63adb80c8d56bca777ec89b533e15e1c8e99 Mon Sep 17 00:00:00 2001 From: Scott Brenner Date: Sat, 11 Oct 2025 19:29:26 -0700 Subject: [PATCH 096/139] feat(CI): Extend Dependabot workflow for GitHub Actions --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d41cd8e..815be86 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,3 +11,9 @@ updates: interval: "weekly" commit-message: prefix: "chore: " + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + commit-message: + prefix: "chore: " From 9fa4beae2e28ee46fc7209d743c4b5ad6895078c Mon Sep 17 00:00:00 2001 From: Scott Brenner Date: Sat, 11 Oct 2025 19:34:49 -0700 Subject: [PATCH 097/139] Potential fix for code scanning alert no. 1: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8e0464..bab5cae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,6 @@ name: Inkay-CI +permissions: + contents: read on: - push From 4c2cdd09d3f372b55d77f8dc7fa44dc61aae09ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 12 Oct 2025 23:09:25 +0000 Subject: [PATCH 098/139] chore: bump actions/checkout from 4 to 5 Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bab5cae..d771658 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: build-inkay: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: build toolchain container run: docker build . -t builder - uses: ammaraskar/gcc-problem-matcher@master From fe55961a18e5cf4293bc0ec1dbac84c78a809799 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 08:07:17 +0000 Subject: [PATCH 099/139] chore: bump actions/upload-artifact from 4 to 5 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d771658..c73586c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - uses: ammaraskar/gcc-problem-matcher@master - name: build Inkay run: docker run --rm -v ${PWD}:/app -w /app builder - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 with: name: inkay path: dist/ From 4c38d9e3030ac8839c18850304944ddaa8d4578a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 07:42:52 +0000 Subject: [PATCH 100/139] chore: bump actions/checkout from 5 to 6 Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c73586c..251061d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: build-inkay: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: build toolchain container run: docker build . -t builder - uses: ammaraskar/gcc-problem-matcher@master From 62c6cec40623a6093ea172b56c281a44f29bb8ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 07:25:29 +0000 Subject: [PATCH 101/139] chore: bump actions/upload-artifact from 5 to 6 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 251061d..5eaaa2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - uses: ammaraskar/gcc-problem-matcher@master - name: build Inkay run: docker run --rm -v ${PWD}:/app -w /app builder - - uses: actions/upload-artifact@v5 + - uses: actions/upload-artifact@v6 with: name: inkay path: dist/ From a25a09cede18c779d348e3237fb13c179435af5f Mon Sep 17 00:00:00 2001 From: adev531 Date: Thu, 29 Jan 2026 13:45:00 +0900 Subject: [PATCH 102/139] fix: swap Italian and Spanish option on plugin settings --- common/lang.h | 3 ++- plugin/src/config.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/lang.h b/common/lang.h index 7fdbe24..29994b2 100644 --- a/common/lang.h +++ b/common/lang.h @@ -3,6 +3,7 @@ #include enum inkay_language { + // Wii U System Languages Japanese = 0, English, French, @@ -16,7 +17,7 @@ enum inkay_language { Russian, TraditionalChinese, Invalid, - // custom ones + // Custom Languages System, EnUwU, }; diff --git a/plugin/src/config.cpp b/plugin/src/config.cpp index 3079bc8..9533b1c 100644 --- a/plugin/src/config.cpp +++ b/plugin/src/config.cpp @@ -204,8 +204,8 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa {1, "English"}, {2, "French"}, {3, "German"}, - {4, "Spanish"}, - {5, "Italian"}, + {4, "Italian"}, + {5, "Spanish"}, {6, "Simplified Chinese"}, {7, "Korean"}, {8, "Dutch"}, From 285d9f51fb6334e076f1a01b9cc50f05975a4f67 Mon Sep 17 00:00:00 2001 From: Aaron Dewes Date: Tue, 16 Sep 2025 22:27:07 +0200 Subject: [PATCH 103/139] Translated using Weblate (German) Currently translated at 92.3% (12 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/de/ --- src/lang/de_DE.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/de_DE.lang b/src/lang/de_DE.lang index 19a57dd..d8c572c 100644 --- a/src/lang/de_DE.lang +++ b/src/lang/de_DE.lang @@ -9,5 +9,5 @@ ,.using_nintendo_network="Nutze Nintendo Network" ,.using_pretendo_network="Nutze Pretendo Network" ,.multiplayer_port_display="Nutze UDP Port %hu für Mehrspieler" -,.module_not_found="Pretendo Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1001 Module missing)" -,.module_init_not_found="Pretendo Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1002 Module init)" +,.module_not_found="Pretendo Network Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1001 Module missing)" +,.module_init_not_found="Pretendo Network Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1002 Module init)" From 1f2660f2c162e35ce930c2a4a6e7aa524f21df70 Mon Sep 17 00:00:00 2001 From: Fefuchs Date: Fri, 19 Sep 2025 10:26:41 +0200 Subject: [PATCH 104/139] Translated using Weblate (German) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/de/ --- src/lang/de_DE.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/de_DE.lang b/src/lang/de_DE.lang index d8c572c..4837d27 100644 --- a/src/lang/de_DE.lang +++ b/src/lang/de_DE.lang @@ -1,6 +1,6 @@ .plugin_name="Inkay" ,.network_category="Netzwerkauswahl" -,.connect_to_network_setting="Verbinde zum Pretendo Network" +,.connect_to_network_setting="Mit Pretendo Network verbinden" ,.other_category="Andere Einstellungen" ,.reset_wwp_setting="Wara Wara Plaza zurücksetzen" ,.press_a_action="Drücke A" From 9e90882ec876512a5613ef5877949734e690a3c9 Mon Sep 17 00:00:00 2001 From: BBasilio2001 Date: Thu, 25 Sep 2025 12:22:19 +0200 Subject: [PATCH 105/139] Translated using Weblate (Chinese (Traditional Han script)) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/zh_Hant/ --- src/lang/zh_Hant.lang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lang/zh_Hant.lang b/src/lang/zh_Hant.lang index f68d3a2..50ff0dd 100644 --- a/src/lang/zh_Hant.lang +++ b/src/lang/zh_Hant.lang @@ -8,6 +8,6 @@ ,.need_menu_action="僅來自WiiU Menu" ,.using_nintendo_network="使用 Nintendo Network" ,.using_pretendo_network="使用 Pretendo Network" -,.multiplayer_port_display="Using UDP port %hu for multiplayer" -,.module_not_found="Pretendo Network patch failed - use Aroma Updater to repair (686-1001 Module missing)" -,.module_init_not_found="Pretendo Network patch failed - use Aroma Updater to repair (686-1002 Module init)" +,.multiplayer_port_display="使用 UDP 端口 %hu 進行多人遊戲" +,.module_not_found="Pretendo Network 補丁失敗 - 請使用 Aroma Updater 修復(缺少 686-1001 模組)" +,.module_init_not_found="Pretendo Network 補丁失敗 - 請使用 Aroma Updater 修復(缺少 686-1002 模組)" From 7be7a0040aac3bcaf8272215cdc101805342742a Mon Sep 17 00:00:00 2001 From: kip Date: Wed, 11 Feb 2026 14:46:36 +0100 Subject: [PATCH 106/139] Translated using Weblate (Italian) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/it/ --- src/lang/it_IT.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/it_IT.lang b/src/lang/it_IT.lang index 6702add..30495ab 100644 --- a/src/lang/it_IT.lang +++ b/src/lang/it_IT.lang @@ -9,5 +9,5 @@ ,.using_nintendo_network="In uso Nintendo Network" ,.using_pretendo_network="In uso Pretendo Network" ,.multiplayer_port_display="È in uso la porta UDP %hu per il multigiocatore" -,.module_not_found="Patch di Pretendo fallita - usa Aroma Updater per correggere (686-1001 Modulo mancante)" -,.module_init_not_found="Patch di Pretendo fallita - usa Aroma Updater per correggere (686-1002 Module init)" +,.module_not_found="Patch Pretendo Network fallita - usa Aroma Updater per riparare (686-1001 Modulo mancante)" +,.module_init_not_found="Patch Pretendo Network fallita - usa Aroma Updater per riparare (686-1002 Module init)" From 48ae2f97e093c7c8f28fcd47d835339211a4942e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 07:28:53 +0000 Subject: [PATCH 107/139] chore: bump actions/upload-artifact from 6 to 7 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5eaaa2e..dcd6868 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - uses: ammaraskar/gcc-problem-matcher@master - name: build Inkay run: docker run --rm -v ${PWD}:/app -w /app builder - - uses: actions/upload-artifact@v6 + - uses: actions/upload-artifact@v7 with: name: inkay path: dist/ From cbe54f5467f11bd7c87fbb89f69c81de67d6c062 Mon Sep 17 00:00:00 2001 From: Valentijn Date: Wed, 25 Feb 2026 10:28:36 +0100 Subject: [PATCH 108/139] Translated using Weblate (Dutch) Currently translated at 84.6% (11 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/nl/ --- src/lang/nl_NL.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/nl_NL.lang b/src/lang/nl_NL.lang index 9e67847..665c622 100644 --- a/src/lang/nl_NL.lang +++ b/src/lang/nl_NL.lang @@ -10,4 +10,4 @@ ,.using_pretendo_network="Pretendo Network wordt gebruikt" ,.multiplayer_port_display="Gebruikt UDP port %hu voor multiplayer" ,.module_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1001 Module ontbreekt)" -,.module_init_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1002 Module init)" +,.module_init_not_found="Pretendo-Netwerk patch mislukt - gebruik Aroma Updater om het te herstellen (686-1002 Module init)" From 7bb99c30d1c9b826ecd3c553ed7fa8242cb306a7 Mon Sep 17 00:00:00 2001 From: Valentijn Date: Thu, 7 May 2026 17:21:40 +0200 Subject: [PATCH 109/139] Translated using Weblate (Dutch) Currently translated at 100.0% (13 of 13 strings) Translation: Pretendo Network/Inkay Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/nl/ --- src/lang/nl_NL.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/nl_NL.lang b/src/lang/nl_NL.lang index 665c622..f96206f 100644 --- a/src/lang/nl_NL.lang +++ b/src/lang/nl_NL.lang @@ -1,6 +1,6 @@ .plugin_name="Inkay" ,.network_category="Netwerkselectie" -,.connect_to_network_setting="Verbind met het Pretendo-netwerk" +,.connect_to_network_setting="Verbind met het Pretendo-Netwerk" ,.other_category="Overige instellingen" ,.reset_wwp_setting="Reset het Wara Wara Plaza" ,.press_a_action="Druk A" From 00a75e94cb2b4796d8d199ee3c18a13302ac3648 Mon Sep 17 00:00:00 2001 From: Maple Nebel Date: Sat, 16 May 2026 22:18:39 +0200 Subject: [PATCH 110/139] initial spfn commit --- Makefile | 2 +- common/inkay_config.h | 2 +- plugin/Makefile | 2 +- plugin/src/main.cpp | 66 ++++++++++++++++++++++++++++++++++++++++-- src/iosu_url_patches.h | 56 +++++++++++++++++------------------ src/lang/de_DE.lang | 8 ++--- src/lang/en_US.lang | 8 ++--- src/lang/es_ES.lang | 8 ++--- src/lang/fr_FR.lang | 8 ++--- src/lang/it_IT.lang | 8 ++--- src/lang/ja_JP.lang | 8 ++--- src/lang/nl_NL.lang | 8 ++--- src/lang/pt_BR.lang | 8 ++--- src/lang/ru_RU.lang | 8 ++--- src/lang/zh_CN.lang | 8 ++--- src/lang/zh_Hant.lang | 8 ++--- src/main.cpp | 4 +-- 17 files changed, 140 insertions(+), 80 deletions(-) diff --git a/Makefile b/Makefile index fa5360d..624a492 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ WUT_ROOT := $(DEVKITPRO)/wut # DATA is a list of directories containing data files # INCLUDES is a list of directories containing header files #------------------------------------------------------------------------------- -TARGET := Inkay-pretendo +TARGET := Inkay-spfn BUILD := build SOURCES := src src/patches src/utils src/ext/inih common DATA := data diff --git a/common/inkay_config.h b/common/inkay_config.h index 0293c20..64a20fd 100644 --- a/common/inkay_config.h +++ b/common/inkay_config.h @@ -15,7 +15,7 @@ #endif #ifndef NETWORK_BASEURL -#define NETWORK_BASEURL "pretendo.cc" +#define NETWORK_BASEURL "spfn.cc" #endif #endif //INKAY_INKAY_CONFIG_H diff --git a/plugin/Makefile b/plugin/Makefile index dfcda53..6553ec1 100644 --- a/plugin/Makefile +++ b/plugin/Makefile @@ -19,7 +19,7 @@ WUMS_ROOT := $(DEVKITPRO)/wums # DATA is a list of directories containing data files # INCLUDES is a list of directories containing header files #------------------------------------------------------------------------------- -TARGET := Inkay-pretendo +TARGET := Inkay-spfn BUILD := build SOURCES := src src/utils ../common DATA := data diff --git a/plugin/src/main.cpp b/plugin/src/main.cpp index e95eaac..57ba9d1 100644 --- a/plugin/src/main.cpp +++ b/plugin/src/main.cpp @@ -21,6 +21,9 @@ #include #include #include "config.h" +#include +#include +#include #include "module.h" #define INKAY_VERSION "v3.0.0" @@ -29,16 +32,72 @@ Mandatory plugin information. If not set correctly, the loader will refuse to use the plugin. **/ -WUPS_PLUGIN_NAME("Inkay"); -WUPS_PLUGIN_DESCRIPTION("Pretendo Network Patcher"); +WUPS_PLUGIN_NAME("Inkay(SPFN)"); +WUPS_PLUGIN_DESCRIPTION("SPFN Network Patcher"); WUPS_PLUGIN_VERSION(INKAY_VERSION); -WUPS_PLUGIN_AUTHOR("Pretendo contributors"); +WUPS_PLUGIN_AUTHOR("Pretendo contributors and RusticMaple"); WUPS_PLUGIN_LICENSE("GPLv3"); WUPS_USE_STORAGE("inkay"); WUPS_USE_WUT_DEVOPTAB(); +bool is_current_game_splatoon(){ + auto current_game = OSGetTitleID(); + + if( + current_game == 0x0005000010162B00 || + current_game == 0x0005000010176900 || + current_game == 0x0005000010176A00 + ){ + return true; + } + return false; +} + +void splatoon_patcher(){ + if(is_current_game_splatoon()){ + NotificationModule_AddInfoNotification("Splatoon Detected, applying patch"); + + auto rpl_count = OSDynLoad_GetNumberOfRPLs(); + + std::vector rpls(rpl_count); + + if(!OSDynLoad_GetRPLInfo(0, rpl_count, rpls.data())){ + NotificationModule_AddInfoNotification("failed to get rpls"); + } + + for(auto rpl: rpls){ + if(rpl.name != 0){ + if(strstr(rpl.name, "Gambit") != NULL){ + NotificationModule_AddInfoNotification(rpl.name); + auto text_color = NMColor(); + text_color.r = 255; + text_color.g = 255; + text_color.b = 255; + text_color.a = 255; + + auto bg_color = NMColor(); + bg_color.r = 0; + bg_color.g = 0; + bg_color.b = 0; + bg_color.a = 0; + + NotificationModule_AddInfoNotificationEx(rpl.name, 30.0f, text_color, bg_color, nullptr, nullptr, true); + + NotificationModule_AddInfoNotification("applying patches!!!!"); + + void* game_data_region = (void*)rpl.dataAddr; + + auto str_loc = (char*)(0x000009ac + (uint32_t)game_data_region); + + strcpy(str_loc, "https://s-res.spfn.net/post"); + } + } + } + } +} + INITIALIZE_PLUGIN() { WHBLogCafeInit(); WHBLogUdpInit(); @@ -63,6 +122,7 @@ DEINITIALIZE_PLUGIN() { ON_APPLICATION_START() { // Tell the module the plugin is running! + splatoon_patcher(); Inkay_SetPluginRunning(); } diff --git a/src/iosu_url_patches.h b/src/iosu_url_patches.h index b500fc6..bf289f1 100644 --- a/src/iosu_url_patches.h +++ b/src/iosu_url_patches.h @@ -8,35 +8,35 @@ typedef struct URL_Patch { static const URL_Patch url_patches[] = { //nim-boss .rodata - {0xE2282550, "http://pushmore.wup.shop.pretendo.cc/pushmore/r/%s"}, - {0xE229A0A0, "http://npns-dev.c.app.pretendo.cc/bst.dat"}, - {0xE229A0D0, "http://npns-dev.c.app.pretendo.cc/bst2.dat"}, - {0xE2281964, "https://tagaya.wup.shop.pretendo.cc/tagaya/versionlist/%s/%s/%s"}, - {0xE22819B4, "https://tagaya.wup.shop.pretendo.cc/tagaya/versionlist/%s/%s/latest_version"}, - {0xE2282584, "http://pushmo.wup.shop.pretendo.cc/pushmo/d/%s/%u"}, - {0xE22825B8, "http://pushmo.wup.shop.pretendo.cc/pushmo/c/%u/%u"}, - {0xE2282DB4, "https://ecs.wup.shop.pretendo.cc/ecs/services/ECommerceSOAP"}, - {0xE22830A0, "https://ecs.wup.shop.pretendo.cc/ecs/services/ECommerceSOAP"}, - {0xE22830E0, "https://nus.wup.shop.pretendo.cc/nus/services/NetUpdateSOAP"}, - {0xE2299990, "nppl.app.pretendo.cc"}, - {0xE229A600, "https://pls.wup.shop.pretendo.cc/pls/upload"}, - {0xE229A6AC, "https://npvk-dev.app.pretendo.cc/reports"}, - {0xE229A6D8, "https://npvk.app.pretendo.cc/reports"}, - {0xE229B1F4, "https://npts.app.pretendo.cc/p01/tasksheet/%s/%s/%s/%s?c=%s&l=%s"}, - {0xE229B238, "https://npts.app.pretendo.cc/p01/tasksheet/%s/%s/%s?c=%s&l=%s"}, - {0xE22AB2D8, "https://idbe-wup.cdn.pretendo.cc/icondata/%02X/%016llX.idbe"}, - {0xE22AB318, "https://idbe-ctr.cdn.pretendo.cc/icondata/%02X/%016llX.idbe"}, - {0xE22AB358, "https://idbe-wup.cdn.pretendo.cc/icondata/%02X/%016llX-%d.idbe"}, - {0xE22AB398, "https://idbe-ctr.cdn.pretendo.cc/icondata/%02X/%016llX-%d.idbe"}, - {0xE22B3EF8, "https://ecs.c.shop.pretendo.cc"}, - {0xE22B3F30, "https://ecs.c.shop.pretendo.cc/ecs/services/ECommerceSOAP"}, - {0xE22B3F70, "https://ias.c.shop.pretendo.cc/ias/services/IdentityAuthenticationSOAP"}, - {0xE22B3FBC, "https://cas.c.shop.pretendo.cc/cas/services/CatalogingSOAP"}, - {0xE22B3FFC, "https://nus.c.shop.pretendo.cc/nus/services/NetUpdateSOAP"}, - {0xE229DE0C, "n.app.pretendo.cc"}, + {0xE2282550, "http://pushmorewupshop.spfn.net/pushmore/r/%s"}, + {0xE229A0A0, "http://npns-devcapp.spfn.net/bst.dat"}, + {0xE229A0D0, "http://npns-devcapp.spfn.net/bst2.dat"}, + {0xE2281964, "https://tagayawupshop.spfn.net/tagaya/versionlist/%s/%s/%s"}, + {0xE22819B4, "https://tagayawupshop.spfn.net/tagaya/versionlist/%s/%s/latest_version"}, + {0xE2282584, "http://pushmowupshop.spfn.net/pushmo/d/%s/%u"}, + {0xE22825B8, "http://pushmowupshop.spfn.net/pushmo/c/%u/%u"}, + {0xE2282DB4, "https://ecswupshop.spfn.net/ecs/services/ECommerceSOAP"}, + {0xE22830A0, "https://ecswupshop.spfn.net/ecs/services/ECommerceSOAP"}, + {0xE22830E0, "https://nuswupshop.spfn.net/nus/services/NetUpdateSOAP"}, + {0xE2299990, "npplapp.spfn.net"}, + {0xE229A600, "https://plswupshop.spfn.net/pls/upload"}, + {0xE229A6AC, "https://npvk-devapp.spfn.net/reports"}, + {0xE229A6D8, "https://npvkapp.spfn.net/reports"}, + {0xE229B1F4, "https://nptsapp.spfn.net/p01/tasksheet/%s/%s/%s/%s?c=%s&l=%s"}, + {0xE229B238, "https://nptsapp.spfn.net/p01/tasksheet/%s/%s/%s?c=%s&l=%s"}, + {0xE22AB2D8, "https://idbe-wupcdn.spfn.net/icondata/%02X/%016llX.idbe"}, + {0xE22AB318, "https://idbe-ctrcdn.spfn.net/icondata/%02X/%016llX.idbe"}, + {0xE22AB358, "https://idbe-wupcdn.spfn.net/icondata/%02X/%016llX-%d.idbe"}, + {0xE22AB398, "https://idbe-ctrcdn.spfn.net/icondata/%02X/%016llX-%d.idbe"}, + {0xE22B3EF8, "https://ecscshop.spfn.net"}, + {0xE22B3F30, "https://ecscshop.spfn.net/ecs/services/ECommerceSOAP"}, + {0xE22B3F70, "https://iascshop.spfn.net/ias/services/IdentityAuthenticationSOAP"}, + {0xE22B3FBC, "https://cascshop.spfn.net/cas/services/CatalogingSOAP"}, + {0xE22B3FFC, "https://nuscshop.spfn.net/nus/services/NetUpdateSOAP"}, + {0xE229DE0C, "n.app.spfn.net"}, //nim-boss .bss - {0xE24B8A24, "https://nppl.app.pretendo.cc/p01/policylist/1/1/UNK"}, - {0xE31930D4, "https://%s%saccount.pretendo.cc/v%u/api/"} + {0xE24B8A24, "https://npplapp.spfn.net/p01/policylist/1/1/UNK"}, + {0xE31930D4, "https://%s%saccount.spfn.net/v%u/api/"} }; diff --git a/src/lang/de_DE.lang b/src/lang/de_DE.lang index 19a57dd..106ee37 100644 --- a/src/lang/de_DE.lang +++ b/src/lang/de_DE.lang @@ -1,13 +1,13 @@ .plugin_name="Inkay" ,.network_category="Netzwerkauswahl" -,.connect_to_network_setting="Verbinde zum Pretendo Network" +,.connect_to_network_setting="Verbinde zum SPFN" ,.other_category="Andere Einstellungen" ,.reset_wwp_setting="Wara Wara Plaza zurücksetzen" ,.press_a_action="Drücke A" ,.restart_to_apply_action="Neustarten zum Anwenden" ,.need_menu_action="Nur vom Wii U-Menü aus" ,.using_nintendo_network="Nutze Nintendo Network" -,.using_pretendo_network="Nutze Pretendo Network" +,.using_pretendo_network="Nutze SPFN" ,.multiplayer_port_display="Nutze UDP Port %hu für Mehrspieler" -,.module_not_found="Pretendo Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1001 Module missing)" -,.module_init_not_found="Pretendo Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1002 Module init)" +,.module_not_found="SPFN Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1001 Module missing)" +,.module_init_not_found="SPFN Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1002 Module init)" diff --git a/src/lang/en_US.lang b/src/lang/en_US.lang index 09ebe6a..4a2d963 100644 --- a/src/lang/en_US.lang +++ b/src/lang/en_US.lang @@ -1,13 +1,13 @@ .plugin_name="Inkay" ,.network_category="Network selection" -,.connect_to_network_setting="Connect to Pretendo Network" +,.connect_to_network_setting="Connect to SPFN" ,.other_category="Other settings" ,.reset_wwp_setting="Reset Wara Wara Plaza" ,.press_a_action="Press A" ,.restart_to_apply_action="Restart to apply" ,.need_menu_action="From WiiU menu only" ,.using_nintendo_network="Using Nintendo Network" -,.using_pretendo_network="Using Pretendo Network" +,.using_pretendo_network="Using SPFN" ,.multiplayer_port_display="Using UDP port %hu for multiplayer" -,.module_not_found="Pretendo Network patch failed - use Aroma Updater to repair (686-1001 Module missing)" -,.module_init_not_found="Pretendo Network patch failed - use Aroma Updater to repair (686-1002 Module init)" +,.module_not_found="SPFN patch failed - use Aroma Updater to repair (686-1001 Module missing)" +,.module_init_not_found="SPFN patch failed - use Aroma Updater to repair (686-1002 Module init)" diff --git a/src/lang/es_ES.lang b/src/lang/es_ES.lang index f84b918..2c98b40 100644 --- a/src/lang/es_ES.lang +++ b/src/lang/es_ES.lang @@ -1,13 +1,13 @@ .plugin_name="Inkay" ,.network_category="Seleccionar red" -,.connect_to_network_setting="Conectar a Pretendo Network" +,.connect_to_network_setting="Conectar a SPFN" ,.other_category="Otros ajustes" ,.reset_wwp_setting="Restablecer Plaza Wara Wara" ,.press_a_action="Pulsa A" ,.restart_to_apply_action="Reiniciar para aplicar" ,.need_menu_action="Solo desde el Menú de Wii U" ,.using_nintendo_network="Usando Nintendo Network" -,.using_pretendo_network="Usando Pretendo Network" +,.using_pretendo_network="Usando SPFN" ,.multiplayer_port_display="Usando puerto UDP %hu para multijugador" -,.module_not_found="Ha fallado el parche Pretendo Network - usa Aroma Updater para repararlo (686-1001 Falta un módulo)" -,.module_init_not_found="Ha fallado el parche Pretendo Network - usa Aroma Updater para repararlo (686-1002 Inicialización del módulo)" +,.module_not_found="Ha fallado el parche SPFN - usa Aroma Updater para repararlo (686-1001 Falta un módulo)" +,.module_init_not_found="Ha fallado el parche SPFN - usa Aroma Updater para repararlo (686-1002 Inicialización del módulo)" diff --git a/src/lang/fr_FR.lang b/src/lang/fr_FR.lang index 901a2a2..58204e1 100644 --- a/src/lang/fr_FR.lang +++ b/src/lang/fr_FR.lang @@ -1,13 +1,13 @@ .plugin_name="Inkay" ,.network_category="Sélection du réseau" -,.connect_to_network_setting="Connexion au Pretendo Network" +,.connect_to_network_setting="Connexion au SPFN" ,.other_category="Autres paramètres" ,.reset_wwp_setting="Réinitialiser la place WaraWara" ,.press_a_action="Appuyez sur A" ,.restart_to_apply_action="Redémarrer pour appliquer" ,.need_menu_action="(retournez d'abord au menu Wii U)" ,.using_nintendo_network="Réseau sélectionné : Nintendo Network" -,.using_pretendo_network="Réseau sélectionné : Pretendo Network" +,.using_pretendo_network="Réseau sélectionné : SPFN" ,.multiplayer_port_display="Le port UDP %hu sera utilisé pour le multijoueur" -,.module_not_found="Le patch Pretendo Network a rencontré un problème, veuillez le réparer avec Aroma Updater (686-1001 Module missing)" -,.module_init_not_found="Le patch Pretendo Network a rencontré un problème, veuillez le réparer avec Aroma Updater (686-1002 Module init)" +,.module_not_found="Le patch SPFN a rencontré un problème, veuillez le réparer avec Aroma Updater (686-1001 Module missing)" +,.module_init_not_found="Le patch SPFN a rencontré un problème, veuillez le réparer avec Aroma Updater (686-1002 Module init)" diff --git a/src/lang/it_IT.lang b/src/lang/it_IT.lang index 6702add..9f49582 100644 --- a/src/lang/it_IT.lang +++ b/src/lang/it_IT.lang @@ -1,13 +1,13 @@ .plugin_name="Inkay" ,.network_category="Seleziona la rete" -,.connect_to_network_setting="Connettiti a Pretendo Network" +,.connect_to_network_setting="Connettiti a SPFN" ,.other_category="Altre impostazioni" ,.reset_wwp_setting="Ripristina Wara Wara Plaza" ,.press_a_action="Premi A" ,.restart_to_apply_action="Riavvia per applicare" ,.need_menu_action="Solo dal menu WiiU" ,.using_nintendo_network="In uso Nintendo Network" -,.using_pretendo_network="In uso Pretendo Network" +,.using_pretendo_network="In uso SPFN" ,.multiplayer_port_display="È in uso la porta UDP %hu per il multigiocatore" -,.module_not_found="Patch di Pretendo fallita - usa Aroma Updater per correggere (686-1001 Modulo mancante)" -,.module_init_not_found="Patch di Pretendo fallita - usa Aroma Updater per correggere (686-1002 Module init)" +,.module_not_found="Patch di SPFN fallita - usa Aroma Updater per correggere (686-1001 Modulo mancante)" +,.module_init_not_found="Patch di SPFN fallita - usa Aroma Updater per correggere (686-1002 Module init)" diff --git a/src/lang/ja_JP.lang b/src/lang/ja_JP.lang index 77214c5..73a419f 100644 --- a/src/lang/ja_JP.lang +++ b/src/lang/ja_JP.lang @@ -1,13 +1,13 @@ .plugin_name="Inkay" ,.network_category="ネットワークの選択" -,.connect_to_network_setting="Pretendoネットワークに接続する" +,.connect_to_network_setting="SPFNネットワークに接続する" ,.other_category="その他の設定" ,.reset_wwp_setting="わらわら広場をリセット" ,.press_a_action="Aボタンを押そう" ,.restart_to_apply_action="再起動後に反映されます" ,.need_menu_action="Wii Uメニューからのみ実行可能" ,.using_nintendo_network="選択済み:ニンテンドーネットワーク" -,.using_pretendo_network="選択済み:Pretendo ネットワーク" +,.using_pretendo_network="選択済み:SPFN ネットワーク" ,.multiplayer_port_display="マルチプレイに UDPポート %hu を使用します" -,.module_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1001 Module missing)" -,.module_init_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1002 Module init)" +,.module_not_found="SPFN パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1001 Module missing)" +,.module_init_not_found="SPFN パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1002 Module init)" diff --git a/src/lang/nl_NL.lang b/src/lang/nl_NL.lang index 9e67847..65d51fb 100644 --- a/src/lang/nl_NL.lang +++ b/src/lang/nl_NL.lang @@ -1,13 +1,13 @@ .plugin_name="Inkay" ,.network_category="Netwerkselectie" -,.connect_to_network_setting="Verbind met het Pretendo-netwerk" +,.connect_to_network_setting="Verbind met het SPFN-netwerk" ,.other_category="Overige instellingen" ,.reset_wwp_setting="Reset het Wara Wara Plaza" ,.press_a_action="Druk A" ,.restart_to_apply_action="Herstart om toe te passen" ,.need_menu_action="Alleen vanuit het WiiU-menu" ,.using_nintendo_network="Nintendo Network wordt gebruikt" -,.using_pretendo_network="Pretendo Network wordt gebruikt" +,.using_pretendo_network="SPFN wordt gebruikt" ,.multiplayer_port_display="Gebruikt UDP port %hu voor multiplayer" -,.module_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1001 Module ontbreekt)" -,.module_init_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1002 Module init)" +,.module_not_found="SPFN patch mislukt - gebruik Aroma Updater om het te herstellen (686-1001 Module ontbreekt)" +,.module_init_not_found="SPFN patch mislukt - gebruik Aroma Updater om het te herstellen (686-1002 Module init)" diff --git a/src/lang/pt_BR.lang b/src/lang/pt_BR.lang index 511d5ab..a776724 100644 --- a/src/lang/pt_BR.lang +++ b/src/lang/pt_BR.lang @@ -1,13 +1,13 @@ .plugin_name="Inkay" ,.network_category="Selecionar rede" -,.connect_to_network_setting="Conecta-se à Pretendo Network" +,.connect_to_network_setting="Conecta-se à SPFN" ,.other_category="Outras configurações" ,.reset_wwp_setting="Resetar Wara Wara Plaza" ,.press_a_action="Aperte A" ,.restart_to_apply_action="Reinicie para aplicar" ,.need_menu_action="Apenas no menu do Wii U" ,.using_nintendo_network="Usando Nintendo Network" -,.using_pretendo_network="Usando Pretendo Network" +,.using_pretendo_network="Usando SPFN" ,.multiplayer_port_display="Usando UDP port %hu para a jogatina multiplayer" -,.module_not_found="Atualização do Pretendo falhou - use o Aroma Updater para corrigir (686-1001 Módulo faltando)" -,.module_init_not_found="Atualização do Pretendo falhou - use o Aroma Updater para corrigir (686-1002 Módulo de início)" +,.module_not_found="Atualização do SPFN falhou - use o Aroma Updater para corrigir (686-1001 Módulo faltando)" +,.module_init_not_found="Atualização do SPFN falhou - use o Aroma Updater para corrigir (686-1002 Módulo de início)" diff --git a/src/lang/ru_RU.lang b/src/lang/ru_RU.lang index 3dc9c9c..a1a8451 100644 --- a/src/lang/ru_RU.lang +++ b/src/lang/ru_RU.lang @@ -1,13 +1,13 @@ .plugin_name="Inkay" ,.network_category="Выбор сети" -,.connect_to_network_setting="Подключиться к Pretendo Network" +,.connect_to_network_setting="Подключиться к SPFN" ,.other_category="Другие настройки" ,.reset_wwp_setting="Сбросить Wara Wara Plaza" ,.press_a_action="Нажмите A" ,.restart_to_apply_action="Перезагрузите для применения изменений" ,.need_menu_action="Только из меню Wii U" ,.using_nintendo_network="Используется Nintendo Network" -,.using_pretendo_network="Используется Pretendo Network" +,.using_pretendo_network="Используется SPFN" ,.multiplayer_port_display="Используем UDP-порт %hu для сетевой игры" -,.module_not_found="Ошибка установки патча Pretendo - для восстановления, запустите Aroma Updater (686-1001 Модуль отсутствует)" -,.module_init_not_found="Ошибка установки патча Pretendo - для восстановления, запустите Aroma Updater (686-1002 Инициализация модуля)" +,.module_not_found="Ошибка установки патча SPFN - для восстановления, запустите Aroma Updater (686-1001 Модуль отсутствует)" +,.module_init_not_found="Ошибка установки патча SPFN - для восстановления, запустите Aroma Updater (686-1002 Инициализация модуля)" diff --git a/src/lang/zh_CN.lang b/src/lang/zh_CN.lang index 5191686..f9b5eec 100644 --- a/src/lang/zh_CN.lang +++ b/src/lang/zh_CN.lang @@ -1,13 +1,13 @@ .plugin_name="Inkay" ,.network_category="选择网络" -,.connect_to_network_setting="连接到Pretendo Network" +,.connect_to_network_setting="连接到SPFN" ,.other_category="其他设置" ,.reset_wwp_setting="重置Wara Wara Plaza" ,.press_a_action="请按 A" ,.restart_to_apply_action="重启以应用设置" ,.need_menu_action="仅来自WiiU Menu" ,.using_nintendo_network="使用 Nintendo Network" -,.using_pretendo_network="使用 Pretendo Network" +,.using_pretendo_network="使用 SPFN" ,.multiplayer_port_display="多人游戏使用 UDP 端口 %hu" -,.module_not_found="Pretendo Network 补丁失败 - 使用 Aroma Updater 修复(686-1001 模块丢失)" -,.module_init_not_found="Pretendo Network 补丁失败 - 使用 Aroma Updater 修复(686-1002 模块初始化)" +,.module_not_found="SPFN 补丁失败 - 使用 Aroma Updater 修复(686-1001 模块丢失)" +,.module_init_not_found="SPFN 补丁失败 - 使用 Aroma Updater 修复(686-1002 模块初始化)" diff --git a/src/lang/zh_Hant.lang b/src/lang/zh_Hant.lang index f68d3a2..8d550f7 100644 --- a/src/lang/zh_Hant.lang +++ b/src/lang/zh_Hant.lang @@ -1,13 +1,13 @@ .plugin_name="Inkay" ,.network_category="選擇網路" -,.connect_to_network_setting="連接到Pretendo Network" +,.connect_to_network_setting="連接到SPFN" ,.other_category="其他設定" ,.reset_wwp_setting="重置Wara Wara Plaza" ,.press_a_action="請按 A" ,.restart_to_apply_action="重啓以套用設定" ,.need_menu_action="僅來自WiiU Menu" ,.using_nintendo_network="使用 Nintendo Network" -,.using_pretendo_network="使用 Pretendo Network" +,.using_pretendo_network="使用 SPFN" ,.multiplayer_port_display="Using UDP port %hu for multiplayer" -,.module_not_found="Pretendo Network patch failed - use Aroma Updater to repair (686-1001 Module missing)" -,.module_init_not_found="Pretendo Network patch failed - use Aroma Updater to repair (686-1002 Module init)" +,.module_not_found="SPFN patch failed - use Aroma Updater to repair (686-1001 Module missing)" +,.module_init_not_found="SPFN patch failed - use Aroma Updater to repair (686-1002 Module init)" diff --git a/src/main.cpp b/src/main.cpp index 4930ac0..1e83168 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,9 +46,9 @@ If not set correctly, the loader will refuse to use the plugin. **/ WUMS_MODULE_EXPORT_NAME("inkay"); -WUMS_MODULE_DESCRIPTION("Pretendo Network Patcher"); +WUMS_MODULE_DESCRIPTION("SPFN Network Patcher"); WUMS_MODULE_VERSION(INKAY_VERSION); -WUMS_MODULE_AUTHOR("Pretendo contributors"); +WUMS_MODULE_AUTHOR("Pretendo contributors and RusticMaple"); WUMS_MODULE_LICENSE("GPLv3"); WUMS_DEPENDS_ON(homebrew_functionpatcher); From d01d322003d07b9a34bfe52b66889a6588bbf021 Mon Sep 17 00:00:00 2001 From: kitten Date: Mon, 18 May 2026 21:38:18 +0200 Subject: [PATCH 111/139] ci: try to fix up to work (it prob wont) --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5eaaa2e..3c29369 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,12 +8,12 @@ on: jobs: build-inkay: - runs-on: ubuntu-22.04 + runs-on: debian-trixie steps: - uses: actions/checkout@v6 - name: build toolchain container run: docker build . -t builder - - uses: ammaraskar/gcc-problem-matcher@master + - uses: https://github.com/ammaraskar/gcc-problem-matcher@master - name: build Inkay run: docker run --rm -v ${PWD}:/app -w /app builder - uses: actions/upload-artifact@v6 From c2e1eef7e5089b9aaaacf52e274bdb837f33046d Mon Sep 17 00:00:00 2001 From: kitten Date: Mon, 18 May 2026 21:41:50 +0200 Subject: [PATCH 112/139] ci: downgrade to v3 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c29369..02ca802 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - uses: https://github.com/ammaraskar/gcc-problem-matcher@master - name: build Inkay run: docker run --rm -v ${PWD}:/app -w /app builder - - uses: actions/upload-artifact@v6 + - uses: actions/upload-artifact@v3 with: name: inkay path: dist/ From bf5336cba939c7facfbb6fcdca5dbd14a0c34fbd Mon Sep 17 00:00:00 2001 From: Spacebot Date: Sat, 16 May 2026 20:30:46 +0000 Subject: [PATCH 113/139] Add renovate.json --- renovate.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..9775346 --- /dev/null +++ b/renovate.json @@ -0,0 +1,3 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json" +} From 7403eaecd3a44d7e15e831192aa0a179f6d85a48 Mon Sep 17 00:00:00 2001 From: Spacebot Date: Mon, 18 May 2026 20:00:48 +0000 Subject: [PATCH 114/139] Update ghcr.io/wiiu-env/wiiumodulesystem Docker tag to v20250219 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a195fbc..d45375f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ COPY --from=ghcr.io/wiiu-env/libnotifications:20240426 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libkernel:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libmocha:20231127 /artifacts $DEVKITPRO -COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20250208 /artifacts $DEVKITPRO +COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20250219 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/wiiupluginsystem:20240505 /artifacts $DEVKITPRO WORKDIR /app From b04ebb8624b79ce3ae0190a7849341a4c454c257 Mon Sep 17 00:00:00 2001 From: Jas Date: Thu, 21 May 2026 13:37:36 -0400 Subject: [PATCH 115/139] feat: make startup toast optional added a configuration option to show/hide startup toast --- common/lang.h | 1 + plugin/src/config.cpp | 28 +++++++++++++++++++++++++++- plugin/src/config.h | 2 ++ plugin/src/main.cpp | 2 +- plugin/src/module.cpp | 6 +++--- plugin/src/module.h | 2 +- src/config.cpp | 1 + src/config.h | 2 ++ src/lang/en_US.lang | 1 + src/main.cpp | 12 +++++++++--- 10 files changed, 48 insertions(+), 9 deletions(-) diff --git a/common/lang.h b/common/lang.h index 6e557fe..c7fb606 100644 --- a/common/lang.h +++ b/common/lang.h @@ -7,6 +7,7 @@ struct config_strings { const char *plugin_name; std::string_view network_category; std::string_view connect_to_network_setting; + std::string_view show_startup_toast_setting; std::string_view other_category; std::string_view reset_wwp_setting; std::string_view press_a_action; diff --git a/plugin/src/config.cpp b/plugin/src/config.cpp index 98c2323..1e459dc 100644 --- a/plugin/src/config.cpp +++ b/plugin/src/config.cpp @@ -39,6 +39,7 @@ static config_strings strings; bool Config::connect_to_network = true; +bool Config::show_startup_toast = true; bool Config::need_relaunch = false; bool Config::unregister_task_item_pressed = false; bool Config::is_wiiu_menu = false; @@ -64,6 +65,15 @@ static void connect_to_network_changed(ConfigItemBoolean* item, bool new_value) if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); } +static void show_startup_toast_changed(ConfigItemBoolean* item, bool new_value) { + DEBUG_FUNCTION_LINE_VERBOSE("show_startup_toast changed to: %d", new_value); + Config::show_startup_toast = new_value; + + WUPSStorageError res; + res = WUPSStorageAPI::Store("show_startup_toast", Config::show_startup_toast); + if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); +} + static void unregister_task_item_on_input_cb(void *context, WUPSConfigSimplePadData input) { if (!Config::unregister_task_item_pressed && Config::is_wiiu_menu && ((input.buttons_d & WUPS_CONFIG_BUTTON_A) == WUPS_CONFIG_BUTTON_A)) { @@ -156,6 +166,9 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa auto other_cat = WUPSConfigCategory::Create(strings.other_category, err); if (!other_cat) return report_error(err); + auto startup_toast_item = WUPSConfigItemBoolean::Create("show_startup_toast", strings.show_startup_toast_setting, true, Config::show_startup_toast, &show_startup_toast_changed, err); + if (!startup_toast_item) return report_error(err); + WUPSConfigAPIItemCallbacksV2 unregisterTasksItemCallbacks = { .getCurrentValueDisplay = unregister_task_item_get_display_value, .getCurrentValueSelectedDisplay = unregister_task_item_get_display_value, @@ -181,6 +194,9 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa err = WUPSConfigAPI_Category_AddItem(other_cat->getHandle(), unregisterTasksItem); if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + res = other_cat->add(std::move(*startup_toast_item), err); + if (!res) return report_error(err); + res = root.add(std::move(*other_cat), err); if (!res) return report_error(err); @@ -210,7 +226,7 @@ void Config::Init() { if (cres != WUPSCONFIG_API_RESULT_SUCCESS) return (void)report_error(cres); WUPSStorageError res; - // Try to get value from storage + // Try to get values from storage res = WUPSStorageAPI::Get("connect_to_network", Config::connect_to_network); if (res == WUPS_STORAGE_ERROR_NOT_FOUND) { DEBUG_FUNCTION_LINE("Connect to network value not found, attempting to migrate/create"); @@ -228,6 +244,16 @@ void Config::Init() { } else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); + res = WUPSStorageAPI::Get("show_startup_toast", Config::show_startup_toast); + if (res == WUPS_STORAGE_ERROR_NOT_FOUND) { + DEBUG_FUNCTION_LINE("Show startup toast value not found, attempting to create"); + + // Add the value to the storage if it's missing. + res = WUPSStorageAPI::Store("show_startup_toast", show_startup_toast); + if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); + } + else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); + // Save storage res = WUPSStorageAPI::SaveStorage(); if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); diff --git a/plugin/src/config.h b/plugin/src/config.h index 0928d5e..78850c6 100644 --- a/plugin/src/config.h +++ b/plugin/src/config.h @@ -12,6 +12,8 @@ public: // wups config items static bool connect_to_network; + static bool show_startup_toast; + // private stuff static bool need_relaunch; diff --git a/plugin/src/main.cpp b/plugin/src/main.cpp index e95eaac..535c266 100644 --- a/plugin/src/main.cpp +++ b/plugin/src/main.cpp @@ -50,7 +50,7 @@ INITIALIZE_PLUGIN() { } // if using pretendo then (try to) apply the ssl patches - Inkay_Initialize(Config::connect_to_network); + Inkay_Initialize(Config::connect_to_network, Config::show_startup_toast); } DEINITIALIZE_PLUGIN() { diff --git a/plugin/src/module.cpp b/plugin/src/module.cpp index c20d980..9de83ce 100644 --- a/plugin/src/module.cpp +++ b/plugin/src/module.cpp @@ -24,7 +24,7 @@ #include static OSDynLoad_Module module; -static void (*moduleInitialize)(bool) = nullptr; +static void (*moduleInitialize)(bool, bool) = nullptr; static InkayStatus (*moduleGetStatus)() = nullptr; static void (*moduleSetPluginRunning)() = nullptr; @@ -36,7 +36,7 @@ static const char *get_module_init_not_found_message() { return get_config_strings(get_system_language()).module_init_not_found.data(); } -void Inkay_Initialize(bool apply_patches) { +void Inkay_Initialize(bool apply_patches, bool show_startup_toast) { if (module) { return; } @@ -54,7 +54,7 @@ void Inkay_Initialize(bool apply_patches) { return; } - moduleInitialize(apply_patches); + moduleInitialize(apply_patches, show_startup_toast); } void Inkay_Finalize() { diff --git a/plugin/src/module.h b/plugin/src/module.h index ab7836d..22e2356 100644 --- a/plugin/src/module.h +++ b/plugin/src/module.h @@ -24,7 +24,7 @@ enum class InkayStatus { Error = -1 ///< Failed to retrieve the module status }; -void Inkay_Initialize(bool apply_patches); +void Inkay_Initialize(bool apply_patches, bool show_startup_toast); void Inkay_Finalize(); InkayStatus Inkay_GetStatus(); void Inkay_SetPluginRunning(); diff --git a/src/config.cpp b/src/config.cpp index 66a78c4..8400d21 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -18,6 +18,7 @@ #include "config.h" bool Config::connect_to_network = false; +bool Config::show_startup_toast = false; bool Config::initialized = false; bool Config::shown_warning = false; bool Config::plugin_is_loaded = false; diff --git a/src/config.h b/src/config.h index 8455bb0..faecea9 100644 --- a/src/config.h +++ b/src/config.h @@ -10,6 +10,8 @@ public: static bool connect_to_network; + static bool show_startup_toast; + static bool initialized; static bool shown_warning; diff --git a/src/lang/en_US.lang b/src/lang/en_US.lang index 09ebe6a..1fb1fd0 100644 --- a/src/lang/en_US.lang +++ b/src/lang/en_US.lang @@ -1,6 +1,7 @@ .plugin_name="Inkay" ,.network_category="Network selection" ,.connect_to_network_setting="Connect to Pretendo Network" +,.show_startup_toast_setting="Show startup toast" ,.other_category="Other settings" ,.reset_wwp_setting="Reset Wara Wara Plaza" ,.press_a_action="Press A" diff --git a/src/main.cpp b/src/main.cpp index 4930ac0..2e63a2a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -122,10 +122,12 @@ static InkayStatus Inkay_GetStatus() { } } -static void Inkay_Initialize(bool apply_patches) { +static void Inkay_Initialize(bool apply_patches, bool show_startup_toast) { if (Config::initialized) return; + Config::show_startup_toast = show_startup_toast; + if (Config::block_initialize) { ShowNotification("Cannot load Inkay while the system is running. Please restart the console"); return; @@ -150,12 +152,16 @@ static void Inkay_Initialize(bool apply_patches) { DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches applied successfully."); - ShowNotification(get_pretendo_message()); + if (Config::show_startup_toast) { + ShowNotification(get_pretendo_message()); + } Config::initialized = true; } else { DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches skipped."); - ShowNotification(get_nintendo_network_message()); + if(Config::show_startup_toast) { + ShowNotification(get_nintendo_network_message()); + } Config::initialized = true; return; } From 4c432b753ccc470bede7c39a5c1ba93c4d638c83 Mon Sep 17 00:00:00 2001 From: kitten Date: Sun, 24 May 2026 21:57:29 +0200 Subject: [PATCH 116/139] chore: remove mentions of spfn.cc --- common/inkay_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/inkay_config.h b/common/inkay_config.h index 64a20fd..fad1699 100644 --- a/common/inkay_config.h +++ b/common/inkay_config.h @@ -15,7 +15,7 @@ #endif #ifndef NETWORK_BASEURL -#define NETWORK_BASEURL "spfn.cc" +#define NETWORK_BASEURL "spfn.net" #endif #endif //INKAY_INKAY_CONFIG_H From 998abca20035ca69ecc6fc883454f2f5464460d3 Mon Sep 17 00:00:00 2001 From: Spacebot Date: Thu, 18 Jun 2026 15:15:47 +0000 Subject: [PATCH 117/139] Update actions/checkout action to v7 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02ca802..3eb8d31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: build-inkay: runs-on: debian-trixie steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: build toolchain container run: docker build . -t builder - uses: https://github.com/ammaraskar/gcc-problem-matcher@master From a43aed245619826fb38337ffa131a8ec0ce075c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 07:23:48 +0000 Subject: [PATCH 118/139] chore: bump actions/checkout from 6 to 7 Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcd6868..792dce0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: build-inkay: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: build toolchain container run: docker build . -t builder - uses: ammaraskar/gcc-problem-matcher@master From 1796ebebb5322c87cfbe951a582ed23d7fbce83a Mon Sep 17 00:00:00 2001 From: red binder Date: Sat, 18 Jul 2026 00:50:36 +0200 Subject: [PATCH 119/139] OLV changes --- plugin/src/main.cpp | 2 +- src/patches/olv_applet.cpp | 62 ++++++++++++++++++++++++++++++++------ src/patches/olv_urls.h | 4 +-- 3 files changed, 55 insertions(+), 13 deletions(-) diff --git a/plugin/src/main.cpp b/plugin/src/main.cpp index 57ba9d1..516146d 100644 --- a/plugin/src/main.cpp +++ b/plugin/src/main.cpp @@ -91,7 +91,7 @@ void splatoon_patcher(){ auto str_loc = (char*)(0x000009ac + (uint32_t)game_data_region); - strcpy(str_loc, "https://s-res.spfn.net/post"); + strcpy(str_loc, "https://splatpost.spbr.net/post"); } } } diff --git a/src/patches/olv_applet.cpp b/src/patches/olv_applet.cpp index 8f97a79..2860027 100644 --- a/src/patches/olv_applet.cpp +++ b/src/patches/olv_applet.cpp @@ -46,7 +46,7 @@ constexpr struct olv_allowlist original_entry = { constexpr struct olv_allowlist new_entry = { .scheme = "https", - .domain = "." NETWORK_BASEURL, + .domain = ".projectrose.cafe", .path = "", .flags = {1, 1, 1, 1, 1}, }; @@ -77,6 +77,7 @@ const replacement replacements[] = { }; static std::optional rootca_pem_handle{}; +static std::optional valid_tld_handle{}; std::vector olv_patches; DECL_FUNCTION(int, FSOpenFile, FSClient *client, FSCmdBlock *block, char *path, const char *mode, uint32_t *handle, @@ -106,33 +107,74 @@ DECL_FUNCTION(int, FSOpenFile, FSClient *client, FSCmdBlock *block, char *path, DEBUG_FUNCTION_LINE_VERBOSE("Inkay: Found Miiverse CA, replacing..."); return ret; } + else if (strcmp("vol/content/browser/effective_tld_names.dat", path) == 0) + { + // we patch the TLD because .cafe isnt on the list (projectrose.cafe) + int ret = real_FSOpenFile(client, block, path, mode, handle, error); + valid_tld_handle = *handle; + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: Found Miiverse TLD List, patching..."); + return ret; + } return real_FSOpenFile(client, block, path, mode, handle, error); } DECL_FUNCTION(FSStatus, FSReadFile, FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, - FSFileHandle handle, uint32_t unk1, uint32_t flags) { - if (size != 1) { - DEBUG_FUNCTION_LINE("Inkay: Miiverse CA replacement failed!"); + FSFileHandle handle, uint32_t unk1, uint32_t flags) +{ + if (size != 1) + { + DEBUG_FUNCTION_LINE("Inkay: Miiverse CA/LTD replacement failed!"); } - if (rootca_pem_handle && *rootca_pem_handle == handle) { - strlcpy((char *) buffer, (const char *) ca_pem, size * count); + if (rootca_pem_handle && *rootca_pem_handle == handle) + { + strlcpy((char *)buffer, (const char *)ca_pem, size * count); - //this can't be done above (in the FSOpenFile hook) since it's not loaded yet. - //the hardcoded offsets suck but they really are at Random Places In The Heap - replaceBulk(0x11000000, 0x02000000, replacements); - return (FSStatus) count; + // this can't be done above (in the FSOpenFile hook) since it's not loaded yet. + // the hardcoded offsets suck but they really are at Random Places In The Heap + return (FSStatus)count; + } + else if (valid_tld_handle && *valid_tld_handle == handle) + { + // we patch the tld "aero"... + FSStatus ret = real_FSReadFile( + client, block, buffer, size, count, handle, unk1, flags); + + if (ret > 0) + { + uint32_t totalSize = size * count; + char *buf = (char *)buffer; + + for (uint32_t i = 0; i + 4 <= totalSize; i++) + { + if (memcmp(&buf[i], "aero", 4) == 0) + { + memcpy(&buf[i], "cafe", 4); + + DEBUG_FUNCTION_LINE_VERBOSE( + "Inkay: patched TLD aero -> cafe"); + } + } + } + + return ret; } return real_FSReadFile(client, block, buffer, size, count, handle, unk1, flags); } + DECL_FUNCTION(FSStatus, FSCloseFile, FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask) { if (handle == rootca_pem_handle) { rootca_pem_handle.reset(); } + if (handle == valid_tld_handle) + { + valid_tld_handle.reset(); + } + return real_FSCloseFile(client, block, handle, errorMask); } diff --git a/src/patches/olv_urls.h b/src/patches/olv_urls.h index 323498f..aa055fc 100644 --- a/src/patches/olv_urls.h +++ b/src/patches/olv_urls.h @@ -18,9 +18,9 @@ #include "inkay_config.h" constexpr char original_url[] = "discovery.olv.nintendo.net/v1/endpoint"; -constexpr char new_url[] = "discovery.olv." NETWORK_BASEURL "/v1/endpoint"; +constexpr char new_url[] = "disco.olv.projectrose.cafe/v1/endpoint"; -_Static_assert(sizeof(original_url) > sizeof(new_url), +_Static_assert(sizeof(original_url) >= sizeof(new_url), "new_url too long! Must be less than 38chars."); bool setup_olv_libs(); From d5f9207deb8d7e5e3fae3f379ac4f85d0a5e470d Mon Sep 17 00:00:00 2001 From: 2Epik4u <2Epikk4u@proton.me> Date: Sun, 19 Jul 2026 19:53:42 -0400 Subject: [PATCH 120/139] dont send splatoon patches if nn is enabled --- plugin/src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/src/main.cpp b/plugin/src/main.cpp index 516146d..5f1b343 100644 --- a/plugin/src/main.cpp +++ b/plugin/src/main.cpp @@ -56,6 +56,10 @@ bool is_current_game_splatoon(){ } void splatoon_patcher(){ + if (!Config::connect_to_network) { + DEBUG_FUNCTION_LINE_VERBOSE("Inkay: Splatoon patches skipped"); + return; + } if(is_current_game_splatoon()){ NotificationModule_AddInfoNotification("Splatoon Detected, applying patch"); From 82cca21ff354280a2ec87a1859930348eda83b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Mon, 20 Jul 2026 14:40:35 +0100 Subject: [PATCH 121/139] chore: Bump version to v3.1.0 --- plugin/src/main.cpp | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/src/main.cpp b/plugin/src/main.cpp index 535c266..8363ca9 100644 --- a/plugin/src/main.cpp +++ b/plugin/src/main.cpp @@ -23,7 +23,7 @@ #include "config.h" #include "module.h" -#define INKAY_VERSION "v3.0.0" +#define INKAY_VERSION "v3.1.0" /** Mandatory plugin information. diff --git a/src/main.cpp b/src/main.cpp index b91d271..df482b3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,7 +39,7 @@ #include "ca_pem.h" -#define INKAY_VERSION "v3.0.0" +#define INKAY_VERSION "v3.1.0" /** Mandatory plugin information. From 8cfbf64d545d4eaa207929a55e649426e141b289 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Mon, 27 Jul 2026 21:42:35 +1000 Subject: [PATCH 122/139] chore: update toolchain --- Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index a195fbc..f249c75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM ghcr.io/wiiu-env/devkitppc:20250608 +FROM ghcr.io/wiiu-env/devkitppc:20260504 -COPY --from=ghcr.io/wiiu-env/libnotifications:20240426 /artifacts $DEVKITPRO -COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO -COPY --from=ghcr.io/wiiu-env/libkernel:20230621 /artifacts $DEVKITPRO -COPY --from=ghcr.io/wiiu-env/libmocha:20231127 /artifacts $DEVKITPRO -COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20250208 /artifacts $DEVKITPRO -COPY --from=ghcr.io/wiiu-env/wiiupluginsystem:20240505 /artifacts $DEVKITPRO +COPY --from=ghcr.io/wiiu-env/libnotifications:20260404 /artifacts $DEVKITPRO +COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20260331 /artifacts $DEVKITPRO +COPY --from=ghcr.io/wiiu-env/libkernel:20260331 /artifacts $DEVKITPRO +COPY --from=ghcr.io/wiiu-env/libmocha:20260331 /artifacts $DEVKITPRO +COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20260418 /artifacts $DEVKITPRO +COPY --from=ghcr.io/wiiu-env/wiiupluginsystem:20260503 /artifacts $DEVKITPRO WORKDIR /app CMD make -f Makefile -j$(nproc) From e5020b88d044e99239b773fb6ae25be034f577b5 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Mon, 27 Jul 2026 21:42:57 +1000 Subject: [PATCH 123/139] fix: don't pull devoptab and sockets requires new-ish aroma for LoggingModule i guess --- plugin/src/main.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugin/src/main.cpp b/plugin/src/main.cpp index 8363ca9..20e5db0 100644 --- a/plugin/src/main.cpp +++ b/plugin/src/main.cpp @@ -37,11 +37,8 @@ WUPS_PLUGIN_LICENSE("GPLv3"); WUPS_USE_STORAGE("inkay"); -WUPS_USE_WUT_DEVOPTAB(); - INITIALIZE_PLUGIN() { - WHBLogCafeInit(); - WHBLogUdpInit(); + WHBLogModuleInit(); Config::Init(); @@ -57,8 +54,7 @@ DEINITIALIZE_PLUGIN() { Inkay_Finalize(); NotificationModule_DeInitLibrary(); - WHBLogCafeDeinit(); - WHBLogUdpDeinit(); + WHBLogModuleDeinit(); } ON_APPLICATION_START() { From ccf5370f84b36acdbb63bfb1c62c2e10217909b2 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Mon, 27 Jul 2026 22:27:13 +1000 Subject: [PATCH 124/139] feat: switch config to C API and add missing strings ~40% bianry size reduction from RTTI/exceptions overhead --- common/lang.h | 5 + plugin/src/config.cpp | 275 ++++++++++++++++++++++-------------------- src/lang/de_DE.lang | 1 + src/lang/en@uwu.lang | 6 +- src/lang/en_US.lang | 5 + src/lang/es_ES.lang | 1 + src/lang/fr_FR.lang | 1 + src/lang/it_IT.lang | 1 + src/lang/ja_JP.lang | 1 + src/lang/ko_KR.lang | 1 + src/lang/nl_NL.lang | 1 + src/lang/pt_BR.lang | 1 + src/lang/ru_RU.lang | 1 + src/lang/zh_CN.lang | 1 + src/lang/zh_Hant.lang | 1 + 15 files changed, 169 insertions(+), 133 deletions(-) diff --git a/common/lang.h b/common/lang.h index 692f9ec..d004ef8 100644 --- a/common/lang.h +++ b/common/lang.h @@ -37,6 +37,11 @@ struct config_strings { std::string_view multiplayer_port_display; std::string_view module_not_found; std::string_view module_init_not_found; + std::string_view setting_yes; + std::string_view setting_no; + std::string_view language_setting; + std::string_view language_name; + std::string_view system_language; }; config_strings get_config_strings(inkay_language language); diff --git a/plugin/src/config.cpp b/plugin/src/config.cpp index 5e68c15..eb8d153 100644 --- a/plugin/src/config.cpp +++ b/plugin/src/config.cpp @@ -56,67 +56,63 @@ static void report_storage_error(WUPSStorageError err) { DEBUG_FUNCTION_LINE_VERBOSE("WUPS storage error: %s", WUPSStorageAPI_GetStatusStr(err)); } -static void connect_to_network_changed(ConfigItemBoolean* item, bool new_value) { +static void connect_to_network_changed(ConfigItemBoolean *item, bool new_value) { DEBUG_FUNCTION_LINE_VERBOSE("connect_to_network changed to: %d", new_value); if (new_value != Config::connect_to_network) { Config::need_relaunch = true; } Config::connect_to_network = new_value; - WUPSStorageError res; - res = WUPSStorageAPI::Store("connect_to_network", Config::connect_to_network); + WUPSStorageError res = WUPSStorageAPI_StoreBool(nullptr, "connect_to_network", Config::connect_to_network); if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); } -static void language_changed(ConfigItemMultipleValues* item, uint32_t new_value) { +static void language_changed(ConfigItemMultipleValues *item, uint32_t new_value) { DEBUG_FUNCTION_LINE_VERBOSE("language changed to: %d", new_value); if (new_value != Config::language) { if (new_value == inkay_language::System) - Config::current_language = (inkay_language)get_system_language(); + Config::current_language = (inkay_language) get_system_language(); else - Config::current_language = (inkay_language)new_value; + Config::current_language = (inkay_language) new_value; } Config::language = new_value; - WUPSStorageError res; - res = WUPSStorageAPI::Store("language", Config::language); + WUPSStorageError res = WUPSStorageAPI_StoreU32(nullptr, "language", Config::language); if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); } -static void show_startup_toast_changed(ConfigItemBoolean* item, bool new_value) { +static void show_startup_toast_changed(ConfigItemBoolean *item, bool new_value) { DEBUG_FUNCTION_LINE_VERBOSE("show_startup_toast changed to: %d", new_value); Config::show_startup_toast = new_value; - WUPSStorageError res; - res = WUPSStorageAPI::Store("show_startup_toast", Config::show_startup_toast); + WUPSStorageError res = WUPSStorageAPI_StoreBool(nullptr, "show_startup_toast", Config::show_startup_toast); if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); } static void unregister_task_item_on_input_cb(void *context, WUPSConfigSimplePadData input) { - if (!Config::unregister_task_item_pressed && Config::is_wiiu_menu && ((input.buttons_d & WUPS_CONFIG_BUTTON_A) == WUPS_CONFIG_BUTTON_A)) { - + if (!Config::unregister_task_item_pressed && Config::is_wiiu_menu && ( + (input.buttons_d & WUPS_CONFIG_BUTTON_A) == WUPS_CONFIG_BUTTON_A)) { nn::act::Initialize(); Initialize__Q2_2nn4bossFv(); - for (uint8_t i = 1; i <= nn::act::GetNumOfAccounts(); i++) - { - if (nn::act::IsSlotOccupied(i) && nn::act::IsNetworkAccountEx(i)) - { - nn::boss::Task task{}; - nn::act::PersistentId persistentId = nn::act::GetPersistentIdEx(i); + for (uint8_t i = 1; i <= nn::act::GetNumOfAccounts(); i++) { + if (nn::act::IsSlotOccupied(i) && nn::act::IsNetworkAccountEx(i)) { + nn::boss::Task task{}; + nn::act::PersistentId persistentId = nn::act::GetPersistentIdEx(i); - __ct__Q3_2nn4boss4TaskFv(&task); - Initialize__Q3_2nn4boss4TaskFPCcUi(&task, "oltopic", persistentId); + __ct__Q3_2nn4boss4TaskFv(&task); + Initialize__Q3_2nn4boss4TaskFPCcUi(&task, "oltopic", persistentId); - // bypasses compiler warning about unused variable - #ifdef DEBUG - uint32_t res = Unregister__Q3_2nn4boss4TaskFv(&task); - DEBUG_FUNCTION_LINE_VERBOSE("Unregistered oltopic for: SlotNo %d | Persistent ID %08x -> 0x%08x", i, persistentId, res); - #else - Unregister__Q3_2nn4boss4TaskFv(&task); - #endif - } - } + // bypasses compiler warning about unused variable +#ifdef DEBUG + uint32_t res = Unregister__Q3_2nn4boss4TaskFv(&task); + DEBUG_FUNCTION_LINE_VERBOSE("Unregistered oltopic for: SlotNo %d | Persistent ID %08x -> 0x%08x", i, + persistentId, res); +#else + Unregister__Q3_2nn4boss4TaskFv(&task); +#endif + } + } Finalize__Q2_2nn4bossFv(); nn::act::Finalize(); @@ -136,16 +132,15 @@ static int32_t unregister_task_item_get_display_value(void *context, char *out_b } } - if ((int)string.length() > out_size - 1) return -1; + if ((int) string.length() > out_size - 1) return -1; string.copy(out_buf, string.length()); out_buf[string.length()] = '\0'; return 0; } -static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHandle rootHandle) { +static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHandle root_cat) { WUPSConfigAPIStatus err; - bool res; uint64_t current_title_id = OSGetTitleID(); uint64_t wiiu_menu_tid = _SYSGetSystemApplicationTitleId(SYSTEM_APP_ID_WII_U_MENU); @@ -154,101 +149,124 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa // get translation strings strings = get_config_strings(Config::current_language); - // create root config category - WUPSConfigCategory root = WUPSConfigCategory(rootHandle); + // Network submenu + // Connect to Pretendo Network Yes/No + // Using UDP port 5000 for multiplayer - auto network_cat = WUPSConfigCategory::Create(strings.network_category, err); - if (!network_cat) return report_error(err); + WUPSConfigCategoryHandle network_cat; + err = WUPSConfigAPI_Category_Create({strings.network_category.data()}, &network_cat); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); - // config id display name default current value changed callback - auto connect_item = WUPSConfigItemBoolean::Create("connect_to_network", strings.connect_to_network_setting, true, Config::connect_to_network, &connect_to_network_changed, err); - if (!connect_item) return report_error(err); + WUPSConfigItemHandle connect_item; + err = WUPSConfigItemBoolean_CreateEx( + "connect_to_network", strings.connect_to_network_setting.data(), true, Config::connect_to_network, + &connect_to_network_changed, strings.setting_yes.data(), strings.setting_no.data(), &connect_item); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); - res = network_cat->add(std::move(*connect_item), err); - if (!res) return report_error(err); + err = WUPSConfigAPI_Category_AddItem(network_cat, connect_item); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); - { - uint16_t port = get_console_peertopeer_port(); - char buffer[256]; - snprintf(buffer, sizeof(buffer), strings.multiplayer_port_display.data(), port); - auto multiplayer_port_display = WUPSConfigItemStub::Create(buffer, err); - if (!multiplayer_port_display) return report_error(err); + const uint16_t port = get_console_peertopeer_port(); + char buffer[256]; + snprintf(buffer, sizeof(buffer), strings.multiplayer_port_display.data(), port); - res = network_cat->add(std::move(*multiplayer_port_display), err); - if (!res) return report_error(err); - } + WUPSConfigItemHandle multiplayer_port_display; + err = WUPSConfigItemStub_Create(buffer, &multiplayer_port_display); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); - res = root.add(std::move(*network_cat), err); - if (!res) return report_error(err); + err = WUPSConfigAPI_Category_AddItem(network_cat, multiplayer_port_display); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); - auto other_cat = WUPSConfigCategory::Create(strings.other_category, err); - if (!other_cat) return report_error(err); + // Add to root and finish + err = WUPSConfigAPI_Category_AddCategory(root_cat, network_cat); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); - auto startup_toast_item = WUPSConfigItemBoolean::Create("show_startup_toast", strings.show_startup_toast_setting, true, Config::show_startup_toast, &show_startup_toast_changed, err); - if (!startup_toast_item) return report_error(err); + // Other category + // Reset Wara Wara Plaza Press A + // Language English/Spanish/etc.. + // Show startup toast Yes/No - WUPSConfigAPIItemCallbacksV2 unregisterTasksItemCallbacks = { - .getCurrentValueDisplay = unregister_task_item_get_display_value, - .getCurrentValueSelectedDisplay = unregister_task_item_get_display_value, - .onSelected = nullptr, - .restoreDefault = nullptr, - .isMovementAllowed = nullptr, - .onCloseCallback = nullptr, - .onInput = unregister_task_item_on_input_cb, - .onInputEx = nullptr, - .onDelete = nullptr - }; - - WUPSConfigAPIItemOptionsV2 unregisterTasksItemOptions = { - .displayName = strings.reset_wwp_setting.data(), - .context = nullptr, - .callbacks = unregisterTasksItemCallbacks, - }; + WUPSConfigCategoryHandle other_cat; + err = WUPSConfigAPI_Category_Create({strings.other_category.data()}, &other_cat); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); WUPSConfigItemHandle unregisterTasksItem; - err = WUPSConfigAPI_Item_Create(unregisterTasksItemOptions, &unregisterTasksItem); + err = WUPSConfigAPI_Item_Create({ + .displayName = strings.reset_wwp_setting.data(), + .context = nullptr, + .callbacks = { + .getCurrentValueDisplay = unregister_task_item_get_display_value, + .getCurrentValueSelectedDisplay = unregister_task_item_get_display_value, + .onSelected = nullptr, + .restoreDefault = nullptr, + .isMovementAllowed = nullptr, + .onCloseCallback = nullptr, + .onInput = unregister_task_item_on_input_cb, + .onInputEx = nullptr, + .onDelete = nullptr + }, + }, &unregisterTasksItem); if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); - err = WUPSConfigAPI_Category_AddItem(other_cat->getHandle(), unregisterTasksItem); + err = WUPSConfigAPI_Category_AddItem(other_cat, unregisterTasksItem); if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); - constexpr WUPSConfigItemMultipleValues::ValuePair languages[] = { - {0, "Japanese"}, - {1, "English"}, - {2, "French"}, - {3, "German"}, - {4, "Italian"}, - {5, "Spanish"}, - {6, "Simplified Chinese"}, - {7, "Korean"}, - {8, "Dutch"}, - {9, "Portuguese"}, - {10, "Russian"}, - {11, "Traditional Chinese"}, - {13, "System"}, - {14, "English (UwU)"}, + // TODO localise these! + constexpr std::array languages = { + { + {0, "Japanese"}, + {1, "English"}, + {2, "French"}, + {3, "German"}, + {4, "Italian"}, + {5, "Spanish"}, + {6, "Simplified Chinese"}, + {7, "Korean"}, + {8, "Dutch"}, + {9, "Portuguese"}, + {10, "Russian"}, + {11, "Traditional Chinese"}, + {13, "System"}, + {14, "English (UwU)"}, + } }; - auto language_item = WUPSConfigItemMultipleValues::CreateFromValue("language", "Language", 13, Config::language, languages, &language_changed, err); - if (!language_item) return report_error(err); + constexpr auto find_lang = [languages](const uint32_t lang) -> int { + return std::ranges::find_if(languages, [lang](auto const l) { return l.value == lang; }) - + std::begin(languages); + }; + constexpr int system_language = find_lang(13 /* System */); + const int current_language = find_lang(Config::language); - res = other_cat->add(std::move(*language_item), err); - if (!res) return report_error(err); + WUPSConfigItemHandle language_item; + err = WUPSConfigItemMultipleValues_Create("language", strings.language_setting.data(), system_language, + current_language, + const_cast(languages.data()), // Yikes! + languages.size(), &language_changed, &language_item); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); - res = other_cat->add(std::move(*startup_toast_item), err); - if (!res) return report_error(err); + err = WUPSConfigAPI_Category_AddItem(other_cat, language_item); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + WUPSConfigItemHandle startup_toast_item; + err = WUPSConfigItemBoolean_CreateEx("show_startup_toast", strings.show_startup_toast_setting.data(), true, + Config::show_startup_toast, &show_startup_toast_changed, + strings.setting_yes.data(), strings.setting_no.data(), &startup_toast_item); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); - res = root.add(std::move(*other_cat), err); - if (!res) return report_error(err); + err = WUPSConfigAPI_Category_AddItem(other_cat, startup_toast_item); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + + // finish up + err = WUPSConfigAPI_Category_AddCategory(root_cat, other_cat); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); return WUPSCONFIG_API_CALLBACK_RESULT_SUCCESS; } static void ConfigMenuClosedCallback() { // Save all changes - WUPSStorageError res; - res = WUPSStorageAPI::SaveStorage(); + WUPSStorageError res = WUPSStorageAPI_SaveStorage(false); if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); if (Config::need_relaunch) { @@ -260,59 +278,54 @@ static void ConfigMenuClosedCallback() { } void Config::Init() { - WUPSConfigAPIStatus cres; - // Init the config api - WUPSConfigAPIOptionsV1 configOptions = { .name = "Inkay" }; - cres = WUPSConfigAPI_Init(configOptions, ConfigMenuOpenedCallback, ConfigMenuClosedCallback); - if (cres != WUPSCONFIG_API_RESULT_SUCCESS) return (void)report_error(cres); + WUPSConfigAPIStatus cres = + WUPSConfigAPI_Init({.name = "Inkay"}, ConfigMenuOpenedCallback, ConfigMenuClosedCallback); + if (cres != WUPSCONFIG_API_RESULT_SUCCESS) return (void) report_error(cres); WUPSStorageError res; // Try to get values from storage - res = WUPSStorageAPI::Get("connect_to_network", Config::connect_to_network); + res = WUPSStorageAPI_GetBool(nullptr, "connect_to_network", &Config::connect_to_network); if (res == WUPS_STORAGE_ERROR_NOT_FOUND) { - DEBUG_FUNCTION_LINE("Connect to network value not found, attempting to migrate/create"); + DEBUG_FUNCTION_LINE_VERBOSE("Connect to network value not found, attempting to migrate/create"); bool skipPatches = false; - if (WUPSStorageAPI::Get("skipPatches", skipPatches) == WUPS_STORAGE_ERROR_SUCCESS) { + if (WUPSStorageAPI_GetBool(nullptr, "skipPatches", &skipPatches) == WUPS_STORAGE_ERROR_SUCCESS) { // Migrate old config value Config::connect_to_network = !skipPatches; - WUPSStorageAPI::DeleteItem("skipPatches"); + WUPSStorageAPI_DeleteItem(nullptr, "skipPatches"); } - - // Add the value to the storage if it's missing. - res = WUPSStorageAPI::Store("connect_to_network", connect_to_network); - if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); - } - else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); - res = WUPSStorageAPI::Get("language", Config::language); + // Add the value to the storage if it's missing. + res = WUPSStorageAPI_StoreBool(nullptr, "connect_to_network", connect_to_network); + if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); + } else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); + + res = WUPSStorageAPI_GetU32(nullptr, "language", &Config::language); if (res == WUPS_STORAGE_ERROR_NOT_FOUND) { - DEBUG_FUNCTION_LINE("Language value not found, attempting to create"); + DEBUG_FUNCTION_LINE_VERBOSE("Language value not found, attempting to create"); // Add the value to the storage. - res = WUPSStorageAPI::Store("language", Config::language); + res = WUPSStorageAPI_StoreU32(nullptr, "language", Config::language); if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); - } - else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); - - res = WUPSStorageAPI::Get("show_startup_toast", Config::show_startup_toast); + } else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); + + res = WUPSStorageAPI_GetBool(nullptr, "show_startup_toast", &Config::show_startup_toast); if (res == WUPS_STORAGE_ERROR_NOT_FOUND) { - DEBUG_FUNCTION_LINE("Show startup toast value not found, attempting to create"); - + DEBUG_FUNCTION_LINE_VERBOSE("Show startup toast value not found, attempting to create"); + // Add the value to the storage if it's missing. - res = WUPSStorageAPI::Store("show_startup_toast", show_startup_toast); + res = WUPSStorageAPI_StoreBool(nullptr, "show_startup_toast", show_startup_toast); if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); - } - else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); + } else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); // Set the language that's currently used if (Config::language == inkay_language::System) - Config::current_language = (inkay_language)get_system_language(); + Config::current_language = (inkay_language) get_system_language(); else - Config::current_language = (inkay_language)Config::language; + Config::current_language = (inkay_language) Config::language; // Save storage - res = WUPSStorageAPI::SaveStorage(); + res = WUPSStorageAPI_SaveStorage(false); if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); } diff --git a/src/lang/de_DE.lang b/src/lang/de_DE.lang index 4837d27..422ca1b 100644 --- a/src/lang/de_DE.lang +++ b/src/lang/de_DE.lang @@ -11,3 +11,4 @@ ,.multiplayer_port_display="Nutze UDP Port %hu für Mehrspieler" ,.module_not_found="Pretendo Network Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1001 Module missing)" ,.module_init_not_found="Pretendo Network Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1002 Module init)" +,.language_name="Deutsch" diff --git a/src/lang/en@uwu.lang b/src/lang/en@uwu.lang index 3e55000..10244a7 100644 --- a/src/lang/en@uwu.lang +++ b/src/lang/en@uwu.lang @@ -1,5 +1,3 @@ - - .plugin_name="Inky ^w^" ,.network_category="Newowk sewectiown! :3" ,.connect_to_network_setting="use dah pretender!!!!" @@ -13,3 +11,7 @@ ,.multiplayer_port_display="mah secret word is %hu... ur modem will know" ,.module_not_found="oh noez! pls get aroma updater help :( (686-1001 Module missing)" ,.module_init_not_found="oh noez! pls get aroma updater help :( (686-1002 Module init)" +,.setting_yes="yaah!" +,.setting_no="nu >w<" +,.language_name="kitteh speak!!" +,.system_language="System" diff --git a/src/lang/en_US.lang b/src/lang/en_US.lang index 1fb1fd0..863dcc6 100644 --- a/src/lang/en_US.lang +++ b/src/lang/en_US.lang @@ -12,3 +12,8 @@ ,.multiplayer_port_display="Using UDP port %hu for multiplayer" ,.module_not_found="Pretendo Network patch failed - use Aroma Updater to repair (686-1001 Module missing)" ,.module_init_not_found="Pretendo Network patch failed - use Aroma Updater to repair (686-1002 Module init)" +,.setting_yes="Yes" +,.setting_no="No" +,.language_setting="Language" +,.language_name="English" +,.system_language="System" diff --git a/src/lang/es_ES.lang b/src/lang/es_ES.lang index f84b918..4633eb7 100644 --- a/src/lang/es_ES.lang +++ b/src/lang/es_ES.lang @@ -11,3 +11,4 @@ ,.multiplayer_port_display="Usando puerto UDP %hu para multijugador" ,.module_not_found="Ha fallado el parche Pretendo Network - usa Aroma Updater para repararlo (686-1001 Falta un módulo)" ,.module_init_not_found="Ha fallado el parche Pretendo Network - usa Aroma Updater para repararlo (686-1002 Inicialización del módulo)" +,.language_name="Español" diff --git a/src/lang/fr_FR.lang b/src/lang/fr_FR.lang index 901a2a2..3bb410f 100644 --- a/src/lang/fr_FR.lang +++ b/src/lang/fr_FR.lang @@ -11,3 +11,4 @@ ,.multiplayer_port_display="Le port UDP %hu sera utilisé pour le multijoueur" ,.module_not_found="Le patch Pretendo Network a rencontré un problème, veuillez le réparer avec Aroma Updater (686-1001 Module missing)" ,.module_init_not_found="Le patch Pretendo Network a rencontré un problème, veuillez le réparer avec Aroma Updater (686-1002 Module init)" +,.language_name="Français" diff --git a/src/lang/it_IT.lang b/src/lang/it_IT.lang index 30495ab..a1bc8ef 100644 --- a/src/lang/it_IT.lang +++ b/src/lang/it_IT.lang @@ -11,3 +11,4 @@ ,.multiplayer_port_display="È in uso la porta UDP %hu per il multigiocatore" ,.module_not_found="Patch Pretendo Network fallita - usa Aroma Updater per riparare (686-1001 Modulo mancante)" ,.module_init_not_found="Patch Pretendo Network fallita - usa Aroma Updater per riparare (686-1002 Module init)" +,.language_name="Italiano" diff --git a/src/lang/ja_JP.lang b/src/lang/ja_JP.lang index 77214c5..3cc6b26 100644 --- a/src/lang/ja_JP.lang +++ b/src/lang/ja_JP.lang @@ -11,3 +11,4 @@ ,.multiplayer_port_display="マルチプレイに UDPポート %hu を使用します" ,.module_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1001 Module missing)" ,.module_init_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1002 Module init)" +,.language_name="日本語" diff --git a/src/lang/ko_KR.lang b/src/lang/ko_KR.lang index de04939..9152519 100644 --- a/src/lang/ko_KR.lang +++ b/src/lang/ko_KR.lang @@ -11,3 +11,4 @@ ,.multiplayer_port_display="멀티플레이어에 UDP 포트 %hu을(를) 사용합니다" ,.module_not_found="패치를 적용하는 데 실패했습니다. Aroma Updater로 복구해 주세요. (686-1001 모듈 없음)" ,.module_init_not_found="패치를 적용하는 데 실패했습니다. Aroma Updater로 복구해 주세요. (686-1002 모듈 초기화)" +,.language_name="한국어" diff --git a/src/lang/nl_NL.lang b/src/lang/nl_NL.lang index f96206f..ad3ef7c 100644 --- a/src/lang/nl_NL.lang +++ b/src/lang/nl_NL.lang @@ -11,3 +11,4 @@ ,.multiplayer_port_display="Gebruikt UDP port %hu voor multiplayer" ,.module_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1001 Module ontbreekt)" ,.module_init_not_found="Pretendo-Netwerk patch mislukt - gebruik Aroma Updater om het te herstellen (686-1002 Module init)" +,.language_name="Nederlands" diff --git a/src/lang/pt_BR.lang b/src/lang/pt_BR.lang index 511d5ab..3da427e 100644 --- a/src/lang/pt_BR.lang +++ b/src/lang/pt_BR.lang @@ -11,3 +11,4 @@ ,.multiplayer_port_display="Usando UDP port %hu para a jogatina multiplayer" ,.module_not_found="Atualização do Pretendo falhou - use o Aroma Updater para corrigir (686-1001 Módulo faltando)" ,.module_init_not_found="Atualização do Pretendo falhou - use o Aroma Updater para corrigir (686-1002 Módulo de início)" +,.language_name="Português" diff --git a/src/lang/ru_RU.lang b/src/lang/ru_RU.lang index 3dc9c9c..64e7a66 100644 --- a/src/lang/ru_RU.lang +++ b/src/lang/ru_RU.lang @@ -11,3 +11,4 @@ ,.multiplayer_port_display="Используем UDP-порт %hu для сетевой игры" ,.module_not_found="Ошибка установки патча Pretendo - для восстановления, запустите Aroma Updater (686-1001 Модуль отсутствует)" ,.module_init_not_found="Ошибка установки патча Pretendo - для восстановления, запустите Aroma Updater (686-1002 Инициализация модуля)" +,.language_name="Русский язык" diff --git a/src/lang/zh_CN.lang b/src/lang/zh_CN.lang index 5191686..bfac85f 100644 --- a/src/lang/zh_CN.lang +++ b/src/lang/zh_CN.lang @@ -11,3 +11,4 @@ ,.multiplayer_port_display="多人游戏使用 UDP 端口 %hu" ,.module_not_found="Pretendo Network 补丁失败 - 使用 Aroma Updater 修复(686-1001 模块丢失)" ,.module_init_not_found="Pretendo Network 补丁失败 - 使用 Aroma Updater 修复(686-1002 模块初始化)" +,.language_name="中文(简体)" diff --git a/src/lang/zh_Hant.lang b/src/lang/zh_Hant.lang index 50ff0dd..9531502 100644 --- a/src/lang/zh_Hant.lang +++ b/src/lang/zh_Hant.lang @@ -11,3 +11,4 @@ ,.multiplayer_port_display="使用 UDP 端口 %hu 進行多人遊戲" ,.module_not_found="Pretendo Network 補丁失敗 - 請使用 Aroma Updater 修復(缺少 686-1001 模組)" ,.module_init_not_found="Pretendo Network 補丁失敗 - 請使用 Aroma Updater 修復(缺少 686-1002 模組)" +,.language_name="中文(繁體)" From 158c597aeb8cc9bb72e20b4bf0dc336dee28c2f5 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Mon, 27 Jul 2026 22:32:02 +1000 Subject: [PATCH 125/139] fix: shrink log data size slightly --- plugin/src/module.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/src/module.cpp b/plugin/src/module.cpp index 94325cd..8a550f7 100644 --- a/plugin/src/module.cpp +++ b/plugin/src/module.cpp @@ -48,7 +48,7 @@ void Inkay_Initialize(bool apply_patches, bool show_startup_toast) { } if (OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_Initialize", reinterpret_cast(&moduleInitialize)) != OS_DYNLOAD_OK) { - DEBUG_FUNCTION_LINE("Failed to find initialization function"); + DEBUG_FUNCTION_LINE("Failed to find function %s", "Inkay_Initialize"); ShowNotification(get_module_init_not_found_message()); OSDynLoad_Release(module); return; @@ -72,7 +72,7 @@ InkayStatus Inkay_GetStatus() { } if (!moduleGetStatus && OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_GetStatus", reinterpret_cast(&moduleGetStatus)) != OS_DYNLOAD_OK) { - DEBUG_FUNCTION_LINE("Failed to find status function"); + DEBUG_FUNCTION_LINE("Failed to find function %s", "Inkay_GetStatus"); return InkayStatus::Error; } @@ -85,7 +85,7 @@ void Inkay_SetPluginRunning() { } if (!moduleSetPluginRunning && OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_SetPluginRunning", reinterpret_cast(&moduleSetPluginRunning)) != OS_DYNLOAD_OK) { - DEBUG_FUNCTION_LINE("Failed to find \"Inkay_SetPluginRunning\" function"); + DEBUG_FUNCTION_LINE("Failed to find function %s", "Inkay_SetPluginRunning"); return; } From 39dc7d8c8ad3be57470270c42de8d9a0fc3e591e Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Tue, 28 Jul 2026 22:49:32 +1000 Subject: [PATCH 126/139] fix: bad debug prints --- common/sysconfig.cpp | 4 ++-- plugin/src/main.cpp | 4 ++-- src/utils/replace_mem.cpp | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/common/sysconfig.cpp b/common/sysconfig.cpp index ec56614..bb13d4b 100644 --- a/common/sysconfig.cpp +++ b/common/sysconfig.cpp @@ -53,7 +53,7 @@ nn::swkbd::LanguageType get_system_language() { return nn::swkbd::LanguageType::English; } - DEBUG_FUNCTION_LINE_VERBOSE("System language found: %d", language); + DEBUG_FUNCTION_LINE_VERBOSE("System language found: %d", static_cast(language)); cached_language = language; return language; } @@ -80,7 +80,7 @@ static void get_mcp_config() { mcp_os_version = os_version; DEBUG_FUNCTION_LINE_VERBOSE("Running on %d.%d.%d%c; %s%s", - os_version.major, os_version.minor, os_version.patch, os_version.region + os_version.major, os_version.minor, os_version.patch, os_version.region, config.code_id, config.serial_id ); } diff --git a/plugin/src/main.cpp b/plugin/src/main.cpp index 20e5db0..a8466e6 100644 --- a/plugin/src/main.cpp +++ b/plugin/src/main.cpp @@ -38,7 +38,7 @@ WUPS_PLUGIN_LICENSE("GPLv3"); WUPS_USE_STORAGE("inkay"); INITIALIZE_PLUGIN() { - WHBLogModuleInit(); + WHBLogCafeInit(); Config::Init(); @@ -54,7 +54,7 @@ DEINITIALIZE_PLUGIN() { Inkay_Finalize(); NotificationModule_DeInitLibrary(); - WHBLogModuleDeinit(); + WHBLogCafeDeinit(); } ON_APPLICATION_START() { diff --git a/src/utils/replace_mem.cpp b/src/utils/replace_mem.cpp index 03e94b2..1c7003b 100644 --- a/src/utils/replace_mem.cpp +++ b/src/utils/replace_mem.cpp @@ -85,7 +85,6 @@ bool replace_unsigned(U *addr, U original_value, U new_value) { ); DCFlushRange(addr, sizeof(new_value)); - DEBUG_FUNCTION_LINE_VERBOSE("%08x is now %08x", inst, *inst); return *addr == new_value; } template bool replace_unsigned(uint64_t *, uint64_t, uint64_t); From df01b5b1dd7a5232fd03f15f292e7fc3b522c64a Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Tue, 28 Jul 2026 22:49:56 +1000 Subject: [PATCH 127/139] feat(config): include line number in error reporting --- plugin/src/config.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/plugin/src/config.cpp b/plugin/src/config.cpp index eb8d153..21d4146 100644 --- a/plugin/src/config.cpp +++ b/plugin/src/config.cpp @@ -47,8 +47,8 @@ bool Config::is_wiiu_menu = false; uint32_t Config::language = 13; inkay_language Config::current_language = English; -static WUPSConfigAPICallbackStatus report_error(WUPSConfigAPIStatus err) { - DEBUG_FUNCTION_LINE_VERBOSE("WUPS config error: %s", WUPSConfigAPI_GetStatusStr(err)); +static WUPSConfigAPICallbackStatus report_error(WUPSConfigAPIStatus err, int line) { + DEBUG_FUNCTION_LINE_VERBOSE("WUPS config error: %s (L%04d)", WUPSConfigAPI_GetStatusStr(err), line); return WUPSCONFIG_API_CALLBACK_RESULT_ERROR; } @@ -155,16 +155,16 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa WUPSConfigCategoryHandle network_cat; err = WUPSConfigAPI_Category_Create({strings.network_category.data()}, &network_cat); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__); WUPSConfigItemHandle connect_item; err = WUPSConfigItemBoolean_CreateEx( "connect_to_network", strings.connect_to_network_setting.data(), true, Config::connect_to_network, &connect_to_network_changed, strings.setting_yes.data(), strings.setting_no.data(), &connect_item); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__); err = WUPSConfigAPI_Category_AddItem(network_cat, connect_item); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__); const uint16_t port = get_console_peertopeer_port(); char buffer[256]; @@ -172,14 +172,14 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa WUPSConfigItemHandle multiplayer_port_display; err = WUPSConfigItemStub_Create(buffer, &multiplayer_port_display); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__); err = WUPSConfigAPI_Category_AddItem(network_cat, multiplayer_port_display); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__); // Add to root and finish err = WUPSConfigAPI_Category_AddCategory(root_cat, network_cat); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__); // Other category // Reset Wara Wara Plaza Press A @@ -188,7 +188,7 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa WUPSConfigCategoryHandle other_cat; err = WUPSConfigAPI_Category_Create({strings.other_category.data()}, &other_cat); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__); WUPSConfigItemHandle unregisterTasksItem; err = WUPSConfigAPI_Item_Create({ @@ -206,10 +206,10 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa .onDelete = nullptr }, }, &unregisterTasksItem); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__); err = WUPSConfigAPI_Category_AddItem(other_cat, unregisterTasksItem); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__); // TODO localise these! constexpr std::array languages = { @@ -243,23 +243,23 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa current_language, const_cast(languages.data()), // Yikes! languages.size(), &language_changed, &language_item); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__); err = WUPSConfigAPI_Category_AddItem(other_cat, language_item); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__); WUPSConfigItemHandle startup_toast_item; err = WUPSConfigItemBoolean_CreateEx("show_startup_toast", strings.show_startup_toast_setting.data(), true, Config::show_startup_toast, &show_startup_toast_changed, strings.setting_yes.data(), strings.setting_no.data(), &startup_toast_item); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__); err = WUPSConfigAPI_Category_AddItem(other_cat, startup_toast_item); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__); // finish up err = WUPSConfigAPI_Category_AddCategory(root_cat, other_cat); - if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); + if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__); return WUPSCONFIG_API_CALLBACK_RESULT_SUCCESS; } @@ -281,7 +281,7 @@ void Config::Init() { // Init the config api WUPSConfigAPIStatus cres = WUPSConfigAPI_Init({.name = "Inkay"}, ConfigMenuOpenedCallback, ConfigMenuClosedCallback); - if (cres != WUPSCONFIG_API_RESULT_SUCCESS) return (void) report_error(cres); + if (cres != WUPSCONFIG_API_RESULT_SUCCESS) return (void) report_error(cres, __LINE__); WUPSStorageError res; // Try to get values from storage From 10688b5ac20c6505f77758e613f9dc7a1af9f9f2 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Tue, 28 Jul 2026 22:50:05 +1000 Subject: [PATCH 128/139] fix(lang): include missing strings as blank --- src/lang/de_DE.lang | 5 +++++ src/lang/en@uwu.lang | 2 ++ src/lang/es_ES.lang | 5 +++++ src/lang/fr_FR.lang | 5 +++++ src/lang/it_IT.lang | 5 +++++ src/lang/ja_JP.lang | 5 +++++ src/lang/ko_KR.lang | 5 +++++ src/lang/nl_NL.lang | 5 +++++ src/lang/pt_BR.lang | 5 +++++ src/lang/ru_RU.lang | 5 +++++ src/lang/zh_CN.lang | 5 +++++ src/lang/zh_Hant.lang | 5 +++++ 12 files changed, 57 insertions(+) diff --git a/src/lang/de_DE.lang b/src/lang/de_DE.lang index 422ca1b..96ba508 100644 --- a/src/lang/de_DE.lang +++ b/src/lang/de_DE.lang @@ -1,6 +1,7 @@ .plugin_name="Inkay" ,.network_category="Netzwerkauswahl" ,.connect_to_network_setting="Mit Pretendo Network verbinden" +,.show_startup_toast_setting="" ,.other_category="Andere Einstellungen" ,.reset_wwp_setting="Wara Wara Plaza zurücksetzen" ,.press_a_action="Drücke A" @@ -11,4 +12,8 @@ ,.multiplayer_port_display="Nutze UDP Port %hu für Mehrspieler" ,.module_not_found="Pretendo Network Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1001 Module missing)" ,.module_init_not_found="Pretendo Network Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1002 Module init)" +,.setting_yes="" +,.setting_no="" +,.language_setting="" ,.language_name="Deutsch" +,.system_language="" diff --git a/src/lang/en@uwu.lang b/src/lang/en@uwu.lang index 10244a7..26abcc4 100644 --- a/src/lang/en@uwu.lang +++ b/src/lang/en@uwu.lang @@ -1,6 +1,7 @@ .plugin_name="Inky ^w^" ,.network_category="Newowk sewectiown! :3" ,.connect_to_network_setting="use dah pretender!!!!" +,.show_startup_toast_setting="show da deets :3" ,.other_category="oth3r stuffzz" ,.reset_wwp_setting="warah wara go BYEBYE x3c" ,.press_a_action="Press A plz?" @@ -13,5 +14,6 @@ ,.module_init_not_found="oh noez! pls get aroma updater help :( (686-1002 Module init)" ,.setting_yes="yaah!" ,.setting_no="nu >w<" +,.language_setting="spek..." ,.language_name="kitteh speak!!" ,.system_language="System" diff --git a/src/lang/es_ES.lang b/src/lang/es_ES.lang index 4633eb7..9815206 100644 --- a/src/lang/es_ES.lang +++ b/src/lang/es_ES.lang @@ -1,6 +1,7 @@ .plugin_name="Inkay" ,.network_category="Seleccionar red" ,.connect_to_network_setting="Conectar a Pretendo Network" +,.show_startup_toast_setting="" ,.other_category="Otros ajustes" ,.reset_wwp_setting="Restablecer Plaza Wara Wara" ,.press_a_action="Pulsa A" @@ -11,4 +12,8 @@ ,.multiplayer_port_display="Usando puerto UDP %hu para multijugador" ,.module_not_found="Ha fallado el parche Pretendo Network - usa Aroma Updater para repararlo (686-1001 Falta un módulo)" ,.module_init_not_found="Ha fallado el parche Pretendo Network - usa Aroma Updater para repararlo (686-1002 Inicialización del módulo)" +,.setting_yes="" +,.setting_no="" +,.language_setting="" ,.language_name="Español" +,.system_language="" diff --git a/src/lang/fr_FR.lang b/src/lang/fr_FR.lang index 3bb410f..d13c8da 100644 --- a/src/lang/fr_FR.lang +++ b/src/lang/fr_FR.lang @@ -1,6 +1,7 @@ .plugin_name="Inkay" ,.network_category="Sélection du réseau" ,.connect_to_network_setting="Connexion au Pretendo Network" +,.show_startup_toast_setting="" ,.other_category="Autres paramètres" ,.reset_wwp_setting="Réinitialiser la place WaraWara" ,.press_a_action="Appuyez sur A" @@ -11,4 +12,8 @@ ,.multiplayer_port_display="Le port UDP %hu sera utilisé pour le multijoueur" ,.module_not_found="Le patch Pretendo Network a rencontré un problème, veuillez le réparer avec Aroma Updater (686-1001 Module missing)" ,.module_init_not_found="Le patch Pretendo Network a rencontré un problème, veuillez le réparer avec Aroma Updater (686-1002 Module init)" +,.setting_yes="" +,.setting_no="" +,.language_setting="" ,.language_name="Français" +,.system_language="" diff --git a/src/lang/it_IT.lang b/src/lang/it_IT.lang index a1bc8ef..be3162d 100644 --- a/src/lang/it_IT.lang +++ b/src/lang/it_IT.lang @@ -1,6 +1,7 @@ .plugin_name="Inkay" ,.network_category="Seleziona la rete" ,.connect_to_network_setting="Connettiti a Pretendo Network" +,.show_startup_toast_setting="" ,.other_category="Altre impostazioni" ,.reset_wwp_setting="Ripristina Wara Wara Plaza" ,.press_a_action="Premi A" @@ -11,4 +12,8 @@ ,.multiplayer_port_display="È in uso la porta UDP %hu per il multigiocatore" ,.module_not_found="Patch Pretendo Network fallita - usa Aroma Updater per riparare (686-1001 Modulo mancante)" ,.module_init_not_found="Patch Pretendo Network fallita - usa Aroma Updater per riparare (686-1002 Module init)" +,.setting_yes="" +,.setting_no="" +,.language_setting="" ,.language_name="Italiano" +,.system_language="" diff --git a/src/lang/ja_JP.lang b/src/lang/ja_JP.lang index 3cc6b26..3471f34 100644 --- a/src/lang/ja_JP.lang +++ b/src/lang/ja_JP.lang @@ -1,6 +1,7 @@ .plugin_name="Inkay" ,.network_category="ネットワークの選択" ,.connect_to_network_setting="Pretendoネットワークに接続する" +,.show_startup_toast_setting="" ,.other_category="その他の設定" ,.reset_wwp_setting="わらわら広場をリセット" ,.press_a_action="Aボタンを押そう" @@ -11,4 +12,8 @@ ,.multiplayer_port_display="マルチプレイに UDPポート %hu を使用します" ,.module_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1001 Module missing)" ,.module_init_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1002 Module init)" +,.setting_yes="" +,.setting_no="" +,.language_setting="" ,.language_name="日本語" +,.system_language="" diff --git a/src/lang/ko_KR.lang b/src/lang/ko_KR.lang index 9152519..b732072 100644 --- a/src/lang/ko_KR.lang +++ b/src/lang/ko_KR.lang @@ -1,6 +1,7 @@ .plugin_name="Inkay" ,.network_category="네트워크 선택" ,.connect_to_network_setting="Pretendo Network 사용" +,.show_startup_toast_setting="" ,.other_category="기타 설정" ,.reset_wwp_setting="Wara Wara Plaza 초기화" ,.press_a_action="A 버튼을 누르세요" @@ -11,4 +12,8 @@ ,.multiplayer_port_display="멀티플레이어에 UDP 포트 %hu을(를) 사용합니다" ,.module_not_found="패치를 적용하는 데 실패했습니다. Aroma Updater로 복구해 주세요. (686-1001 모듈 없음)" ,.module_init_not_found="패치를 적용하는 데 실패했습니다. Aroma Updater로 복구해 주세요. (686-1002 모듈 초기화)" +,.setting_yes="" +,.setting_no="" +,.language_setting="" ,.language_name="한국어" +,.system_language="" diff --git a/src/lang/nl_NL.lang b/src/lang/nl_NL.lang index ad3ef7c..3712ff2 100644 --- a/src/lang/nl_NL.lang +++ b/src/lang/nl_NL.lang @@ -1,6 +1,7 @@ .plugin_name="Inkay" ,.network_category="Netwerkselectie" ,.connect_to_network_setting="Verbind met het Pretendo-Netwerk" +,.show_startup_toast_setting="" ,.other_category="Overige instellingen" ,.reset_wwp_setting="Reset het Wara Wara Plaza" ,.press_a_action="Druk A" @@ -11,4 +12,8 @@ ,.multiplayer_port_display="Gebruikt UDP port %hu voor multiplayer" ,.module_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1001 Module ontbreekt)" ,.module_init_not_found="Pretendo-Netwerk patch mislukt - gebruik Aroma Updater om het te herstellen (686-1002 Module init)" +,.setting_yes="" +,.setting_no="" +,.language_setting="" ,.language_name="Nederlands" +,.system_language="" diff --git a/src/lang/pt_BR.lang b/src/lang/pt_BR.lang index 3da427e..5bcf4c1 100644 --- a/src/lang/pt_BR.lang +++ b/src/lang/pt_BR.lang @@ -1,6 +1,7 @@ .plugin_name="Inkay" ,.network_category="Selecionar rede" ,.connect_to_network_setting="Conecta-se à Pretendo Network" +,.show_startup_toast_setting="" ,.other_category="Outras configurações" ,.reset_wwp_setting="Resetar Wara Wara Plaza" ,.press_a_action="Aperte A" @@ -11,4 +12,8 @@ ,.multiplayer_port_display="Usando UDP port %hu para a jogatina multiplayer" ,.module_not_found="Atualização do Pretendo falhou - use o Aroma Updater para corrigir (686-1001 Módulo faltando)" ,.module_init_not_found="Atualização do Pretendo falhou - use o Aroma Updater para corrigir (686-1002 Módulo de início)" +,.setting_yes="" +,.setting_no="" +,.language_setting="" ,.language_name="Português" +,.system_language="" diff --git a/src/lang/ru_RU.lang b/src/lang/ru_RU.lang index 64e7a66..327a47b 100644 --- a/src/lang/ru_RU.lang +++ b/src/lang/ru_RU.lang @@ -1,6 +1,7 @@ .plugin_name="Inkay" ,.network_category="Выбор сети" ,.connect_to_network_setting="Подключиться к Pretendo Network" +,.show_startup_toast_setting="" ,.other_category="Другие настройки" ,.reset_wwp_setting="Сбросить Wara Wara Plaza" ,.press_a_action="Нажмите A" @@ -11,4 +12,8 @@ ,.multiplayer_port_display="Используем UDP-порт %hu для сетевой игры" ,.module_not_found="Ошибка установки патча Pretendo - для восстановления, запустите Aroma Updater (686-1001 Модуль отсутствует)" ,.module_init_not_found="Ошибка установки патча Pretendo - для восстановления, запустите Aroma Updater (686-1002 Инициализация модуля)" +,.setting_yes="" +,.setting_no="" +,.language_setting="" ,.language_name="Русский язык" +,.system_language="" diff --git a/src/lang/zh_CN.lang b/src/lang/zh_CN.lang index bfac85f..e653106 100644 --- a/src/lang/zh_CN.lang +++ b/src/lang/zh_CN.lang @@ -1,6 +1,7 @@ .plugin_name="Inkay" ,.network_category="选择网络" ,.connect_to_network_setting="连接到Pretendo Network" +,.show_startup_toast_setting="" ,.other_category="其他设置" ,.reset_wwp_setting="重置Wara Wara Plaza" ,.press_a_action="请按 A" @@ -11,4 +12,8 @@ ,.multiplayer_port_display="多人游戏使用 UDP 端口 %hu" ,.module_not_found="Pretendo Network 补丁失败 - 使用 Aroma Updater 修复(686-1001 模块丢失)" ,.module_init_not_found="Pretendo Network 补丁失败 - 使用 Aroma Updater 修复(686-1002 模块初始化)" +,.setting_yes="" +,.setting_no="" +,.language_setting="" ,.language_name="中文(简体)" +,.system_language="" diff --git a/src/lang/zh_Hant.lang b/src/lang/zh_Hant.lang index 9531502..a9b82cf 100644 --- a/src/lang/zh_Hant.lang +++ b/src/lang/zh_Hant.lang @@ -1,6 +1,7 @@ .plugin_name="Inkay" ,.network_category="選擇網路" ,.connect_to_network_setting="連接到Pretendo Network" +,.show_startup_toast_setting="" ,.other_category="其他設定" ,.reset_wwp_setting="重置Wara Wara Plaza" ,.press_a_action="請按 A" @@ -11,4 +12,8 @@ ,.multiplayer_port_display="使用 UDP 端口 %hu 進行多人遊戲" ,.module_not_found="Pretendo Network 補丁失敗 - 請使用 Aroma Updater 修復(缺少 686-1001 模組)" ,.module_init_not_found="Pretendo Network 補丁失敗 - 請使用 Aroma Updater 修復(缺少 686-1002 模組)" +,.setting_yes="" +,.setting_no="" +,.language_setting="" ,.language_name="中文(繁體)" +,.system_language="" From 6df031b26d1e8aa6b562d72ae032bf9b99d78328 Mon Sep 17 00:00:00 2001 From: Ash Date: Wed, 29 Jul 2026 21:28:40 +1000 Subject: [PATCH 129/139] Create codeql.yml --- .github/workflows/codeql.yml | 101 +++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..32eabd0 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,101 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL Advanced" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: '31 9 * * 0' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: actions + build-mode: none + - language: c-cpp + build-mode: none + # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Add any setup steps before running the `github/codeql-action/init` action. + # This includes steps like installing compilers or runtimes (`actions/setup-node` + # or others). This is typically only required for manual builds. + # - name: Setup runtime (example) + # uses: actions/setup-example@v1 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - name: Run manual build steps + if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 + with: + category: "/language:${{matrix.language}}" From 890be941a91e05e27b15e1dd697b6c96988a7232 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Wed, 29 Jul 2026 21:33:03 +1000 Subject: [PATCH 130/139] Revert "Create codeql.yml" This reverts commit 6df031b26d1e8aa6b562d72ae032bf9b99d78328. --- .github/workflows/codeql.yml | 101 ----------------------------------- 1 file changed, 101 deletions(-) delete mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 32eabd0..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,101 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL Advanced" - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - schedule: - - cron: '31 9 * * 0' - -jobs: - analyze: - name: Analyze (${{ matrix.language }}) - # Runner size impacts CodeQL analysis time. To learn more, please see: - # - https://gh.io/recommended-hardware-resources-for-running-codeql - # - https://gh.io/supported-runners-and-hardware-resources - # - https://gh.io/using-larger-runners (GitHub.com only) - # Consider using larger runners or machines with greater resources for possible analysis time improvements. - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} - permissions: - # required for all workflows - security-events: write - - # required to fetch internal or private CodeQL packs - packages: read - - # only required for workflows in private repositories - actions: read - contents: read - - strategy: - fail-fast: false - matrix: - include: - - language: actions - build-mode: none - - language: c-cpp - build-mode: none - # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift' - # Use `c-cpp` to analyze code written in C, C++ or both - # Use 'java-kotlin' to analyze code written in Java, Kotlin or both - # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both - # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, - # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. - # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how - # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Add any setup steps before running the `github/codeql-action/init` action. - # This includes steps like installing compilers or runtimes (`actions/setup-node` - # or others). This is typically only required for manual builds. - # - name: Setup runtime (example) - # uses: actions/setup-example@v1 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v4 - with: - languages: ${{ matrix.language }} - build-mode: ${{ matrix.build-mode }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - # If the analyze step fails for one of the languages you are analyzing with - # "We were unable to automatically build your code", modify the matrix above - # to set the build mode to "manual" for that language. Then modify this step - # to build your code. - # ℹ️ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - name: Run manual build steps - if: matrix.build-mode == 'manual' - shell: bash - run: | - echo 'If you are using a "manual" build mode for one or more of the' \ - 'languages you are analyzing, replace this with the commands to build' \ - 'your code, for example:' - echo ' make bootstrap' - echo ' make release' - exit 1 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v4 - with: - category: "/language:${{matrix.language}}" From 5960ff1e40768da216f06d25a4f26cb391a08ca1 Mon Sep 17 00:00:00 2001 From: Ash Date: Wed, 29 Jul 2026 21:38:46 +1000 Subject: [PATCH 131/139] Create codeql.yml --- .github/workflows/codeql.yml | 101 +++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..e0192d2 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,101 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL Advanced" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: '25 19 * * 2' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: actions + build-mode: none + - language: c-cpp + build-mode: none + # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Add any setup steps before running the `github/codeql-action/init` action. + # This includes steps like installing compilers or runtimes (`actions/setup-node` + # or others). This is typically only required for manual builds. + # - name: Setup runtime (example) + # uses: actions/setup-example@v1 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - name: Run manual build steps + if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 + with: + category: "/language:${{matrix.language}}" From e421ac5a4083367f2cde37d38ca9ca2a492e82fe Mon Sep 17 00:00:00 2001 From: red binder Date: Sat, 8 Aug 2026 02:08:37 +0200 Subject: [PATCH 132/139] malamar changes --- .github/dependabot.yml | 19 ------------- .github/workflows/ci.yml | 22 --------------- Makefile | 2 +- README.md | 25 +++++++---------- common/inkay_config.h | 2 +- plugin/Makefile | 2 +- plugin/src/main.cpp | 4 +-- src/iosu_url_patches.h | 56 +++++++++++++++++++------------------- src/lang/en_US.lang | 2 +- src/patches/olv_applet.cpp | 4 +-- src/patches/olv_urls.h | 2 +- 11 files changed, 47 insertions(+), 93 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/ci.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 815be86..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,19 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file - -version: 2 -updates: - - package-ecosystem: "docker" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "weekly" - commit-message: - prefix: "chore: " - - package-ecosystem: "github-actions" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "weekly" - commit-message: - prefix: "chore: " diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3eb8d31..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Inkay-CI -permissions: - contents: read - -on: -- push -- pull_request - -jobs: - build-inkay: - runs-on: debian-trixie - steps: - - uses: actions/checkout@v7 - - name: build toolchain container - run: docker build . -t builder - - uses: https://github.com/ammaraskar/gcc-problem-matcher@master - - name: build Inkay - run: docker run --rm -v ${PWD}:/app -w /app builder - - uses: actions/upload-artifact@v3 - with: - name: inkay - path: dist/ diff --git a/Makefile b/Makefile index 624a492..1a50efc 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ WUT_ROOT := $(DEVKITPRO)/wut # DATA is a list of directories containing data files # INCLUDES is a list of directories containing header files #------------------------------------------------------------------------------- -TARGET := Inkay-spfn +TARGET := Malamar-spfn BUILD := build SOURCES := src src/patches src/utils src/ext/inih common DATA := data diff --git a/README.md b/README.md index 5e42d0b..560fb2d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ -# Inkay - Aroma patches for Pretendo +# Malamar - Aroma patches for Splatfestival Network/Spacebar -[![Pretendo network logo](https://github.com/PretendoNetwork/website/raw/master/public/assets/images/opengraph/opengraph-image.png)](https://pretendo.network) - -Inkay is an Aroma/WUPS plugin that patches various Nintendo Network URLs on a Wii U to use Pretendo Network instead. It also (for the time being) bypasses SSL verification in most cases. It redirects Nintendo Network in: +Malamar is an Aroma/WUPS plugin based on Pretendo's Malamar that patches various Nintendo Network URLs on a Wii U to use Splatfestival/Spacebar Network instead. It also (for the time being) bypasses SSL verification in most cases. It redirects Nintendo Network in: - IOSU-side connections (Friends, SpotPass, accounts etc.) - Account Settings @@ -11,27 +9,27 @@ Inkay is an Aroma/WUPS plugin that patches various Nintendo Network URLs on a Wi - Miiverse (in-game) - Miiverse applet -Inkay also includes game-specific patches to add extra features: +Malamar also includes game-specific patches to add extra features: - Modpack-specific matchmaking for global, regional rooms (by simulating extra DLC) - **Mario Kart 8** - P2P port override for better connection stability (if you port forward) - **Minecraft: Wii U Edition**, **Mario Kart 8**, **Splatoon** ## Requirements -Inkay is only supported on the release version of Aroma configured for autoboot/coldboot. Other configurations (specifically lacking coldboot) may cause issues with SpotPass. +Malamar is only supported on the release version of Aroma configured for autoboot/coldboot. Other configurations (specifically lacking coldboot) may cause issues with SpotPass. ## Safety -Inkay's patches are all temporary, and only applied in-memory without modifying your console. The SSL patch, while also temporary, could reduce the overall security of your console while active - this is because it no longer checks if a server is verified. However, this does not apply to the Internet Browser, where SSL still works as expected. +Malamar's patches are all temporary, and only applied in-memory without modifying your console. The SSL patch, while also temporary, could reduce the overall security of your console while active - this is because it no longer checks if a server is verified. However, this does not apply to the Internet Browser, where SSL still works as expected. ## Compiling - Docker -Inkay's dependencies and build tooling can be handled as a container, which is recommended for WUPS plugins. Using `docker` or `podman`: +Malamar's dependencies and build tooling can be handled as a container, which is recommended for WUPS plugins. Using `docker` or `podman`: ```shell -docker build -t inkay . -docker run --rm -v $(pwd):/app inkay make +docker build -t malamar . +docker run --rm -v $(pwd):/app malamar make # you can replace "make" with other commands - e.g. make clean ``` If using `podman` on SELinux systems (like Fedora Linux), you might need to use `$(pwd):/app:Z` instead of `$(pwd):/app`. ## Compiling - System -Inkay has the following dependencies aside from devkitPPC and wut: +Malamar has the following dependencies aside from devkitPPC and wut: - [WiiUPluginSystem](https://github.com/wiiu-env/WiiUPluginSystem) - [WiiUModuleSystem](https://github.com/wiiu-env/WiiUModuleSystem) - [libmocha](https://github.com/wiiu-env/libmocha) @@ -39,7 +37,4 @@ Inkay has the following dependencies aside from devkitPPC and wut: - [libnotifications](https://github.com/wiiu-env/libnotifications/) - [libfunctionpatcher](https://github.com/wiiu-env/libfunctionpatcher) -Each of these should be `make install`-able. After that, you can compile Inkay with `make`. - -## TODO -See [Issues](https://github.com/PretendoNetwork/Inkay/issues). +Each of these should be `make install`-able. After that, you can compile Malamar with `make`. diff --git a/common/inkay_config.h b/common/inkay_config.h index fad1699..906d60f 100644 --- a/common/inkay_config.h +++ b/common/inkay_config.h @@ -15,7 +15,7 @@ #endif #ifndef NETWORK_BASEURL -#define NETWORK_BASEURL "spfn.net" +#define NETWORK_BASEURL "spbr.net" #endif #endif //INKAY_INKAY_CONFIG_H diff --git a/plugin/Makefile b/plugin/Makefile index 6553ec1..a4baa3d 100644 --- a/plugin/Makefile +++ b/plugin/Makefile @@ -19,7 +19,7 @@ WUMS_ROOT := $(DEVKITPRO)/wums # DATA is a list of directories containing data files # INCLUDES is a list of directories containing header files #------------------------------------------------------------------------------- -TARGET := Inkay-spfn +TARGET := Malamar-spfn BUILD := build SOURCES := src src/utils ../common DATA := data diff --git a/plugin/src/main.cpp b/plugin/src/main.cpp index 5f1b343..7d3ad2e 100644 --- a/plugin/src/main.cpp +++ b/plugin/src/main.cpp @@ -32,10 +32,10 @@ Mandatory plugin information. If not set correctly, the loader will refuse to use the plugin. **/ -WUPS_PLUGIN_NAME("Inkay(SPFN)"); +WUPS_PLUGIN_NAME("Malamar (SPFN)"); WUPS_PLUGIN_DESCRIPTION("SPFN Network Patcher"); WUPS_PLUGIN_VERSION(INKAY_VERSION); -WUPS_PLUGIN_AUTHOR("Pretendo contributors and RusticMaple"); +WUPS_PLUGIN_AUTHOR("redbinder0526, kittentm and Pretendo contributors"); WUPS_PLUGIN_LICENSE("GPLv3"); WUPS_USE_STORAGE("inkay"); diff --git a/src/iosu_url_patches.h b/src/iosu_url_patches.h index bf289f1..3b84b54 100644 --- a/src/iosu_url_patches.h +++ b/src/iosu_url_patches.h @@ -8,35 +8,35 @@ typedef struct URL_Patch { static const URL_Patch url_patches[] = { //nim-boss .rodata - {0xE2282550, "http://pushmorewupshop.spfn.net/pushmore/r/%s"}, - {0xE229A0A0, "http://npns-devcapp.spfn.net/bst.dat"}, - {0xE229A0D0, "http://npns-devcapp.spfn.net/bst2.dat"}, - {0xE2281964, "https://tagayawupshop.spfn.net/tagaya/versionlist/%s/%s/%s"}, - {0xE22819B4, "https://tagayawupshop.spfn.net/tagaya/versionlist/%s/%s/latest_version"}, - {0xE2282584, "http://pushmowupshop.spfn.net/pushmo/d/%s/%u"}, - {0xE22825B8, "http://pushmowupshop.spfn.net/pushmo/c/%u/%u"}, - {0xE2282DB4, "https://ecswupshop.spfn.net/ecs/services/ECommerceSOAP"}, - {0xE22830A0, "https://ecswupshop.spfn.net/ecs/services/ECommerceSOAP"}, - {0xE22830E0, "https://nuswupshop.spfn.net/nus/services/NetUpdateSOAP"}, - {0xE2299990, "npplapp.spfn.net"}, - {0xE229A600, "https://plswupshop.spfn.net/pls/upload"}, - {0xE229A6AC, "https://npvk-devapp.spfn.net/reports"}, - {0xE229A6D8, "https://npvkapp.spfn.net/reports"}, - {0xE229B1F4, "https://nptsapp.spfn.net/p01/tasksheet/%s/%s/%s/%s?c=%s&l=%s"}, - {0xE229B238, "https://nptsapp.spfn.net/p01/tasksheet/%s/%s/%s?c=%s&l=%s"}, - {0xE22AB2D8, "https://idbe-wupcdn.spfn.net/icondata/%02X/%016llX.idbe"}, - {0xE22AB318, "https://idbe-ctrcdn.spfn.net/icondata/%02X/%016llX.idbe"}, - {0xE22AB358, "https://idbe-wupcdn.spfn.net/icondata/%02X/%016llX-%d.idbe"}, - {0xE22AB398, "https://idbe-ctrcdn.spfn.net/icondata/%02X/%016llX-%d.idbe"}, - {0xE22B3EF8, "https://ecscshop.spfn.net"}, - {0xE22B3F30, "https://ecscshop.spfn.net/ecs/services/ECommerceSOAP"}, - {0xE22B3F70, "https://iascshop.spfn.net/ias/services/IdentityAuthenticationSOAP"}, - {0xE22B3FBC, "https://cascshop.spfn.net/cas/services/CatalogingSOAP"}, - {0xE22B3FFC, "https://nuscshop.spfn.net/nus/services/NetUpdateSOAP"}, - {0xE229DE0C, "n.app.spfn.net"}, + {0xE2282550, "http://pushmorewupshop.spbr.net/pushmore/r/%s"}, + {0xE229A0A0, "http://npns-devcapp.spbr.net/bst.dat"}, + {0xE229A0D0, "http://npns-devcapp.spbr.net/bst2.dat"}, + {0xE2281964, "https://tagayawupshop.spbr.net/tagaya/versionlist/%s/%s/%s"}, + {0xE22819B4, "https://tagayawupshop.spbr.net/tagaya/versionlist/%s/%s/latest_version"}, + {0xE2282584, "http://pushmowupshop.spbr.net/pushmo/d/%s/%u"}, + {0xE22825B8, "http://pushmowupshop.spbr.net/pushmo/c/%u/%u"}, + {0xE2282DB4, "https://ecswupshop.spbr.net/ecs/services/ECommerceSOAP"}, + {0xE22830A0, "https://ecswupshop.spbr.net/ecs/services/ECommerceSOAP"}, + {0xE22830E0, "https://nuswupshop.spbr.net/nus/services/NetUpdateSOAP"}, + {0xE2299990, "policylist.spbr.net"}, + {0xE229A600, "https://plswupshop.spbr.net/pls/upload"}, + {0xE229A6AC, "https://npvk-devapp.spbr.net/reports"}, + {0xE229A6D8, "https://npvkapp.spbr.net/reports"}, + {0xE229B1F4, "https://tasksheets.spbr.net/p01/tasksheet/%s/%s/%s/%s?c=%s&l=%s"}, + {0xE229B238, "https://tasksheets.spbr.net/p01/tasksheet/%s/%s/%s?c=%s&l=%s"}, + {0xE22AB2D8, "https://idbe-wupcdn.spbr.net/icondata/%02X/%016llX.idbe"}, + {0xE22AB318, "https://idbe-ctrcdn.spbr.net/icondata/%02X/%016llX.idbe"}, + {0xE22AB358, "https://idbe-wupcdn.spbr.net/icondata/%02X/%016llX-%d.idbe"}, + {0xE22AB398, "https://idbe-ctrcdn.spbr.net/icondata/%02X/%016llX-%d.idbe"}, + {0xE22B3EF8, "https://ecscshop.spbr.net"}, + {0xE22B3F30, "https://ecscshop.spbr.net/ecs/services/ECommerceSOAP"}, + {0xE22B3F70, "https://iascshop.spbr.net/ias/services/IdentityAuthenticationSOAP"}, + {0xE22B3FBC, "https://cascshop.spbr.net/cas/services/CatalogingSOAP"}, + {0xE22B3FFC, "https://nuscshop.spbr.net/nus/services/NetUpdateSOAP"}, + {0xE229DE0C, "n.app.spbr.net"}, //nim-boss .bss - {0xE24B8A24, "https://npplapp.spfn.net/p01/policylist/1/1/UNK"}, - {0xE31930D4, "https://%s%saccount.spfn.net/v%u/api/"} + {0xE24B8A24, "https://policylist.spbr.net/p01/policylist/1/1/UNK"}, + {0xE31930D4, "https://%s%saccount.spbr.net/v%u/api/"} }; diff --git a/src/lang/en_US.lang b/src/lang/en_US.lang index 4a2d963..389fa6e 100644 --- a/src/lang/en_US.lang +++ b/src/lang/en_US.lang @@ -1,4 +1,4 @@ -.plugin_name="Inkay" +.plugin_name="Malamar" ,.network_category="Network selection" ,.connect_to_network_setting="Connect to SPFN" ,.other_category="Other settings" diff --git a/src/patches/olv_applet.cpp b/src/patches/olv_applet.cpp index 2860027..5b38688 100644 --- a/src/patches/olv_applet.cpp +++ b/src/patches/olv_applet.cpp @@ -46,7 +46,7 @@ constexpr struct olv_allowlist original_entry = { constexpr struct olv_allowlist new_entry = { .scheme = "https", - .domain = ".projectrose.cafe", + .domain = ".spbr.net", .path = "", .flags = {1, 1, 1, 1, 1}, }; @@ -109,7 +109,7 @@ DECL_FUNCTION(int, FSOpenFile, FSClient *client, FSCmdBlock *block, char *path, } else if (strcmp("vol/content/browser/effective_tld_names.dat", path) == 0) { - // we patch the TLD because .cafe isnt on the list (projectrose.cafe) + // we patch the TLD because .cafe isnt on the list int ret = real_FSOpenFile(client, block, path, mode, handle, error); valid_tld_handle = *handle; DEBUG_FUNCTION_LINE_VERBOSE("Inkay: Found Miiverse TLD List, patching..."); diff --git a/src/patches/olv_urls.h b/src/patches/olv_urls.h index aa055fc..0e6ca69 100644 --- a/src/patches/olv_urls.h +++ b/src/patches/olv_urls.h @@ -18,7 +18,7 @@ #include "inkay_config.h" constexpr char original_url[] = "discovery.olv.nintendo.net/v1/endpoint"; -constexpr char new_url[] = "disco.olv.projectrose.cafe/v1/endpoint"; +constexpr char new_url[] = "discovery.olv.spbr.net/v1/endpoint"; _Static_assert(sizeof(original_url) >= sizeof(new_url), "new_url too long! Must be less than 38chars."); From 257d4ba119998500198fed8ee4cc8c8348d9449b Mon Sep 17 00:00:00 2001 From: red binder Date: Sat, 8 Aug 2026 02:17:48 +0200 Subject: [PATCH 133/139] fix language file issues --- src/lang/en_US.lang | 1 - src/lang/ko_KR.lang | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lang/en_US.lang b/src/lang/en_US.lang index 8e658d5..6ff8663 100644 --- a/src/lang/en_US.lang +++ b/src/lang/en_US.lang @@ -1,7 +1,6 @@ .plugin_name="Malamar" ,.network_category="Network selection" ,.connect_to_network_setting="Connect to SPFN" -,.connect_to_network_setting="Connect to Pretendo Network" ,.show_startup_toast_setting="Show startup toast" ,.other_category="Other settings" ,.reset_wwp_setting="Reset Wara Wara Plaza" diff --git a/src/lang/ko_KR.lang b/src/lang/ko_KR.lang index b732072..9392a9e 100644 --- a/src/lang/ko_KR.lang +++ b/src/lang/ko_KR.lang @@ -1,6 +1,6 @@ .plugin_name="Inkay" ,.network_category="네트워크 선택" -,.connect_to_network_setting="Pretendo Network 사용" +,.connect_to_network_setting="SPFN 사용" ,.show_startup_toast_setting="" ,.other_category="기타 설정" ,.reset_wwp_setting="Wara Wara Plaza 초기화" @@ -8,7 +8,7 @@ ,.restart_to_apply_action="재시작 후 적용" ,.need_menu_action="Wii U 메뉴에서만" ,.using_nintendo_network="Nintendo Network 사용 중" -,.using_pretendo_network="Pretendo Network 사용 중" +,.using_pretendo_network="SPFN 사용 중" ,.multiplayer_port_display="멀티플레이어에 UDP 포트 %hu을(를) 사용합니다" ,.module_not_found="패치를 적용하는 데 실패했습니다. Aroma Updater로 복구해 주세요. (686-1001 모듈 없음)" ,.module_init_not_found="패치를 적용하는 데 실패했습니다. Aroma Updater로 복구해 주세요. (686-1002 모듈 초기화)" From 04bbcbfda9db6c7ec844af0121468fd2c612017f Mon Sep 17 00:00:00 2001 From: red binder Date: Sat, 8 Aug 2026 02:25:26 +0200 Subject: [PATCH 134/139] fix language AGAIN --- common/lang.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/lang.cpp b/common/lang.cpp index ac39d15..c5506c5 100644 --- a/common/lang.cpp +++ b/common/lang.cpp @@ -25,9 +25,6 @@ config_strings get_config_strings(inkay_language language) { case inkay_language::SimplifiedChinese: return { #include "zh_CN.lang" }; - case inkay_language::TraditionalChinese: return { -#include "zh_Hant.lang" - }; case inkay_language::Portuguese: return { #include "pt_BR.lang" }; From bc2014fbe8cb762e54acfea98658e9b853a60d27 Mon Sep 17 00:00:00 2001 From: kitten Date: Sat, 8 Aug 2026 02:36:04 +0200 Subject: [PATCH 135/139] ci: fix for fj actions --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 792dce0..ad80363 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,15 +8,16 @@ on: jobs: build-inkay: - runs-on: ubuntu-22.04 + runs-on: debian-trixie steps: - uses: actions/checkout@v7 - name: build toolchain container run: docker build . -t builder - - uses: ammaraskar/gcc-problem-matcher@master + - uses: https://github.com/ammaraskar/gcc-problem-matcher@master - name: build Inkay run: docker run --rm -v ${PWD}:/app -w /app builder - - uses: actions/upload-artifact@v7 + - uses: actions/upload-artifact@v3 with: name: inkay - path: dist/ + path: dis + t/ \ No newline at end of file From dc1466eb362ac368e57d0cdfe101e6e3d6f5fe31 Mon Sep 17 00:00:00 2001 From: redbinder0526 Date: Sat, 8 Aug 2026 02:39:17 +0200 Subject: [PATCH 136/139] fix ci --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad80363..f4895b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,5 +19,4 @@ jobs: - uses: actions/upload-artifact@v3 with: name: inkay - path: dis - t/ \ No newline at end of file + path: dist/ \ No newline at end of file From 14501054acb3f76ddd56541eede1d0d3c7673c25 Mon Sep 17 00:00:00 2001 From: kitten Date: Sat, 8 Aug 2026 02:40:52 +0200 Subject: [PATCH 137/139] Delete .github/workflows/codeql.yml --- .github/workflows/codeql.yml | 101 ----------------------------------- 1 file changed, 101 deletions(-) delete mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index e0192d2..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,101 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL Advanced" - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - schedule: - - cron: '25 19 * * 2' - -jobs: - analyze: - name: Analyze (${{ matrix.language }}) - # Runner size impacts CodeQL analysis time. To learn more, please see: - # - https://gh.io/recommended-hardware-resources-for-running-codeql - # - https://gh.io/supported-runners-and-hardware-resources - # - https://gh.io/using-larger-runners (GitHub.com only) - # Consider using larger runners or machines with greater resources for possible analysis time improvements. - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} - permissions: - # required for all workflows - security-events: write - - # required to fetch internal or private CodeQL packs - packages: read - - # only required for workflows in private repositories - actions: read - contents: read - - strategy: - fail-fast: false - matrix: - include: - - language: actions - build-mode: none - - language: c-cpp - build-mode: none - # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift' - # Use `c-cpp` to analyze code written in C, C++ or both - # Use 'java-kotlin' to analyze code written in Java, Kotlin or both - # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both - # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, - # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. - # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how - # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Add any setup steps before running the `github/codeql-action/init` action. - # This includes steps like installing compilers or runtimes (`actions/setup-node` - # or others). This is typically only required for manual builds. - # - name: Setup runtime (example) - # uses: actions/setup-example@v1 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v4 - with: - languages: ${{ matrix.language }} - build-mode: ${{ matrix.build-mode }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - # If the analyze step fails for one of the languages you are analyzing with - # "We were unable to automatically build your code", modify the matrix above - # to set the build mode to "manual" for that language. Then modify this step - # to build your code. - # ℹ️ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - name: Run manual build steps - if: matrix.build-mode == 'manual' - shell: bash - run: | - echo 'If you are using a "manual" build mode for one or more of the' \ - 'languages you are analyzing, replace this with the commands to build' \ - 'your code, for example:' - echo ' make bootstrap' - echo ' make release' - exit 1 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v4 - with: - category: "/language:${{matrix.language}}" From cc7d9e8d845ad063620407f9dbbe8c266d662693 Mon Sep 17 00:00:00 2001 From: redbinder0526 Date: Sat, 8 Aug 2026 02:45:12 +0200 Subject: [PATCH 138/139] Update src/lang/zh_CN.lang --- src/lang/zh_CN.lang | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lang/zh_CN.lang b/src/lang/zh_CN.lang index a49aa85..b8ac1ec 100644 --- a/src/lang/zh_CN.lang +++ b/src/lang/zh_CN.lang @@ -1,7 +1,6 @@ .plugin_name="Inkay" ,.network_category="选择网络" ,.connect_to_network_setting="连接到SPFN" -,.connect_to_network_setting="连接到Pretendo Network" ,.other_category="其他设置" ,.reset_wwp_setting="重置Wara Wara Plaza" ,.press_a_action="请按 A" From 56a115ca79b9336be74d25e5c4f8ab28b6707393 Mon Sep 17 00:00:00 2001 From: kittentm Date: Sat, 8 Aug 2026 19:14:24 +0200 Subject: [PATCH 139/139] a bunch of bullshit --- plugin/src/main.cpp | 21 ++++++++++++++++++++- src/main.cpp | 20 +++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/plugin/src/main.cpp b/plugin/src/main.cpp index ccff31a..166ce2c 100644 --- a/plugin/src/main.cpp +++ b/plugin/src/main.cpp @@ -32,7 +32,26 @@ Mandatory plugin information. If not set correctly, the loader will refuse to use the plugin. **/ -WUPS_PLUGIN_NAME("Malamar (SPFN)"); +WUPS_META(name, "Malamar (SPFN)"); +WUPS_META(wups, WUPS_VERSION_STR); +WUPS_USE_WUT_MALLOC(); +WUPS_USE_WUT_SOCKETS(); +WUPS_USE_WUT_NEWLIB(); +WUPS___INIT_WRAPPER(); +WUPS___FINI_WRAPPER(); +WUPS_INIT_CONFIG_FUNCTIONS(); +WUPS_META(buildtimestamp, __DATE__ " " __TIME__); +extern const char wups_meta_plugin_name[] WUPS_SECTION("meta"); +const char wups_meta_plugin_name[] = "Malamar (SPFN)"; +extern const char wups_meta_info_dump[] WUPS_SECTION("meta"); +const char wups_meta_info_dump[] = "(plugin: Malamar (SPFN);" \ + "wups " WUPS_VERSION_STR ";" \ + "buildtime: " __DATE__ " " __TIME__ ")"; +extern const char wups_meta_info_linking_order[] WUPS_SECTION("meta"); +const char wups_meta_info_linking_order[] = "Loading \"Malamar (SPFN)\" failed.\n" \ + "Function \"wut_get_thread_specific\" returned unexpected value.\n" \ + "Please check linking order (expected \"-lwups -lwut\")"; + WUPS_PLUGIN_DESCRIPTION("SPFN Network Patcher"); WUPS_PLUGIN_VERSION(INKAY_VERSION); WUPS_PLUGIN_AUTHOR("redbinder0526, kittentm and Pretendo contributors"); diff --git a/src/main.cpp b/src/main.cpp index 5d03f81..4c6aee4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,7 +45,25 @@ Mandatory plugin information. If not set correctly, the loader will refuse to use the plugin. **/ -WUMS_MODULE_EXPORT_NAME("inkay"); +WUMS_META(export_name, "inkay"); +WUMS_META(wums, WUMS_VERSION); +WUMS_USE_WUT_MALLOC(); +WUMS_USE_WUT_SOCKETS(); +WUMS_USE_WUT_NEWLIB(); +WUMS___INIT_WRAPPER(); +WUMS___FINI_WRAPPER(); +WUMS_META(buildtimestamp, __DATE__ " " __TIME__); +extern const char wums_meta_module_name[] WUMS_SECTION("meta"); +const char wums_meta_module_name[] = "inkay"; +extern const char wums_meta_info_dump[] WUMS_SECTION("meta"); +const char wums_meta_info_dump[] = "(module: inkay;" \ + "wums " WUMS_VERSION ";" \ + "buildtime: " __DATE__ " " __TIME__ ")"; +extern const char wums_meta_info_linking_order[] WUMS_SECTION("meta"); +const char wums_meta_info_linking_order[] = "Loading module \"inkay\" failed.\n" \ + "Function \"wut_get_thread_specific\" returned unexpected value.\n" \ + "Please check linking order (expected \"-lwums -lwut\")"; + WUMS_MODULE_DESCRIPTION("SPFN Network Patcher"); WUMS_MODULE_VERSION(INKAY_VERSION); WUMS_MODULE_AUTHOR("Pretendo contributors and RusticMaple");