From b6b7b45c32736d1d8f1ca8cb1d4b1498a2ac6188 Mon Sep 17 00:00:00 2001 From: flb Date: Sun, 20 Feb 2022 16:33:54 +0100 Subject: [PATCH] add hekate_ipl download --- Makefile | 2 +- include/constants.hpp | 3 ++- include/download_cheats_page.hpp | 2 ++ resources/i18n/de/menus.json | 2 +- resources/i18n/en-US/menus.json | 8 ++++--- resources/i18n/es/menus.json | 2 +- resources/i18n/fr/menus.json | 2 +- resources/i18n/it/menus.json | 2 +- resources/i18n/ja/menus.json | 2 +- resources/i18n/pl/menus.json | 2 +- resources/i18n/pt-BR/menus.json | 2 +- resources/i18n/zh-CN/menus.json | 2 +- resources/i18n/zh-TW/menus.json | 2 +- source/changelog_page.cpp | 3 +++ source/download_cheats_page.cpp | 37 +++++++++++++++++++++++--------- source/list_download_tab.cpp | 20 ++++++++++++++--- 16 files changed, 66 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index 079b54d..db9f8c8 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ DATA := data INCLUDES := include lib/zipper/include /lib/borealis/library/include/borealis/extern/nlohmann APP_TITLE := All-in-One Switch Updater APP_AUTHOR := HamletDuFromage -APP_VERSION := 2.16.3 +APP_VERSION := 2.17.0 TARGET := $(notdir $(CURDIR)) ROMFS := resources diff --git a/include/constants.hpp b/include/constants.hpp index c135308..5db2f20 100644 --- a/include/constants.hpp +++ b/include/constants.hpp @@ -115,9 +115,10 @@ enum class contentType bootloaders, ams_cfw, payloads, + hekate_ipl, }; -constexpr std::string_view contentTypeNames[7]{"sigpatches", "cheats", "firmwares", "app", "bootloaders", "cfws", "payloads"}; +constexpr std::string_view contentTypeNames[8]{"sigpatches", "cheats", "firmwares", "app", "bootloaders", "cfws", "payloads", "hekate_ipl"}; enum class CFW { diff --git a/include/download_cheats_page.hpp b/include/download_cheats_page.hpp index ce9d747..e20f2c7 100644 --- a/include/download_cheats_page.hpp +++ b/include/download_cheats_page.hpp @@ -34,6 +34,8 @@ protected: void GetBuildIDFromFile(); void WriteCheats(const std::string& cheatContent); void AddCheatsfileListItem(); + void ShowBidNotFound(); + void ShowCheatsNotFound(); typedef struct { diff --git a/resources/i18n/de/menus.json b/resources/i18n/de/menus.json index 5510c61..d2d6b02 100644 --- a/resources/i18n/de/menus.json +++ b/resources/i18n/de/menus.json @@ -109,7 +109,7 @@ "cheats_text": "\ue016 Lade ein täglich geupdatetes Archiv von 'gbatemp.net' runter. Cheats von Spielen, die du nicht besitzt, werden nicht entpackt. Du kannst Updates für ausgewählte Spiele unter 'Tools->Cheat Menü' deaktivieren.\n\ue016 Momentane Cheatversion: ", "get_cheats": "Lade GBAtemp.net Cheatarchiv herunter (ver {})", "sigpatches": "Sigpatches", - "sigpatches_text": "\ue016 Sigpatches erlauben dir, inoffizielle NSPs zu installieren und starten. Stelle sicher, dass du die korrekten Patches für dein Setup auswählst (reines Atmosphère or Atmosphère+Hekate). Starte die Konsole neu, um die Patches zu aktivieren.", + "sigpatches_text": "\ue016 Sigpatches erlauben dir, inoffizielle NSPs zu installieren und starten. Starte die Konsole neu, um die Patches zu aktivieren.", "firmware": "Firmware", "not_found": "Nicht gefunden", "latest_cheats": "Neueste Version", diff --git a/resources/i18n/en-US/menus.json b/resources/i18n/en-US/menus.json index dcda499..f0ade00 100644 --- a/resources/i18n/en-US/menus.json +++ b/resources/i18n/en-US/menus.json @@ -46,7 +46,8 @@ "show_existing": "Show existing", "delete_cheats": "Delete cheats for this game", "deletion_error": "Couldn't delete the cheat files for game with ID:\n{}", - "show_cheat_files": "Show all cheat files" + "show_cheat_files": "Show all cheat files", + "cheats_not_found": "Couldn't find cheat codes matching this build ID." }, "common": { "downloading": "Downloading…", @@ -108,7 +109,7 @@ "get_cheats": "Download GBAtemp.net cheat archive (ver {})", "get_all_cheats:": "Download GBAtemp.net cheat archive", "sigpatches": "sigpatches", - "sigpatches_text": "\ue016 Sigpatches allow your Switch to install and run unofficial NSP files. Make sure you pick the correct sigpatches for your setup (Atmosphère only or Hekate+Atmosphère). Reboot the console to apply patches.", + "sigpatches_text": "\ue016 Sigpatches allow your Switch to install and run unofficial NSP files. Reboot the console to apply patches.", "firmware": "firmware", "not_found": "not found", "latest_cheats": "Latest version", @@ -132,7 +133,8 @@ "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 In order to avoid any risk of data corruption, using this app on an exFAT SD card is STRONGLY discouraged.\n\n\ue016 The latest information about features that have been introduced and/or changed is available in the Tools->Changelog menu.\n\nThis screen won't show again.", "footer_text": "v{} | {:.1f}GB available", "theme_warning": "It seems like you have a custom theme installed, this may cause your system to fail to boot after upgrading your firmware.\nPlease consider deleting it before upgrading.", - "payloads_label": "\ue016 Download RCM payloads to {}" + "payloads_label": "\ue016 Download RCM payloads to {}", + "hekate_ipl_label": "\ue016 Download a stripped down, sigpatches compatibles, \"just works\" hekate_ipl.ini config file. This will overwrite your current hekate_ipl.ini." }, "hide": { "title": "Hide tabs", diff --git a/resources/i18n/es/menus.json b/resources/i18n/es/menus.json index 794129c..e24ceba 100644 --- a/resources/i18n/es/menus.json +++ b/resources/i18n/es/menus.json @@ -60,7 +60,7 @@ "firmware_text": "\ue016 Firmwares de 'https://darthsternie.net/switch-firmwares/'. Una vez descargado, será extraído en '/firmware'. Entonces podrás instalar la actualización a través de Daybreak.\n\ue016 FW actual: ", "cheats_text": "\ue016 Esto descargará un paquete actualizado diario de trucos de 'gbatemp.net'. Los trucos de juegos que no tienes instalados no se extraerán a tu tarjeta SD. Puedes desactivar los trucos actualizados en 'Herramientas->Menú de trucos'.\n\ue016 Versión de trucos actual: ", "sigpatches": "sigpatches", - "sigpatches_text": "\ue016 Los sigpatches permiten a tu Switch instalar y ejecutar archivos NSP no oficiales. Asegúrate de escoger los sigpatches correctos para tu configuración (Atmosphère puro o Hekate+Atmosphère).", + "sigpatches_text": "\ue016 Los sigpatches permiten a tu Switch instalar y ejecutar archivos NSP no oficiales. Reiniciar para aplicar los cambios.", "firmware": "firmware", "not_found": "no encontrado", "latest_cheats": "Última versión", diff --git a/resources/i18n/fr/menus.json b/resources/i18n/fr/menus.json index f076bcb..da73f5f 100644 --- a/resources/i18n/fr/menus.json +++ b/resources/i18n/fr/menus.json @@ -108,7 +108,7 @@ "get_cheats": "Télécharger l'archive de codes de triche de GBAtemp.net (ver {})", "get_all_cheats:": "Télécharger l'archive de codes de triche de GBAtemp.net", "sigpatches": "sigpatches", - "sigpatches_text": "\u25c6 Les sigpatches permettent à la Switch d'installer et d'exécuter des fichiers NSP non officiels. Assurez-vous de choisir les bons sigpatches pour votre configuration (Atmosphère seul ou Hekate+Atmosphère). Redémarrez la console pour appliquer les patches.", + "sigpatches_text": "\u25c6 Les sigpatches permettent à la Switch d'installer et d'exécuter des fichiers NSP non officiels. Redémarrez la console pour appliquer les patches.", "firmware": "firmware", "not_found": "non trouvé", "latest_cheats": "Dernière version", diff --git a/resources/i18n/it/menus.json b/resources/i18n/it/menus.json index e607397..7563cdc 100644 --- a/resources/i18n/it/menus.json +++ b/resources/i18n/it/menus.json @@ -60,7 +60,7 @@ "firmware_text": "\ue016 il dump del Firmware da 'https://darthsternie.net/switch-firmwares/'. Una volta scaricato, sarà estratto in '/firmware'. Puoi installare l'aggiornamento tramite Daybreak.\n\ue016 FW attuale: ", "cheats_text": "\ue016 Questo scaricherà quotidianamente un archivio di cheat da 'gbatemp.net'. I cheat per i giochi non installati non saranno estratti sulla tua scheda SD. Puoi disabilitare l'aggiornamento dei cheat in 'Tools->Cheat menu'.\n\ue016 Current cheats version: ", "sigpatches": "sigpatches", - "sigpatches_text": "\ue016 Le sigpatches consentono di installare ed eseguire NSP non ufficiali sulla Switch. Assicurati di scegliere le sigpatches corrette per la tua configurazione (solo Atmosphère o Hekate+Atmosphère).", + "sigpatches_text": "\ue016 Le sigpatches consentono di installare ed eseguire NSP non ufficiali sulla Switch.", "firmware": "firmware", "not_found": "non trovato", "latest_cheats": "Ultima versione", diff --git a/resources/i18n/ja/menus.json b/resources/i18n/ja/menus.json index 77552c0..4ddb452 100644 --- a/resources/i18n/ja/menus.json +++ b/resources/i18n/ja/menus.json @@ -108,7 +108,7 @@ "get_cheats": "GBAtemp.net チートアーカイブをダウンロード (ver {})", "get_all_cheats:": "GBAtemp.net チートアーカイブをダウンロードする", "sigpatches": "sigpatch", - "sigpatches_text": "\ue016 Sigpatchを使用すると、スイッチで非公式のNSPファイルをインストールして実行できます。\nセットアップに適したsigpatchを選択してください(AtmosphèreまたはHekate + Atmosphère)。", + "sigpatches_text": "\ue016 Sigpatchを使用すると、スイッチで非公式のNSPファイルをインストールして実行できます。", "firmware": "FW", "not_found": "見つかりませんでした", "latest_cheats": "最新バージョン", diff --git a/resources/i18n/pl/menus.json b/resources/i18n/pl/menus.json index 962e627..a9865ff 100644 --- a/resources/i18n/pl/menus.json +++ b/resources/i18n/pl/menus.json @@ -91,7 +91,7 @@ "cheats_text": "\ue016 Pobierze aktualizowaną codziennie paczkę cheatów z 'gbatemp.net'. Cheaty dla gier których nie masz zainstalowanych nie zostaną wypakowane na twoją kartę SD. Możesz wyłączyć aktualizację cheatów dla poszczególnych gier w 'Narzędzia->Menu cheatów'.\n\ue016 Bieżąca wersja cheatów: ", "get_cheats": "Pobierz archiwum cheatów GBAtemp.net (wersja {})", "sigpatches": "sigpatche", - "sigpatches_text": "\ue016 Sigpatche umożliwiają twojemu Switchowi instalowanie i uruchamianie nieoficjalnych plików NSP. Upewnij się, że wybierasz sigpatche zgodne z twoim setupem (czysty Atmosph\u00e8re lub Hekate+Atmosph\u00e8re). Uruchom konsolę ponownie aby zastosować zmiany.", + "sigpatches_text": "\ue016 Sigpatche umożliwiają twojemu Switchowi instalowanie i uruchamianie nieoficjalnych plików NSP. Uruchom konsolę ponownie aby zastosować zmiany.", "firmware": "firmware", "not_found": "nie znaleziono", "latest_cheats": "Najnowsza wersja", diff --git a/resources/i18n/pt-BR/menus.json b/resources/i18n/pt-BR/menus.json index 9ad0ee5..a1b482a 100644 --- a/resources/i18n/pt-BR/menus.json +++ b/resources/i18n/pt-BR/menus.json @@ -60,7 +60,7 @@ "firmware_text": "\ue016 Firmwares de 'https://darthsternie.net/switch-firmwares/'. Depois de baixado, ele será extraído para '/firmware'. Você pode então instalar a atualização por meio do Daybreak ou.\n\ue016 FW atual: ", "cheats_text": "\ue016 Isso irá baixar um pacote de cheat atualizado diariamente do 'gbatemp.net'. Os cheats do jogo que você não instalou não serão extraídos para o seu cartão SD. Você pode desabilitar cheats atualizados em 'Ferramentas->Trapaças'.\n\ue016 Versão das trapaças atual: ", "sigpatches": "sigpatches", - "sigpatches_text": "\ue016 Os Sigpatches permitem que o Switch instale e execute arquivos NSP não oficiais. Certifique-se de escolher os sigpatches corretos para sua configuração (Atmosphère Puro ou Hekate+Atmosphère).", + "sigpatches_text": "\ue016 Os Sigpatches permitem que o Switch instale e execute arquivos NSP não oficiais.", "firmware": "firmware", "not_found": "não encontrado", "latest_cheats": "Última versão", diff --git a/resources/i18n/zh-CN/menus.json b/resources/i18n/zh-CN/menus.json index cd1c260..b67e0b2 100644 --- a/resources/i18n/zh-CN/menus.json +++ b/resources/i18n/zh-CN/menus.json @@ -68,7 +68,7 @@ "latest_cheats": "最新版本", "app": "应用", "cfw": "自制系统", - "cfw_text": "\ue016 主要 Switch 破解系统. 如果你使用 Atmosphère with Hekate, 下载 Atmosphère, 然后 Hekate.", + "cfw_text": "\ue016 主要 Switch 破解系统.", "cheats": "金手指", "links_not_found": "如果点击功能后,界面没有反应,确保switch已经连接互联网\n如果问题依然存在\n请到GitHub(https://github.com/HamletDuFromage/AIO-switch-updater)上为作者提交issue.", "new_update": " - 最版本可用,请更新最新版本", diff --git a/resources/i18n/zh-TW/menus.json b/resources/i18n/zh-TW/menus.json index f6bd747..3ef2a41 100644 --- a/resources/i18n/zh-TW/menus.json +++ b/resources/i18n/zh-TW/menus.json @@ -108,7 +108,7 @@ "get_cheats:": "下載GBAtemp.net金手指資料庫 (版本 {})", "get_all_cheats": "下載GBAtemp.net金手指資料庫", "sigpatches": "sigpatches", - "sigpatches_text": "\ue016 Sigpatches可讓你的Switch安裝並執行非官方的NSP檔案。請確認你安裝過程中使用合適的sigpatches(Pure Atmosphère或Hekate+Atmosphère)。安裝完成後請重新開機以套用更新", + "sigpatches_text": "\ue016 Sigpatches可讓你的Switch安裝並執行非官方的NSP檔案。安裝完成後請重新開機以套用更新", "firmware": "韌體", "not_found": "沒有符合的項目", "latest_cheats": "最新版本", diff --git a/source/changelog_page.cpp b/source/changelog_page.cpp index e5e85e6..f5f7b16 100644 --- a/source/changelog_page.cpp +++ b/source/changelog_page.cpp @@ -223,6 +223,9 @@ ChangelogPage::ChangelogPage() : AppletFrame(true, true) verTitles.push_back("v2.16.3"); changes.push_back("\uE016 Fetch default profiles online for joy-con and pro-con color swaps.\n\uE016 Updated french localization (https://github.com/NotaInutilis)."); + verTitles.push_back("v2.17.0"); + changes.push_back("\uE016 Add ability to download a basic hekate_ipl file.\n\uE016 Add error messages when cheats are not found for a game."); + for (int i = verTitles.size() - 1; i >= 0; i--) { listItem = new brls::ListItem(verTitles[i]); change = changes[i]; diff --git a/source/download_cheats_page.cpp b/source/download_cheats_page.cpp index 0dfdd90..be59ab2 100644 --- a/source/download_cheats_page.cpp +++ b/source/download_cheats_page.cpp @@ -103,6 +103,7 @@ namespace show_cheats { { std::filesystem::remove(fmt::format("{}{:016X}/cheats/{}.txt", util::getContentsPath(), tid, bid)); } + } // namespace show_cheats DownloadCheatsPage::DownloadCheatsPage(uint64_t tid, const std::string& name) : AppletFrame(true, true), tid(tid), name(name) @@ -184,6 +185,24 @@ void DownloadCheatsPage::AddCheatsfileListItem() this->list->addView(item); } +void DownloadCheatsPage::ShowBidNotFound() +{ + brls::Label* label = new brls::Label( + brls::LabelStyle::REGULAR, + "menus/cheats/bid_not_found"_i18n, + true); + this->list->addView(label); +} + +void DownloadCheatsPage::ShowCheatsNotFound() +{ + brls::Label* label = new brls::Label( + brls::LabelStyle::REGULAR, + "menus/cheats/cheats_not_found"_i18n, + true); + this->list->addView(label); +} + DownloadCheatsPage_CheatSlips::DownloadCheatsPage_CheatSlips(uint64_t tid, const std::string& name) : DownloadCheatsPage(tid, name) { this->label = new brls::Label( @@ -212,14 +231,13 @@ DownloadCheatsPage_CheatSlips::DownloadCheatsPage_CheatSlips(uint64_t tid, const if (this->list->getViewsCount() > 1) this->list->addView(new brls::ListItemGroupSpacing(true)); } + else { + ShowCheatsNotFound(); + } } else { - this->label = new brls::Label( - brls::LabelStyle::REGULAR, - "menus/cheats/bid_not_found"_i18n, - true); - this->list->addView(label); + ShowBidNotFound(); } this->list->registerAction((this->bid != "") ? "menus/cheats/cheatslips_dl_cheats"_i18n : "brls/hints/back"_i18n, brls::Key::B, [this] { @@ -356,14 +374,13 @@ DownloadCheatsPage_GbaTemp::DownloadCheatsPage_GbaTemp(uint64_t tid, const std:: } this->list->addView(new brls::ListItemGroupSpacing(true)); } + else { + ShowCheatsNotFound(); + } } else { - label = new brls::Label( - brls::LabelStyle::REGULAR, - "menus/cheats/bid_not_found"_i18n, - true); - list->addView(label); + ShowBidNotFound(); } this->AddCheatsfileListItem(); this->setContentView(this->list); diff --git a/source/list_download_tab.cpp b/source/list_download_tab.cpp index d23cf93..7971a69 100644 --- a/source/list_download_tab.cpp +++ b/source/list_download_tab.cpp @@ -37,9 +37,15 @@ ListDownloadTab::ListDownloadTab(const contentType type, const nlohmann::ordered this->setDescription(contentType::payloads); this->createList(contentType::payloads); } + + if (this->type == contentType::sigpatches) { + this->setDescription(contentType::hekate_ipl); + this->createList(contentType::hekate_ipl); + } } -void ListDownloadTab::createList() { +void ListDownloadTab::createList() +{ ListDownloadTab::createList(this->type); } @@ -62,17 +68,22 @@ void ListDownloadTab::createList(contentType type) brls::StagedAppletFrame* stagedFrame = new brls::StagedAppletFrame(); stagedFrame->setTitle(fmt::format("menus/main/getting"_i18n, contentTypeNames[(int)type].data())); stagedFrame->addStage(new ConfirmPage(stagedFrame, text)); - if (type != contentType::payloads) { + if (type != contentType::payloads && type != contentType::hekate_ipl) { if (type != contentType::cheats || (this->newCheatsVer != this->currentCheatsVer && this->newCheatsVer != "offline")) { stagedFrame->addStage(new WorkerPage(stagedFrame, "menus/common/downloading"_i18n, [this, type, url]() { util::downloadArchive(url, type); })); } stagedFrame->addStage(new WorkerPage(stagedFrame, "menus/common/extracting"_i18n, [this, type]() { util::extractArchive(type, this->newCheatsVer); })); } - else { + else if (type == contentType::payloads) { fs::createTree(BOOTLOADER_PL_PATH); std::string path = std::string(BOOTLOADER_PL_PATH) + title; stagedFrame->addStage(new WorkerPage(stagedFrame, "menus/common/downloading"_i18n, [url, path]() { download::downloadFile(url, path, OFF); })); } + else if (type == contentType::hekate_ipl) { + fs::createTree(BOOTLOADER_PATH); + std::string path = std::string(BOOTLOADER_PATH) + title; + stagedFrame->addStage(new WorkerPage(stagedFrame, "menus/common/downloading"_i18n, [url, path]() { download::downloadFile(url, path, OFF); })); + } std::string doneMsg = "menus/common/all_done"_i18n; switch (type) { @@ -150,6 +161,9 @@ void ListDownloadTab::setDescription(contentType type) case contentType::payloads: description->setText(fmt::format("menus/main/payloads_label"_i18n, BOOTLOADER_PL_PATH)); break; + case contentType::hekate_ipl: + description->setText("menus/main/hekate_ipl_label"_i18n); + break; default: break; }