diff --git a/src/core/settings.cpp b/src/core/settings.cpp index c6ed71b9..ca68706a 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -373,12 +373,7 @@ void setClock() { if (!returnToMenu) { if (auto_mode) { - if(!wifiConnected) { - //Previous implementation was triggering Stack Canary error. - //NTP Adjust is made autommatically everytime you connect to wifi. - displayWarning("Connect to WiFi"); - return; - } + if(!wifiConnected) wifiConnectMenu(); if(!returnToMenu) { options = { {"Brasilia", [&]() { timeClient.setTimeOffset(-3 * 3600); tmz=0; }, tmz==0 ? true:false}, @@ -412,85 +407,15 @@ void setClock() { } else { int hr, mn, am; - options = { - {"00", [&]() { hr=0; }}, - {"01", [&]() { hr=1; }}, - {"02", [&]() { hr=2; }}, - {"03", [&]() { hr=3; }}, - {"04", [&]() { hr=4; }}, - {"05", [&]() { hr=5; }}, - {"06", [&]() { hr=6; }}, - {"07", [&]() { hr=7; }}, - {"08", [&]() { hr=8; }}, - {"09", [&]() { hr=9; }}, - {"10", [&]() { hr=10; }}, - {"11", [&]() { hr=11; }}, - }; + options = { }; + for(int i=0; i<12;i++) options.push_back({String(i<10?"0":"" + String(i)).c_str(), [&]() { mn=i; }}); + delay(200); loopOptions(options,false,true,"Set Hour"); delay(200); - options = { - {"00", [&]() { mn=0; }}, - {"01", [&]() { mn=1; }}, - {"02", [&]() { mn=2; }}, - {"03", [&]() { mn=3; }}, - {"04", [&]() { mn=4; }}, - {"05", [&]() { mn=5; }}, - {"06", [&]() { mn=6; }}, - {"07", [&]() { mn=7; }}, - {"08", [&]() { mn=8; }}, - {"09", [&]() { mn=9; }}, - {"10", [&]() { mn=10; }}, - {"11", [&]() { mn=11; }}, - {"12", [&]() { mn=12; }}, - {"13", [&]() { mn=13; }}, - {"14", [&]() { mn=14; }}, - {"15", [&]() { mn=15; }}, - {"16", [&]() { mn=16; }}, - {"17", [&]() { mn=17; }}, - {"18", [&]() { mn=18; }}, - {"19", [&]() { mn=19; }}, - {"20", [&]() { mn=20; }}, - {"21", [&]() { mn=21; }}, - {"22", [&]() { mn=22; }}, - {"23", [&]() { mn=23; }}, - {"24", [&]() { mn=24; }}, - {"25", [&]() { mn=25; }}, - {"26", [&]() { mn=26; }}, - {"27", [&]() { mn=27; }}, - {"28", [&]() { mn=28; }}, - {"29", [&]() { mn=29; }}, - {"30", [&]() { mn=30; }}, - {"31", [&]() { mn=31; }}, - {"32", [&]() { mn=32; }}, - {"33", [&]() { mn=33; }}, - {"34", [&]() { mn=34; }}, - {"35", [&]() { mn=35; }}, - {"36", [&]() { mn=36; }}, - {"37", [&]() { mn=37; }}, - {"38", [&]() { mn=38; }}, - {"39", [&]() { mn=39; }}, - {"40", [&]() { mn=40; }}, - {"41", [&]() { mn=41; }}, - {"42", [&]() { mn=42; }}, - {"43", [&]() { mn=43; }}, - {"44", [&]() { mn=44; }}, - {"45", [&]() { mn=45; }}, - {"46", [&]() { mn=46; }}, - {"47", [&]() { mn=47; }}, - {"48", [&]() { mn=48; }}, - {"49", [&]() { mn=49; }}, - {"50", [&]() { mn=50; }}, - {"51", [&]() { mn=51; }}, - {"52", [&]() { mn=52; }}, - {"53", [&]() { mn=53; }}, - {"54", [&]() { mn=54; }}, - {"55", [&]() { mn=55; }}, - {"56", [&]() { mn=56; }}, - {"57", [&]() { mn=57; }}, - {"58", [&]() { mn=58; }}, - {"59", [&]() { mn=59; }}, - }; + options = { }; + for(int i=0; i<60;i++) options.push_back({String(i<10?"0":"" + String(i)).c_str(), [&]() { mn=i; }}); + delay(200); loopOptions(options,false,true,"Set Minute"); delay(200); diff --git a/src/modules/others/webInterface.h b/src/modules/others/webInterface.h index a79108e9..2d1dff52 100644 --- a/src/modules/others/webInterface.h +++ b/src/modules/others/webInterface.h @@ -497,7 +497,7 @@ function runJsFile(filePath) { var fs = document.getElementById("actualFS").value; const ajax5 = new XMLHttpRequest(); const formdata5 = new FormData(); - formdata5.append("cmnd", "js " + filePath); + formdata5.append("cmnd", "js " + filePath); ajax5.open("POST", "/cm", false); ajax5.send(formdata5); document.getElementById("status").innerHTML = ajax5.responseText; @@ -511,7 +511,7 @@ function runBadusbFile(filePath) { var fs = document.getElementById("actualFS").value; const ajax5 = new XMLHttpRequest(); const formdata5 = new FormData(); - formdata5.append("cmnd", "badusb tx_from_file " + filePath); + formdata5.append("cmnd", "badusb tx_from_file " + filePath); ajax5.open("POST", "/cm", false); ajax5.send(formdata5); document.getElementById("status").innerHTML = ajax5.responseText; diff --git a/src/modules/wifi/evil_portal.cpp b/src/modules/wifi/evil_portal.cpp index 11747d57..7937a61f 100644 --- a/src/modules/wifi/evil_portal.cpp +++ b/src/modules/wifi/evil_portal.cpp @@ -48,6 +48,7 @@ void startEvilPortal(String tssid, uint8_t channel, bool deauth) { }; delay(200); loopOptions(options); + memcpy(deauth_frame, deauth_frame_default, sizeof(deauth_frame_default)); wsl_bypasser_send_raw_frame(&ap_record,channel); //writes the buffer with the information while(checkNextPress()){ yield(); } // debounce