mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Introduce SafeMode9
This commit is contained in:
parent
c010efb236
commit
b572dac3be
7
Makefile
7
Makefile
@ -17,6 +17,9 @@ include $(DEVKITARM)/ds_rules
|
|||||||
# SPECS is the directory containing the important build and link files
|
# SPECS is the directory containing the important build and link files
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
export TARGET := GodMode9
|
export TARGET := GodMode9
|
||||||
|
ifeq ($(MODE),safe)
|
||||||
|
export TARGET := SafeMode9
|
||||||
|
endif
|
||||||
BUILD := build
|
BUILD := build
|
||||||
SOURCES := source source/fatfs source/nand source/abstraction
|
SOURCES := source source/fatfs source/nand source/abstraction
|
||||||
DATA := data
|
DATA := data
|
||||||
@ -51,6 +54,10 @@ else ifeq ($(EXEC_METHOD),A9LH)
|
|||||||
LDFLAGS += --specs=../a9lh.specs
|
LDFLAGS += --specs=../a9lh.specs
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(MODE),safe)
|
||||||
|
CFLAGS += -DSAFEMODE
|
||||||
|
endif
|
||||||
|
|
||||||
LIBS :=
|
LIBS :=
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
20
source/fs.c
20
source/fs.c
@ -123,6 +123,10 @@ bool SetWritePermissions(u32 perm, bool add_perm) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (perm) {
|
switch (perm) {
|
||||||
|
case PERM_BASE:
|
||||||
|
if (!ShowUnlockSequence(1, "You want to enable base\nwriting permissions."))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
case PERM_SDCARD:
|
case PERM_SDCARD:
|
||||||
if (!ShowUnlockSequence(1, "You want to enable SD card\nwriting permissions."))
|
if (!ShowUnlockSequence(1, "You want to enable SD card\nwriting permissions."))
|
||||||
return false;
|
return false;
|
||||||
@ -138,6 +142,7 @@ bool SetWritePermissions(u32 perm, bool add_perm) {
|
|||||||
if (!ShowUnlockSequence(2, "You want to enable image\nwriting permissions.\nKeep backups, just in case."))
|
if (!ShowUnlockSequence(2, "You want to enable image\nwriting permissions.\nKeep backups, just in case."))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
#ifndef SAFEMODE
|
||||||
case PERM_SYSNAND:
|
case PERM_SYSNAND:
|
||||||
if (!ShowUnlockSequence(3, "!This is your only warning!\n \nYou want to enable SysNAND\nwriting permissions.\nThis enables you to do some\nreally dangerous stuff!\nHaving a SysNAND backup and\nNANDmod is recommended."))
|
if (!ShowUnlockSequence(3, "!This is your only warning!\n \nYou want to enable SysNAND\nwriting permissions.\nThis enables you to do some\nreally dangerous stuff!\nHaving a SysNAND backup and\nNANDmod is recommended."))
|
||||||
return false;
|
return false;
|
||||||
@ -146,10 +151,6 @@ bool SetWritePermissions(u32 perm, bool add_perm) {
|
|||||||
if (!ShowUnlockSequence(4, "!Better be careful!\n \nYou want to enable memory\nwriting permissions.\nWriting to certain areas may\nlead to unexpected results."))
|
if (!ShowUnlockSequence(4, "!Better be careful!\n \nYou want to enable memory\nwriting permissions.\nWriting to certain areas may\nlead to unexpected results."))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case PERM_BASE:
|
|
||||||
if (!ShowUnlockSequence(1, "You want to enable base\nwriting permissions."))
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
case PERM_ALL:
|
case PERM_ALL:
|
||||||
if (!ShowUnlockSequence(3, "!This is your only warning!\n \nYou want to enable ALL\nwriting permissions.\nThis enables you to do some\nreally dangerous stuff!\nHaving a SysNAND backup and\nNANDmod is recommended."))
|
if (!ShowUnlockSequence(3, "!This is your only warning!\n \nYou want to enable ALL\nwriting permissions.\nThis enables you to do some\nreally dangerous stuff!\nHaving a SysNAND backup and\nNANDmod is recommended."))
|
||||||
return false;
|
return false;
|
||||||
@ -157,6 +158,17 @@ bool SetWritePermissions(u32 perm, bool add_perm) {
|
|||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
#else
|
||||||
|
case PERM_ALL:
|
||||||
|
perm &= ~(PERM_SYSNAND|PERM_MEMORY);
|
||||||
|
if (!ShowUnlockSequence(2, "You want to enable EmuNAND &\nimage writing permissions.\nKeep backups, just in case."))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ShowPrompt(false, "Can't unlock write permission.\nTry GodMode9 instead!");
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
write_permissions = add_perm ? write_permissions | perm : perm;
|
write_permissions = add_perm ? write_permissions | perm : perm;
|
||||||
|
@ -104,7 +104,11 @@ void DrawUserInterface(const char* curr_path, DirEntry* curr_entry, DirStruct* c
|
|||||||
// bottom: inctruction block
|
// bottom: inctruction block
|
||||||
char instr[256];
|
char instr[256];
|
||||||
snprintf(instr, 256, "%s%s\n%s%s%s%s%s%s",
|
snprintf(instr, 256, "%s%s\n%s%s%s%s%s%s",
|
||||||
|
#ifndef SAFEMODE
|
||||||
"GodMode9 Explorer v", VERSION, // generic start part
|
"GodMode9 Explorer v", VERSION, // generic start part
|
||||||
|
#else
|
||||||
|
"SafeMode9 Explorer v", VERSION, // generic start part
|
||||||
|
#endif
|
||||||
(*curr_path) ? ((clipboard->n_entries == 0) ? "L - MARK files (use with \x18\x19\x1A\x1B)\nX - DELETE / [+R] RENAME file(s)\nY - COPY file(s) / [+R] CREATE dir\n" :
|
(*curr_path) ? ((clipboard->n_entries == 0) ? "L - MARK files (use with \x18\x19\x1A\x1B)\nX - DELETE / [+R] RENAME file(s)\nY - COPY file(s) / [+R] CREATE dir\n" :
|
||||||
"L - MARK files (use with \x18\x19\x1A\x1B)\nX - DELETE / [+R] RENAME file(s)\nY - PASTE file(s) / [+R] CREATE dir\n") :
|
"L - MARK files (use with \x18\x19\x1A\x1B)\nX - DELETE / [+R] RENAME file(s)\nY - PASTE file(s) / [+R] CREATE dir\n") :
|
||||||
((GetWritePermissions() > PERM_BASE) ? "R+Y - Relock write permissions\nR+B - Unmount SD card\n" :
|
((GetWritePermissions() > PERM_BASE) ? "R+Y - Relock write permissions\nR+B - Unmount SD card\n" :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user