mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
Add deleteTitle and bootTitle.
**ONLY USE "DELETE TITLE" WHEN NEEDED!!!!!!!!!!!!!**
This commit is contained in:
+1
-8
@@ -2,7 +2,7 @@
|
||||
|
||||
bool updatingSelf = false;
|
||||
|
||||
static Result CIA_LaunchTitle(u64 titleId, FS_MediaType mediaType) {
|
||||
Result CIA_LaunchTitle(u64 titleId, FS_MediaType mediaType) {
|
||||
Result ret = 0;
|
||||
u8 param[0x300];
|
||||
u8 hmac[0x20];
|
||||
@@ -74,12 +74,6 @@ Result installCia(const char * ciaPath)
|
||||
AM_TitleEntry info;
|
||||
Result ret = 0;
|
||||
|
||||
ret = amInit();
|
||||
if (R_FAILED(ret)) {
|
||||
printf("Error in:\namInit();\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
FS_MediaType media = MEDIATYPE_SD;
|
||||
|
||||
ret = openFile(&fileHandle, ciaPath, false);
|
||||
@@ -140,6 +134,5 @@ Result installCia(const char * ciaPath)
|
||||
if (R_FAILED(ret = CIA_LaunchTitle(info.titleID, MEDIATYPE_SD)))
|
||||
return ret;
|
||||
}
|
||||
amExit();
|
||||
return 0;
|
||||
}
|
||||
@@ -148,4 +148,36 @@ bool ScriptHelper::checkIfValid(std::string scriptFile, int mode) {
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScriptHelper::deleteTitle(const std::string TitleID, bool isNAND, std::string message) {
|
||||
std::string MSG = Lang::get("DELETE_TITLE") + "\n\n";
|
||||
if (isNAND) MSG += Lang::get("MEDIATYPE_NAND") + "\n" + TitleID;
|
||||
else MSG += Lang::get("MEDIATYPE_SD") + "\n" + TitleID;
|
||||
u64 ID = std::stoull(TitleID, 0, 16);
|
||||
if (Msg::promptMsg(MSG)) {
|
||||
if (isNAND == true) {
|
||||
Msg::DisplayMsg(message);
|
||||
deletePrevious(ID, MEDIATYPE_NAND);
|
||||
} else {
|
||||
Msg::DisplayMsg(message);
|
||||
deletePrevious(ID, MEDIATYPE_SD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptHelper::bootTitle(const std::string TitleID, bool isNAND, std::string message) {
|
||||
std::string MSG = Lang::get("BOOT_TITLE") + "\n\n";
|
||||
if (isNAND) MSG += Lang::get("MEDIATYPE_NAND") + "\n" + TitleID;
|
||||
else MSG += Lang::get("MEDIATYPE_SD") + "\n" + TitleID;
|
||||
u64 ID = std::stoull(TitleID, 0, 16);
|
||||
if (Msg::promptMsg(MSG)) {
|
||||
if (isNAND == true) {
|
||||
Msg::DisplayMsg(message);
|
||||
CIA_LaunchTitle(ID, MEDIATYPE_NAND);
|
||||
} else {
|
||||
Msg::DisplayMsg(message);
|
||||
CIA_LaunchTitle(ID, MEDIATYPE_SD);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user