Add Borealis GUI for patch extraction on Switch.
All checks were successful
Build NRO / build (push) Successful in 1m48s

Replace the console UI with a Borealis-based flow, bundle ROMFS assets and
borealis as a submodule, and apply small upstream patches at build time.
Self-delete runs after romfsExit on quit so the NRO can be removed like the
old console build.
This commit is contained in:
2026-05-28 22:22:44 +02:00
parent 828edf6ad2
commit 2cf3db2097
19 changed files with 956 additions and 214 deletions

43
source/extractor.hpp Normal file
View File

@@ -0,0 +1,43 @@
#pragma once
#include <minizip/unzip.h>
#include <string>
class PatchExtractor {
public:
static constexpr const char* PATCHES_ZIP = "sdmc:/SaltySD/plugins/FPSLocker/patches.zip";
static constexpr const char* EXTRACT_DIR = "sdmc:/SaltySD/plugins/FPSLocker/";
static constexpr const char* SELF_NRO = "sdmc:/switch/PatchExtractor.nro";
bool open();
void close();
/** Process one zip entry. Returns false when finished or on fatal error. */
bool step();
bool isOpen() const { return zip != nullptr; }
unsigned long getTotal() const { return total; }
unsigned long getExtracted() const { return extracted; }
unsigned long getSkipped() const { return skipped; }
int getProgressPercent() const;
const std::string& getCurrentFile() const { return currentFile; }
bool isFinished() const { return finished; }
bool cleanup();
bool cleanupOk() const { return cleanupOk_; }
/** Call after the UI has shut down; releases romfs so the NRO file can be unlinked. */
static void tryDeleteSelfOnExit();
private:
static int mkdirs(const char* path);
unzFile zip = nullptr;
unsigned long total = 0;
unsigned long extracted = 0;
unsigned long skipped = 0;
int err = UNZ_OK;
bool finished = false;
bool cleanupOk_ = true;
std::string currentFile;
};