Make extra clear that SysNAND lvl3 permissions are dangerous

This commit is contained in:
d0k3 2017-03-10 18:52:39 +01:00
parent 8957d74016
commit 2d0abe2e49
2 changed files with 18 additions and 6 deletions

View File

@ -238,6 +238,11 @@ bool ShowUnlockSequence(u32 seqlvl, const char *format, ...) {
{ '\x18', '\x19', '\x1B', '\x1A', 'A' } { '\x18', '\x19', '\x1B', '\x1A', 'A' }
}; };
const u32 len = 5; const u32 len = 5;
u32 color_bg = COLOR_STD_BG;
u32 color_font = COLOR_STD_FONT;
u32 color_off = COLOR_GREY;
u32 color_on = seqcolors[seqlvl];
u32 lvl = 0; u32 lvl = 0;
u32 str_width, str_height; u32 str_width, str_height;
@ -255,14 +260,21 @@ bool ShowUnlockSequence(u32 seqlvl, const char *format, ...) {
x = (str_width >= SCREEN_WIDTH_TOP) ? 0 : (SCREEN_WIDTH_TOP - str_width) / 2; x = (str_width >= SCREEN_WIDTH_TOP) ? 0 : (SCREEN_WIDTH_TOP - str_width) / 2;
y = (str_height >= SCREEN_HEIGHT) ? 0 : (SCREEN_HEIGHT - str_height) / 2; y = (str_height >= SCREEN_HEIGHT) ? 0 : (SCREEN_HEIGHT - str_height) / 2;
ClearScreenF(true, false, COLOR_STD_BG); if (seqlvl >= 6) { // special handling
DrawStringF(TOP_SCREEN, x, y, COLOR_STD_FONT, COLOR_STD_BG, str); color_bg = seqcolors[seqlvl];
DrawStringF(TOP_SCREEN, x, y + str_height - 28, COLOR_STD_FONT, COLOR_STD_BG, "To proceed, enter this:"); color_font = COLOR_BLACK;
color_off = COLOR_BLACK;
color_on = COLOR_DARKGREY;
}
ClearScreenF(true, false, color_bg);
DrawStringF(TOP_SCREEN, x, y, color_font, color_bg, str);
DrawStringF(TOP_SCREEN, x, y + str_height - 28, color_font, color_bg, "To proceed, enter this:");
while (true) { while (true) {
for (u32 n = 0; n < len; n++) { for (u32 n = 0; n < len; n++) {
DrawStringF(TOP_SCREEN, x + (n*4*8), y + str_height - 18, DrawStringF(TOP_SCREEN, x + (n*4*8), y + str_height - 18,
(lvl > n) ? seqcolors[seqlvl] : COLOR_GREY, COLOR_STD_BG, "<%c>", seqsymbols[seqlvl][n]); (lvl > n) ? color_on : color_off, color_bg, "<%c>", seqsymbols[seqlvl][n]);
} }
if (lvl == len) if (lvl == len)
break; break;

View File

@ -171,10 +171,10 @@ bool SetWritePermissions(u32 perm, bool add_perm) {
return false; return false;
break; break;
case PERM_SYS_LVL3: case PERM_SYS_LVL3:
if (!ShowUnlockSequence(5, "!THIS IS YOUR ONLY WARNING!\n \nYou want to enable SysNAND\nlvl3 writing permissions.\n \nThis enables you to OVERWRITE\n%s", IS_A9LH ? "your A9LH installation and/or\nBRICK your console!" : "essential system files and/or\nBRICK your console!")) if (!ShowUnlockSequence(6, "!THIS IS YOUR ONLY WARNING!\n \nYou want to enable SysNAND\nlvl3 writing permissions.\n \nThis enables you to OVERWRITE\n%s", IS_A9LH ? "your A9LH installation and/or\nBRICK your console!" : "essential system files and/or\nBRICK your console!"))
return false; return false;
break; break;
case PERM_ALL: // maybe get rid of this (???) case PERM_ALL: // not accessible from GM9
if (!ShowUnlockSequence(3, "!Better be careful!\n \nYou want to enable ALL\nwriting permissions.\n \nThis enables you to do some\nreally dangerous stuff!")) if (!ShowUnlockSequence(3, "!Better be careful!\n \nYou want to enable ALL\nwriting permissions.\n \nThis enables you to do some\nreally dangerous stuff!"))
return false; return false;
break; break;