From b5337fcff5c45d11be419a284d8bf01c9fa122a6 Mon Sep 17 00:00:00 2001 From: Just Call Me Koko Date: Sun, 4 Feb 2024 13:43:01 -0500 Subject: [PATCH] Add disable touch --- esp32_marauder/Assets.h | 5 +- esp32_marauder/MenuFunctions.cpp | 160 +++++++++++++++++----------- esp32_marauder/MenuFunctions.h | 6 +- esp32_marauder/esp32_marauder.ino | 16 +++ pictures/icons/disable_touch_16.bmp | Bin 0 -> 190 bytes pictures/xbm/disable_touch_16.xbm | 6 ++ 6 files changed, 129 insertions(+), 64 deletions(-) create mode 100644 pictures/icons/disable_touch_16.bmp create mode 100644 pictures/xbm/disable_touch_16.xbm diff --git a/esp32_marauder/Assets.h b/esp32_marauder/Assets.h index e24d9cd35..583638791 100644 --- a/esp32_marauder/Assets.h +++ b/esp32_marauder/Assets.h @@ -200,7 +200,10 @@ PROGMEM static const unsigned char menu_icons[][66] = { 0x1F, 0xD0, 0x3F, 0x3F, 0xE0, 0x3F, 0x5F, 0xF0, 0x3F, 0xEF, 0xE8, 0x3F, 0xF7, 0xE5, 0x3B, 0xFB, 0xDE, 0x3A, 0x7D, 0xFF, 0x3A, 0xBB, 0x7F, 0x3B, 0xD7, 0x9F, 0x3D, 0xEF, 0xFF, 0x3E, 0xFF, 0x0F, 0x3F, 0xFF, 0xFF, 0x3F, - 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F} + 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F}, + {0xFF, 0xFF, 0xFD, 0xBF, 0x0B, 0xD0, 0xE7, 0xE7, 0xEF, 0xF7, 0xCF, 0xF3, // DISABLED TOUCH: 34 + 0xAF, 0xF5, 0x6F, 0xF6, 0x6F, 0xF6, 0xAF, 0xF5, 0xCF, 0xF3, 0x0F, 0xF0, + 0xE7, 0xE7, 0x0B, 0xD0, 0xFD, 0xBF, 0xFF, 0xFF} }; #ifndef MARAUDER_MINI diff --git a/esp32_marauder/MenuFunctions.cpp b/esp32_marauder/MenuFunctions.cpp index fa60c8a97..c3ffe2b74 100644 --- a/esp32_marauder/MenuFunctions.cpp +++ b/esp32_marauder/MenuFunctions.cpp @@ -548,7 +548,8 @@ void MenuFunctions::main(uint32_t currentTime) // getTouch causes a 10ms delay which makes beacon spam less effective #ifdef HAS_ILI9341 - pressed = this->updateTouch(&t_x, &t_y); + if (!this->disable_touch) + pressed = this->updateTouch(&t_x, &t_y); #endif @@ -615,67 +616,70 @@ void MenuFunctions::main(uint32_t currentTime) #ifdef HAS_BUTTONS bool c_btn_press = c_btn.justPressed(); + + #ifndef HAS_ILI9341 - if ((c_btn_press) && - (wifi_scan_obj.currentScanMode != WIFI_SCAN_OFF) && - (wifi_scan_obj.currentScanMode != OTA_UPDATE) && - (wifi_scan_obj.currentScanMode != ESP_UPDATE) && - (wifi_scan_obj.currentScanMode != SHOW_INFO) && - (wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_DATA) && - (wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_NMEA)) - { - // Stop the current scan - if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_PROBE) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION_WAR_DRIVE) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_WAR_DRIVE) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_EVIL_PORTAL) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_ESPRESSIF) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_ALL) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_DEAUTH) || - (wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_SPAM) || - (wifi_scan_obj.currentScanMode == WIFI_ATTACK_AP_SPAM) || - (wifi_scan_obj.currentScanMode == WIFI_ATTACK_AUTH) || - (wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH) || - (wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_MANUAL) || - (wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_TARGETED) || - (wifi_scan_obj.currentScanMode == WIFI_ATTACK_MIMIC) || - (wifi_scan_obj.currentScanMode == WIFI_ATTACK_RICK_ROLL) || - (wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_LIST) || - (wifi_scan_obj.currentScanMode == BT_SCAN_ALL) || - (wifi_scan_obj.currentScanMode == BT_ATTACK_SOUR_APPLE) || - (wifi_scan_obj.currentScanMode == BT_ATTACK_SWIFTPAIR_SPAM) || - (wifi_scan_obj.currentScanMode == BT_ATTACK_SPAM_ALL) || - (wifi_scan_obj.currentScanMode == BT_ATTACK_SAMSUNG_SPAM) || - (wifi_scan_obj.currentScanMode == BT_ATTACK_GOOGLE_SPAM) || - (wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE) || - (wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE_CONT) || - (wifi_scan_obj.currentScanMode == BT_SCAN_SKIMMERS) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_EAPOL) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_LIST_EAPOL) || - (wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR)) + if ((c_btn_press) && + (wifi_scan_obj.currentScanMode != WIFI_SCAN_OFF) && + (wifi_scan_obj.currentScanMode != OTA_UPDATE) && + (wifi_scan_obj.currentScanMode != ESP_UPDATE) && + (wifi_scan_obj.currentScanMode != SHOW_INFO) && + (wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_DATA) && + (wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_NMEA)) { - wifi_scan_obj.StartScan(WIFI_SCAN_OFF); - - // If we don't do this, the text and button coordinates will be off - display_obj.tft.init(); - - // Take us back to the menu - changeMenu(current_menu); + // Stop the current scan + if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_PROBE) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION_WAR_DRIVE) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_WAR_DRIVE) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_EVIL_PORTAL) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_ESPRESSIF) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_ALL) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_DEAUTH) || + (wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_SPAM) || + (wifi_scan_obj.currentScanMode == WIFI_ATTACK_AP_SPAM) || + (wifi_scan_obj.currentScanMode == WIFI_ATTACK_AUTH) || + (wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH) || + (wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_MANUAL) || + (wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_TARGETED) || + (wifi_scan_obj.currentScanMode == WIFI_ATTACK_MIMIC) || + (wifi_scan_obj.currentScanMode == WIFI_ATTACK_RICK_ROLL) || + (wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_LIST) || + (wifi_scan_obj.currentScanMode == BT_SCAN_ALL) || + (wifi_scan_obj.currentScanMode == BT_ATTACK_SOUR_APPLE) || + (wifi_scan_obj.currentScanMode == BT_ATTACK_SWIFTPAIR_SPAM) || + (wifi_scan_obj.currentScanMode == BT_ATTACK_SPAM_ALL) || + (wifi_scan_obj.currentScanMode == BT_ATTACK_SAMSUNG_SPAM) || + (wifi_scan_obj.currentScanMode == BT_ATTACK_GOOGLE_SPAM) || + (wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE) || + (wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE_CONT) || + (wifi_scan_obj.currentScanMode == BT_SCAN_SKIMMERS) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_EAPOL) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_LIST_EAPOL) || + (wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR)) + { + wifi_scan_obj.StartScan(WIFI_SCAN_OFF); + + // If we don't do this, the text and button coordinates will be off + display_obj.tft.init(); + + // Take us back to the menu + changeMenu(current_menu); + } + + x = -1; + y = -1; + + return; } - - x = -1; - y = -1; - - return; - } + #endif #endif @@ -989,7 +993,23 @@ void MenuFunctions::updateStatusBar() } // Draw battery info - MenuFunctions::battery(false); + //MenuFunctions::battery(false); + display_obj.tft.fillRect(190, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR); + + #ifdef HAS_ILI9341 + #ifdef HAS_BUTTONS + if (this->disable_touch) { + display_obj.tft.setCursor(0, 1); + display_obj.tft.drawXBitmap(190, + 0, + menu_icons[DISABLE_TOUCH], + 16, + 16, + STATUSBAR_COLOR, + TFT_RED); + } + #endif + #endif // Draw SD info @@ -1075,7 +1095,23 @@ void MenuFunctions::drawStatusBar() #endif - MenuFunctions::battery2(true); + //MenuFunctions::battery2(true); + display_obj.tft.fillRect(190, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR); + + #ifdef HAS_ILI9341 + #ifdef HAS_BUTTONS + if (this->disable_touch) { + display_obj.tft.setCursor(0, 1); + display_obj.tft.drawXBitmap(190, + 0, + menu_icons[DISABLE_TOUCH], + 16, + 16, + STATUSBAR_COLOR, + TFT_RED); + } + #endif + #endif // Draw SD info if (sd_obj.supported) @@ -1168,6 +1204,8 @@ void MenuFunctions::displaySetting(String key, Menu* menu, int index) { void MenuFunctions::RunSetup() { extern LinkedList* access_points; + + this->disable_touch = false; #ifdef HAS_ILI9341 this->initLVGL(); diff --git a/esp32_marauder/MenuFunctions.h b/esp32_marauder/MenuFunctions.h index cb735ea6b..50291bbb4 100644 --- a/esp32_marauder/MenuFunctions.h +++ b/esp32_marauder/MenuFunctions.h @@ -71,6 +71,7 @@ extern Settings settings_obj; #define LANGUAGE 31 #define STATUS_GPS 32 #define GPS_MENU 33 +#define DISABLE_TOUCH 34 PROGMEM void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p); PROGMEM bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data); @@ -121,7 +122,6 @@ class MenuFunctions uint32_t initTime = 0; uint8_t menu_start_index = 0; - // Main menu stuff Menu mainMenu; @@ -163,7 +163,6 @@ class MenuFunctions void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function callable, bool selected = false, String command = ""); - void updateStatusBar(); void battery(bool initial = false); void battery2(bool initial = false); void showMenuList(Menu* menu, int layer); @@ -192,11 +191,14 @@ class MenuFunctions uint16_t x = -1, y = -1; boolean pressed = false; + bool disable_touch; + String loaded_file = ""; void initLVGL(); void deinitLVGL(); void selectEPHTMLGFX(); + void updateStatusBar(); void addSSIDGFX(); void addAPGFX(); void addStationGFX(); diff --git a/esp32_marauder/esp32_marauder.ino b/esp32_marauder/esp32_marauder.ino index 3f17fe52e..d5ce728ce 100644 --- a/esp32_marauder/esp32_marauder.ino +++ b/esp32_marauder/esp32_marauder.ino @@ -387,6 +387,22 @@ void loop() mini = true; #endif + #ifdef HAS_ILI9341 + #ifdef HAS_BUTTONS + if (c_btn.isHeld()) { + if (menu_function_obj.disable_touch) + menu_function_obj.disable_touch = false; + else + menu_function_obj.disable_touch = true; + + menu_function_obj.updateStatusBar(); + + while (!c_btn.justReleased()) + delay(1); + } + #endif + #endif + // Update all of our objects /*#ifdef HAS_SCREEN bool do_draw = display_obj.draw_tft; diff --git a/pictures/icons/disable_touch_16.bmp b/pictures/icons/disable_touch_16.bmp new file mode 100644 index 0000000000000000000000000000000000000000..d983ef119bf6b0e7e9979bdbc711ed8e8d70923b GIT binary patch literal 190 zcmY+8I}U&_3_}ydjLa>13I=wr%*4Im2(JJD literal 0 HcmV?d00001 diff --git a/pictures/xbm/disable_touch_16.xbm b/pictures/xbm/disable_touch_16.xbm new file mode 100644 index 000000000..b286f4ce0 --- /dev/null +++ b/pictures/xbm/disable_touch_16.xbm @@ -0,0 +1,6 @@ +#define ce2b329463664e43e1607d0384f46ac1NszJo7o8A3Pedgwr_width 16 +#define ce2b329463664e43e1607d0384f46ac1NszJo7o8A3Pedgwr_height 16 +static char ce2b329463664e43e1607d0384f46ac1NszJo7o8A3Pedgwr_bits[] = { + 0xFF, 0xFF, 0xFD, 0xBF, 0x0B, 0xD0, 0xE7, 0xE7, 0xEF, 0xF7, 0xCF, 0xF3, + 0xAF, 0xF5, 0x6F, 0xF6, 0x6F, 0xF6, 0xAF, 0xF5, 0xCF, 0xF3, 0x0F, 0xF0, + 0xE7, 0xE7, 0x0B, 0xD0, 0xFD, 0xBF, 0xFF, 0xFF, };