Universal-Updater -> DarkStore Part 2

Renamed Strings For DarkStore
Made .store Files Useable
This commit is contained in:
dark98
2021-09-09 16:23:22 +01:00
parent 76b41884c5
commit c894ff9924
61 changed files with 650 additions and 648 deletions
+25 -25
View File
@@ -463,11 +463,11 @@ void notConnectedMsg(void) { Msg::waitMsg(Lang::get("CONNECT_WIFI")); }
/*
Return, if an update is available.
const std::string &URL: Const Reference to the URL of the UniStore.
const std::string &URL: Const Reference to the URL of the Store.
int revCurrent: The current Revision. (-1 if unused)
*/
bool IsUpdateAvailable(const std::string &URL, int revCurrent) {
Msg::DisplayMsg(Lang::get("CHECK_UNISTORE_UPDATES"));
Msg::DisplayMsg(Lang::get("CHECK_STORE_UPDATES"));
Result ret = 0;
void *socubuf = memalign(0x1000, 0x100000);
@@ -539,19 +539,19 @@ bool IsUpdateAvailable(const std::string &URL, int revCurrent) {
}
/*
Download a UniStore and return, if revision is higher than current.
Download a Store and return, if revision is higher than current.
const std::string &URL: Const Reference to the URL of the UniStore.
const std::string &URL: Const Reference to the URL of the Store.
int currentRev: Const Reference to the current Revision. (-1 if unused)
std::string &fl: Output for the filepath.
bool isDownload: If download or updating.
bool isUDB: If Universal-DB download or not.
bool isDS: If Default store download or not.
*/
bool DownloadUniStore(const std::string &URL, int currentRev, std::string &fl, bool isDownload, bool isUDB) {
if (isUDB) Msg::DisplayMsg(Lang::get("DOWNLOADING_UNIVERSAL_DB"));
bool DownloadStore(const std::string &URL, int currentRev, std::string &fl, bool isDownload, bool isDS) {
if (isDS) Msg::DisplayMsg(Lang::get("DOWNLOADING_DEFAULT_STORE"));
else {
if (currentRev > -1) Msg::DisplayMsg(Lang::get("CHECK_UNISTORE_UPDATES"));
else Msg::DisplayMsg((isDownload ? Lang::get("DOWNLOADING_UNISTORE") : Lang::get("UPDATING_UNISTORE")));
if (currentRev > -1) Msg::DisplayMsg(Lang::get("CHECK_STORE_UPDATES"));
else Msg::DisplayMsg((isDownload ? Lang::get("DOWNLOADING_STORE") : Lang::get("UPDATING_STORE")));
}
if (URL.length() > 4) {
@@ -605,7 +605,7 @@ bool DownloadUniStore(const std::string &URL, int currentRev, std::string &fl, b
nlohmann::json parsedAPI = nlohmann::json::parse(result_buf);
if (parsedAPI.contains("storeInfo") && parsedAPI.contains("storeContent")) {
/* Ensure, version == _UNISTORE_VERSION. */
/* Ensure, version == _STORE_VERSION. */
if (parsedAPI["storeInfo"].contains("version") && parsedAPI["storeInfo"]["version"].is_number()) {
if (parsedAPI["storeInfo"]["version"] == 3 || parsedAPI["storeInfo"]["version"] == 4) {
if (currentRev > -1) {
@@ -614,7 +614,7 @@ bool DownloadUniStore(const std::string &URL, int currentRev, std::string &fl, b
const int rev = parsedAPI["storeInfo"]["revision"];
if (rev > currentRev) {
Msg::DisplayMsg(Lang::get("UPDATING_UNISTORE"));
Msg::DisplayMsg(Lang::get("UPDATING_STORE"));
if (parsedAPI["storeInfo"].contains("file") && parsedAPI["storeInfo"]["file"].is_string()) {
fl = parsedAPI["storeInfo"]["file"];
@@ -668,16 +668,16 @@ bool DownloadUniStore(const std::string &URL, int currentRev, std::string &fl, b
}
} else if (parsedAPI["storeInfo"]["version"] < 3) {
Msg::waitMsg(Lang::get("UNISTORE_TOO_OLD"));
Msg::waitMsg(Lang::get("STORE_TOO_OLD"));
} else if (parsedAPI["storeInfo"]["version"] > _UNISTORE_VERSION) {
Msg::waitMsg(Lang::get("UNISTORE_TOO_NEW"));
} else if (parsedAPI["storeInfo"]["version"] > _STORE_VERSION) {
Msg::waitMsg(Lang::get("STORE_TOO_NEW"));
}
}
} else {
Msg::waitMsg(Lang::get("UNISTORE_INVALID_ERROR"));
Msg::waitMsg(Lang::get("STORE_INVALID_ERROR"));
}
}
}
@@ -775,12 +775,12 @@ bool DownloadSpriteSheet(const std::string &URL, const std::string &file) {
}
/*
Checks for U-U updates.
Checks for DarkStore updates.
*/
UUUpdate IsUUUpdateAvailable() {
DSUpdate IsDSUpdateAvailable() {
if (!checkWifiStatus()) return { false, "", "" };
Msg::DisplayMsg(Lang::get("CHECK_UU_UPDATES"));
Msg::DisplayMsg(Lang::get("CHECK_DS_UPDATES"));
Result ret = 0;
void *socubuf = memalign(0x1000, 0x100000);
@@ -827,7 +827,7 @@ UUUpdate IsUUUpdateAvailable() {
nlohmann::json parsedAPI = nlohmann::json::parse(result_buf);
if (parsedAPI.contains("tag_name") && parsedAPI["tag_name"].is_string()) {
UUUpdate update = { false, "", "" };
DSUpdate update = { false, "", "" };
update.Version = parsedAPI["tag_name"];
socExit();
@@ -858,10 +858,10 @@ extern bool is3DSX, exiting;
extern std::string _3dsxPath;
/*
Execute U-U update action.
Execute DarkStore update action.
*/
void UpdateAction() {
UUUpdate res = IsUUUpdateAvailable();
DSUpdate res = IsDSUpdateAvailable();
if (res.Available) {
bool confirmed = false;
int scrollIndex = 0;
@@ -906,7 +906,7 @@ void UpdateAction() {
if (ScriptUtils::downloadRelease("DarkStore-3DS/DarkStore", (is3DSX ? "DarkStore.3dsx" : "DarkStore.cia"),
(is3DSX ? _3dsxPath : "sdmc:/DarkStore.cia"),
false, Lang::get("DONLOADING_UNIVERSAL_UPDATER"), true) == 0) {
false, Lang::get("DONLOADING_DARKSTORE"), true) == 0) {
if (is3DSX) {
Msg::waitMsg(Lang::get("UPDATE_DONE"));
@@ -914,7 +914,7 @@ void UpdateAction() {
return;
}
ScriptUtils::installFile("sdmc:/DarkStore.cia", false, Lang::get("INSTALL_UNIVERSAL_UPDATER"), true);
ScriptUtils::installFile("sdmc:/DarkStore.cia", false, Lang::get("INSTALL_DARKSTORE"), true);
ScriptUtils::removeFile("sdmc:/DarkStore.cia", Lang::get("DELETE_UNNEEDED_FILE"), true);
Msg::waitMsg(Lang::get("UPDATE_DONE"));
exiting = true;
@@ -934,10 +934,10 @@ static StoreList fetch(const std::string &entry, nlohmann::json &js) {
return store;
}
/*
Fetch store list for available UniStores.
Fetch store list for available Stores.
*/
std::vector<StoreList> FetchStores() {
Msg::DisplayMsg(Lang::get("FETCHING_RECOMMENDED_UNISTORES"));
Msg::DisplayMsg(Lang::get("FETCHING_RECOMMENDED_STORES"));
std::vector<StoreList> stores = { };
Result ret = 0;