1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-09-07 23:07:25 +01:00

check for theme before (and not after) downloading firmware files

This commit is contained in:
HamletDuFromage 2024-04-03 17:34:09 +02:00
parent 841b32554b
commit 29d0131384
15 changed files with 76 additions and 56 deletions

View file

@ -6,7 +6,6 @@
class DialoguePage : public brls::View
{
private:
std::chrono::system_clock::time_point start = std::chrono::high_resolution_clock::now();
brls::NavigationMap navigationMap;
protected:
@ -34,12 +33,12 @@ private:
public:
DialoguePage_fw(brls::StagedAppletFrame* frame, const std::string& text) : DialoguePage(), text(text), frame(frame) { CreateView(); }
void draw(NVGcontext* vg, int x, int y, unsigned width, unsigned height, brls::Style* style, brls::FrameContext* ctx) override;
};
class DialoguePage_ams : public DialoguePage
{
private:
std::chrono::system_clock::time_point start = std::chrono::high_resolution_clock::now();
void instantiateButtons() override;
bool erista = true;
std::string text;
@ -47,4 +46,16 @@ private:
public:
DialoguePage_ams(brls::StagedAppletFrame* frame, const std::string& text, bool erista = true) : DialoguePage(), erista(erista), text(text), frame(frame) { CreateView(); }
void draw(NVGcontext* vg, int x, int y, unsigned width, unsigned height, brls::Style* style, brls::FrameContext* ctx) override;
};
class DialoguePage_confirm : public DialoguePage
{
private:
void instantiateButtons() override;
std::string text;
brls::StagedAppletFrame* frame;
public:
DialoguePage_confirm(brls::StagedAppletFrame* frame, const std::string& text) : DialoguePage(), text(text), frame(frame) { CreateView(); }
};

View file

@ -126,7 +126,7 @@
"update_bootloaders": "Bootloader aktualisieren",
"hekate_ipl_label": "Lade eine 'einfache Funktionierende' hekate_ipl.ini , Dies Überschreibt deine jetzige!",
"footer_text": "v{} | {:.1f}GB verfügbar",
"theme_warning": "Es scheint, dass ein benutzerdefiniertes Theme installiert ist, das dazu führen kann, dass das System nach dem Upgrade der Firmware nicht mehr startet. Bitte lösche das Theme vor dem Upgrade.",
"theme_warning": "Es scheint, dass ein benutzerdefiniertes Theme installiert ist, das dazu führen kann, dass das System nach dem Upgrade der Firmware nicht mehr startet. Bitte lösche das Theme vor dem Upgrade.\n\nDo you wish to proceed regardless?",
"payloads_label": "\u25c6 RCM-Payloads herunterladen in {}"
},
"hide": {

View file

@ -135,7 +135,7 @@
"tools": "Tools",
"launch_warning": "Please pay attention to the following points before using the app:\n\n\u25c6 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\u25c6 In order to avoid any risk of data corruption, using this app on an exFAT SD card is STRONGLY discouraged.\n\n\u25c6 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.",
"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.\n\nDo you wish to proceed regardless?",
"payloads_label": "\u25c6 Download RCM payloads to {}",
"hekate_ipl_label": "\u25c6 Download a stripped down \"just works\" hekate_ipl.ini config file. This will overwrite your current hekate_ipl.ini."
},

View file

@ -136,7 +136,7 @@
"tools": "Herramientas",
"launch_warning": "Por favor, presta atención a los siguientes puntos antes de usar la app:\n\n\u25c6 Lee primero sobre cómo actualizar manualmente tu Switch. Esto te ayudará a entender mejor lo que hace esta app y sabrás qué hacer en caso de que algo salga mal.\n\u25c6 Para evitar cualquier riesgo de corrupción de datos se desaconseja encarecidamente utilizar esta aplicación en una tarjeta SD exFAT.\n\n\u25c6 La última información sobre las características introducidas y/o cambios está disponible en el menú Herramientas→Cambios.\n\nEsta pantalla no se mostrará de nuevo.",
"footer_text": "v{} | {:.1f}GB Disponibles",
"theme_warning": "Parece que tienes instalado un tema personalizado. Esto puede causar que el sistema falle al inciar tras actualizar el firmware.\nPor favor, plantéate borrar el tema antes de actualizar.",
"theme_warning": "Parece que tienes instalado un tema personalizado. Esto puede causar que el sistema falle al inciar tras actualizar el firmware.\nPor favor, plantéate borrar el tema antes de actualizar.\n\nDo you wish to proceed regardless?",
"payloads_label": "\u25c6 Descarga 'RCM payloads' a {}",
"hekate_ipl_label": "\u25c6 Descarga un hekate_ipl.ini básico \"funcional\". Esto sobrescribirá tu hekate_ipl.ini actual."
},

