diff --git a/Makefile b/Makefile index 139359e..fc76f7a 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ DATA := data INCLUDES := include lib/zipper/include APP_TITLE := All-in-One Switch Updater APP_AUTHOR := HamletDuFromage -APP_VERSION := 2.3.2 +APP_VERSION := 2.3.3 TARGET := $(notdir $(CURDIR)) ROMFS := resources diff --git a/include/tools_tab.hpp b/include/tools_tab.hpp index 0e64885..bc0942f 100644 --- a/include/tools_tab.hpp +++ b/include/tools_tab.hpp @@ -24,6 +24,6 @@ class ToolsTab : public brls::List brls::StagedAppletFrame* stagedFrame; public: - ToolsTab(std::string tag); + ToolsTab(std::string tag, bool erista = true); }; \ No newline at end of file diff --git a/include/utils.hpp b/include/utils.hpp index 1e957e9..ff1db3b 100644 --- a/include/utils.hpp +++ b/include/utils.hpp @@ -38,4 +38,5 @@ void saveVersion(std::string version, const char* path); std::string readVersion(const char* path); void cp(const char *to, const char *from); std::string copyFiles(const char* path); -int removeDir(const char* path); \ No newline at end of file +int removeDir(const char* path); +bool isErista(); \ No newline at end of file diff --git a/resources/i18n/en-US/menus.json b/resources/i18n/en-US/menus.json index d701954..f0aebac 100644 --- a/resources/i18n/en-US/menus.json +++ b/resources/i18n/en-US/menus.json @@ -239,7 +239,7 @@ "files_not_found": "The following files were not found and couldn't be copied:\n", "copy_files_not_found": "This tool allows you to copy files to other locations, which may be needed for your bootloader/trinket. Grab copy_files.json at 'https://git.io/aiosu_copy_files' and add it to your config folder. This will also be performed after updates.", - "delete_contents": "Would you like to remove the existing '/atmosphere/contents/' directory? This will prevent crashes if you have sysmodules that do not support the latest Atmosphère. Please note that it will delete all your existing sysmodules and cheats.", + "delete_contents": "Would you like to remove the existing '/atmosphere/contents/' directory? This will prevent crashes if you have sysmodules that do not support the latest Atmosphère. Please note that it will delete all your existing sysmodules, mods and cheats.", "launch_warning": "Please pay attention to the following points before using the app:\n\n\uE016 Read up on how to manually update your Switch first. This will help you understand the app better and you'll know what to do in case something goes wrong.\n\uE016 On Mariko (i.e. chipped) Switches, payloads cannot be launched from HOS. This means you WILL NOT be able to update Atmosphère with this app. You won't be able to use the reboot to payload feature either.\n\uE016 Please note that using this app (or any homebrew) on a exFAT SD card is not recommended, as those are more likely to corrupt.\n\nThis screen won't show again." diff --git a/source/changelog_page.cpp b/source/changelog_page.cpp index a05edf5..3f0b493 100644 --- a/source/changelog_page.cpp +++ b/source/changelog_page.cpp @@ -107,7 +107,7 @@ ChangelogPage::ChangelogPage() : AppletFrame(true, true) changes.push_back("menus/v2_3_1_text"_i18n ); verTitles.push_back("v2.3.2"); - changes.push_back("menus/v2_3_1_text"_i18n ); + changes.push_back("menus/v2_3_2_text"_i18n ); int nbVersions = verTitles.size(); items.reserve(nbVersions); diff --git a/source/main_frame.cpp b/source/main_frame.cpp index 8b2cefc..bf36427 100644 --- a/source/main_frame.cpp +++ b/source/main_frame.cpp @@ -31,10 +31,12 @@ MainFrame::MainFrame() : TabFrame() if(json::accept(fileContent)) hideStatus = json::parse(fileContent); else hideStatus = json::object(); + bool erista = isErista(); + if(hideStatus.find("about") == hideStatus.end() || !hideStatus["about"]) this->addTab("menus/main_about"_i18n, new AboutTab()); - if(hideStatus.find("atmosphere") == hideStatus.end() || !hideStatus["atmosphere"]) + if(erista && (hideStatus.find("atmosphere") == hideStatus.end() || !hideStatus["atmosphere"])) this->addTab("menus/main_update_ams"_i18n, new AmsTab()); if(hideStatus.find("cfw") == hideStatus.end() || !hideStatus["cfw"]) @@ -50,8 +52,7 @@ MainFrame::MainFrame() : TabFrame() this->addTab("menus/main_cheats"_i18n, new ListDownloadTab(cheats)); if(hideStatus.find("tools") == hideStatus.end() || !hideStatus["tools"]) - this->addTab("menus/main_tools"_i18n , new ToolsTab(tag)); + this->addTab("menus/main_tools"_i18n , new ToolsTab(tag, erista)); this->registerAction("" , brls::Key::B, [this] { return true; }); - } diff --git a/source/tools_tab.cpp b/source/tools_tab.cpp index 4fe202b..786c80f 100644 --- a/source/tools_tab.cpp +++ b/source/tools_tab.cpp @@ -19,7 +19,7 @@ namespace i18n = brls::i18n; using namespace i18n::literals; using json = nlohmann::json; -ToolsTab::ToolsTab(std::string tag) : brls::List() +ToolsTab::ToolsTab(std::string tag, bool erista) : brls::List() { if(!tag.empty() && tag != APP_VERSION){ updateApp = new brls::ListItem("menus/tool_update"_i18n + tag +")"); @@ -73,12 +73,14 @@ ToolsTab::ToolsTab(std::string tag) : brls::List() downloadPayload->setHeight(LISTITEM_HEIGHT); this->addView(downloadPayload); - rebootPayload = new brls::ListItem("menus/tool_inject"_i18n ); - rebootPayload->getClickEvent()->subscribe([&](brls::View* view){ - brls::Application::pushView(new PayloadPage()); - }); - rebootPayload->setHeight(LISTITEM_HEIGHT); - this->addView(rebootPayload); + if(erista) { + rebootPayload = new brls::ListItem("menus/tool_inject"_i18n ); + rebootPayload->getClickEvent()->subscribe([&](brls::View* view){ + brls::Application::pushView(new PayloadPage()); + }); + rebootPayload->setHeight(LISTITEM_HEIGHT); + this->addView(rebootPayload); + } /* ntcp = new brls::ListItem("menus/ntcp"_i18n ); ntcp->getClickEvent()->subscribe([&](brls::View* view){ diff --git a/source/utils.cpp b/source/utils.cpp index 0b27833..0306de9 100644 --- a/source/utils.cpp +++ b/source/utils.cpp @@ -397,3 +397,28 @@ int removeDir(const char* path) { } return 0; } + + +bool isErista() { + splInitialize(); + u64 hwType; + Result rc = splGetConfig(SplConfigItem_HardwareType, &hwType); + splExit(); + + if(R_FAILED(rc)) + return true; + + switch (hwType) + { + case 0: + case 1: + return true; + case 2: + case 3: + case 4: + case 5: + return false; + default: + return true; + } +};