Skip to content

Commit

Permalink
2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Kronos2308 committed Jan 11, 2020
1 parent 91cd021 commit 586ce84
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ INCLUDES := include
EXEFS_SRC := exefs_src
APP_TITLE := Haku33
APP_AUTHOR := Kronos2308
APP_VERSION := 2.4
APP_VERSION := 2.5
ROMFS := romfs

#---------------------------------------------------------------------------------
Expand Down
78 changes: 43 additions & 35 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ char *incognito(void) {
closedir(d);
}


//Power on led
bool led_on(void)
{
Result rc=0;
Expand Down Expand Up @@ -179,6 +179,7 @@ char *incognito(void) {
return 0;
}

//check connnection
bool HasConnection()
{
u32 strg = 0;
Expand All @@ -188,19 +189,23 @@ char *incognito(void) {
return (strg > 0);
}


//Clean Funtion
bool install()
{
//warning
if(isSpanish)
printf("\n\x1b[33;1m*\x1b[0m Si se congela mucho tiempo, Es que ha fallado. Pulsa POWER 15s \n\n");
else
printf("\n\x1b[33;1m*\x1b[0m If it freezes a long time, it has failed. Press POWER 15s\n\n");
printf("\n\x1b[33;1m*\x1b[0m If it freezes a long time, It has failed. Press POWER 15s\n\n");

//force disable sxos ftp for evoid freeze
txinit();
txforcedisableftp();
txexit();

//Initialize proc
printf("\x1b[32;1m*\x1b[0m Initialize proc\n");
printf("\x1b[32;1m*\x1b[0m Initialize Proc\n");
consoleUpdate(NULL);
fsInitialize();
pmdmntInitialize();
Expand Down Expand Up @@ -264,16 +269,14 @@ bool install()
pmshellTerminateProgram(0x0100000000534C56);//ReverseNX
pmshellTerminateProgram(0x0100000000000069);//ReiSpoof



//mount user
printf("\x1b[32;1m*\x1b[0m mount User\n");
consoleUpdate(NULL);
FsFileSystem myUser;
fsOpenBisFileSystem(&myUser, FsBisPartitionId_User, "");
fsdevMountDevice("myUser", myUser);
//delete user
printf("\x1b[32;1m*\x1b[0m delete User\n");
printf("\x1b[32;1m*\x1b[0m Delete User\n");
consoleUpdate(NULL);
DeleteDir("myUser:/Contents/registered");
DeleteDir("myUser:/Contents");
Expand Down Expand Up @@ -305,7 +308,7 @@ bool install()
fsFsClose(&mySystem);

//exit proc
printf("\x1b[32;1m*\x1b[0m exit proc\n");
printf("\x1b[32;1m*\x1b[0m Exit proc\n");
consoleUpdate(NULL);
pmdmntExit();
pmshellExit();
Expand All @@ -322,41 +325,47 @@ led_on();
{
bpcShutdownSystem();
}
// bpcRebootSystem();
bpcExit();
return 0;
}

int main(int argc, char **argv)
{
//romfs
romfsInit();
set_LANG();
//keys
u32 minus = 0;
u32 more = 0;
u32 LT = 0;
u32 RT = 0;
set_LANG();

//romfs
romfsInit();

//keys
while (appletMainLoop())
{

hidScanInput();
u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO);
u64 kHeld = hidKeysHeld(CONTROLLER_P1_AUTO);

minus = 0;
more = 0;
LT = 0;
RT = 0;
if (kHeld & KEY_ZL)
LT = 2;
if (kHeld & KEY_ZR)
RT = 2;
if (kHeld & KEY_MINUS)
minus = 2;
if (kHeld & KEY_PLUS)
more = 2;

u32 minus = 0;
u32 more = 0;
u32 LT = 0;
u32 RT = 0;

if (kHeld & KEY_ZL)
LT = 4;
if (kHeld & KEY_ZR)
RT = 4;
if (kHeld & KEY_MINUS)
minus = 4;
if (kHeld & KEY_PLUS)
more = 4;

if (kHeld & KEY_ZL && kHeld & KEY_ZR && kHeld & KEY_MINUS && kHeld & KEY_PLUS)
{
minus = 2;
more = 2;
LT = 2;
RT = 2;
}

//main menu
consoleInit(NULL);
printf("\x1b[32;1m*\x1b[0m %s v%s Kronos2308, Hard Reset\n",TITLE, VERSION);
if(isSpanish)
Expand All @@ -365,7 +374,7 @@ if (kHeld & KEY_PLUS)
printf("\n\x1b[30;1m SE REALIZARA UN HARD RESET LUEGO SE APAGARA LA CONSOLA \x1b[0m\n");
printf("\n\x1b[30;1m SI NO SABES LO QUE HACES, PRESIONA B PARA ABORTAR \x1b[0m\n");
printf("\n\n\x1b[30;1m-------- LO DEVORARE TODO --------\x1b[0m\n\n");
printf("\x1b[30;1m PULSA \x1b[3%u;1m ZL \x1b[3%u;1m -\x1b[3%u;1m +\x1b[3%u;1m ZR\x1b[0m \x1b[30;1m PARA LIMPIAR\n\n",LT,minus,more,RT);
printf("\x1b[30;1m PULSA \x1b[3%u;1m ZL\x1b[3%u;1m -\x1b[3%u;1m +\x1b[3%u;1m ZR\x1b[0m \x1b[30;1m JUNTOS PARA LIMPIAR\n\n",LT,minus,more,RT);
if(strlen(incognito()) == 0)//detect incognito
printf("\x1b[31;1m*\x1b[0m Desinstala Incognito %s(Requerido)\n\n",incognito());
if(!HasConnection())//detect airplane mode for evoid freeze
Expand All @@ -375,16 +384,16 @@ if (kHeld & KEY_PLUS)
printf("\n\x1b[30;1m A HARD RESET WILL BE PERFORMED AFTER THE CONSOLE WILL BE OFF \x1b[0m\n");
printf("\n\x1b[30;1m IF YOU DON'T KNOW WHAT YOU DO, PRESS B FOR ABORT \x1b[0m\n");
printf("\n\n\x1b[30;1m-------- I WILL CONSUME EVERYTHING --------\x1b[0m\n\n");
printf("PRESS \x1b[3%u;1m ZL\x1b[3%u;1m -\x1b[3%u;1m +\x1b[3%u;1m ZR \x1b[0m \x1b[30;1m TO CLEAN\n\n",LT,minus,more,RT);
printf("PRESS \x1b[3%u;1m ZL\x1b[3%u;1m -\x1b[3%u;1m +\x1b[3%u;1m ZR \x1b[0m \x1b[30;1m TOGETHER TO CLEAN\n\n",LT,minus,more,RT);
if(strlen(incognito()) == 0)//detect incognito
printf("\x1b[31;1m*\x1b[0m Uninstall Incognito (Required)\n\n");
if(!HasConnection())//detect airplane mode for evoid freeze
printf("\x1b[31;1m*\x1b[0m Disable Airplane mode and use 90DNS(Required)\n\n\x1b[32;1m*\x1b[0m Primary DNS: 163.172.141.219\n\n\x1b[32;1m*\x1b[0m Secondary DNS: 207.246.121.77\n\n");
}
consoleUpdate(NULL);


if ((kDown & KEY_ZL || kDown & KEY_ZR || kDown & KEY_MINUS || kDown & KEY_PLUS) && (kHeld & KEY_ZL && kHeld & KEY_ZR && kHeld & KEY_MINUS && kHeld & KEY_PLUS))
//call clean after combo
if (kHeld & KEY_ZL && kHeld & KEY_ZR && kHeld & KEY_MINUS && kHeld & KEY_PLUS)
{
install();
break;
Expand All @@ -396,7 +405,6 @@ if (kHeld & KEY_PLUS)
}
}


//cansel
fsExit();
socketExit();
Expand Down

0 comments on commit 586ce84

Please sign in to comment.