1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-12-29 10:56:01 +00:00

added SOC type check

This commit is contained in:
flb 2021-02-17 19:00:12 +01:00
parent 4574589dc6
commit 0cdb0ad6d9
8 changed files with 44 additions and 15 deletions

View file

@ -22,7 +22,7 @@ DATA := data
INCLUDES := include lib/zipper/include INCLUDES := include lib/zipper/include
APP_TITLE := All-in-One Switch Updater APP_TITLE := All-in-One Switch Updater
APP_AUTHOR := HamletDuFromage APP_AUTHOR := HamletDuFromage
APP_VERSION := 2.3.2 APP_VERSION := 2.3.3
TARGET := $(notdir $(CURDIR)) TARGET := $(notdir $(CURDIR))
ROMFS := resources ROMFS := resources

View file

@ -24,6 +24,6 @@ class ToolsTab : public brls::List
brls::StagedAppletFrame* stagedFrame; brls::StagedAppletFrame* stagedFrame;
public: public:
ToolsTab(std::string tag); ToolsTab(std::string tag, bool erista = true);
}; };

View file

@ -38,4 +38,5 @@ void saveVersion(std::string version, const char* path);
std::string readVersion(const char* path); std::string readVersion(const char* path);
void cp(const char *to, const char *from); void cp(const char *to, const char *from);
std::string copyFiles(const char* path); std::string copyFiles(const char* path);
int removeDir(const char* path); int removeDir(const char* path);
bool isErista();

View file

@ -239,7 +239,7 @@
"files_not_found": "The following files were not found and couldn't be copied:\n", "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.", "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." "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."

View file

@ -107,7 +107,7 @@ ChangelogPage::ChangelogPage() : AppletFrame(true, true)
changes.push_back("menus/v2_3_1_text"_i18n ); changes.push_back("menus/v2_3_1_text"_i18n );
verTitles.push_back("v2.3.2"); 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(); int nbVersions = verTitles.size();
items.reserve(nbVersions); items.reserve(nbVersions);

View file

@ -31,10 +31,12 @@ MainFrame::MainFrame() : TabFrame()
if(json::accept(fileContent)) hideStatus = json::parse(fileContent); if(json::accept(fileContent)) hideStatus = json::parse(fileContent);
else hideStatus = json::object(); else hideStatus = json::object();
bool erista = isErista();
if(hideStatus.find("about") == hideStatus.end() || !hideStatus["about"]) if(hideStatus.find("about") == hideStatus.end() || !hideStatus["about"])
this->addTab("menus/main_about"_i18n, new AboutTab()); 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()); this->addTab("menus/main_update_ams"_i18n, new AmsTab());
if(hideStatus.find("cfw") == hideStatus.end() || !hideStatus["cfw"]) if(hideStatus.find("cfw") == hideStatus.end() || !hideStatus["cfw"])
@ -50,8 +52,7 @@ MainFrame::MainFrame() : TabFrame()
this->addTab("menus/main_cheats"_i18n, new ListDownloadTab(cheats)); this->addTab("menus/main_cheats"_i18n, new ListDownloadTab(cheats));
if(hideStatus.find("tools") == hideStatus.end() || !hideStatus["tools"]) 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; }); this->registerAction("" , brls::Key::B, [this] { return true; });
} }

View file

@ -19,7 +19,7 @@ namespace i18n = brls::i18n;
using namespace i18n::literals; using namespace i18n::literals;
using json = nlohmann::json; 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){ if(!tag.empty() && tag != APP_VERSION){
updateApp = new brls::ListItem("menus/tool_update"_i18n + tag +")"); updateApp = new brls::ListItem("menus/tool_update"_i18n + tag +")");
@ -73,12 +73,14 @@ ToolsTab::ToolsTab(std::string tag) : brls::List()
downloadPayload->setHeight(LISTITEM_HEIGHT); downloadPayload->setHeight(LISTITEM_HEIGHT);
this->addView(downloadPayload); this->addView(downloadPayload);
rebootPayload = new brls::ListItem("menus/tool_inject"_i18n ); if(erista) {
rebootPayload->getClickEvent()->subscribe([&](brls::View* view){ rebootPayload = new brls::ListItem("menus/tool_inject"_i18n );
brls::Application::pushView(new PayloadPage()); rebootPayload->getClickEvent()->subscribe([&](brls::View* view){
}); brls::Application::pushView(new PayloadPage());
rebootPayload->setHeight(LISTITEM_HEIGHT); });
this->addView(rebootPayload); rebootPayload->setHeight(LISTITEM_HEIGHT);
this->addView(rebootPayload);
}
/* ntcp = new brls::ListItem("menus/ntcp"_i18n ); /* ntcp = new brls::ListItem("menus/ntcp"_i18n );
ntcp->getClickEvent()->subscribe([&](brls::View* view){ ntcp->getClickEvent()->subscribe([&](brls::View* view){

View file

@ -397,3 +397,28 @@ int removeDir(const char* path) {
} }
return 0; 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;
}
};