View file

@ -133,7 +133,7 @@
"tools": "Outils",
"launch_warning": "Veuillez prendre connaissance des points suivants avant d'utiliser cette application :\n\n Renseignez-vous d'abord sur le processus de mise à jour manuel de la Switch. Cela vous aidera à mieux comprendre le fonctionnement de l'application et savoir quoi faire en cas de problème.\n Afin d'éviter tout risque de corruption de données, l'utilisation de cette application avec une carte SD formatée en exFAT est FORTEMENT déconseillé.\n\n Les dernières informations à propos des fonctionnalités ajoutées et/ou modifiées sont disponibles dans le menu Outils→Journal des modifications.\n\nCet écran ne sera pas réaffiché.",
"footer_text": "v{} | {:.1f}Go disponibles",
"theme_warning": "Il semblerait que vous avez installé un thème personnalisé, cela pourrait empêcher le système de démarrer après la mise à jour de votre firmware.\nIl est conseillé de le supprimer avant d'effectuer la mise à jour.",
"theme_warning": "Il semblerait que vous avez installé un thème personnalisé, cela pourrait empêcher le système de démarrer après la mise à jour de votre firmware.\nIl est conseillé de le supprimer avant d'effectuer la mise à jour.\n\nSouhaitez-vous tout de même poursuivre l'installation?",
"payloads_label": "◆ Enregistrer les payloads RCM sous {}",
"hekate_ipl_label": "◆ Télécharger une version minimale et prête à l'emploi du fichier de configuration hekate_ipl.ini. Le fichier hekate_ipl.ini déjà présent sera écrasé.",
"get_cheats_gfx": "Télécharger des cheats d'amélioration des graphismes",

View file

@ -129,7 +129,7 @@
"tools": "Strumenti",
"launch_warning": "Per favore presta attenzione ai seguenti punti prima di utilizzare l'app:\n\n\u25c6 Informati su come effettuare l'aggiornamento manuale della tua console. Ti aiuterà a comprendere meglio l'app e saprai cosa fare in caso di errori.\n\u25c6 Per scongiurare ogni rischio di perdita dei dati, scoraggiamo FORTEMENTE l'utilizzo di questa app su una scheda SD exFAT.\n\n\u25c6 Puoi trovare informazioni sulle funzioni introdotte e/o modificate negli ultimi aggiornamenti nel menu Strumenti→Cronologia aggiornamenti.\n\nQuesta schermata non verrà mostrata di nuovo.",
"footer_text": "v{} | {:.1f}GB disponibili",
"theme_warning": "Sembra che tu stia usando un custom theme: tieni conto che potrebbe impedire l'avvio del sistema dopo l'aggiornamento del firmware.\nValuta se cancellarlo o meno prima di effettuare l'aggiornamento.",
"theme_warning": "Sembra che tu stia usando un custom theme: tieni conto che potrebbe impedire l'avvio del sistema dopo l'aggiornamento del firmware.\nValuta se cancellarlo o meno prima di effettuare l'aggiornamento.\n\nDo you wish to proceed regardless?",
"payloads_label": "\u25c6 Scarica ed aggiorna i payload RCM in {}",
"hekate_ipl_label": "\u25c6 Scarica una configurazione di base di hekate_ipl.ini. Sovrascriverà l'attuale configurazione presente in hekate_ipl.ini."
},

