Skip to content

Commit

Permalink
Add disable touch
Browse files Browse the repository at this point in the history
  • Loading branch information
justcallmekoko committed Feb 4, 2024
1 parent 24a1862 commit b5337fc
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 64 deletions.
5 changes: 4 additions & 1 deletion esp32_marauder/Assets.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
160 changes: 99 additions & 61 deletions esp32_marauder/MenuFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -1168,6 +1204,8 @@ void MenuFunctions::displaySetting(String key, Menu* menu, int index) {
void MenuFunctions::RunSetup()
{
extern LinkedList<AccessPoint>* access_points;

this->disable_touch = false;

#ifdef HAS_ILI9341
this->initLVGL();
Expand Down
6 changes: 4 additions & 2 deletions esp32_marauder/MenuFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -121,7 +122,6 @@ class MenuFunctions
uint32_t initTime = 0;
uint8_t menu_start_index = 0;


// Main menu stuff
Menu mainMenu;

Expand Down Expand Up @@ -163,7 +163,6 @@ class MenuFunctions


void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable, bool selected = false, String command = "");
void updateStatusBar();
void battery(bool initial = false);
void battery2(bool initial = false);
void showMenuList(Menu* menu, int layer);
Expand Down Expand Up @@ -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();
Expand Down
16 changes: 16 additions & 0 deletions esp32_marauder/esp32_marauder.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Binary file added pictures/icons/disable_touch_16.bmp
Binary file not shown.
6 changes: 6 additions & 0 deletions pictures/xbm/disable_touch_16.xbm
Original file line number Diff line number Diff line change
@@ -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, };

0 comments on commit b5337fc

Please sign in to comment.