mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-12 15:50:36 -08:00
Develop (#121)
* Adding new library, changing way of displaying texts (#118) * Adding custom icon for language button * Adding new library, changing way of displaying texts Added new library to make incoming translation possible to exists at the same time. * Prepare for flipper integration * More flipper wifi dev board work * Add command parse * Add set channel * Create bins for release v0.9.6 Co-authored-by: mlodawy <105587112+mlodawy@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9f013d3d52
commit
2f0d05a538
@@ -1,43 +1,49 @@
|
||||
#include "BatteryInterface.h"
|
||||
|
||||
#include "lang_var.h"
|
||||
BatteryInterface::BatteryInterface() {
|
||||
|
||||
}
|
||||
|
||||
void BatteryInterface::main(uint32_t currentTime) {
|
||||
if (currentTime != 0) {
|
||||
if (currentTime - initTime >= 3000) {
|
||||
//Serial.println("Checking Battery Level");
|
||||
this->initTime = millis();
|
||||
int8_t new_level = this->getBatteryLevel();
|
||||
//this->battery_level = this->getBatteryLevel();
|
||||
if (this->battery_level != new_level) {
|
||||
Serial.println("Battery Level changed: " + (String)new_level);
|
||||
this->battery_level = new_level;
|
||||
#ifndef MARAUDER_FLIPPER
|
||||
if (currentTime != 0) {
|
||||
if (currentTime - initTime >= 3000) {
|
||||
//Serial.println("Checking Battery Level");
|
||||
this->initTime = millis();
|
||||
int8_t new_level = this->getBatteryLevel();
|
||||
//this->battery_level = this->getBatteryLevel();
|
||||
if (this->battery_level != new_level) {
|
||||
Serial.println(text00 + (String)new_level);
|
||||
this->battery_level = new_level;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void BatteryInterface::RunSetup() {
|
||||
Wire.begin(I2C_SDA, I2C_SCL);
|
||||
this->initTime = millis();
|
||||
#ifndef MARAUDER_FLIPPER
|
||||
Wire.begin(I2C_SDA, I2C_SCL);
|
||||
this->initTime = millis();
|
||||
#endif
|
||||
}
|
||||
|
||||
int8_t BatteryInterface::getBatteryLevel() {
|
||||
Wire.beginTransmission(IP5306_ADDR);
|
||||
Wire.write(0x78);
|
||||
if (Wire.endTransmission(false) == 0 &&
|
||||
Wire.requestFrom(0x75, 1)) {
|
||||
this->i2c_supported = true;
|
||||
switch (Wire.read() & 0xF0) {
|
||||
case 0xE0: return 25;
|
||||
case 0xC0: return 50;
|
||||
case 0x80: return 75;
|
||||
case 0x00: return 100;
|
||||
default: return 0;
|
||||
#ifndef MARAUDER_FLIPPER
|
||||
Wire.beginTransmission(IP5306_ADDR);
|
||||
Wire.write(0x78);
|
||||
if (Wire.endTransmission(false) == 0 &&
|
||||
Wire.requestFrom(0x75, 1)) {
|
||||
this->i2c_supported = true;
|
||||
switch (Wire.read() & 0xF0) {
|
||||
case 0xE0: return 25;
|
||||
case 0xC0: return 50;
|
||||
case 0x80: return 75;
|
||||
case 0x00: return 100;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
this->i2c_supported = false;
|
||||
return -1;
|
||||
this->i2c_supported = false;
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include <Wire.h>
|
||||
#include "configs.h"
|
||||
|
||||
#ifndef MARAUDER_FLIPPER
|
||||
#include <Wire.h>
|
||||
#endif
|
||||
|
||||
#define I2C_SDA 33
|
||||
#define I2C_SCL 22
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "Buffer.h"
|
||||
#include "lang_var.h"
|
||||
|
||||
Buffer::Buffer(){
|
||||
bufA = (uint8_t*)malloc(BUF_SIZE);
|
||||
@@ -37,7 +38,7 @@ void Buffer::close(fs::FS* fs){
|
||||
if(!writing) return;
|
||||
forceSave(fs);
|
||||
writing = false;
|
||||
Serial.println("file closed");
|
||||
Serial.println(text01);
|
||||
}
|
||||
|
||||
void Buffer::addPacket(uint8_t* buf, uint32_t len){
|
||||
@@ -123,7 +124,7 @@ void Buffer::save(fs::FS* fs){
|
||||
|
||||
file = fs->open(fileName, FILE_APPEND);
|
||||
if (!file) {
|
||||
Serial.println("Failed to open file '"+fileName+"'");
|
||||
Serial.println(text02 + fileName+"'");
|
||||
//useSD = false;
|
||||
return;
|
||||
}
|
||||
@@ -159,7 +160,7 @@ void Buffer::forceSave(fs::FS* fs){
|
||||
|
||||
file = fs->open(fileName, FILE_APPEND);
|
||||
if (!file) {
|
||||
Serial.println("Failed to open file '"+fileName+"'");
|
||||
Serial.println(text02+fileName+"'");
|
||||
//useSD = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -17,42 +17,118 @@ String CommandLine::getSerialInput() {
|
||||
}
|
||||
|
||||
void CommandLine::main(uint32_t currentTime) {
|
||||
this->parseCommand(this->getSerialInput());
|
||||
String input = this->getSerialInput();
|
||||
|
||||
this->runCommand(input);
|
||||
}
|
||||
|
||||
void CommandLine::parseCommand(String input) {
|
||||
LinkedList<String> CommandLine::parseCommand(String input) {
|
||||
LinkedList<String> cmd_args;
|
||||
|
||||
if (input != "") {
|
||||
|
||||
char delim[] = " ";
|
||||
|
||||
char fancy[input.length() + 1] = {};
|
||||
input.toCharArray(fancy, input.length() + 1);
|
||||
|
||||
char* ptr = strtok(fancy, delim);
|
||||
|
||||
while (ptr != NULL) {
|
||||
cmd_args.add(String(ptr));
|
||||
|
||||
ptr = strtok(NULL, delim);
|
||||
}
|
||||
|
||||
//memset(fancy, 0, sizeof(fancy));
|
||||
|
||||
// Display the segmented cmd
|
||||
//for (int i = 0; i < cmd_args.size(); i++) {
|
||||
// Serial.println(cmd_args.get(i));
|
||||
//}
|
||||
}
|
||||
|
||||
return cmd_args;
|
||||
}
|
||||
|
||||
int CommandLine::argSearch(LinkedList<String>* cmd_args_list, String key) {
|
||||
for (int i = 0; i < cmd_args_list->size(); i++) {
|
||||
if (cmd_args_list->get(i) == key)
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void CommandLine::runCommand(String input) {
|
||||
if (input != "")
|
||||
Serial.println("#" + input);
|
||||
else
|
||||
return;
|
||||
|
||||
if (input == STOPSCAN_CMD) {
|
||||
LinkedList<String> cmd_args = this->parseCommand(input);
|
||||
|
||||
//// Admin commands
|
||||
|
||||
// Stop Scan
|
||||
if (cmd_args.get(0) == STOPSCAN_CMD) {
|
||||
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
|
||||
menu_function_obj.changeMenu(menu_function_obj.current_menu);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.init();
|
||||
menu_function_obj.changeMenu(menu_function_obj.current_menu);
|
||||
#endif
|
||||
}
|
||||
// Channel command
|
||||
else if (cmd_args.get(0) == CH_CMD) {
|
||||
// Search for channel set arg
|
||||
int ch_set = this->argSearch(&cmd_args, "-s");
|
||||
|
||||
else if (input == SCANAP_CMD) {
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_TARGET_AP, TFT_MAGENTA);
|
||||
if (cmd_args.size() == 1) {
|
||||
Serial.println("Current channel: " + (String)wifi_scan_obj.set_channel);
|
||||
}
|
||||
else if (ch_set != -1) {
|
||||
wifi_scan_obj.set_channel = cmd_args.get(ch_set + 1).toInt();
|
||||
wifi_scan_obj.changeChannel();
|
||||
Serial.println("Set channel: " + (String)wifi_scan_obj.set_channel);
|
||||
}
|
||||
}
|
||||
|
||||
else if (input == CLEARAP_CMD) {
|
||||
// Clear APs
|
||||
else if (cmd_args.get(0) == CLEARAP_CMD) {
|
||||
wifi_scan_obj.RunClearAPs();
|
||||
}
|
||||
|
||||
else if (input == SNIFF_BEACON_CMD) {
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);
|
||||
}
|
||||
//// WiFi Scan commands
|
||||
if (!wifi_scan_obj.scanning()) {
|
||||
|
||||
else if (input == SNIFF_DEAUTH_CMD) {
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);
|
||||
// AP Scan
|
||||
if (cmd_args.get(0) == SCANAP_CMD) {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_TARGET_AP, TFT_MAGENTA);
|
||||
}
|
||||
// Beacon sniff
|
||||
else if (cmd_args.get(0) == SNIFF_BEACON_CMD) {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);
|
||||
}
|
||||
// Deauth sniff
|
||||
else if (cmd_args.get(0) == SNIFF_DEAUTH_CMD) {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);
|
||||
}
|
||||
// PMKID sniff
|
||||
else if (cmd_args.get(0) == SNIFF_PMKID_CMD) {
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,37 @@
|
||||
#ifndef CommandLine_h
|
||||
#define CommandLine_h
|
||||
|
||||
#include "MenuFunctions.h"
|
||||
#include "WiFiScan.h"
|
||||
#include "Display.h"
|
||||
#include "configs.h"
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
#include "MenuFunctions.h"
|
||||
#include "Display.h"
|
||||
#endif
|
||||
|
||||
#include "WiFiScan.h"
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
extern MenuFunctions menu_function_obj;
|
||||
extern Display display_obj;
|
||||
#endif
|
||||
|
||||
extern MenuFunctions menu_function_obj;
|
||||
extern WiFiScan wifi_scan_obj;
|
||||
extern Display display_obj;
|
||||
|
||||
// Commands
|
||||
const char PROGMEM CH_CMD[] = "channel";
|
||||
const char PROGMEM SCANAP_CMD[] = "scanap";
|
||||
const char PROGMEM SNIFF_BEACON_CMD[] = "sniffbeacon";
|
||||
const char PROGMEM SNIFF_DEAUTH_CMD[] = "sniffdeauth";
|
||||
const char PROGMEM SNIFF_PMKID_CMD[] = "sniffpmkid";
|
||||
const char PROGMEM STOPSCAN_CMD[] = "stopscan";
|
||||
const char PROGMEM CLEARAP_CMD[] = "clearap";
|
||||
|
||||
class CommandLine {
|
||||
private:
|
||||
String getSerialInput();
|
||||
void parseCommand(String input);
|
||||
LinkedList<String> parseCommand(String input);
|
||||
void runCommand(String input);
|
||||
int argSearch(LinkedList<String>* cmd_args, String key);
|
||||
|
||||
public:
|
||||
CommandLine();
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#include "Display.h"
|
||||
#include "lang_var.h"
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
|
||||
Display::Display()
|
||||
{
|
||||
@@ -34,7 +37,7 @@ void Display::RunSetup()
|
||||
clearScreen();
|
||||
|
||||
Serial.println("SPI_FREQUENCY: " + (String)SPI_FREQUENCY);
|
||||
Serial.println("SPI_READ_FREQUENCY: " + (String)SPI_READ_FREQUENCY);
|
||||
Serial.println("SPI_READ_FREQUENCY:" + (String)SPI_READ_FREQUENCY);
|
||||
Serial.println("SPI_TOUCH_FREQUENCY: " + (String)SPI_TOUCH_FREQUENCY);
|
||||
|
||||
#ifdef KIT
|
||||
@@ -54,7 +57,7 @@ void Display::tftDrawRedOnOffButton() {
|
||||
tft.setTextColor(TFT_WHITE);
|
||||
tft.setTextSize(2);
|
||||
tft.setTextDatum(MC_DATUM);
|
||||
tft.drawString("ON", GREENBUTTON_X + (GREENBUTTON_W / 2), GREENBUTTON_Y + (GREENBUTTON_H / 2));
|
||||
tft.drawString(text03, GREENBUTTON_X + (GREENBUTTON_W / 2), GREENBUTTON_Y + (GREENBUTTON_H / 2));
|
||||
this->SwitchOn = false;
|
||||
}
|
||||
|
||||
@@ -65,7 +68,7 @@ void Display::tftDrawGreenOnOffButton() {
|
||||
tft.setTextColor(TFT_WHITE);
|
||||
tft.setTextSize(2);
|
||||
tft.setTextDatum(MC_DATUM);
|
||||
tft.drawString("OFF", REDBUTTON_X + (REDBUTTON_W / 2) + 1, REDBUTTON_Y + (REDBUTTON_H / 2));
|
||||
tft.drawString(text04, REDBUTTON_X + (REDBUTTON_W / 2) + 1, REDBUTTON_Y + (REDBUTTON_H / 2));
|
||||
this->SwitchOn = true;
|
||||
}
|
||||
|
||||
@@ -167,7 +170,7 @@ void Display::tftDrawYScaleButtons(byte y_scale)
|
||||
void Display::tftDrawChannelScaleButtons(int set_channel)
|
||||
{
|
||||
tft.drawFastVLine(178, 0, 20, TFT_WHITE);
|
||||
tft.setCursor(145, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print("Channel:"); tft.print(set_channel);
|
||||
tft.setCursor(145, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print(text10); tft.print(set_channel);
|
||||
|
||||
key[4].initButton(&tft, // channel - box
|
||||
164,
|
||||
@@ -237,7 +240,7 @@ void Display::touchToExit()
|
||||
{
|
||||
tft.setTextColor(TFT_BLACK, TFT_LIGHTGREY);
|
||||
tft.fillRect(0,32,HEIGHT_1,16, TFT_LIGHTGREY);
|
||||
tft.drawCentreString("Touch screen to exit",120,32,2);
|
||||
tft.drawCentreString(text11,120,32,2);
|
||||
}
|
||||
|
||||
|
||||
@@ -763,3 +766,5 @@ void Display::main(uint8_t scan_mode)
|
||||
return;
|
||||
}
|
||||
// End SPIFFS_functions
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#ifndef Display_h
|
||||
#define Display_h
|
||||
|
||||
#include "configs.h"
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
|
||||
#include <FS.h>
|
||||
#include <functional>
|
||||
@@ -13,7 +16,6 @@
|
||||
//#include <M5Stack.h>
|
||||
#include "SPIFFS.h"
|
||||
#include "Assets.h"
|
||||
#include "configs.h"
|
||||
|
||||
#include <TFT_eSPI.h>
|
||||
|
||||
@@ -152,3 +154,4 @@ class Display
|
||||
void updateBanner(String msg);
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#include "MenuFunctions.h"
|
||||
#include "lang_var.h"
|
||||
//#include "icons.h"
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
|
||||
extern const unsigned char menu_icons[][66];
|
||||
PROGMEM lv_obj_t * slider_label;
|
||||
PROGMEM lv_obj_t * ta1;
|
||||
@@ -138,7 +141,7 @@ MenuFunctions::MenuFunctions()
|
||||
lv_obj_set_width(load_btn, LV_HOR_RES / 3);
|
||||
lv_obj_align(load_btn, ta1, LV_ALIGN_IN_TOP_RIGHT, NULL, (LV_VER_RES / 2) - 35); // align to text area
|
||||
label = lv_label_create(load_btn, NULL);
|
||||
lv_label_set_text(label, "Load");
|
||||
lv_label_set_text(label, text05);
|
||||
|
||||
// Create Save As button
|
||||
lv_obj_t * label2;
|
||||
@@ -148,7 +151,7 @@ MenuFunctions::MenuFunctions()
|
||||
lv_obj_set_width(save_as_btn, LV_HOR_RES / 3);
|
||||
lv_obj_align(save_as_btn, ta1, LV_ALIGN_IN_TOP_MID, NULL, (LV_VER_RES / 2) - 35); // align to text area
|
||||
label2 = lv_label_create(save_as_btn, NULL);
|
||||
lv_label_set_text(label2, "Save As");
|
||||
lv_label_set_text(label2, text06);
|
||||
}
|
||||
|
||||
// Focus it on one of the text areas to start
|
||||
@@ -174,7 +177,7 @@ MenuFunctions::MenuFunctions()
|
||||
String display_string = "";
|
||||
|
||||
if (event == LV_EVENT_CLICKED) {
|
||||
if (btn_text == "Exit") {
|
||||
if (btn_text == text07) {
|
||||
Serial.println("Exiting...");
|
||||
lv_obj_del_async(lv_obj_get_parent(lv_obj_get_parent(btn)));
|
||||
|
||||
@@ -198,7 +201,7 @@ MenuFunctions::MenuFunctions()
|
||||
// Build the generic Exit button
|
||||
exit_btn = lv_btn_create(obj, NULL);
|
||||
lv_obj_set_event_cb(exit_btn, settings_list_cb);
|
||||
lv_label_set_text(label, "Exit");
|
||||
lv_label_set_text(label, text07);
|
||||
//lv_obj_center(label);
|
||||
|
||||
label = lv_label_create(exit_btn, NULL);
|
||||
@@ -260,12 +263,12 @@ MenuFunctions::MenuFunctions()
|
||||
|
||||
lv_obj_t * sw;
|
||||
|
||||
list_btn = lv_list_add_btn(list1, LV_SYMBOL_CLOSE, "Exit");
|
||||
list_btn = lv_list_add_btn(list1, LV_SYMBOL_CLOSE, text07);
|
||||
lv_obj_set_event_cb(list_btn, ap_list_cb);
|
||||
|
||||
for (int i = 0; i < json["Settings"].size(); i++) {
|
||||
char buf[json["Settings"][i]["name"].as<String>().length() + 1] = {};
|
||||
json["Settings"][i]["name"].as<String>().toCharArray(buf, json["Settings"][i]["name"].as<String>().length() + 1);
|
||||
for (int i = 0; i < json[text09].size(); i++) {
|
||||
char buf[json[text08][i]["name"].as<String>().length() + 1] = {};
|
||||
json[text08][i]["name"].as<String>().toCharArray(buf, json[text08][i]["name"].as<String>().length() + 1);
|
||||
|
||||
list_btn = lv_list_add_btn(list1, LV_SYMBOL_WIFI, buf);
|
||||
lv_btn_set_checkable(list_btn, false);
|
||||
@@ -315,7 +318,7 @@ MenuFunctions::MenuFunctions()
|
||||
|
||||
lv_obj_t * label;
|
||||
|
||||
list_btn = lv_list_add_btn(list1, LV_SYMBOL_CLOSE, "Exit");
|
||||
list_btn = lv_list_add_btn(list1, LV_SYMBOL_CLOSE, text09);
|
||||
lv_obj_set_event_cb(list_btn, ap_list_cb);
|
||||
|
||||
for (int i = 0; i < access_points->size(); i++) {
|
||||
@@ -349,7 +352,7 @@ MenuFunctions::MenuFunctions()
|
||||
String display_string = "";
|
||||
|
||||
if (event == LV_EVENT_CLICKED) {
|
||||
if (btn_text != "Exit") {
|
||||
if (btn_text != text09) {
|
||||
//lv_list_focus_btn(lv_obj_get_parent(lv_obj_get_parent(btn)), btn);
|
||||
}
|
||||
else {
|
||||
@@ -415,7 +418,7 @@ MenuFunctions::MenuFunctions()
|
||||
lv_obj_set_pos(ta1, 5, 20);
|
||||
lv_textarea_set_cursor_hidden(ta1, true);
|
||||
lv_obj_align(ta1, NULL, LV_ALIGN_IN_TOP_MID, NULL, NULL);
|
||||
lv_textarea_set_placeholder_text(ta1, "SSID List");
|
||||
lv_textarea_set_placeholder_text(ta1, text_table1[0]);
|
||||
|
||||
// Create second text area
|
||||
// Add SSIDs
|
||||
@@ -424,7 +427,7 @@ MenuFunctions::MenuFunctions()
|
||||
lv_textarea_set_one_line(ta2, true);
|
||||
lv_obj_align(ta2, NULL, LV_ALIGN_IN_TOP_MID, NULL, (LV_VER_RES / 2) - 35);
|
||||
lv_textarea_set_text(ta2, "");
|
||||
lv_textarea_set_placeholder_text(ta2, "Add SSIDs");
|
||||
lv_textarea_set_placeholder_text(ta2, text_table1[1]);
|
||||
|
||||
// After generating text areas, add text to first text box
|
||||
for (int i = 0; i < ssids->size(); i++)
|
||||
@@ -451,7 +454,7 @@ MenuFunctions::MenuFunctions()
|
||||
|
||||
// Create first label
|
||||
lv_obj_t * ssid_label = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_label_set_text(ssid_label, "SSID:");
|
||||
lv_label_set_text(ssid_label, text_table1[2]);
|
||||
lv_obj_align(ssid_label, ta1, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
|
||||
|
||||
// Create second text area
|
||||
@@ -463,7 +466,7 @@ MenuFunctions::MenuFunctions()
|
||||
|
||||
// Create second label
|
||||
lv_obj_t * pw_label = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_label_set_text(pw_label, "Password:");
|
||||
lv_label_set_text(pw_label, text_table1[3]);
|
||||
lv_obj_align(pw_label, ta2, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
|
||||
|
||||
// Create a keyboard and apply the styles
|
||||
@@ -526,7 +529,7 @@ MenuFunctions::MenuFunctions()
|
||||
lv_obj_set_width(save_btn, LV_HOR_RES / 3);
|
||||
lv_obj_align(save_btn, ta1, LV_ALIGN_IN_TOP_LEFT, NULL, (LV_VER_RES / 2) - 35); // align to text area
|
||||
save_label = lv_label_create(save_btn, NULL);
|
||||
lv_label_set_text(save_label, "Save");
|
||||
lv_label_set_text(save_label, text13);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -542,7 +545,7 @@ MenuFunctions::MenuFunctions()
|
||||
Serial.println(btn_text);
|
||||
|
||||
// Get file content and send to text area
|
||||
if (btn_text != "Cancel") {
|
||||
if (btn_text != text12) {
|
||||
File script = SD.open(btn_text);
|
||||
|
||||
if (script) {
|
||||
@@ -566,7 +569,7 @@ MenuFunctions::MenuFunctions()
|
||||
lv_obj_set_width(save_btn, LV_HOR_RES / 3);
|
||||
lv_obj_align(save_btn, ta1, LV_ALIGN_IN_TOP_LEFT, NULL, (LV_VER_RES / 2) - 35); // align to text area
|
||||
save_label = lv_label_create(save_btn, NULL);
|
||||
lv_label_set_text(save_label, "Save");
|
||||
lv_label_set_text(save_label, text13);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -600,7 +603,7 @@ MenuFunctions::MenuFunctions()
|
||||
// Build list of files from the SD card
|
||||
lv_obj_t * list_btn;
|
||||
|
||||
list_btn = lv_list_add_btn(list1, LV_SYMBOL_CLOSE, "Cancel");
|
||||
list_btn = lv_list_add_btn(list1, LV_SYMBOL_CLOSE, text12);
|
||||
lv_obj_set_event_cb(list_btn, test_btn_cb);
|
||||
|
||||
while (true) {
|
||||
@@ -628,7 +631,7 @@ MenuFunctions::MenuFunctions()
|
||||
}
|
||||
|
||||
// Save current text bod content to new file
|
||||
else if (btn_text == "Save As") {
|
||||
else if (btn_text == text06) {
|
||||
if (event == LV_EVENT_CLICKED)
|
||||
Serial.println("Save button pressed");
|
||||
else if (event == LV_EVENT_RELEASED) {
|
||||
@@ -652,7 +655,7 @@ MenuFunctions::MenuFunctions()
|
||||
}
|
||||
|
||||
// Save current text box content to current loaded file
|
||||
else if (btn_text == "Save") {
|
||||
else if (btn_text == text13) {
|
||||
if (event == LV_EVENT_CLICKED)
|
||||
Serial.println("Save button pressed");
|
||||
else if (event == LV_EVENT_RELEASED) {
|
||||
@@ -965,7 +968,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
//display_obj.key[b].drawButton2(current_menu->list->get(b).name, true); // draw invert
|
||||
//display_obj.key[b].drawButton(ML_DATUM, BUTTON_PADDING, current_menu->list->get(b).name, true);
|
||||
display_obj.key[b].drawButton(true, current_menu->list->get(b).name);
|
||||
if (current_menu->list->get(b).name != "Back")
|
||||
if (current_menu->list->get(b).name != text09)
|
||||
display_obj.tft.drawXBitmap(0,
|
||||
KEY_Y + b * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
|
||||
menu_icons[current_menu->list->get(b).icon],
|
||||
@@ -988,7 +991,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
// This
|
||||
else if ((display_obj.key[b].justReleased()) && (pressed)) {
|
||||
display_obj.key[b].drawButton(false, current_menu->list->get(b).name);
|
||||
if (current_menu->list->get(b).name != "Back")
|
||||
if (current_menu->list->get(b).name != text09)
|
||||
display_obj.tft.drawXBitmap(0,
|
||||
KEY_Y + b * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
|
||||
menu_icons[current_menu->list->get(b).icon],
|
||||
@@ -1360,12 +1363,12 @@ void MenuFunctions::displaySetting(String key, Menu* menu, int index) {
|
||||
// Set local copy value
|
||||
if (!setting_value) {
|
||||
display_obj.tft.setTextColor(TFT_RED);
|
||||
display_obj.tft.println(F("Setting disabled"));
|
||||
display_obj.tft.println(F(text_table1[4]));
|
||||
node.selected = false;
|
||||
}
|
||||
else {
|
||||
display_obj.tft.setTextColor(TFT_GREEN);
|
||||
display_obj.tft.println(F("Setting on"));
|
||||
display_obj.tft.println(F(text_table1[5]));
|
||||
node.selected = true;
|
||||
}
|
||||
|
||||
@@ -1420,139 +1423,139 @@ void MenuFunctions::RunSetup()
|
||||
clearAPsMenu.list = new LinkedList<MenuNode>();
|
||||
|
||||
// Work menu names
|
||||
mainMenu.name = " ESP32 Marauder ";
|
||||
wifiMenu.name = " WiFi ";
|
||||
badusbMenu.name = " Bad USB ";
|
||||
deviceMenu.name = " Device ";
|
||||
generalMenu.name = " General Apps ";
|
||||
failedUpdateMenu.name = " Updating... ";
|
||||
whichUpdateMenu.name = "Select Method ";
|
||||
confirmMenu.name = " Confirm Update ";
|
||||
espUpdateMenu.name = " ESP8266 Update ";
|
||||
updateMenu.name = " Update Firmware ";
|
||||
languageMenu.name = " Language ";
|
||||
infoMenu.name = " Device Info ";
|
||||
settingsMenu.name = " Settings ";
|
||||
bluetoothMenu.name = " Bluetooth ";
|
||||
wifiSnifferMenu.name = " WiFi Sniffers ";
|
||||
wifiAttackMenu.name = " WiFi Attacks ";
|
||||
wifiGeneralMenu.name = " WiFi General ";
|
||||
bluetoothSnifferMenu.name = " Bluetooth Sniffers ";
|
||||
bluetoothGeneralMenu.name = " Bluetooth General ";
|
||||
shutdownWiFiMenu.name = " Shutdown WiFi ";
|
||||
shutdownBLEMenu.name = " Shutdown BLE ";
|
||||
generateSSIDsMenu.name = " Generate SSIDs ";
|
||||
clearSSIDsMenu.name = " Clear SSIDs ";
|
||||
clearAPsMenu.name = " Clear APs ";
|
||||
mainMenu.name = text_table1[6];
|
||||
wifiMenu.name = text_table1[7];
|
||||
badusbMenu.name = text_table1[8];
|
||||
deviceMenu.name = text_table1[9];
|
||||
generalMenu.name = text_table1[10];
|
||||
failedUpdateMenu.name = text_table1[11];
|
||||
whichUpdateMenu.name = text_table1[12];
|
||||
confirmMenu.name = text_table1[13];
|
||||
espUpdateMenu.name = text_table1[14];
|
||||
updateMenu.name = text_table1[15];
|
||||
languageMenu.name = text_table1[16];
|
||||
infoMenu.name = text_table1[17];
|
||||
settingsMenu.name = text_table1[18];
|
||||
bluetoothMenu.name = text_table1[19];
|
||||
wifiSnifferMenu.name = text_table1[20];
|
||||
wifiAttackMenu.name = text_table1[21];
|
||||
wifiGeneralMenu.name = text_table1[22];
|
||||
bluetoothSnifferMenu.name = text_table1[23];
|
||||
bluetoothGeneralMenu.name = text_table1[24];
|
||||
shutdownWiFiMenu.name = text_table1[25];
|
||||
shutdownBLEMenu.name = text_table1[26];
|
||||
generateSSIDsMenu.name = text_table1[27];
|
||||
clearSSIDsMenu.name = text_table1[28];
|
||||
clearAPsMenu.name = text_table1[29];
|
||||
|
||||
|
||||
// Build Main Menu
|
||||
mainMenu.parentMenu = NULL;
|
||||
addNodes(&mainMenu, "WiFi", TFT_GREEN, NULL, WIFI, [this]() {
|
||||
addNodes(&mainMenu, text_table1[7], TFT_GREEN, NULL, WIFI, [this]() {
|
||||
changeMenu(&wifiMenu);
|
||||
});
|
||||
addNodes(&mainMenu, "Bluetooth", TFT_CYAN, NULL, BLUETOOTH, [this]() {
|
||||
addNodes(&mainMenu, text_table1[19], TFT_CYAN, NULL, BLUETOOTH, [this]() {
|
||||
changeMenu(&bluetoothMenu);
|
||||
});
|
||||
if (a32u4_obj.supported) addNodes(&mainMenu, "Bad USB", TFT_RED, NULL, BAD_USB_ICO, [this]() {
|
||||
if (a32u4_obj.supported) addNodes(&mainMenu, text_table1[8], TFT_RED, NULL, BAD_USB_ICO, [this]() {
|
||||
changeMenu(&badusbMenu);
|
||||
});
|
||||
addNodes(&mainMenu, "General Apps", TFT_MAGENTA, NULL, GENERAL_APPS, [this]() {
|
||||
addNodes(&mainMenu, text_table1[10], TFT_MAGENTA, NULL, GENERAL_APPS, [this]() {
|
||||
changeMenu(&generalMenu);
|
||||
});
|
||||
addNodes(&mainMenu, "Device", TFT_BLUE, NULL, DEVICE, [this]() {
|
||||
addNodes(&mainMenu, text_table1[9], TFT_BLUE, NULL, DEVICE, [this]() {
|
||||
changeMenu(&deviceMenu);
|
||||
});
|
||||
addNodes(&mainMenu, "Reboot", TFT_LIGHTGREY, NULL, REBOOT, []() {
|
||||
addNodes(&mainMenu, text_table1[30], TFT_LIGHTGREY, NULL, REBOOT, []() {
|
||||
ESP.restart();
|
||||
});
|
||||
|
||||
// Build WiFi Menu
|
||||
wifiMenu.parentMenu = &mainMenu; // Main Menu is second menu parent
|
||||
addNodes(&wifiMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&wifiMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(wifiMenu.parentMenu);
|
||||
});
|
||||
addNodes(&wifiMenu, "Sniffers", TFT_YELLOW, NULL, SNIFFERS, [this]() {
|
||||
addNodes(&wifiMenu, text_table1[31], TFT_YELLOW, NULL, SNIFFERS, [this]() {
|
||||
changeMenu(&wifiSnifferMenu);
|
||||
});
|
||||
//addNodes(&wifiMenu, "Scanners", TFT_ORANGE, NULL, SCANNERS, [this]() {
|
||||
// changeMenu(&wifiScannerMenu);
|
||||
//});
|
||||
addNodes(&wifiMenu, "Attacks", TFT_RED, NULL, ATTACKS, [this]() {
|
||||
addNodes(&wifiMenu, text_table1[32], TFT_RED, NULL, ATTACKS, [this]() {
|
||||
changeMenu(&wifiAttackMenu);
|
||||
});
|
||||
addNodes(&wifiMenu, "General", TFT_PURPLE, NULL, GENERAL_APPS, [this]() {
|
||||
addNodes(&wifiMenu, text_table1[33], TFT_PURPLE, NULL, GENERAL_APPS, [this]() {
|
||||
changeMenu(&wifiGeneralMenu);
|
||||
});
|
||||
|
||||
// Build WiFi sniffer Menu
|
||||
wifiSnifferMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||
addNodes(&wifiSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&wifiSnifferMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(wifiSnifferMenu.parentMenu);
|
||||
});
|
||||
addNodes(&wifiSnifferMenu, "Probe Request Sniff", TFT_CYAN, NULL, PROBE_SNIFF, [this]() {
|
||||
addNodes(&wifiSnifferMenu, text_table1[42], TFT_CYAN, NULL, PROBE_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_CYAN);
|
||||
}, "probescan");
|
||||
addNodes(&wifiSnifferMenu, "Beacon Sniff", TFT_MAGENTA, NULL, BEACON_SNIFF, [this]() {
|
||||
});
|
||||
addNodes(&wifiSnifferMenu, text_table1[43], TFT_MAGENTA, NULL, BEACON_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);
|
||||
});
|
||||
addNodes(&wifiSnifferMenu, "Deauth Sniff", TFT_RED, NULL, DEAUTH_SNIFF, [this]() {
|
||||
addNodes(&wifiSnifferMenu, text_table1[44], TFT_RED, NULL, DEAUTH_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);
|
||||
});
|
||||
addNodes(&wifiSnifferMenu, "Packet Monitor", TFT_BLUE, NULL, PACKET_MONITOR, [this]() {
|
||||
addNodes(&wifiSnifferMenu, text_table1[45], TFT_BLUE, NULL, PACKET_MONITOR, [this]() {
|
||||
wifi_scan_obj.StartScan(WIFI_PACKET_MONITOR, TFT_BLUE);
|
||||
});
|
||||
addNodes(&wifiSnifferMenu, "EAPOL/PMKID Scan", TFT_VIOLET, NULL, EAPOL, [this]() {
|
||||
addNodes(&wifiSnifferMenu, text_table1[46], TFT_VIOLET, NULL, EAPOL, [this]() {
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);
|
||||
});
|
||||
addNodes(&wifiSnifferMenu, "Detect Pwnagotchi", TFT_RED, NULL, PWNAGOTCHI, [this]() {
|
||||
addNodes(&wifiSnifferMenu, text_table1[47], TFT_RED, NULL, PWNAGOTCHI, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_PWN, TFT_RED);
|
||||
});
|
||||
addNodes(&wifiSnifferMenu, "Detect Espressif", TFT_ORANGE, NULL, ESPRESSIF, [this]() {
|
||||
addNodes(&wifiSnifferMenu, text_table1[48], TFT_ORANGE, NULL, ESPRESSIF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_ESPRESSIF, TFT_ORANGE);
|
||||
});
|
||||
addNodes(&wifiSnifferMenu, "Scan APs", TFT_MAGENTA, NULL, BEACON_SNIFF, [this]() {
|
||||
addNodes(&wifiSnifferMenu, text_table1[49], TFT_MAGENTA, NULL, BEACON_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_TARGET_AP, TFT_MAGENTA);
|
||||
}, "scanap");
|
||||
});
|
||||
|
||||
// Build WiFi attack menu
|
||||
wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||
addNodes(&wifiAttackMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&wifiAttackMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(wifiAttackMenu.parentMenu);
|
||||
});
|
||||
addNodes(&wifiAttackMenu, "Beacon Spam List", TFT_RED, NULL, BEACON_LIST, [this]() {
|
||||
addNodes(&wifiAttackMenu, text_table1[50], TFT_RED, NULL, BEACON_LIST, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_LIST, TFT_RED);
|
||||
});
|
||||
addNodes(&wifiAttackMenu, "Beacon Spam Random", TFT_ORANGE, NULL, BEACON_SPAM, [this]() {
|
||||
addNodes(&wifiAttackMenu, text_table1[51], TFT_ORANGE, NULL, BEACON_SPAM, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE);
|
||||
});
|
||||
addNodes(&wifiAttackMenu, "Rick Roll Beacon", TFT_YELLOW, NULL, RICK_ROLL, [this]() {
|
||||
addNodes(&wifiAttackMenu, text_table1[52], TFT_YELLOW, NULL, RICK_ROLL, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW);
|
||||
});
|
||||
addNodes(&wifiAttackMenu, "Probe Req Flood", TFT_RED, NULL, PROBE_SNIFF, [this]() {
|
||||
addNodes(&wifiAttackMenu, text_table1[53], TFT_RED, NULL, PROBE_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_ATTACK_AUTH, TFT_RED);
|
||||
});
|
||||
addNodes(&wifiAttackMenu, "Deauth Flood", TFT_RED, NULL, DEAUTH_SNIFF, [this]() {
|
||||
addNodes(&wifiAttackMenu, text_table1[54], TFT_RED, NULL, DEAUTH_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_ATTACK_DEAUTH, TFT_RED);
|
||||
@@ -1565,43 +1568,43 @@ void MenuFunctions::RunSetup()
|
||||
|
||||
// Build WiFi General menu
|
||||
wifiGeneralMenu.parentMenu = &wifiMenu;
|
||||
addNodes(&wifiGeneralMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&wifiGeneralMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(wifiGeneralMenu.parentMenu);
|
||||
});
|
||||
#ifndef MARAUDER_MINI
|
||||
addNodes(&wifiGeneralMenu, "Join WiFi", TFT_DARKCYAN, NULL, JOIN_WIFI, [this](){
|
||||
addNodes(&wifiGeneralMenu, text_table1[55], TFT_DARKCYAN, NULL, JOIN_WIFI, [this](){
|
||||
display_obj.clearScreen();
|
||||
wifi_scan_obj.currentScanMode = LV_JOIN_WIFI;
|
||||
wifi_scan_obj.StartScan(LV_JOIN_WIFI, TFT_YELLOW);
|
||||
joinWiFiGFX();
|
||||
});
|
||||
#endif
|
||||
addNodes(&wifiGeneralMenu, "Shutdown WiFi", TFT_CYAN, NULL, SHUTDOWN, [this]() {
|
||||
addNodes(&wifiGeneralMenu, text_table1[25], TFT_CYAN, NULL, SHUTDOWN, [this]() {
|
||||
changeMenu(&shutdownWiFiMenu);
|
||||
wifi_scan_obj.RunShutdownWiFi();
|
||||
});
|
||||
addNodes(&wifiGeneralMenu, "Generate SSIDs", TFT_SKYBLUE, NULL, GENERATE, [this]() {
|
||||
addNodes(&wifiGeneralMenu, text_table1[27], TFT_SKYBLUE, NULL, GENERATE, [this]() {
|
||||
changeMenu(&generateSSIDsMenu);
|
||||
wifi_scan_obj.RunGenerateSSIDs();
|
||||
});
|
||||
#ifndef MARAUDER_MINI
|
||||
addNodes(&wifiGeneralMenu, "Add SSID", TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
|
||||
addNodes(&wifiGeneralMenu, text_table1[1], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
|
||||
display_obj.clearScreen();
|
||||
//wifi_scan_obj.currentScanMode = LV_ADD_SSID;
|
||||
wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_YELLOW);
|
||||
addSSIDGFX();
|
||||
});
|
||||
#endif
|
||||
addNodes(&wifiGeneralMenu, "Clear SSIDs", TFT_SILVER, NULL, CLEAR_ICO, [this]() {
|
||||
addNodes(&wifiGeneralMenu, text_table1[28], TFT_SILVER, NULL, CLEAR_ICO, [this]() {
|
||||
changeMenu(&clearSSIDsMenu);
|
||||
wifi_scan_obj.RunClearSSIDs();
|
||||
});
|
||||
addNodes(&wifiGeneralMenu, "Clear APs", TFT_DARKGREY, NULL, CLEAR_ICO, [this]() {
|
||||
addNodes(&wifiGeneralMenu, text_table1[29], TFT_DARKGREY, NULL, CLEAR_ICO, [this]() {
|
||||
changeMenu(&clearAPsMenu);
|
||||
wifi_scan_obj.RunClearAPs();
|
||||
});
|
||||
#ifndef MARAUDER_MINI
|
||||
addNodes(&wifiGeneralMenu, "Select APs", TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
|
||||
addNodes(&wifiGeneralMenu, text_table1[56], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
|
||||
display_obj.clearScreen();
|
||||
wifi_scan_obj.currentScanMode = LV_ADD_SSID;
|
||||
wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED);
|
||||
@@ -1611,53 +1614,53 @@ void MenuFunctions::RunSetup()
|
||||
|
||||
// Build shutdown wifi menu
|
||||
shutdownWiFiMenu.parentMenu = &wifiGeneralMenu;
|
||||
addNodes(&shutdownWiFiMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&shutdownWiFiMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(shutdownWiFiMenu.parentMenu);
|
||||
});
|
||||
|
||||
// Build generate ssids menu
|
||||
generateSSIDsMenu.parentMenu = &wifiGeneralMenu;
|
||||
addNodes(&generateSSIDsMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&generateSSIDsMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(generateSSIDsMenu.parentMenu);
|
||||
});
|
||||
|
||||
// Build clear ssids menu
|
||||
clearSSIDsMenu.parentMenu = &wifiGeneralMenu;
|
||||
addNodes(&clearSSIDsMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&clearSSIDsMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(clearSSIDsMenu.parentMenu);
|
||||
});
|
||||
clearAPsMenu.parentMenu = &wifiGeneralMenu;
|
||||
addNodes(&clearAPsMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&clearAPsMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(clearAPsMenu.parentMenu);
|
||||
});
|
||||
|
||||
|
||||
// Build Bluetooth Menu
|
||||
bluetoothMenu.parentMenu = &mainMenu; // Second Menu is third menu parent
|
||||
addNodes(&bluetoothMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&bluetoothMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(bluetoothMenu.parentMenu);
|
||||
});
|
||||
addNodes(&bluetoothMenu, "Sniffers", TFT_YELLOW, NULL, SNIFFERS, [this]() {
|
||||
addNodes(&bluetoothMenu, text_table1[31], TFT_YELLOW, NULL, SNIFFERS, [this]() {
|
||||
changeMenu(&bluetoothSnifferMenu);
|
||||
});
|
||||
//addNodes(&bluetoothMenu, "Scanners", TFT_ORANGE, NULL, SCANNERS, [this]() {
|
||||
// changeMenu(&bluetoothScannerMenu);
|
||||
//});
|
||||
addNodes(&bluetoothMenu, "General", TFT_PURPLE, NULL, GENERAL_APPS, [this]() {
|
||||
addNodes(&bluetoothMenu, text_table1[33], TFT_PURPLE, NULL, GENERAL_APPS, [this]() {
|
||||
changeMenu(&bluetoothGeneralMenu);
|
||||
});
|
||||
|
||||
// Build bluetooth sniffer Menu
|
||||
bluetoothSnifferMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
|
||||
addNodes(&bluetoothSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&bluetoothSnifferMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(bluetoothSnifferMenu.parentMenu);
|
||||
});
|
||||
addNodes(&bluetoothSnifferMenu, "Bluetooth Sniffer", TFT_GREEN, NULL, BLUETOOTH_SNIFF, [this]() {
|
||||
addNodes(&bluetoothSnifferMenu, text_table1[34], TFT_GREEN, NULL, BLUETOOTH_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);
|
||||
});
|
||||
addNodes(&bluetoothSnifferMenu, "Detect Card Skimmers", TFT_MAGENTA, NULL, CC_SKIMMERS, [this]() {
|
||||
addNodes(&bluetoothSnifferMenu, text_table1[35], TFT_MAGENTA, NULL, CC_SKIMMERS, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);
|
||||
@@ -1665,36 +1668,36 @@ void MenuFunctions::RunSetup()
|
||||
|
||||
// Build bluetooth scanner Menu
|
||||
//bluetoothScannerMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
|
||||
//addNodes(&bluetoothScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
//addNodes(&bluetoothScannerMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
// changeMenu(bluetoothScannerMenu.parentMenu);
|
||||
//});
|
||||
|
||||
// Build bluetooth general menu
|
||||
bluetoothGeneralMenu.parentMenu = &bluetoothMenu;
|
||||
addNodes(&bluetoothGeneralMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&bluetoothGeneralMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(bluetoothGeneralMenu.parentMenu);
|
||||
});
|
||||
addNodes(&bluetoothGeneralMenu, "Shutdown BLE", TFT_ORANGE, NULL, SHUTDOWN, [this]() {
|
||||
addNodes(&bluetoothGeneralMenu, text_table1[26], TFT_ORANGE, NULL, SHUTDOWN, [this]() {
|
||||
changeMenu(&shutdownBLEMenu);
|
||||
wifi_scan_obj.RunShutdownBLE();
|
||||
});
|
||||
|
||||
// Build shutdown BLE menu
|
||||
shutdownBLEMenu.parentMenu = &bluetoothGeneralMenu;
|
||||
addNodes(&shutdownBLEMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&shutdownBLEMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(shutdownBLEMenu.parentMenu);
|
||||
});
|
||||
|
||||
// Bad USB Menu
|
||||
badusbMenu.parentMenu = &mainMenu;
|
||||
addNodes(&badusbMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&badusbMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(badusbMenu.parentMenu);
|
||||
});
|
||||
addNodes(&badusbMenu, "Test BadUSB", TFT_PURPLE, NULL, TEST_BAD_USB_ICO, [this]() {
|
||||
addNodes(&badusbMenu, text_table1[36], TFT_PURPLE, NULL, TEST_BAD_USB_ICO, [this]() {
|
||||
a32u4_obj.test();
|
||||
});
|
||||
#ifndef MARAUDER_MINI
|
||||
addNodes(&badusbMenu, "Run Ducky Script", TFT_RED, NULL, BAD_USB_ICO, [this](){
|
||||
addNodes(&badusbMenu, text_table1[37], TFT_RED, NULL, BAD_USB_ICO, [this](){
|
||||
display_obj.clearScreen();
|
||||
wifi_scan_obj.currentScanMode = LV_ADD_SSID;
|
||||
wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED);
|
||||
@@ -1704,11 +1707,11 @@ void MenuFunctions::RunSetup()
|
||||
|
||||
// General apps menu
|
||||
generalMenu.parentMenu = &mainMenu;
|
||||
addNodes(&generalMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&generalMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
display_obj.draw_tft = false;
|
||||
changeMenu(generalMenu.parentMenu);
|
||||
});
|
||||
addNodes(&generalMenu, "Draw", TFT_WHITE, NULL, DRAW, [this]() {
|
||||
addNodes(&generalMenu, text_table1[38], TFT_WHITE, NULL, DRAW, [this]() {
|
||||
display_obj.clearScreen();
|
||||
display_obj.setupDraw();
|
||||
display_obj.draw_tft = true;
|
||||
@@ -1716,27 +1719,29 @@ void MenuFunctions::RunSetup()
|
||||
|
||||
// Device menu
|
||||
deviceMenu.parentMenu = &mainMenu;
|
||||
addNodes(&deviceMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&deviceMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(deviceMenu.parentMenu);
|
||||
});
|
||||
//addNodes(&deviceMenu, "Update Firmware", TFT_ORANGE, NULL, UPDATE, [this](){wifi_scan_obj.currentScanMode = OTA_UPDATE; changeMenu(&updateMenu); web_obj.setupOTAupdate();});
|
||||
addNodes(&deviceMenu, "Update Firmware", TFT_ORANGE, NULL, UPDATE, [this]() {
|
||||
addNodes(&deviceMenu, text_table1[15], TFT_ORANGE, NULL, UPDATE, [this]() {
|
||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||
changeMenu(&whichUpdateMenu);
|
||||
});
|
||||
addNodes(&deviceMenu, "Language", TFT_GREEN, NULL, LANGUAGE, [this]() {
|
||||
|
||||
addNodes(&deviceMenu, text_table1[16], TFT_GREEN, NULL, LANGUAGE, [this]() {
|
||||
|
||||
wifi_scan_obj.currentScanMode = SHOW_INFO;
|
||||
changeMenu(&languageMenu);
|
||||
});
|
||||
addNodes(&deviceMenu, "Device Info", TFT_WHITE, NULL, DEVICE_INFO, [this]() {
|
||||
addNodes(&deviceMenu, text_table1[17], TFT_WHITE, NULL, DEVICE_INFO, [this]() {
|
||||
wifi_scan_obj.currentScanMode = SHOW_INFO;
|
||||
changeMenu(&infoMenu);
|
||||
wifi_scan_obj.RunInfo();
|
||||
});
|
||||
addNodes(&deviceMenu, "Settings", TFT_NAVY, NULL, KEYBOARD_ICO, [this]() {
|
||||
addNodes(&deviceMenu, text08, TFT_NAVY, NULL, KEYBOARD_ICO, [this]() {
|
||||
changeMenu(&settingsMenu);
|
||||
});
|
||||
/*addNodes(&deviceMenu, "Settings", TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
|
||||
/*addNodes(&deviceMenu, text08, TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
|
||||
display_obj.clearScreen();
|
||||
wifi_scan_obj.currentScanMode = LV_ADD_SSID;
|
||||
wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED);
|
||||
@@ -1746,7 +1751,7 @@ void MenuFunctions::RunSetup()
|
||||
// Settings menu
|
||||
// Device menu
|
||||
settingsMenu.parentMenu = &deviceMenu;
|
||||
addNodes(&settingsMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&settingsMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(settingsMenu.parentMenu);
|
||||
});
|
||||
for (int i = 0; i < settings_obj.getNumberSettings(); i++) {
|
||||
@@ -1761,25 +1766,25 @@ void MenuFunctions::RunSetup()
|
||||
|
||||
// Specific setting menu
|
||||
specSettingMenu.parentMenu = &settingsMenu;
|
||||
addNodes(&specSettingMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&specSettingMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(specSettingMenu.parentMenu);
|
||||
});
|
||||
|
||||
// Select update
|
||||
whichUpdateMenu.parentMenu = &deviceMenu;
|
||||
addNodes(&whichUpdateMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&whichUpdateMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(whichUpdateMenu.parentMenu);
|
||||
});
|
||||
addNodes(&whichUpdateMenu, "Web Update", TFT_GREEN, NULL, WEB_UPDATE, [this]() {
|
||||
addNodes(&whichUpdateMenu, text_table1[39], TFT_GREEN, NULL, WEB_UPDATE, [this]() {
|
||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||
changeMenu(&updateMenu);
|
||||
web_obj.setupOTAupdate();
|
||||
});
|
||||
if (sd_obj.supported) addNodes(&whichUpdateMenu, "SD Update", TFT_MAGENTA, NULL, SD_UPDATE, [this]() {
|
||||
if (sd_obj.supported) addNodes(&whichUpdateMenu, text_table1[40], TFT_MAGENTA, NULL, SD_UPDATE, [this]() {
|
||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||
changeMenu(&confirmMenu);
|
||||
});
|
||||
addNodes(&whichUpdateMenu, "ESP8266 Update", TFT_RED, NULL, ESP_UPDATE_ICO, [this]() {
|
||||
addNodes(&whichUpdateMenu, text_table1[41], TFT_RED, NULL, ESP_UPDATE_ICO, [this]() {
|
||||
wifi_scan_obj.currentScanMode = ESP_UPDATE;
|
||||
changeMenu(&espUpdateMenu);
|
||||
esp_obj.RunUpdate();
|
||||
@@ -1787,7 +1792,7 @@ void MenuFunctions::RunSetup()
|
||||
|
||||
// ESP Update Menu
|
||||
espUpdateMenu.parentMenu = &whichUpdateMenu;
|
||||
addNodes(&espUpdateMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&espUpdateMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||
esp_obj.bootRunMode();
|
||||
changeMenu(espUpdateMenu.parentMenu);
|
||||
@@ -1795,11 +1800,11 @@ void MenuFunctions::RunSetup()
|
||||
|
||||
// Confirm SD update menu
|
||||
confirmMenu.parentMenu = &whichUpdateMenu;
|
||||
addNodes(&confirmMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&confirmMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(confirmMenu.parentMenu);
|
||||
});
|
||||
//addNodes(&confirmMenu, "Yes", TFT_ORANGE, NULL, UPDATE, [this](){wifi_scan_obj.currentScanMode = OTA_UPDATE; changeMenu(&updateMenu); sd_obj.runUpdate();});
|
||||
addNodes(&confirmMenu, "Yes", TFT_ORANGE, NULL, UPDATE, [this]() {
|
||||
addNodes(&confirmMenu, text14, TFT_ORANGE, NULL, UPDATE, [this]() {
|
||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||
changeMenu(&failedUpdateMenu);
|
||||
sd_obj.runUpdate();
|
||||
@@ -1807,30 +1812,30 @@ void MenuFunctions::RunSetup()
|
||||
|
||||
// Web Update
|
||||
updateMenu.parentMenu = &deviceMenu;
|
||||
addNodes(&updateMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&updateMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||
changeMenu(updateMenu.parentMenu);
|
||||
WiFi.softAPdisconnect(true);
|
||||
web_obj.shutdownServer();
|
||||
});
|
||||
//addNodes(&updateMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; changeMenu(updateMenu.parentMenu);});
|
||||
//addNodes(&updateMenu, text09, TFT_LIGHTGREY, NULL, 0, [this](){wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; changeMenu(updateMenu.parentMenu);});
|
||||
|
||||
// Failed update menu
|
||||
failedUpdateMenu.parentMenu = &whichUpdateMenu;
|
||||
addNodes(&failedUpdateMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&failedUpdateMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||
changeMenu(failedUpdateMenu.parentMenu);
|
||||
});
|
||||
|
||||
// Device info menu
|
||||
infoMenu.parentMenu = &deviceMenu;
|
||||
addNodes(&infoMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&infoMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||
changeMenu(infoMenu.parentMenu);
|
||||
});
|
||||
//language info menu
|
||||
languageMenu.parentMenu = &deviceMenu;
|
||||
addNodes(&languageMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
addNodes(&languageMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||
changeMenu(infoMenu.parentMenu);
|
||||
});
|
||||
@@ -1931,7 +1936,7 @@ void MenuFunctions::displayCurrentMenu()
|
||||
else
|
||||
display_obj.key[i].drawButton(true, current_menu->list->get(i).name);
|
||||
|
||||
if (current_menu->list->get(i).name != "Back")
|
||||
if (current_menu->list->get(i).name != text09)
|
||||
display_obj.tft.drawXBitmap(0,
|
||||
KEY_Y + i * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
|
||||
menu_icons[current_menu->list->get(i).icon],
|
||||
@@ -1952,3 +1957,5 @@ void MenuFunctions::displayCurrentMenu()
|
||||
display_obj.tft.setFreeFont(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#ifndef MenuFunctions_h
|
||||
#define MenuFunctions_h
|
||||
|
||||
#include "configs.h"
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
|
||||
#define BATTERY_ANALOG_ON 0
|
||||
|
||||
#include "WiFiScan.h"
|
||||
@@ -11,7 +15,6 @@
|
||||
#include "esp_interface.h"
|
||||
#include "a32u4_interface.h"
|
||||
#include "settings.h"
|
||||
#include "configs.h"
|
||||
|
||||
#ifdef MARAUDER_MINI
|
||||
#include <SwitchLib.h>
|
||||
@@ -214,5 +217,5 @@ class MenuFunctions
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "SDInterface.h"
|
||||
#include "lang_var.h"
|
||||
|
||||
bool SDInterface::initSD() {
|
||||
String display_string = "";
|
||||
@@ -32,18 +33,11 @@ bool SDInterface::initSD() {
|
||||
else
|
||||
Serial.println(F("SD: UNKNOWN Card Mounted"));
|
||||
|
||||
//this->cardSizeBT = SD.cardSize();
|
||||
//this->cardSizeKB = SD.cardSize() / 1024;
|
||||
this->cardSizeMB = SD.cardSize() / (1024 * 1024);
|
||||
//this->cardSizeGB = SD.cardSize() / (1024 * 1024 * 1024);
|
||||
|
||||
//Serial.printf("SD Card Size: %llu Bytes\n", this->cardSizeBT);
|
||||
//Serial.printf("SD Card Size: %lluKB\n", this->cardSizeKB);
|
||||
Serial.printf("SD Card Size: %lluMB\n", this->cardSizeMB);
|
||||
//Serial.printf("SD Card Size: %lluGB\n", this->cardSizeGB);
|
||||
|
||||
if (this->supported) {
|
||||
//display_obj.tft.println((byte)(sd_obj.cardSizeMB % 10));
|
||||
const int NUM_DIGITS = log10(this->cardSizeMB) + 1;
|
||||
|
||||
char sz[NUM_DIGITS + 1];
|
||||
@@ -55,16 +49,11 @@ bool SDInterface::initSD() {
|
||||
display_string.concat((String)sz[i]);
|
||||
}
|
||||
|
||||
//this->card_sz = display_string;
|
||||
this->card_sz = sz;
|
||||
}
|
||||
|
||||
buffer_obj = Buffer();
|
||||
|
||||
//if (this->supported)
|
||||
// buffer_obj.open(&SD);
|
||||
|
||||
// Check for SCRIPTS folder
|
||||
|
||||
if (!SD.exists("/SCRIPTS")) {
|
||||
Serial.println("/SCRIPTS does not exist. Creating...");
|
||||
|
||||
@@ -78,7 +67,6 @@ bool SDInterface::initSD() {
|
||||
|
||||
void SDInterface::addPacket(uint8_t* buf, uint32_t len) {
|
||||
if ((this->supported) && (this->do_save)) {
|
||||
//Serial.println("Adding packet to buffer...");
|
||||
buffer_obj.addPacket(buf, len);
|
||||
}
|
||||
}
|
||||
@@ -89,21 +77,26 @@ void SDInterface::openCapture(String file_name) {
|
||||
}
|
||||
|
||||
void SDInterface::runUpdate() {
|
||||
//display_obj.clearScreen();
|
||||
display_obj.tft.setTextWrap(false);
|
||||
display_obj.tft.setFreeFont(NULL);
|
||||
display_obj.tft.setCursor(0, 100);
|
||||
display_obj.tft.setTextSize(1);
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
|
||||
display_obj.tft.println(F("Opening /update.bin..."));
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextWrap(false);
|
||||
display_obj.tft.setFreeFont(NULL);
|
||||
display_obj.tft.setCursor(0, 100);
|
||||
display_obj.tft.setTextSize(1);
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
|
||||
display_obj.tft.println(F(text15));
|
||||
#endif
|
||||
File updateBin = SD.open("/update.bin");
|
||||
if (updateBin) {
|
||||
if(updateBin.isDirectory()){
|
||||
display_obj.tft.setTextColor(TFT_RED);
|
||||
display_obj.tft.println(F("Error, could not find update.bin"));
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_RED);
|
||||
display_obj.tft.println(F(text_table2[0]));
|
||||
#endif
|
||||
Serial.println(F("Error, update.bin is not a file"));
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
#endif
|
||||
updateBin.close();
|
||||
return;
|
||||
}
|
||||
@@ -111,70 +104,98 @@ void SDInterface::runUpdate() {
|
||||
size_t updateSize = updateBin.size();
|
||||
|
||||
if (updateSize > 0) {
|
||||
display_obj.tft.println(F("Starting SD Update..."));
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(F(text_table2[1]));
|
||||
#endif
|
||||
Serial.println(F("Try to start update"));
|
||||
this->performUpdate(updateBin, updateSize);
|
||||
}
|
||||
else {
|
||||
display_obj.tft.setTextColor(TFT_RED);
|
||||
display_obj.tft.println(F("Error, update.bin is empty"));
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_RED);
|
||||
display_obj.tft.println(F(text_table2[2]));
|
||||
#endif
|
||||
Serial.println(F("Error, file is empty"));
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
updateBin.close();
|
||||
|
||||
// whe finished remove the binary from sd card to indicate end of the process
|
||||
display_obj.tft.println(F("rebooting..."));
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(F(text_table2[3]));
|
||||
#endif
|
||||
Serial.println(F("rebooting..."));
|
||||
//SD.remove("/update.bin");
|
||||
delay(1000);
|
||||
ESP.restart();
|
||||
}
|
||||
else {
|
||||
display_obj.tft.setTextColor(TFT_RED);
|
||||
display_obj.tft.println(F("Could not load update.bin from /"));
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_RED);
|
||||
display_obj.tft.println(F(text_table2[4]));
|
||||
#endif
|
||||
Serial.println(F("Could not load update.bin from sd root"));
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void SDInterface::performUpdate(Stream &updateSource, size_t updateSize) {
|
||||
if (Update.begin(updateSize)) {
|
||||
display_obj.tft.println("File size: " + String(updateSize));
|
||||
display_obj.tft.println(F("Writing file to partition..."));
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(text_table2[5] + String(updateSize));
|
||||
display_obj.tft.println(F(text_table2[6]));
|
||||
#endif
|
||||
size_t written = Update.writeStream(updateSource);
|
||||
if (written == updateSize) {
|
||||
display_obj.tft.println("Written: " + String(written) + " successfully");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(text_table2[7] + String(written) + text_table2[10]);
|
||||
#endif
|
||||
Serial.println("Written : " + String(written) + " successfully");
|
||||
}
|
||||
else {
|
||||
display_obj.tft.println("Written only : " + String(written) + "/" + String(updateSize) + ". Retry?");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(text_table2[8] + String(written) + "/" + String(updateSize) + text_table2[9]);
|
||||
#endif
|
||||
Serial.println("Written only : " + String(written) + "/" + String(updateSize) + ". Retry?");
|
||||
}
|
||||
if (Update.end()) {
|
||||
Serial.println("OTA done!");
|
||||
if (Update.isFinished()) {
|
||||
display_obj.tft.println(F("Update complete"));
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(F(text_table2[11]));
|
||||
#endif
|
||||
Serial.println(F("Update successfully completed. Rebooting."));
|
||||
}
|
||||
else {
|
||||
display_obj.tft.setTextColor(TFT_RED);
|
||||
display_obj.tft.println("Update could not complete");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_RED);
|
||||
display_obj.tft.println(text_table2[12]);
|
||||
#endif
|
||||
Serial.println("Update not finished? Something went wrong!");
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
display_obj.tft.println("Error Occurred. Error #: " + String(Update.getError()));
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(text_table2[13] + String(Update.getError()));
|
||||
#endif
|
||||
Serial.println("Error Occurred. Error #: " + String(Update.getError()));
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
display_obj.tft.println("Not enough space to begin OTA");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(text_table2[14]);
|
||||
#endif
|
||||
Serial.println("Not enough space to begin OTA");
|
||||
}
|
||||
}
|
||||
@@ -202,8 +223,3 @@ void SDInterface::main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//void SDInterface::savePacket(uint8_t* buf, uint32_t len) {
|
||||
// if (this->supported)
|
||||
// buffer_obj.save(
|
||||
//}
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
#ifndef SDInterface_h
|
||||
#define SDInterface_h
|
||||
|
||||
#include "configs.h"
|
||||
|
||||
#include "SD.h"
|
||||
#include "Buffer.h"
|
||||
#include "Display.h"
|
||||
#include "configs.h"
|
||||
#ifdef HAS_SCREEN
|
||||
#include "Display.h"
|
||||
#endif
|
||||
#include <Update.h>
|
||||
|
||||
extern Buffer buffer_obj;
|
||||
extern Display display_obj;
|
||||
#ifdef HAS_SCREEN
|
||||
extern Display display_obj;
|
||||
#endif
|
||||
|
||||
#ifdef KIT
|
||||
#define SD_DET 4
|
||||
|
||||
@@ -19,7 +19,10 @@ void TemperatureInterface::RunSetup() {
|
||||
}
|
||||
|
||||
uint8_t TemperatureInterface::getCurrentTemp() {
|
||||
return ((temprature_sens_read() - 32) / 1.8);
|
||||
#ifndef MARAUDER_FLIPPER
|
||||
return ((temprature_sens_read() - 32) / 1.8);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void TemperatureInterface::main(uint32_t currentTime) {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef TemperatureInterface_h
|
||||
#define TemperatureInterface_h
|
||||
|
||||
#include "configs.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
class TemperatureInterface {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "Web.h"
|
||||
#include "lang_var.h"
|
||||
|
||||
WebServer server(80);
|
||||
|
||||
@@ -9,7 +10,6 @@ Web::Web()
|
||||
|
||||
void Web::main()
|
||||
{
|
||||
//Serial.println("Running the shits");
|
||||
// Notify if client has connected to the update server
|
||||
|
||||
|
||||
@@ -44,18 +44,24 @@ void Web::onJavaScript(void) {
|
||||
void Web::setupOTAupdate()
|
||||
{
|
||||
uint8_t newMACAddress[] = {0x06, 0x07, 0x0D, 0x09, 0x0E, 0x0D};
|
||||
|
||||
display_obj.tft.setTextWrap(false);
|
||||
display_obj.tft.setFreeFont(NULL);
|
||||
display_obj.tft.setCursor(0, 100);
|
||||
display_obj.tft.setTextSize(1);
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextWrap(false);
|
||||
display_obj.tft.setFreeFont(NULL);
|
||||
display_obj.tft.setCursor(0, 100);
|
||||
display_obj.tft.setTextSize(1);
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
#endif
|
||||
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
display_obj.tft.print("Configuring update server...\n\n");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.print(text_table3[0]);
|
||||
#endif
|
||||
Serial.println("Configuring update server...");
|
||||
|
||||
display_obj.tft.setTextColor(TFT_YELLOW);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_YELLOW);
|
||||
#endif
|
||||
|
||||
// Start WiFi AP
|
||||
Serial.println("Initializing WiFi...");
|
||||
@@ -76,25 +82,16 @@ void Web::setupOTAupdate()
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
|
||||
Serial.println("Displaying settings to TFT...");
|
||||
display_obj.tft.print("SSID: ");
|
||||
display_obj.tft.println(ssid);
|
||||
display_obj.tft.print("IP address: ");
|
||||
display_obj.tft.print(WiFi.softAPIP());
|
||||
display_obj.tft.print("\n");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.print(text_table1[2]);
|
||||
display_obj.tft.println(ssid);
|
||||
display_obj.tft.print(text_table3[1]);
|
||||
display_obj.tft.print(WiFi.softAPIP());
|
||||
display_obj.tft.print("\n");
|
||||
#endif
|
||||
Serial.print("IP address: ");
|
||||
Serial.println(WiFi.softAPIP());
|
||||
|
||||
/*use mdns for host name resolution*/
|
||||
/*
|
||||
if (!MDNS.begin(host)) { //http://esp32.local
|
||||
Serial.println("Error setting up MDNS responder!");
|
||||
while (1) {
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
Serial.println("mDNS responder started");
|
||||
*/
|
||||
|
||||
// return javascript jquery
|
||||
Serial.println("Setting server behavior...");
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
@@ -116,11 +113,12 @@ void Web::setupOTAupdate()
|
||||
}, [this]() {
|
||||
HTTPUpload& upload = server.upload();
|
||||
if (upload.status == UPLOAD_FILE_START) {
|
||||
display_obj.tft.setTextColor(TFT_YELLOW);
|
||||
display_obj.tft.print("Update: ");
|
||||
display_obj.tft.print(upload.filename.c_str());
|
||||
display_obj.tft.print("\n");
|
||||
//display_obj.updateBanner(menu_function_obj.current_menu->name);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_YELLOW);
|
||||
display_obj.tft.print(text_table3[2]);
|
||||
display_obj.tft.print(upload.filename.c_str());
|
||||
display_obj.tft.print("\n");
|
||||
#endif
|
||||
Serial.printf("Update: %s\n", upload.filename.c_str());
|
||||
if (!Update.begin(UPDATE_SIZE_UNKNOWN)) { //start with max available size
|
||||
Update.printError(Serial);
|
||||
@@ -130,30 +128,23 @@ void Web::setupOTAupdate()
|
||||
if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
|
||||
Update.printError(Serial);
|
||||
}
|
||||
//display_obj.tft.println(upload.totalSize);
|
||||
/*
|
||||
String display_string = "";
|
||||
display_obj.tft.setCursor(0, 164);
|
||||
for (int i = 0; i < 40; i++) {
|
||||
display_string.concat(" ");
|
||||
}
|
||||
*/
|
||||
display_obj.tft.setTextColor(TFT_CYAN);
|
||||
display_obj.tft.fillRect(0, 164, 240, 8, TFT_BLACK);
|
||||
//delay(1);
|
||||
//display_obj.tft.print(display_string);
|
||||
display_obj.tft.setCursor(0, 164);
|
||||
display_obj.tft.print("Bytes complete: ");
|
||||
display_obj.tft.print(upload.totalSize);
|
||||
display_obj.tft.print("\n");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_CYAN);
|
||||
display_obj.tft.fillRect(0, 164, 240, 8, TFT_BLACK);
|
||||
display_obj.tft.setCursor(0, 164);
|
||||
display_obj.tft.print(text_table3[3]);
|
||||
display_obj.tft.print(upload.totalSize);
|
||||
display_obj.tft.print("\n");
|
||||
#endif
|
||||
|
||||
//Serial.println(upload.totalSize);
|
||||
} else if (upload.status == UPLOAD_FILE_END) {
|
||||
if (Update.end(true)) { //true to set the size to the current progress
|
||||
display_obj.tft.setTextColor(TFT_GREEN);
|
||||
display_obj.tft.print("Update Success: ");
|
||||
display_obj.tft.print(upload.totalSize);
|
||||
display_obj.tft.print("\nRebooting...\n");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_GREEN);
|
||||
display_obj.tft.print(text_table3[4]);
|
||||
display_obj.tft.print(upload.totalSize);
|
||||
display_obj.tft.print(text_table2[3]);
|
||||
#endif
|
||||
Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
|
||||
delay(1000);
|
||||
} else {
|
||||
@@ -168,8 +159,10 @@ void Web::setupOTAupdate()
|
||||
Serial.println("Starting server...");
|
||||
server.begin();
|
||||
|
||||
display_obj.tft.setTextColor(TFT_GREEN);
|
||||
display_obj.tft.println("\nCompleted update server setup");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_GREEN);
|
||||
display_obj.tft.println(text_table3[5]);
|
||||
#endif
|
||||
Serial.println("Completed update server setup");
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
Code taken from espressif ESP32 OTA Update example
|
||||
*/
|
||||
|
||||
#include "configs.h"
|
||||
|
||||
#include <WiFi.h>
|
||||
#include <WiFiClient.h>
|
||||
#include <WebServer.h>
|
||||
@@ -12,10 +14,17 @@ Code taken from espressif ESP32 OTA Update example
|
||||
#include <Update.h>
|
||||
|
||||
#include "Assets.h"
|
||||
#include "Display.h"
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
#include "Display.h"
|
||||
#endif
|
||||
|
||||
#include "WiFiScan.h"
|
||||
|
||||
extern Display display_obj;
|
||||
#ifdef HAS_SCREEN
|
||||
extern Display display_obj;
|
||||
#endif
|
||||
|
||||
extern WiFiScan wifi_scan_obj;
|
||||
|
||||
class Web
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,8 @@
|
||||
#ifndef WiFiScan_h
|
||||
#define WiFiScan_h
|
||||
|
||||
#include "configs.h"
|
||||
|
||||
//#include <BLEDevice.h>
|
||||
//#include <BLEUtils.h>
|
||||
//#include <BLEScan.h>
|
||||
@@ -8,15 +10,20 @@
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
// Testing NimBLE
|
||||
#include <NimBLEDevice.h>
|
||||
//#include <NimBLEAdvertisedDevice.h>
|
||||
#ifdef HAS_BT
|
||||
#include <NimBLEDevice.h>
|
||||
#endif
|
||||
|
||||
#include <WiFi.h>
|
||||
#include <math.h>
|
||||
#include "esp_wifi.h"
|
||||
#include "esp_wifi_types.h"
|
||||
#include "esp_bt.h"
|
||||
#include "Display.h"
|
||||
#ifdef HAS_BT
|
||||
#include "esp_bt.h"
|
||||
#endif
|
||||
#ifdef HAS_SCREEN
|
||||
#include "Display.h"
|
||||
#endif
|
||||
#include "SDInterface.h"
|
||||
#include "Buffer.h"
|
||||
#include "BatteryInterface.h"
|
||||
@@ -56,7 +63,9 @@
|
||||
|
||||
#define MAX_CHANNEL 14
|
||||
|
||||
extern Display display_obj;
|
||||
#ifdef HAS_SCREEN
|
||||
extern Display display_obj;
|
||||
#endif
|
||||
extern SDInterface sd_obj;
|
||||
extern Buffer buffer_obj;
|
||||
extern BatteryInterface battery_obj;
|
||||
@@ -112,7 +121,9 @@ class WiFiScan
|
||||
int bluetoothScanTime = 5;
|
||||
int packets_sent = 0;
|
||||
const wifi_promiscuous_filter_t filt = {.filter_mask=WIFI_PROMIS_FILTER_MASK_MGMT | WIFI_PROMIS_FILTER_MASK_DATA};
|
||||
NimBLEScan* pBLEScan;
|
||||
#ifdef HAS_BT
|
||||
NimBLEScan* pBLEScan;
|
||||
#endif
|
||||
|
||||
//String connected_network = "";
|
||||
String alfa = "1234567890qwertyuiopasdfghjkklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM_";
|
||||
@@ -207,7 +218,6 @@ class WiFiScan
|
||||
|
||||
void packetMonitorMain(uint32_t currentTime);
|
||||
void eapolMonitorMain(uint32_t currentTime);
|
||||
void changeChannel();
|
||||
void updateMidway();
|
||||
void tftDrawXScalButtons();
|
||||
void tftDrawYScaleButtons();
|
||||
@@ -235,7 +245,9 @@ class WiFiScan
|
||||
void RunPacketMonitor(uint8_t scan_mode, uint16_t color);
|
||||
void RunBluetoothScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunLvJoinWiFi(uint8_t scan_mode, uint16_t color);
|
||||
static void scanCompleteCB(BLEScanResults scanResults);
|
||||
#ifdef HAS_BT
|
||||
static void scanCompleteCB(BLEScanResults scanResults);
|
||||
#endif
|
||||
|
||||
//int ieee80211_raw_frame_sanity_check(int32_t arg, int32_t arg2, int32_t arg3);
|
||||
|
||||
@@ -270,10 +282,12 @@ class WiFiScan
|
||||
int generateSSIDs();
|
||||
bool shutdownWiFi();
|
||||
bool shutdownBLE();
|
||||
bool scanning();
|
||||
void joinWiFi(String ssid, String password);
|
||||
String getStaMAC();
|
||||
String getApMAC();
|
||||
String freeRAM();
|
||||
void changeChannel();
|
||||
void RunInfo();
|
||||
void RunShutdownWiFi();
|
||||
void RunShutdownBLE();
|
||||
|
||||
@@ -25,14 +25,18 @@ void A32u4Interface::begin() {
|
||||
|
||||
if (a32u4_rep != 0) {
|
||||
this->supported = true;
|
||||
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
display_obj.tft.println("ATmega32U4 Found!");
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
display_obj.tft.println("ATmega32U4 Found!");
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
|
||||
display_obj.tft.println("ATmega32U4 Not Found");
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
|
||||
display_obj.tft.println("ATmega32U4 Not Found");
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
#endif
|
||||
Serial.print("A32U4 Said: ");
|
||||
Serial.println(a32u4_rep);
|
||||
}
|
||||
@@ -62,5 +66,4 @@ void A32u4Interface::main(uint32_t current_time) {
|
||||
}
|
||||
}
|
||||
|
||||
//delay(1);*/
|
||||
}
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
#ifndef a32u4_interface_h
|
||||
#define a32u4_interface_h
|
||||
|
||||
#include "Display.h"
|
||||
#include "configs.h"
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
#include "Display.h"
|
||||
#endif
|
||||
#include <HardwareSerial.h>
|
||||
|
||||
#define BAUD32U4 115200
|
||||
|
||||
extern Display display_obj;
|
||||
#ifdef HAS_SCREEN
|
||||
extern Display display_obj;
|
||||
#endif
|
||||
|
||||
class A32u4Interface {
|
||||
public:
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
|
||||
//#define MARAUDER_MINI
|
||||
#define MARAUDER_V4
|
||||
//#define MARAUDER_V6
|
||||
//#define MARAUDER_KIT
|
||||
//#define GENERIC_ESP32
|
||||
//#define MARAUDER_FLIPPER
|
||||
|
||||
#define MARAUDER_VERSION "v0.9.6"
|
||||
|
||||
@@ -74,8 +78,117 @@
|
||||
|
||||
#define STATUSBAR_COLOR 0x4A49
|
||||
|
||||
#define KIT_LED_BUILTIN 13
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_V6
|
||||
#define BANNER_TEXT_SIZE 2
|
||||
|
||||
#ifndef TFT_WIDTH
|
||||
#define TFT_WIDTH 240
|
||||
#endif
|
||||
|
||||
#ifndef TFT_HEIGHT
|
||||
#define TFT_HEIGHT 320
|
||||
#endif
|
||||
|
||||
#define TFT_DIY
|
||||
|
||||
#define SCREEN_WIDTH TFT_WIDTH
|
||||
#define SCREEN_HEIGHT TFT_HEIGHT
|
||||
#define HEIGHT_1 TFT_WIDTH
|
||||
#define WIDTH_1 TFT_HEIGHT
|
||||
#define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
|
||||
#define TEXT_HEIGHT 16 // Height of text to be printed and scrolled
|
||||
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
|
||||
#define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
|
||||
#define YMAX 320 // Bottom of screen area
|
||||
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
|
||||
//#define MENU_FONT NULL
|
||||
#define MENU_FONT &FreeMono9pt7b // Winner
|
||||
//#define MENU_FONT &FreeMonoBold9pt7b
|
||||
//#define MENU_FONT &FreeSans9pt7b
|
||||
//#define MENU_FONT &FreeSansBold9pt7b
|
||||
#define BUTTON_ARRAY_LEN 9
|
||||
#define STATUS_BAR_WIDTH 16
|
||||
#define LVGL_TICK_PERIOD 6
|
||||
|
||||
#define FRAME_X 100
|
||||
#define FRAME_Y 64
|
||||
#define FRAME_W 120
|
||||
#define FRAME_H 50
|
||||
|
||||
// Red zone size
|
||||
#define REDBUTTON_X FRAME_X
|
||||
#define REDBUTTON_Y FRAME_Y
|
||||
#define REDBUTTON_W (FRAME_W/2)
|
||||
#define REDBUTTON_H FRAME_H
|
||||
|
||||
// Green zone size
|
||||
#define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
|
||||
#define GREENBUTTON_Y FRAME_Y
|
||||
#define GREENBUTTON_W (FRAME_W/2)
|
||||
#define GREENBUTTON_H FRAME_H
|
||||
|
||||
#define STATUSBAR_COLOR 0x4A49
|
||||
|
||||
#define KIT_LED_BUILTIN 13
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_KIT
|
||||
#define BANNER_TEXT_SIZE 2
|
||||
|
||||
#ifndef TFT_WIDTH
|
||||
#define TFT_WIDTH 240
|
||||
#endif
|
||||
|
||||
#ifndef TFT_HEIGHT
|
||||
#define TFT_HEIGHT 320
|
||||
#endif
|
||||
|
||||
#define TFT_DIY
|
||||
#define KIT
|
||||
|
||||
#define SCREEN_WIDTH TFT_WIDTH
|
||||
#define SCREEN_HEIGHT TFT_HEIGHT
|
||||
#define HEIGHT_1 TFT_WIDTH
|
||||
#define WIDTH_1 TFT_HEIGHT
|
||||
#define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
|
||||
#define TEXT_HEIGHT 16 // Height of text to be printed and scrolled
|
||||
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
|
||||
#define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
|
||||
#define YMAX 320 // Bottom of screen area
|
||||
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
|
||||
//#define MENU_FONT NULL
|
||||
#define MENU_FONT &FreeMono9pt7b // Winner
|
||||
//#define MENU_FONT &FreeMonoBold9pt7b
|
||||
//#define MENU_FONT &FreeSans9pt7b
|
||||
//#define MENU_FONT &FreeSansBold9pt7b
|
||||
#define BUTTON_ARRAY_LEN 9
|
||||
#define STATUS_BAR_WIDTH 16
|
||||
#define LVGL_TICK_PERIOD 6
|
||||
|
||||
#define FRAME_X 100
|
||||
#define FRAME_Y 64
|
||||
#define FRAME_W 120
|
||||
#define FRAME_H 50
|
||||
|
||||
// Red zone size
|
||||
#define REDBUTTON_X FRAME_X
|
||||
#define REDBUTTON_Y FRAME_Y
|
||||
#define REDBUTTON_W (FRAME_W/2)
|
||||
#define REDBUTTON_H FRAME_H
|
||||
|
||||
// Green zone size
|
||||
#define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
|
||||
#define GREENBUTTON_Y FRAME_Y
|
||||
#define GREENBUTTON_W (FRAME_W/2)
|
||||
#define GREENBUTTON_H FRAME_H
|
||||
|
||||
#define STATUSBAR_COLOR 0x4A49
|
||||
|
||||
#define KIT_LED_BUILTIN 13
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI
|
||||
#define TFT_MISO 19
|
||||
@@ -157,6 +270,44 @@
|
||||
#define BUTTON_PADDING 22
|
||||
//#define BUTTON_ARRAY_LEN 5
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_V6
|
||||
#define BANNER_TIME 100
|
||||
|
||||
#define COMMAND_PREFIX "!"
|
||||
|
||||
// Keypad start position, key sizes and spacing
|
||||
#define KEY_X 120 // Centre of key
|
||||
#define KEY_Y 50
|
||||
#define KEY_W 240 // Width and height
|
||||
#define KEY_H 22
|
||||
#define KEY_SPACING_X 0 // X and Y gap
|
||||
#define KEY_SPACING_Y 1
|
||||
#define KEY_TEXTSIZE 1 // Font size multiplier
|
||||
#define ICON_W 22
|
||||
#define ICON_H 22
|
||||
#define BUTTON_PADDING 22
|
||||
//#define BUTTON_ARRAY_LEN 5
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_KIT
|
||||
#define BANNER_TIME 100
|
||||
|
||||
#define COMMAND_PREFIX "!"
|
||||
|
||||
// Keypad start position, key sizes and spacing
|
||||
#define KEY_X 120 // Centre of key
|
||||
#define KEY_Y 50
|
||||
#define KEY_W 240 // Width and height
|
||||
#define KEY_H 22
|
||||
#define KEY_SPACING_X 0 // X and Y gap
|
||||
#define KEY_SPACING_Y 1
|
||||
#define KEY_TEXTSIZE 1 // Font size multiplier
|
||||
#define ICON_W 22
|
||||
#define ICON_H 22
|
||||
#define BUTTON_PADDING 22
|
||||
//#define BUTTON_ARRAY_LEN 5
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI
|
||||
#define BANNER_TIME 50
|
||||
@@ -182,9 +333,66 @@
|
||||
#define SD_CS 12
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_V6
|
||||
#define SD_CS 12
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_KIT
|
||||
#define SD_CS 12
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI
|
||||
#define SD_CS 4
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
#define SD_CS -1
|
||||
#endif
|
||||
//// END SD DEFINITIONS
|
||||
|
||||
//// SCREEN STUFF
|
||||
#ifdef MARAUDER_MINI
|
||||
#define HAS_SCREEN
|
||||
#define HAS_BT
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_V4
|
||||
#define HAS_SCREEN
|
||||
#define HAS_BT
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_V6
|
||||
#define HAS_SCREEN
|
||||
#define HAS_BT
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_KIT
|
||||
#define HAS_SCREEN
|
||||
#define HAS_BT
|
||||
#endif
|
||||
|
||||
#ifdef GENERIC_ESP32
|
||||
#define HAS_BT
|
||||
#endif
|
||||
|
||||
#ifndef HAS_SCREEN
|
||||
#define TFT_CYAN 0
|
||||
#define TFT_BLUE 0
|
||||
#define TFT_RED 0
|
||||
#define TFT_GREEN 0
|
||||
#define TFT_GREY 0
|
||||
#define TFT_GRAY 0
|
||||
#define TFT_MAGENTA 0
|
||||
#define TFT_VIOLET 0
|
||||
#define STANDARD_FONT_CHAR_LIMIT 40
|
||||
#define FLASH_BUTTON -1
|
||||
|
||||
#include <FS.h>
|
||||
#include <functional>
|
||||
#include <LinkedList.h>
|
||||
#include "SPIFFS.h"
|
||||
#include "Assets.h"
|
||||
#endif
|
||||
//// END SCREEN STUFF
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,6 +5,13 @@ Partition Scheme: Minimal SPIFFS
|
||||
https://www.online-utility.org/image/convert/to/XBM
|
||||
*/
|
||||
|
||||
#include "configs.h"
|
||||
|
||||
#ifndef HAS_SCREEN
|
||||
#define MenuFunctions_h
|
||||
#define Display_h
|
||||
#endif
|
||||
|
||||
#include <WiFi.h>
|
||||
#include <Wire.h>
|
||||
#include "esp_wifi.h"
|
||||
@@ -15,11 +22,8 @@ https://www.online-utility.org/image/convert/to/XBM
|
||||
#include "esp_system.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
|
||||
#include "Assets.h"
|
||||
#include "Display.h"
|
||||
#include "WiFiScan.h"
|
||||
#include "MenuFunctions.h"
|
||||
#include "SDInterface.h"
|
||||
#include "Web.h"
|
||||
#include "Buffer.h"
|
||||
@@ -27,10 +31,15 @@ https://www.online-utility.org/image/convert/to/XBM
|
||||
#include "TemperatureInterface.h"
|
||||
#include "LedInterface.h"
|
||||
#include "esp_interface.h"
|
||||
#include "a32u4_interface.h"
|
||||
#include "settings.h"
|
||||
#include "CommandLine.h"
|
||||
#include "configs.h"
|
||||
#include "lang_var.h"
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
#include "Display.h"
|
||||
#include "MenuFunctions.h"
|
||||
#include "a32u4_interface.h"
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI
|
||||
#include <SwitchLib.h>
|
||||
@@ -41,9 +50,7 @@ https://www.online-utility.org/image/convert/to/XBM
|
||||
SwitchLib c_btn = SwitchLib(C_BTN, 1000, true);
|
||||
#endif
|
||||
|
||||
Display display_obj;
|
||||
WiFiScan wifi_scan_obj;
|
||||
MenuFunctions menu_function_obj;
|
||||
SDInterface sd_obj;
|
||||
Web web_obj;
|
||||
Buffer buffer_obj;
|
||||
@@ -51,10 +58,16 @@ BatteryInterface battery_obj;
|
||||
TemperatureInterface temp_obj;
|
||||
LedInterface led_obj;
|
||||
EspInterface esp_obj;
|
||||
A32u4Interface a32u4_obj;
|
||||
Settings settings_obj;
|
||||
CommandLine cli_obj;
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
Display display_obj;
|
||||
MenuFunctions menu_function_obj;
|
||||
A32u4Interface a32u4_obj;
|
||||
#endif
|
||||
|
||||
const String PROGMEM version_number = MARAUDER_VERSION;
|
||||
|
||||
Adafruit_NeoPixel strip = Adafruit_NeoPixel(Pixels, PIN, NEO_GRB + NEO_KHZ800);
|
||||
|
||||
@@ -62,22 +75,26 @@ uint32_t currentTime = 0;
|
||||
|
||||
|
||||
void backlightOn() {
|
||||
#ifdef MARAUDER_MINI
|
||||
digitalWrite(TFT_BL, LOW);
|
||||
#endif
|
||||
|
||||
#ifndef MARAUDER_MINI
|
||||
digitalWrite(TFT_BL, HIGH);
|
||||
#ifdef HAS_SCREEN
|
||||
#ifdef MARAUDER_MINI
|
||||
digitalWrite(TFT_BL, LOW);
|
||||
#endif
|
||||
|
||||
#ifndef MARAUDER_MINI
|
||||
digitalWrite(TFT_BL, HIGH);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void backlightOff() {
|
||||
#ifdef MARAUDER_MINI
|
||||
digitalWrite(TFT_BL, HIGH);
|
||||
#endif
|
||||
|
||||
#ifndef MARAUDER_MINI
|
||||
digitalWrite(TFT_BL, LOW);
|
||||
#ifdef HAS_SCREEN
|
||||
#ifdef MARAUDER_MINI
|
||||
digitalWrite(TFT_BL, HIGH);
|
||||
#endif
|
||||
|
||||
#ifndef MARAUDER_MINI
|
||||
digitalWrite(TFT_BL, LOW);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -85,7 +102,11 @@ void backlightOff() {
|
||||
void setup()
|
||||
{
|
||||
pinMode(FLASH_BUTTON, INPUT);
|
||||
pinMode(TFT_BL, OUTPUT);
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
pinMode(TFT_BL, OUTPUT);
|
||||
#endif
|
||||
|
||||
backlightOff();
|
||||
#if BATTERY_ANALOG_ON == 1
|
||||
pinMode(BATTERY_PIN, OUTPUT);
|
||||
@@ -93,7 +114,10 @@ void setup()
|
||||
#endif
|
||||
|
||||
// Preset SPI CS pins to avoid bus conflicts
|
||||
digitalWrite(TFT_CS, HIGH);
|
||||
#ifdef HAS_SCREEN
|
||||
digitalWrite(TFT_CS, HIGH);
|
||||
#endif
|
||||
|
||||
digitalWrite(SD_CS, HIGH);
|
||||
|
||||
Serial.begin(115200);
|
||||
@@ -103,43 +127,57 @@ void setup()
|
||||
Serial.println("\n\nHello, World!\n");
|
||||
|
||||
Serial.println("ESP-IDF version is: " + String(esp_get_idf_version()));
|
||||
|
||||
display_obj.RunSetup();
|
||||
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
Serial.println("Has Screen");
|
||||
#else
|
||||
Serial.println("Does not have screen");
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.RunSetup();
|
||||
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
#endif
|
||||
|
||||
backlightOff();
|
||||
|
||||
// Draw the title screen
|
||||
display_obj.drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
|
||||
|
||||
//showCenterText(version_number, 250);
|
||||
#ifndef MARAUDER_MINI
|
||||
display_obj.tft.drawCentreString(display_obj.version_number, 120, 250, 2);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI
|
||||
display_obj.tft.drawCentreString(display_obj.version_number, TFT_WIDTH/2, TFT_HEIGHT, 1);
|
||||
#ifdef HAS_SCREEN
|
||||
//showCenterText(version_number, 250);
|
||||
#ifndef MARAUDER_MINI
|
||||
display_obj.tft.drawCentreString(display_obj.version_number, 120, 250, 2);
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI
|
||||
display_obj.tft.drawCentreString(display_obj.version_number, TFT_WIDTH/2, TFT_HEIGHT, 1);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
backlightOn(); // Need this
|
||||
|
||||
delay(2000);
|
||||
|
||||
display_obj.clearScreen();
|
||||
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
|
||||
display_obj.tft.println("Giving room for HardwareSerial...");
|
||||
|
||||
delay(2000);
|
||||
|
||||
display_obj.tft.println("Marauder " + display_obj.version_number + "\n");
|
||||
|
||||
display_obj.tft.println("Started Serial");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
|
||||
display_obj.tft.println(text_table0[0]);
|
||||
|
||||
delay(2000);
|
||||
|
||||
display_obj.tft.println("Marauder " + display_obj.version_number + "\n");
|
||||
|
||||
display_obj.tft.println(text_table0[1]);
|
||||
#endif
|
||||
|
||||
Serial.println(F("\n\n--------------------------------\n"));
|
||||
Serial.println(F(" ESP32 Marauder \n"));
|
||||
Serial.println(" " + display_obj.version_number + "\n");
|
||||
Serial.println(" " + version_number + "\n");
|
||||
Serial.println(F(" By: justcallmekoko\n"));
|
||||
Serial.println(F("--------------------------------\n\n"));
|
||||
|
||||
@@ -148,7 +186,7 @@ void setup()
|
||||
settings_obj.begin();
|
||||
|
||||
Serial.println("This is a test Channel: " + (String)settings_obj.loadSetting<uint8_t>("Channel"));
|
||||
if (settings_obj.loadSetting<bool>("Force PMKID"))
|
||||
if (settings_obj.loadSetting<bool>( "Force PMKID"))
|
||||
Serial.println("This is a test Force PMKID: true");
|
||||
else
|
||||
Serial.println("This is a test Force PMKID: false");
|
||||
@@ -157,89 +195,90 @@ void setup()
|
||||
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
|
||||
display_obj.tft.println("Checked RAM");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(F(text_table0[2]));
|
||||
#endif
|
||||
|
||||
// Do some SD stuff
|
||||
if(sd_obj.initSD()) {
|
||||
Serial.println(F("SD Card supported"));
|
||||
display_obj.tft.println(F("Initialized SD Card"));
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(F(text_table0[3]));
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
Serial.println(F("SD Card NOT Supported"));
|
||||
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
|
||||
display_obj.tft.println(F("Failed to Initialize SD Card"));
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
|
||||
display_obj.tft.println(F(text_table0[4]));
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Run display setup
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
//display_obj.RunSetup();
|
||||
|
||||
// Build menus
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
//menu_function_obj.RunSetup();
|
||||
|
||||
//display_obj.tft.println("Created Menu Structure");
|
||||
|
||||
// Battery stuff
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
battery_obj.RunSetup();
|
||||
|
||||
display_obj.tft.println(F("Checked battery configuration"));
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(F(text_table0[5]));
|
||||
#endif
|
||||
|
||||
// Temperature stuff
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
temp_obj.RunSetup();
|
||||
#ifndef MARAUDER_FLIPPER
|
||||
temp_obj.RunSetup();
|
||||
#endif
|
||||
|
||||
display_obj.tft.println(F("Initialized temperature interface"));
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(F(text_table0[6]));
|
||||
#endif
|
||||
|
||||
battery_obj.battery_level = battery_obj.getBatteryLevel();
|
||||
Serial.println("Bat lvl");
|
||||
|
||||
if (battery_obj.i2c_supported) {
|
||||
Serial.println(F("IP5306 I2C Supported: true"));
|
||||
}
|
||||
else
|
||||
Serial.println(F("IP5306 I2C Supported: false"));
|
||||
#ifndef MARAUDER_FLIPPER
|
||||
battery_obj.battery_level = battery_obj.getBatteryLevel();
|
||||
|
||||
if (battery_obj.i2c_supported) {
|
||||
Serial.println(F("IP5306 I2C Supported: true"));
|
||||
}
|
||||
else
|
||||
Serial.println(F("IP5306 I2C Supported: false"));
|
||||
#endif
|
||||
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
|
||||
// Do some LED stuff
|
||||
led_obj.RunSetup();
|
||||
#ifndef MARAUDER_FLIPPER
|
||||
Serial.println("LED");
|
||||
led_obj.RunSetup();
|
||||
#endif
|
||||
|
||||
display_obj.tft.println(F("Initialized LED Interface"));
|
||||
|
||||
//display_obj.tft.println(F("Starting..."));
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(F(text_table0[7]));
|
||||
#endif
|
||||
|
||||
delay(500);
|
||||
|
||||
//display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
// OG Logo Section
|
||||
/*
|
||||
digitalWrite(TFT_BL, LOW);
|
||||
|
||||
// Draw the title screen
|
||||
display_obj.drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
|
||||
|
||||
//showCenterText(version_number, 250);
|
||||
display_obj.tft.drawCentreString(display_obj.version_number, 120, 250, 2);
|
||||
|
||||
digitalWrite(TFT_BL, HIGH);
|
||||
*/
|
||||
|
||||
//esp_obj.begin();
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(F(text_table0[8]));
|
||||
|
||||
//a32u4_obj.begin(); // This goes last to make sure nothing is messed up when reading serial
|
||||
|
||||
display_obj.tft.println(F("Starting..."));
|
||||
|
||||
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
delay(2000);
|
||||
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
delay(2000);
|
||||
#endif
|
||||
|
||||
Serial.println("CLI");
|
||||
cli_obj.RunSetup();
|
||||
|
||||
menu_function_obj.RunSetup();
|
||||
#ifdef HAS_SCREEN
|
||||
menu_function_obj.RunSetup();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -248,32 +287,49 @@ void loop()
|
||||
currentTime = millis();
|
||||
|
||||
// Update all of our objects
|
||||
if ((!display_obj.draw_tft) && (wifi_scan_obj.currentScanMode != ESP_UPDATE))
|
||||
#ifdef HAS_SCREEN
|
||||
bool do_draw = display_obj.draw_tft;
|
||||
#else
|
||||
bool do_draw = false;
|
||||
#endif
|
||||
|
||||
if ((!do_draw) && (wifi_scan_obj.currentScanMode != ESP_UPDATE))
|
||||
{
|
||||
display_obj.main(wifi_scan_obj.currentScanMode);
|
||||
cli_obj.main(currentTime);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.main(wifi_scan_obj.currentScanMode);
|
||||
#endif
|
||||
wifi_scan_obj.main(currentTime);
|
||||
sd_obj.main();
|
||||
battery_obj.main(currentTime);
|
||||
temp_obj.main(currentTime);
|
||||
#ifndef MARAUDER_FLIPPER
|
||||
battery_obj.main(currentTime);
|
||||
temp_obj.main(currentTime);
|
||||
#endif
|
||||
settings_obj.main(currentTime);
|
||||
if ((wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL)) {
|
||||
menu_function_obj.main(currentTime);
|
||||
cli_obj.main(currentTime);
|
||||
#ifdef HAS_SCREEN
|
||||
menu_function_obj.main(currentTime);
|
||||
#endif
|
||||
//cli_obj.main(currentTime);
|
||||
}
|
||||
if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
|
||||
web_obj.main();
|
||||
delay(1);
|
||||
}
|
||||
else if ((display_obj.draw_tft) &&
|
||||
(wifi_scan_obj.currentScanMode != OTA_UPDATE))
|
||||
{
|
||||
display_obj.drawStylus();
|
||||
}
|
||||
#ifdef HAS_SCREEN
|
||||
else if ((display_obj.draw_tft) &&
|
||||
(wifi_scan_obj.currentScanMode != OTA_UPDATE))
|
||||
{
|
||||
display_obj.drawStylus();
|
||||
}
|
||||
#endif
|
||||
else if (wifi_scan_obj.currentScanMode == ESP_UPDATE) {
|
||||
display_obj.main(wifi_scan_obj.currentScanMode);
|
||||
menu_function_obj.main(currentTime);
|
||||
cli_obj.main(currentTime);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.main(wifi_scan_obj.currentScanMode);
|
||||
menu_function_obj.main(currentTime);
|
||||
#endif
|
||||
//cli_obj.main(currentTime);
|
||||
delay(1);
|
||||
}
|
||||
}
|
||||
|
||||
BIN
esp32_marauder/esp32_marauder_v0_9_6_20220528_flipper.bin
Normal file
BIN
esp32_marauder/esp32_marauder_v0_9_6_20220528_flipper.bin
Normal file
Binary file not shown.
BIN
esp32_marauder/esp32_marauder_v0_9_6_20220528_kit.bin
Normal file
BIN
esp32_marauder/esp32_marauder_v0_9_6_20220528_kit.bin
Normal file
Binary file not shown.
BIN
esp32_marauder/esp32_marauder_v0_9_6_20220528_mini.bin
Normal file
BIN
esp32_marauder/esp32_marauder_v0_9_6_20220528_mini.bin
Normal file
Binary file not shown.
BIN
esp32_marauder/esp32_marauder_v0_9_6_20220528_old_hardware.bin
Normal file
BIN
esp32_marauder/esp32_marauder_v0_9_6_20220528_old_hardware.bin
Normal file
Binary file not shown.
BIN
esp32_marauder/esp32_marauderv_0_9_6_20220528_new_hardware.bin
Normal file
BIN
esp32_marauder/esp32_marauderv_0_9_6_20220528_new_hardware.bin
Normal file
Binary file not shown.
@@ -16,7 +16,9 @@ void EspInterface::begin() {
|
||||
|
||||
delay(100);
|
||||
|
||||
display_obj.tft.println("Checking for ESP8266...");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println("Checking for ESP8266...");
|
||||
#endif
|
||||
|
||||
this->bootRunMode();
|
||||
|
||||
@@ -40,16 +42,20 @@ void EspInterface::begin() {
|
||||
Serial.println("\nDisplay string: " + (String)display_string);
|
||||
|
||||
if (display_string == "ESP8266 Pong") {
|
||||
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
display_obj.tft.println("ESP8266 Found!");
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
display_obj.tft.println("ESP8266 Found!");
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
#endif
|
||||
Serial.println("ESP8266 Found!");
|
||||
this->supported = true;
|
||||
}
|
||||
else {
|
||||
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
|
||||
display_obj.tft.println("ESP8266 Not Found");
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
|
||||
display_obj.tft.println("ESP8266 Not Found");
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
#endif
|
||||
}
|
||||
|
||||
this->initTime = millis();
|
||||
@@ -57,16 +63,17 @@ void EspInterface::begin() {
|
||||
|
||||
void EspInterface::RunUpdate() {
|
||||
this->bootProgramMode();
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextWrap(true);
|
||||
display_obj.tft.setFreeFont(NULL);
|
||||
display_obj.tft.setCursor(0, 100);
|
||||
display_obj.tft.setTextSize(1);
|
||||
display_obj.tft.setTextColor(TFT_GREEN);
|
||||
|
||||
display_obj.tft.setTextWrap(true);
|
||||
display_obj.tft.setFreeFont(NULL);
|
||||
display_obj.tft.setCursor(0, 100);
|
||||
display_obj.tft.setTextSize(1);
|
||||
display_obj.tft.setTextColor(TFT_GREEN);
|
||||
|
||||
display_obj.tft.println("Waiting for serial data...");
|
||||
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
display_obj.tft.println("Waiting for serial data...");
|
||||
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
#endif
|
||||
}
|
||||
|
||||
void EspInterface::bootProgramMode() {
|
||||
@@ -103,7 +110,9 @@ void EspInterface::program() {
|
||||
}
|
||||
|
||||
if (Serial.available()) {
|
||||
display_obj.tft.print(".");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.print(".");
|
||||
#endif
|
||||
while (Serial.available()) {
|
||||
MySerial.write((uint8_t)Serial.read());
|
||||
}
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
#ifndef esp_interface_h
|
||||
#define esp_interface_h
|
||||
|
||||
#include "Display.h"
|
||||
#include "configs.h"
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
#include "Display.h"
|
||||
#endif
|
||||
|
||||
#include <HardwareSerial.h>
|
||||
|
||||
#define ESP_RST 14
|
||||
#define ESP_ZERO 13
|
||||
#define BAUD 115200
|
||||
|
||||
extern Display display_obj;
|
||||
#ifdef HAS_SCREEN
|
||||
extern Display display_obj;
|
||||
#endif
|
||||
|
||||
class EspInterface {
|
||||
public:
|
||||
|
||||
179
esp32_marauder/lang_var.h
Normal file
179
esp32_marauder/lang_var.h
Normal file
@@ -0,0 +1,179 @@
|
||||
#ifndef lang_var_h
|
||||
#define lang_var_h
|
||||
|
||||
|
||||
#include "configs.h"
|
||||
|
||||
//Starting window texts
|
||||
PROGMEM const char text0_0[] = "Giving room for HardwareSerial...";
|
||||
PROGMEM const char text0_1[] = "Started Serial";
|
||||
PROGMEM const char text0_2[] = "Checked RAM";
|
||||
PROGMEM const char text0_3[] = "Initialized SD Card";
|
||||
PROGMEM const char text0_4[] = "Failed to Initialize SD Card";
|
||||
PROGMEM const char text0_5[] = "Checked battery configuration";
|
||||
PROGMEM const char text0_6[] = "Initialized temperature interface";
|
||||
PROGMEM const char text0_7[] = "Initialized LED Interface";
|
||||
PROGMEM const char text0_8[] = "Starting...";
|
||||
|
||||
//Single library (action) texts/Often used
|
||||
PROGMEM const char text00[] = "Battery Level changed: ";
|
||||
PROGMEM const char text01[] = "file closed";
|
||||
PROGMEM const char text02[] = "Failed to open file '";
|
||||
PROGMEM const char text03[] = "ON";
|
||||
PROGMEM const char text04[] = "OFF";
|
||||
PROGMEM const char text05[] = "Load";
|
||||
PROGMEM const char text06[] = "Save As";
|
||||
PROGMEM const char text07[] = "Exit";
|
||||
PROGMEM const char text08[] = "Settings";
|
||||
PROGMEM const char text09[] = "Back";
|
||||
PROGMEM const char text10[] = "Channel:";
|
||||
PROGMEM const char text11[] = "Touch screen to exit";
|
||||
PROGMEM const char text12[] = "Cancel";
|
||||
PROGMEM const char text13[] = "Save";
|
||||
PROGMEM const char text14[] = "Yes";
|
||||
PROGMEM const char text15[] = "Opening /update.bin...";
|
||||
PROGMEM const char text16[] = "Close";
|
||||
PROGMEM const char text17[] = "FAIL";
|
||||
PROGMEM const char text18[] = "packets/sec: ";
|
||||
|
||||
|
||||
//Menufunctions.cpp texts
|
||||
PROGMEM const char text1_0[] = "SSID List";
|
||||
PROGMEM const char text1_1[] = "Add SSIDs";
|
||||
PROGMEM const char text1_2[] = "SSID: ";
|
||||
PROGMEM const char text1_3[] = "Password:";
|
||||
PROGMEM const char text1_4[] = "Setting disabled";
|
||||
PROGMEM const char text1_5[] = "Setting on";
|
||||
PROGMEM const char text1_6[] = "ESP32 Marauder ";
|
||||
PROGMEM const char text1_7[] = "WiFi ";
|
||||
PROGMEM const char text1_8[] = "Bad USB ";
|
||||
PROGMEM const char text1_9[] = "Device ";
|
||||
PROGMEM const char text1_10[] = "General Apps ";
|
||||
PROGMEM const char text1_11[] = "Updating... ";
|
||||
PROGMEM const char text1_12[] = "Select Method ";
|
||||
PROGMEM const char text1_13[] = "Confirm Update ";
|
||||
PROGMEM const char text1_14[] = "ESP8266 Update ";
|
||||
PROGMEM const char text1_15[] = "Update Firmware ";
|
||||
PROGMEM const char text1_16[] = "Language ";
|
||||
PROGMEM const char text1_17[] = "Device Info ";
|
||||
PROGMEM const char text1_18[] = "Settings ";
|
||||
PROGMEM const char text1_19[] = "Bluetooth ";
|
||||
PROGMEM const char text1_20[] = "WiFi Sniffers ";
|
||||
PROGMEM const char text1_21[] = "WiFi Attacks ";
|
||||
PROGMEM const char text1_22[] = "WiFi General ";
|
||||
PROGMEM const char text1_23[] = "Bluetooth Sniffers ";
|
||||
PROGMEM const char text1_24[] = "Bluetooth General ";
|
||||
PROGMEM const char text1_25[] = "Shutdown WiFi ";
|
||||
PROGMEM const char text1_26[] = "Shutdown BLE ";
|
||||
PROGMEM const char text1_27[] = "Generate SSIDs ";
|
||||
PROGMEM const char text1_28[] = "Clear SSIDs ";
|
||||
PROGMEM const char text1_29[] = "Clear APs ";
|
||||
PROGMEM const char text1_30[] = "Reboot";
|
||||
PROGMEM const char text1_31[] = "Sniffers";
|
||||
PROGMEM const char text1_32[] = "Attacks";
|
||||
PROGMEM const char text1_33[] = "General";
|
||||
PROGMEM const char text1_34[] = "Bluetooth Sniffer";
|
||||
PROGMEM const char text1_35[] = "Detect Card Skimmers";
|
||||
PROGMEM const char text1_36[] = "Test BadUSB";
|
||||
PROGMEM const char text1_37[] = "Run Ducky Script";
|
||||
PROGMEM const char text1_38[] = "Draw";
|
||||
PROGMEM const char text1_39[] = "Web Update";
|
||||
PROGMEM const char text1_40[] = "SD Update";
|
||||
PROGMEM const char text1_41[] = "ESP8266 Update";
|
||||
PROGMEM const char text1_42[] = "Probe Request Sniff";
|
||||
PROGMEM const char text1_43[] = "Beacon Sniff";
|
||||
PROGMEM const char text1_44[] = "Deauth Sniff";
|
||||
PROGMEM const char text1_45[] = "Packet Monitor";
|
||||
PROGMEM const char text1_46[] = "EAPOL/PMKID Scan";
|
||||
PROGMEM const char text1_47[] = "Detect Pwnagotchi";
|
||||
PROGMEM const char text1_48[] = "Detect Espressif";
|
||||
PROGMEM const char text1_49[] = "Scan APs";
|
||||
PROGMEM const char text1_50[] = "Beacon Spam List";
|
||||
PROGMEM const char text1_51[] = "Beacon Spam Random";
|
||||
PROGMEM const char text1_52[] = "Rick Roll Beacon";
|
||||
PROGMEM const char text1_53[] = "Probe Req Flood";
|
||||
PROGMEM const char text1_54[] = "Deauth Flood";
|
||||
PROGMEM const char text1_55[] = "Join WiFi";
|
||||
PROGMEM const char text1_56[] = "Select APs";
|
||||
|
||||
|
||||
//SDInterface.cpp texts
|
||||
PROGMEM const char text2_0[] = "Error, could not find update.bin";
|
||||
PROGMEM const char text2_1[] = "Starting SD Update...";
|
||||
PROGMEM const char text2_2[] = "Error, update.bin is empty";
|
||||
PROGMEM const char text2_3[] = "\nRebooting...\n";
|
||||
PROGMEM const char text2_4[] = "Could not load update.bin from /";
|
||||
PROGMEM const char text2_5[] = "File size: ";
|
||||
PROGMEM const char text2_6[] = "Writing file to partition...";
|
||||
PROGMEM const char text2_7[] = "Written: ";
|
||||
PROGMEM const char text2_8[] = "Written only : ";
|
||||
PROGMEM const char text2_9[] = ". Retry?";
|
||||
PROGMEM const char text2_10[] = " successfully";
|
||||
PROGMEM const char text2_11[] = "Update complete";
|
||||
PROGMEM const char text2_12[] = "Update could not complete";
|
||||
PROGMEM const char text2_13[] = "Error Occurred. Error #: ";
|
||||
PROGMEM const char text2_14[] = "Not enough space to begin OTA";
|
||||
|
||||
//Web.cpp texts
|
||||
PROGMEM const char text3_0[] = "Configuring update server...\n\n";
|
||||
PROGMEM const char text3_1[] = "IP address: ";
|
||||
PROGMEM const char text3_2[] = "Update: ";
|
||||
PROGMEM const char text3_3[] = "Bytes complete: ";
|
||||
PROGMEM const char text3_4[] = "Update Success: ";
|
||||
PROGMEM const char text3_5[] = "\nCompleted update server setup";
|
||||
|
||||
//WiFiScan.cpp texts
|
||||
PROGMEM const char text4_0[] = " RSSI: ";
|
||||
PROGMEM const char text4_1[] = "Potential Skimmer: ";
|
||||
PROGMEM const char text4_2[] = "Already Connected";
|
||||
PROGMEM const char text4_3[] = "Failed to connect";
|
||||
PROGMEM const char text4_4[] = "Connected";
|
||||
PROGMEM const char text4_5[] = "Force PMKID";
|
||||
PROGMEM const char text4_6[] = "Force Probe";
|
||||
PROGMEM const char text4_7[] = "Save PCAP";
|
||||
PROGMEM const char text4_8[] = "Probe Flood";
|
||||
PROGMEM const char text4_9[] = "Clearing APs...";
|
||||
PROGMEM const char text4_10[] = "APs Cleared: ";
|
||||
PROGMEM const char text4_11[] = "Clearing SSIDs...";
|
||||
PROGMEM const char text4_12[] = "SSIDs Cleared: ";
|
||||
PROGMEM const char text4_13[] = "Generating SSIDs...";
|
||||
PROGMEM const char text4_14[] = "SSIDs Generated: "; //Add spaces before to match : [15]
|
||||
PROGMEM const char text4_15[] = " Total SSIDs: "; //Add spaces beforer to match : [14]
|
||||
PROGMEM const char text4_16[] = "Shutting down WiFi...";
|
||||
PROGMEM const char text4_17[] = "WiFi not currently initialized";
|
||||
PROGMEM const char text4_18[] = "Shutting down BLE...";
|
||||
PROGMEM const char text4_19[] = "BLE not currently initialized";
|
||||
PROGMEM const char text4_20[] = " Firmware: Marauder"; //From 20 to 35 add spaces so : is in line like it is now
|
||||
PROGMEM const char text4_21[] = " Version: ";
|
||||
PROGMEM const char text4_22[] = " ESP-IDF: ";
|
||||
PROGMEM const char text4_23[] = " WSL Bypass: enabled\n";
|
||||
PROGMEM const char text4_24[] = " WSL Bypass: disabled\n";
|
||||
PROGMEM const char text4_25[] = " Station MAC: ";
|
||||
PROGMEM const char text4_26[] = " AP MAC: ";
|
||||
PROGMEM const char text4_27[] = " ";
|
||||
PROGMEM const char text4_28[] = " SD Card: Connected";
|
||||
PROGMEM const char text4_29[] = " SD Card Size: ";
|
||||
PROGMEM const char text4_30[] = " SD Card: Not Connected";
|
||||
PROGMEM const char text4_31[] = " SD Card Size: 0";
|
||||
PROGMEM const char text4_32[] = " IP5306 I2C: supported";
|
||||
PROGMEM const char text4_33[] = " Battery Lvl: ";
|
||||
PROGMEM const char text4_34[] = " IP5306 I2C: not supported";
|
||||
PROGMEM const char text4_35[] = "Internal temp: ";
|
||||
PROGMEM const char text4_36[] = " Detect Espressif ";
|
||||
PROGMEM const char text4_37[] = " Detect Pwnagotchi ";
|
||||
PROGMEM const char text4_38[] = " Beacon Sniffer ";
|
||||
PROGMEM const char text4_39[] = " Deauthentication Sniffer ";
|
||||
PROGMEM const char text4_40[] = " Probe Request Sniffer ";
|
||||
PROGMEM const char text4_41[] = " Bluetooth Sniff ";
|
||||
PROGMEM const char text4_42[] = " Detect Card Skimmers ";
|
||||
PROGMEM const char text4_43[] = "Scanning for\nBluetooth-enabled skimmers\nHC-03, HC-05, and HC-06...";
|
||||
PROGMEM const char text4_44[] = " AP Scan ";
|
||||
|
||||
//Making tables
|
||||
PROGMEM const char *text_table0[] = {text0_0,text0_1, text0_2, text0_3, text0_4, text0_5, text0_6, text0_7, text0_8};
|
||||
PROGMEM const char *text_table1[] = {text1_0,text1_1,text1_2,text1_3,text1_4,text1_5,text1_6,text1_7,text1_8,text1_9,text1_10,text1_11,text1_12,text1_13,text1_14,text1_15,text1_16,text1_17,text1_18,text1_19,text1_20,text1_21,text1_22,text1_23,text1_24,text1_25,text1_26,text1_27,text1_28,text1_29,text1_30,text1_31,text1_32,text1_33,text1_34,text1_35,text1_36,text1_37,text1_38,text1_39,text1_40,text1_41,text1_42,text1_43,text1_44,text1_45,text1_46,text1_47,text1_48,text1_49,text1_50,text1_51,text1_52,text1_53,text1_54,text1_55,text1_56};
|
||||
PROGMEM const char *text_table2[] = {text2_0,text2_1,text2_2,text2_3,text2_4,text2_5,text2_6,text2_7,text2_8,text2_9,text2_10,text2_11,text2_12,text2_13,text2_14};
|
||||
PROGMEM const char *text_table3[] = {text3_0,text3_1,text3_2,text3_3,text3_4,text3_5};
|
||||
PROGMEM const char *text_table4[] = {text4_0,text4_1,text4_2,text4_3,text4_4,text4_5,text4_6,text4_7,text4_8,text4_9,text4_10,text4_11,text4_12,text4_13,text4_14,text4_15,text4_16,text4_17,text4_18,text4_19,text4_20,text4_21,text4_22,text4_23,text4_24,text4_25,text4_26,text4_27,text4_28,text4_29,text4_30,text4_31,text4_32,text4_33,text4_34,text4_35,text4_36,text4_37,text4_38,text4_39,text4_40,text4_41,text4_42,text4_43,text4_44};
|
||||
|
||||
#endif
|
||||
@@ -1,15 +1,19 @@
|
||||
#ifndef Settings_h
|
||||
#define Settings_h
|
||||
|
||||
#include "configs.h"
|
||||
|
||||
#include "SPIFFS.h"
|
||||
#include <FS.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
#define FORMAT_SPIFFS_IF_FAILED true
|
||||
|
||||
#include "Display.h"
|
||||
#ifdef HAS_SCREEN
|
||||
#include "Display.h"
|
||||
|
||||
extern Display display_obj;
|
||||
extern Display display_obj;
|
||||
#endif
|
||||
|
||||
class Settings {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user