View file

@ -127,7 +127,7 @@
"tools": "ツール",
"launch_warning": "アプリを使用する前に、次の点に注意をしてください:\n\n\u25c6 始めにSwitchを手動で更新する方法を読んでください。それでアプリをしっかりと理解し、問題が発生した場合の対処方法を知る事ができます。\n\u25c6 exFATのSDカードでこのアプリの使用は推奨しません。理由はデータが破損をする可能性が高いためです。\n\n\u25c6 現在の機能に関するいくつかの新しい機能および変更が導入されている可能性があります。 「ツール」→「変更履歴」から確認をしてください。\n\nこの画面は再度表示されません。",
"footer_text": "v{} | {:.1f}GB 利用可能",
"theme_warning": "カスタムテーマがインストールされているようです。これにより、ファームウェアのアップグレード後にシステムの起動に失敗をする可能性があります。\nアップグレード前に削除を検討してください。",
"theme_warning": "カスタムテーマがインストールされているようです。これにより、ファームウェアのアップグレード後にシステムの起動に失敗をする可能性があります。\nアップグレード前に削除を検討してください。\n\nDo you wish to proceed regardless?",
"payloads_label": "\u25c6 RCMペイロードを{}にダウンロードします。",
"hekate_ipl_label": "\u25c6 換のhekate_ipl.iniの設定ファイルをダウンロード。 これにより、現在のhekate_ipl.iniが上書きされます。"
},

View file

@ -52,9 +52,9 @@
"show_cheat_files": "모든 치트 파일 표시",
"cheats_not_found": "이 빌드 ID와 일치하는 치트 코드를 찾을 수 없습니다.",
"old_cheats_found": "[ {}] BID(s)와 일치하는 치트 코드가 있습니다.",
"cheatslips_logout": "로그 아웃"
"gfx_title": "치트를 향상시키는 그래픽",
"get_gfx": "치트 코드를 향상시키는 개별 그래픽 다운로드"
"cheatslips_logout": "로그 아웃",
"gfx_title": "치트를 향상시키는 그래픽",
"get_gfx": "치트 코드를 향상시키는 개별 그래픽 다운로드"
},
"common": {
"downloading": "다운로드 중…",
@ -135,7 +135,7 @@
"tools": "도구",
"launch_warning": "앱을 사용하기 전에 다음 사항에 주의하세요:\n\n\u25c6 먼저 스위치를 수동으로 업데이트하는 방법을 읽어보세요. 이렇게 하면 앱을 더 잘 이해하는 데 도움이 되며 문제가 발생한 경우 어떻게 해야 하는지 알 수 있습니다.\n\u25c6 데이터 손상 위험을 방지하려면 exFAT SD 카드에서 이 앱을 사용하는 것을 적극 권장하지 않습니다.\n\n\u25c6 도입 및/또는 변경된 기능에 대한 최신 정보는 도구→변경기록 메뉴에서 확인할 수 있습니다.\n\n이 화면은 다시 표시되지 않습니다.",
"footer_text": "v{} | {:.1f}GB 사용 가능",
"theme_warning": "사용자 정의 테마가 설치된 것 같습니다. 이로 인해 펌웨어를 업그레이드한 후 시스템이 부팅되지 않을 수 있습니다.\n업그레이드하기 전에 삭제를 고려하세요.",
"theme_warning": "사용자 정의 테마가 설치된 것 같습니다. 이로 인해 펌웨어를 업그레이드한 후 시스템이 부팅되지 않을 수 있습니다.\n업그레이드하기 전에 삭제를 고려하세요.\n\nDo you wish to proceed regardless?",
"payloads_label": "\u25c6 RCM 페이로드를 {}에 다운로드",
"hekate_ipl_label": "\u25c6 불필요한 것이 제거되고 호환 가능한 시그패치, \"그냥 작동\" hekate_ipl.ini 구성 파일을 다운로드하세요. 현재 hekate_ipl.ini를 덮어씁니다."
},

View file

