diff --git a/Makefile b/Makefile index b05c4b7..0526af4 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ INCLUDES := include EXEFS_SRC := exefs_src APP_TITLE := Haku33 APP_AUTHOR := Kronos2308 -APP_VERSION := 5.2 +APP_VERSION := 5.3 ROMFS := romfs #--------------------------------------------------------------------------------- diff --git a/romfs/startup_mariko.te b/romfs/startup_mariko.te index f3f9af9..1d0d2f6 100644 --- a/romfs/startup_mariko.te +++ b/romfs/startup_mariko.te @@ -2,14 +2,12 @@ is=["8000000000000120","8000000000000047"] p=println pr=print -pe={pause() exit()} +pe={pause() exit() movefile("sd:/payload.bin.bak", "sd:/payload.bin")} println("Haku33 Kronos2308 Hard Reset, Kronos2308 - Fork from TegraExplorer") wait={t=timer()while(timer()<(t+tw)){print("Wait for",(t+tw-timer()/1000),"seconds \r")}} p("System wiper\n") mount=mountsys if(mount("SYSTEM")){p("Mount failed!")pe()} -color(0x0000FF) -p("Press power to wipe, any other key to exit")a=pause()if(!a.power){exit()}clear() color(0xFF0000) pr("Deleting system saves... ") f=readdir("bis:/save") @@ -30,6 +28,7 @@ delfile("sd:/startup.te") delfile("sd:/Haku33.nro") delfile("sd:/Switch/Haku33.nro") delfile("sd:/Switch/Haku33/Haku33.nro") +delfile("sd:/payload.bin") movefile("sd:/payload.bin.bak", "sd:/payload.bin") p("\n\nDone!") diff --git a/source/lang.hpp b/source/lang.hpp index a24647b..7d55a0f 100644 --- a/source/lang.hpp +++ b/source/lang.hpp @@ -33,8 +33,8 @@ typedef struct { const char* text9; const char* text0; const char* text11; -/* const char* text12; - const char* text; + const char* text12; +/* const char* text; const char* text; const char* text; const char* text; @@ -71,8 +71,9 @@ language LG; LG.text7 = "\x1b[33;1m*\x1b[0m Luego del Reinicio ve a Hekate -> More configs -> Haku33\n\n"; LG.text8 = " No se puede Reiniciar al Payload en una consola Mariko\n"; LG.text9 = "\n\x1b[33;1m*\x1b[0m Si se congela mucho tiempo, Es que ha fallado. Pulsa POWER 15s \n\ny haslo de nuevo\n\n"; - LG.text0 = "\x1b[32;1m*\x1b[0m Desabilitando FTP de SXOS\n"; - LG.text11 = "\x1b[32;1m*\x1b[0m Esto no esta pensado para uasrse en EMU\n"; + LG.text0 = "\x1b[32;1m*\x1b[0m Deshabilitando FTP de SXOS\n"; + LG.text11 = "\x1b[32;1m*\x1b[0m Esto no esta pensado para usarse en EMU\n"; + LG.text12 = "\x1b[32;1m*\x1b[0m NO Existe /switch/prod.keys, usa LockPick_RCM\n"; break; default: //all LG.text1 = "\n\x1b[30;1m YOUR CONSOLE WILL BE COMPLETELY CLEANED: SAVES, GAMES, ETC \x1b[0m\n"; @@ -86,6 +87,7 @@ language LG; LG.text9 = "\n\x1b[33;1m*\x1b[0m If it freezes for a long time, It has failed. Press POWER 15s \n\nand try again \n\n"; LG.text0 = "\x1b[32;1m*\x1b[0m Disabling SXOS FTP\n"; LG.text11 = "\x1b[32;1m*\x1b[0m This is not intended to be used at EMU\n"; + LG.text12 = "\x1b[32;1m*\x1b[0m /switch/prod.keys does not exist, use LockPick_RCM\n"; break; } setsysExit(); diff --git a/source/main.cpp b/source/main.cpp index a00c2ba..bf40c8d 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -108,6 +108,14 @@ void close_Services() psmExit(); } +bool IsExist(std::string Path) +{ + std::ifstream ifs(Path); + bool ex = ifs.good(); + ifs.close(); + return ex; +} + void copy_me(string origen, string destino) { ifstream source(origen, ios::binary); ofstream dest(destino, ios::binary); @@ -128,23 +136,30 @@ void CheckHardware() void SetupClean (){ if (is_patched){ - //force boot + + led_on(2); + + //force boot sxcore copy_me("romfs:/boot.dat", "/boot.dat"); copy_me("romfs:/boot.ini", "/boot.ini"); + + //force boot HWFLY + copy_me("sdmc:/payload.bin","sdmc:/payload.bin.bak"); + copy_me("romfs:/TegraExplorer.bin", "/payload.bin"); + //copy keys mkdir("sdmc:/bootloader",0777); copy_me("romfs:/hekate_keys.ini", "/bootloader/hekate_keys.ini"); - //copy Start - mkdir("sdmc:/bootloader/res",0777); - mkdir("sdmc:/bootloader/ini",0777); - rename("/payload.bin","/payload.bin.bak"); - copy_me("romfs:/TegraExplorer.bin", "/payload.bin"); + + //copy Script copy_me("romfs:/startup_mariko.te", "/startup.te"); + led_on(1); spsmInitialize(); spsmShutdown(true); }else{ - copy_me("romfs:/TegraExplorer.bin", "/TegraExplorer.bin"); + //Erista boot + led_on(2); copy_me("romfs:/startup.te", "/startup.te"); led_on(1); bpcInitialize(); @@ -163,7 +178,7 @@ int main(int argc, char **argv) PadState pad; padConfigureInput(8, HidNpadStyleSet_NpadStandard); padInitializeDefault(&pad); - + bool keysok = IsExist("/switch/prod.keys"); Result rc = 0; //keys @@ -208,15 +223,22 @@ int main(int argc, char **argv) printf("\n\n %s",LG.text7); } printf("\n\x1b[31;1m%s \x1b[0m ",Logs); + if (is_patched && !keysok){ + printf(LG.text12); + } printf(LG.text5); consoleUpdate(NULL); - + //call clean after combo if (kHeld & KEY_A) { - SetupClean(); + if (is_patched){ + if (keysok){ + SetupClean(); + } + } else SetupClean(); //break; }