Skip to content

Commit

Permalink
Fixed delays & merge errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ATOMNFT committed Jun 27, 2024
1 parent 1ada9bf commit 5920700
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 30 deletions.
4 changes: 2 additions & 2 deletions minigotchi-ESP32/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ bool Config::parasite = false;

// screen configuration
bool Config::display = true;
std::string Config::screen = "Define_Display_Here";
std::string Config::screen = "";

// define baud rate
int Config::baud = 115200;
Expand Down Expand Up @@ -113,4 +113,4 @@ int Config::random(int min, int max) { return min + rand() % (max - min + 1); }

int Config::time() {
return millis() / 1000; // convert to seconds
}
}
8 changes: 4 additions & 4 deletions minigotchi-ESP32/deauth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ void Deauth::add(const std::string &bssids) {
Serial.print(token.c_str());
Serial.println(" to the whitelist");
Display::updateDisplay("('-')", "Adding " + (String) + " to the whitelist");
delay(Config::shortDelay);
whitelist.push_back(token.c_str());
}
}
Expand Down Expand Up @@ -205,6 +206,7 @@ bool Deauth::select() {
Display::updateDisplay(
"('-')",
"Selected AP is not encrypted. Skipping deauthentication...");
delay(Config::shortDelay);
Parasite::sendDeauthStatus(SKIPPING_UNENCRYPTED);
return false;
}
Expand All @@ -217,7 +219,7 @@ bool Deauth::select() {
Display::updateDisplay(
"('-')",
"Selected AP is in the whitelist. Skipping deauthentication...");
delay(1000);
delay(Config::shortDelay);
Parasite::sendDeauthStatus(SKIPPING_WHITELIST);
return false;
}
Expand Down Expand Up @@ -381,7 +383,6 @@ void Deauth::deauth() {
"(>-<) Starting deauthentication attack on the selected AP...");
Serial.println(" ");
Display::updateDisplay("(>-<)", "Begin deauth-attack on AP...");
delay(900);
delay(Config::shortDelay);
// define the attack
if (!running) {
Expand Down Expand Up @@ -472,6 +473,5 @@ void Deauth::start() {
Serial.println("(^-^) Attack finished!");
Serial.println(" ");
Display::updateDisplay("(^-^)", "Attack finished!");
delay(900);
running = false;
}
}
13 changes: 2 additions & 11 deletions minigotchi-ESP32/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ void Display::startScreen() {
ssd1306_ideaspark_display->clearBuffer();
delay(100);
} else if (Config::screen == "M5StickCP" || Config::screen == "M5StickCP2" || Config::screen == "M5Cardputer") { // New condition for M5StickC Plus
tft.setRotation(1); // Set display rotation if needed
tft.begin(); // Initialize TFT_eSPI library
delay(100);
tft.setRotation(1); // Set display rotation if needed
Expand All @@ -134,16 +135,6 @@ void Display::startScreen() {
delay(100);
tft.setTextSize(2); // Set text size)
delay(100);
} else if ((Config::screen == "CYD" || Config::screen == "T_DISPLAY_S3") &&
tft_display != nullptr) {
tft.setRotation(1); // Set display rotation if needed
delay(100);
tft.fillScreen(TFT_BLACK); // Fill screen with black color
delay(100);
tft.setTextColor(TFT_WHITE); // Set text color to white
delay(100);
tft.setTextSize(2); // Set text size
delay(100);
}
}
}
Expand Down Expand Up @@ -265,7 +256,7 @@ void Display::updateDisplay(String face, String text) {
}

if (textChanged) {
int textY = (Config::screen == "CYD") ? 40 : 60;
int textY = (Config::screen == "CYD") ? 40 : 50;
tft.fillRect(0, textY, tft.width(), tft.height() - textY,
TFT_BLACK); // Clear text area
tft.setCursor(0, textY);
Expand Down
2 changes: 1 addition & 1 deletion minigotchi-ESP32/minigotchi-ESP32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ void loop() {
// deauth random access point
minigotchi.deauth();
delay(250);
}
}
12 changes: 5 additions & 7 deletions minigotchi-ESP32/minigotchi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,17 @@ if (Config::screen == "M5StickCP") {
Serial.println(" ");
Serial.println("(^-^) Hi, I'm Minigotchi, your pwnagotchi's best friend!");
Display::updateDisplay("(^-^)", "Hi, I'm Minigotchi");
delay(1000);
Serial.println(" ");
Serial.println(
"('-') You can edit my configuration parameters in config.cpp!");
Serial.println(" ");
delay(250);
Display::updateDisplay("('-')", "Edit my config.cpp!");
delay(900);
delay(250);
Serial.println("(>-<) Starting now...");
Serial.println(" ");
Display::updateDisplay("(>-<)", "Starting now");
delay(1000);
delay(250);
Serial.println("################################################");
Serial.println("# BOOTUP PROCESS #");
Serial.println("################################################");
Expand All @@ -94,7 +93,6 @@ void Minigotchi::info() {
Serial.println(" ");
Serial.println("('-') Current Minigotchi Stats: ");
Display::updateDisplay("('-')", "Current Minigotchi Stats:");
delay(1000);
version();
mem();
cpu();
Expand All @@ -109,15 +107,15 @@ void Minigotchi::finish() {
Serial.println("('-') Started successfully!");
Serial.println(" ");
Display::updateDisplay("('-')", "Started sucessfully");
delay(900);
delay(250);
}

void Minigotchi::version() {
Serial.print("('-') Version: ");
Serial.println(Config::version.c_str());
Display::updateDisplay("('-')",
"Version: " + (String)Config::version.c_str());
delay(1000);
delay(250);
}

void Minigotchi::mem() {
Expand All @@ -135,7 +133,7 @@ void Minigotchi::cpu() {
Serial.println(" MHz");
Display::updateDisplay(
"('-')", "CPU Frequency: " + (String)ESP.getCpuFreqMHz() + " MHz");
delay(900);
delay(250);
}

/** developer note:
Expand Down
8 changes: 3 additions & 5 deletions minigotchi-ESP32/pwnagotchi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ void Pwnagotchi::pwnagotchiCallback(void *buf,
Serial.println("(^-^) Pwnagotchi detected!");
Serial.println(" ");
Display::updateDisplay("(^-^)", "Pwnagotchi detected!");
delay(Config::shortDelay);
// delay(Config::shortDelay);

// extract the ESSID from the beacon frame
String essid;

Expand Down Expand Up @@ -195,12 +194,11 @@ void Pwnagotchi::pwnagotchiCallback(void *buf,
Serial.println(pwndTot);
Serial.print(" ");
Display::updateDisplay("(^-^)", "Pwnagotchi name: " + (String)name);
delay(Config::shortDelay);
Display::updateDisplay("(^-^)", "Pwned Networks: " + (String)pwndTot);
delay(Config::shortDelay);
delay(Config::shortDelay);
Parasite::sendPwnagotchiStatus(FRIEND_FOUND, name.c_str());
}
}
}
}
}
}

0 comments on commit 5920700

Please sign in to comment.