@ -134,7 +134,7 @@
"tools": "Ferramentas",
"launch_warning": "Por favor, preste atenção nos seguintes pontos antes de usar o aplicativo:\n\n\u25c6 Leia sobre como atualizar manualmente seu Switch primeiro. Isso ajudará você a entender melhor o aplicativo e voc^e saberá o que fazer caso algo dê errado.\n\u25c6 Para evitar qualquer risco de corrupção de dados, é FORTEMENTE desencorajado usar este aplicativo em um cartão SD formatado como exFAT.\n\n\u25c6 As informações mais recentes sobre recursos que foram introduzidos e/ou alterados estão disponíveis no menu Ferramentas→Histórico de alterações.\n\nEsta tela não será exibida novamente.",
"footer_text": "v{} | {:.1f}GB disponíveis",
"theme_warning": "Parece que você tem um tema personalizado instalado, isso pode fazer com que seu sistema falhe ao inicializar após atualizar seu firmware.\nPor favor, considere excluí-lo antes de fazer a atualização.",
"theme_warning": "Parece que você tem um tema personalizado instalado, isso pode fazer com que seu sistema falhe ao inicializar após atualizar seu firmware.\nPor favor, considere excluí-lo antes de fazer a atualização.\n\nDo you wish to proceed regardless?",
"payloads_label": "\u25c6 Baixar payloads RCM para {}",
"hekate_ipl_label": "\u25c6 Baixar um arquivo de configuração hekate_ipl.ini simplificado. Isso substituirá o seu hekate_ipl.ini atual."
},

View file

@ -135,7 +135,7 @@
"tools": "Unelte",
"launch_warning": "Vă rugăm să acordați atenție următoarelor puncte înainte de a utiliza aplicația:\n\n\u25c6 Citiți mai întâi cum să actualizați manual Switch. Acest lucru vă va ajuta să înțelegeți mai bine aplicația și veți ști ce să faceți în cazul în care ceva nu merge bine.\n\u25c6 Pentru a evita orice risc de corupere a datelor, folosirea acestei aplicații pe un card SD exFAT este FORT descurajată.\n\n\u25c6 Cele mai recente informații despre funcțiile care au fost introduse și/sau modificat este disponibil în meniul Tools→Changelog.\n\nAcest ecran nu se va afișa din nou.",
"footer_text": "v{} | {:.1f}GB disponibil",
"theme_warning": "Se pare că aveți o temă personalizată instalată, acest lucru poate duce la eșecul sistemului dvs. de pornire după actualizarea firmware-ului.\nVă rugăm să o ștergeți înainte de a actualiza.",
"theme_warning": "Se pare că aveți o temă personalizată instalată, acest lucru poate duce la eșecul sistemului dvs. de pornire după actualizarea firmware-ului.\nVă rugăm să o ștergeți înainte de a actualiza.\n\nDo you wish to proceed regardless?",
"payloads_label": "\u25c6 Descărcați încărcăturile utile RCM pe {}",
"hekate_ipl_label": "\u25c6 Descărcați un fișier de configurare hekate_ipl.ini redus \"just works\". Aceasta va suprascrie actualul dvs. hekate_ipl.ini."
},

View file

@ -134,7 +134,7 @@
"tools": "Инструменты",
"launch_warning": "Перед использованием приложения:\n\n\u25c6 Прочитайте о том, как вручную обновить ваш Switch. Это поможет вам лучше понять приложение, и вы будете знать, что делать, если что-то пойдет не так.\n\u25c6 Во избежание риска повреждения данных, настоятельно не рекомендуется использовать это приложение на SD-карте, отформатированной в exFAT.\n\n\u25c6 Последняя информация о функциях, которые были представлены и/или изменены, доступны в меню Инструменты>Изменения.\n\nЭтот экран больше не появится.",
"footer_text": "v{} | {:.1f}GB доступно",
"theme_warning": "Похоже, что у вас установлена пользовательская тема, это может привести к тому, что ваша система не загрузится после обновления прошивки.\nПожалуйста, удалите ее перед обновлением.",
"theme_warning": "Похоже, что у вас установлена пользовательская тема, это может привести к тому, что ваша система не загрузится после обновления прошивки.\nПожалуйста, удалите ее перед обновлением.\n\nDo you wish to proceed regardless?",
"payloads_label": "\u25c6 Загрузить payload-ы для RCM в {}",
"hekate_ipl_label": "\u25c6 Загрузите базовый \u25c6 \"рабочий\" файл конфигурации hekate_ipl.ini. Он перезапишет ваш текущий hekate_ipl.ini."
},

View file

@ -135,7 +135,7 @@
"tools": "工具",
"launch_warning": "使用此程序前请注意以下几点:\n\n\u25c6 首先阅读如何手动更新您的 Switch。这将有助于您更好地理解此程序您将知道在出现问题时该怎么做。\n\u25c6 为了避免任何数据损坏的风险,强烈建议不要在 exFAT 格式的 SD 卡上使用此程序。\n\n\u25c6 有关已支持和已更改的功能的最新更新可在 工具 → 更新日志 菜单中查看。\n\n该说明下次将不再显示。",
"footer_text": "v{} | {:.1f} GB 可用",
"theme_warning": "您似乎安装了一个自定义主题,这可能会导致您的系统在升级固件后无法启动。\n请考虑在升级之前将其删除。",
"theme_warning": "您似乎安装了一个自定义主题,这可能会导致您的系统在升级固件后无法启动。\n请考虑在升级之前将其删除。\n\nDo you wish to proceed regardless?",
"payloads_label": "\u25c6 下载 RCM payloads 到 {}",
"hekate_ipl_label": "\u25c6 下载一个精简的 \"够用\"的 hekate_ipl.ini 配置文件。这将覆盖您当前的 hekate_ipl.ini。"
},

View file

@ -135,7 +135,7 @@
"tools": "工具",
"launch_warning": "在開始使用此app前請務必注意\n\n\u25c6 請先閱讀有關如何手動更新Switch系統的文件協助你瞭解app提供的各項功能以及發生問題時如何排除。\n\u25c6 請注意我們非常不建議在exFAT格式的記憶卡上使用此app可能會因此產生錯誤或執行中斷。\n\n\u25c6 程式版本更新時會加入新的功能,也會改善現有的功能。請由選單內的 工具→更新履歷 前往檢視詳細內容。\n\n此提醒畫面將不再顯示。",
"footer_text": "v{} | {:.1f}GB 可用",
"theme_warning": "偵測已安裝自訂主題,更新系統韌體版本後,可能無法導致正常開機。\n建議更新系統前移除自訂主題並改回預設。",
"theme_warning": "偵測已安裝自訂主題,更新系統韌體版本後,可能無法導致正常開機。\n建議更新系統前移除自訂主題並改回預設。\n\nDo you wish to proceed regardless?",
"payloads_label": "\u25c6 下載RCM引導程序至 {}",
"hekate_ipl_label": "\u25c6 下載精簡且 \"可正常使用\" 的hekate_ipl.ini 配置檔案。此操作將會覆蓋系統目前使用的hekate_ipl.ini檔案。"
},

View file

@ -39,19 +39,6 @@ void DialoguePage::draw(NVGcontext* vg, int x, int y, unsigned width, unsigned h
{
this->label->frame(ctx);
this->button1->frame(ctx);
auto end = std::chrono::high_resolution_clock::now();
auto missing = std::max(1l - std::chrono::duration_cast<std::chrono::seconds>(end - start).count(), 0l);
auto text = std::string("menus/common/no"_i18n);
if (missing > 0) {
this->button2->setLabel(text + " (" + std::to_string(missing) + ")");
this->button2->setState(brls::ButtonState::DISABLED);
}
else {
this->button2->setLabel(text);
this->button2->setState(brls::ButtonState::ENABLED);
}
this->button2->invalidate();
this->button2->frame(ctx);
}
@ -77,8 +64,6 @@ void DialoguePage::layout(NVGcontext* vg, brls::Style* style, brls::FontStash* s
style->CrashFrame.buttonWidth,
style->CrashFrame.buttonHeight);
this->button2->invalidate();
start = std::chrono::high_resolution_clock::now() + std::chrono::milliseconds(150);
}
brls::View* DialoguePage::getDefaultFocus()
@ -119,6 +104,27 @@ void DialoguePage_ams::instantiateButtons()
});
this->label = new brls::Label(brls::LabelStyle::DIALOG, "menus/ams_update/install_hekate"_i18n + "\n\n" + this->text, true);
start = std::chrono::high_resolution_clock::now() + std::chrono::milliseconds(150);
}
void DialoguePage_ams::draw(NVGcontext* vg, int x, int y, unsigned width, unsigned height, brls::Style* style, brls::FrameContext* ctx)
{
this->label->frame(ctx);
this->button1->frame(ctx);
auto end = std::chrono::high_resolution_clock::now();
auto missing = std::max(1l - std::chrono::duration_cast<std::chrono::seconds>(end - start).count(), 0l);
auto text = std::string("menus/common/no"_i18n);
if (missing > 0) {
this->button2->setLabel(text + " (" + std::to_string(missing) + ")");
this->button2->setState(brls::ButtonState::DISABLED);
}
else {
this->button2->setLabel(text);
this->button2->setState(brls::ButtonState::ENABLED);
}
this->button2->invalidate();
this->button2->frame(ctx);
}
void DialoguePage_fw::instantiateButtons()
@ -140,9 +146,19 @@ void DialoguePage_fw::instantiateButtons()
this->label = new brls::Label(brls::LabelStyle::DIALOG, fmt::format("{}\n\n{}", this->text, "menus/firmware/launch_daybreak"_i18n), true);
}
void DialoguePage_fw::draw(NVGcontext* vg, int x, int y, unsigned width, unsigned height, brls::Style* style, brls::FrameContext* ctx)
void DialoguePage_confirm::instantiateButtons()
{
this->label->frame(ctx);
this->button1->frame(ctx);
this->button2->frame(ctx);
this->button1->getClickEvent()->subscribe([this](View* view) {
if (!frame->isLastStage())
frame->nextStage();
else {
brls::Application::pushView(new MainFrame());
}
});
this->button2->getClickEvent()->subscribe([this](View* view) {
brls::Application::pushView(new MainFrame());
});
this->label = new brls::Label(brls::LabelStyle::DIALOG, this->text, true);
}

View file

@ -68,6 +68,14 @@ 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::fw) {
std::string contentsPath = util::getContentsPath();
for (const auto& tid : {"0100000000001000", "0100000000001007", "0100000000001013"}) {
if (std::filesystem::exists(contentsPath + tid) && !std::filesystem::is_empty(contentsPath + tid)) {
stagedFrame->addStage(new DialoguePage_confirm(stagedFrame, "menus/main/theme_warning"_i18n));
}
}
}
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); }));
@ -86,26 +94,11 @@ void ListDownloadTab::createList(contentType type)
}
std::string doneMsg = "menus/common/all_done"_i18n;
switch (type) {
case contentType::fw: {
std::string contentsPath = util::getContentsPath();
for (const auto& tid : {"0100000000001000", "0100000000001007", "0100000000001013"}) {
if (std::filesystem::exists(contentsPath + tid) && !std::filesystem::is_empty(contentsPath + tid)) {
doneMsg += "\n" + "menus/main/theme_warning"_i18n;
break;
}
}
if (std::filesystem::exists(DAYBREAK_PATH)) {
stagedFrame->addStage(new DialoguePage_fw(stagedFrame, doneMsg));
}
else {
stagedFrame->addStage(new ConfirmPage_Done(stagedFrame, doneMsg));
}
break;
}
default:
stagedFrame->addStage(new ConfirmPage_Done(stagedFrame, doneMsg));
break;
if (type == contentType::fw && std::filesystem::exists(DAYBREAK_PATH)) {
stagedFrame->addStage(new DialoguePage_fw(stagedFrame, doneMsg));
}
else {
stagedFrame->addStage(new ConfirmPage_Done(stagedFrame, doneMsg));
}
brls::Application::pushView(stagedFrame);
});