mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-23 15:38:14 -08:00
Compare commits
10 Commits
nightly_1d
...
nightly_8e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ef5cf3b92 | ||
|
|
b3eade1e06 | ||
|
|
1dd5502c1d | ||
|
|
1862a5b812 | ||
|
|
f5375eedaf | ||
|
|
2910addb8a | ||
|
|
be3971d081 | ||
|
|
86e2fb206a | ||
|
|
431fa175a0 | ||
|
|
976687980c |
@@ -475,33 +475,37 @@ void Display::processAndPrintString(TFT_eSPI& tft, const String& originalString)
|
||||
String new_string = originalString;
|
||||
|
||||
// Check for color macros at the start of the string
|
||||
if (new_string.startsWith(RED_KEY)) {
|
||||
text_color = TFT_RED;
|
||||
new_string.remove(0, strlen(RED_KEY)); // Remove the macro
|
||||
} else if (new_string.startsWith(GREEN_KEY)) {
|
||||
text_color = TFT_GREEN;
|
||||
new_string.remove(0, strlen(GREEN_KEY)); // Remove the macro
|
||||
} else if (new_string.startsWith(CYAN_KEY)) {
|
||||
text_color = TFT_CYAN;
|
||||
new_string.remove(0, strlen(CYAN_KEY)); // Remove the macro
|
||||
} else if (new_string.startsWith(WHITE_KEY)) {
|
||||
text_color = TFT_WHITE;
|
||||
new_string.remove(0, strlen(WHITE_KEY)); // Remove the macro
|
||||
} else if (new_string.startsWith(MAGENTA_KEY)) {
|
||||
text_color = TFT_MAGENTA;
|
||||
new_string.remove(0, strlen(MAGENTA_KEY)); // Remove the macro
|
||||
if (new_string.startsWith(";")) {
|
||||
if (new_string.startsWith(RED_KEY)) {
|
||||
text_color = TFT_RED;
|
||||
new_string.remove(0, strlen(RED_KEY)); // Remove the macro
|
||||
} else if (new_string.startsWith(GREEN_KEY)) {
|
||||
text_color = TFT_GREEN;
|
||||
new_string.remove(0, strlen(GREEN_KEY)); // Remove the macro
|
||||
} else if (new_string.startsWith(CYAN_KEY)) {
|
||||
text_color = TFT_CYAN;
|
||||
new_string.remove(0, strlen(CYAN_KEY)); // Remove the macro
|
||||
} else if (new_string.startsWith(WHITE_KEY)) {
|
||||
text_color = TFT_WHITE;
|
||||
new_string.remove(0, strlen(WHITE_KEY)); // Remove the macro
|
||||
} else if (new_string.startsWith(MAGENTA_KEY)) {
|
||||
text_color = TFT_MAGENTA;
|
||||
new_string.remove(0, strlen(MAGENTA_KEY)); // Remove the macro
|
||||
}
|
||||
}
|
||||
|
||||
String spaces = String(' ', TFT_WIDTH / CHAR_WIDTH);
|
||||
|
||||
// Set text color and print the string
|
||||
tft.setTextColor(text_color, background_color);
|
||||
tft.print(new_string);
|
||||
tft.print(new_string + spaces);
|
||||
}
|
||||
|
||||
void Display::displayBuffer(bool do_clear)
|
||||
{
|
||||
if (this->display_buffer->size() > 0)
|
||||
{
|
||||
int print_count = 1;
|
||||
int print_count = 10;
|
||||
while ((display_buffer->size() > 0) && (print_count > 0))
|
||||
{
|
||||
|
||||
@@ -530,9 +534,9 @@ void Display::displayBuffer(bool do_clear)
|
||||
screen_buffer->add(display_buffer->shift());
|
||||
|
||||
for (int i = 0; i < this->screen_buffer->size(); i++) {
|
||||
tft.setCursor(xPos, (i * 12) + (SCREEN_HEIGHT / 6));
|
||||
String spaces = String(' ', TFT_WIDTH / CHAR_WIDTH);
|
||||
tft.print(spaces);
|
||||
//tft.setCursor(xPos, (i * 12) + (SCREEN_HEIGHT / 6));
|
||||
//String spaces = String(' ', TFT_WIDTH / CHAR_WIDTH);
|
||||
//tft.print(spaces);
|
||||
tft.setCursor(xPos, (i * 12) + (SCREEN_HEIGHT / 6));
|
||||
|
||||
this->processAndPrintString(tft, this->screen_buffer->get(i));
|
||||
|
||||
@@ -432,7 +432,16 @@ extern "C" {
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
bool do_save = false;
|
||||
if (buf >= 0)
|
||||
{
|
||||
{
|
||||
|
||||
unsigned char mac_char[6];
|
||||
wifi_scan_obj.copyNimbleMac(advertisedDevice->getAddress(), mac_char);
|
||||
|
||||
if (wifi_scan_obj.currentScanMode != BT_SCAN_WAR_DRIVE_CONT) {
|
||||
if (wifi_scan_obj.seen_mac(mac_char))
|
||||
return;
|
||||
}
|
||||
|
||||
Serial.print(F("Device: "));
|
||||
if(advertisedDevice->getName().length() != 0)
|
||||
{
|
||||
@@ -476,6 +485,10 @@ extern "C" {
|
||||
|
||||
if (do_save)
|
||||
buffer_obj.append(wardrive_line);
|
||||
|
||||
if (wifi_scan_obj.currentScanMode != BT_SCAN_WAR_DRIVE_CONT) {
|
||||
wifi_scan_obj.save_mac(mac_char);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1153,6 +1166,14 @@ extern "C" {
|
||||
bool do_save = false;
|
||||
if (buf >= 0)
|
||||
{
|
||||
unsigned char mac_char[6];
|
||||
wifi_scan_obj.copyNimbleMac(advertisedDevice->getAddress(), mac_char);
|
||||
|
||||
if (wifi_scan_obj.currentScanMode != BT_SCAN_WAR_DRIVE_CONT) {
|
||||
if (wifi_scan_obj.seen_mac(mac_char))
|
||||
return;
|
||||
}
|
||||
|
||||
Serial.print(F("Device: "));
|
||||
if(advertisedDevice->getName().length() != 0)
|
||||
{
|
||||
@@ -1196,6 +1217,10 @@ extern "C" {
|
||||
|
||||
if (do_save)
|
||||
buffer_obj.append(wardrive_line);
|
||||
|
||||
if (wifi_scan_obj.currentScanMode != BT_SCAN_WAR_DRIVE_CONT) {
|
||||
wifi_scan_obj.save_mac(mac_char);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -2499,6 +2524,7 @@ void WiFiScan::StopScan(uint8_t scan_mode)
|
||||
#endif
|
||||
|
||||
this->shutdownBLE();
|
||||
this->ble_scanning = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -4414,19 +4440,37 @@ void WiFiScan::executeWarDrive() {
|
||||
bool do_save;
|
||||
String display_string;
|
||||
|
||||
while (WiFi.scanComplete() == WIFI_SCAN_RUNNING) {
|
||||
/*while (WiFi.scanComplete() == WIFI_SCAN_RUNNING) {
|
||||
Serial.println(F("Scan running..."));
|
||||
delay(500);
|
||||
}*/
|
||||
|
||||
int scan_status = WiFi.scanComplete();
|
||||
|
||||
if (scan_status == WIFI_SCAN_RUNNING) {
|
||||
delay(1);
|
||||
return;
|
||||
}
|
||||
else if (scan_status == WIFI_SCAN_FAILED) {
|
||||
Serial.println("WiFi scan failed to start. Restarting...");
|
||||
this->wifi_initialized = true;
|
||||
this->shutdownWiFi();
|
||||
this->startWardriverWiFi();
|
||||
this->wifi_initialized = true;
|
||||
delay(100);
|
||||
}
|
||||
|
||||
#ifndef HAS_DUAL_BAND
|
||||
/*#ifndef HAS_DUAL_BAND
|
||||
int n = WiFi.scanNetworks(false, true, false, 110, this->set_channel);
|
||||
#else
|
||||
int n = WiFi.scanNetworks(false, true, false, 110);
|
||||
#endif
|
||||
#endif*/
|
||||
|
||||
if (n > 0) {
|
||||
for (int i = 0; i < n; i++) {
|
||||
bool do_continue = false;
|
||||
|
||||
if (scan_status > 0) {
|
||||
for (int i = 0; i < scan_status; i++) {
|
||||
do_continue = true;
|
||||
display_string = "";
|
||||
do_save = false;
|
||||
uint8_t *this_bssid_raw = WiFi.BSSID(i);
|
||||
@@ -4439,6 +4483,24 @@ void WiFiScan::executeWarDrive() {
|
||||
this->save_mac(this_bssid_raw);
|
||||
|
||||
String ssid = WiFi.SSID(i);
|
||||
|
||||
//Serial.println(ssid);
|
||||
|
||||
if (this->currentScanMode == BT_SCAN_FLOCK_WARDRIVE) {
|
||||
for (int x = 0; x < sizeof(flock_ssid)/sizeof(this->flock_ssid[0]); x++) {
|
||||
//Serial.print("Comparing ");
|
||||
//Serial.print(ssid);
|
||||
//Serial.print(" to ");
|
||||
//Serial.println(this->flock_ssid[x]);
|
||||
if (strcasestr(ssid.c_str(), this->flock_ssid[x])) {
|
||||
do_continue = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (do_continue)
|
||||
continue;
|
||||
}
|
||||
|
||||
ssid.replace(",","_");
|
||||
|
||||
if (ssid != "") {
|
||||
@@ -4476,11 +4538,17 @@ void WiFiScan::executeWarDrive() {
|
||||
buffer_obj.append(wardrive_line);
|
||||
}
|
||||
}
|
||||
}
|
||||
this->channelHop();
|
||||
|
||||
// Free up that memory, you sexy devil
|
||||
WiFi.scanDelete();
|
||||
// Free up that memory, you sexy devil
|
||||
WiFi.scanDelete();
|
||||
}
|
||||
|
||||
/*#ifndef HAS_DUAL_BAND
|
||||
this->channelHop();
|
||||
#endif*/
|
||||
|
||||
if (!this->ble_scanning)
|
||||
WiFi.scanNetworks(true, true, false, 80);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -4941,6 +5009,8 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color)
|
||||
NimBLEDevice::init("");
|
||||
pBLEScan = NimBLEDevice::getScan(); //create new scan
|
||||
if ((scan_mode == BT_SCAN_ALL) ||
|
||||
(scan_mode == BT_SCAN_WAR_DRIVE) ||
|
||||
(scan_mode == BT_SCAN_WAR_DRIVE_CONT) ||
|
||||
(scan_mode == BT_SCAN_AIRTAG) ||
|
||||
(scan_mode == BT_SCAN_AIRTAG_MON) ||
|
||||
(scan_mode == BT_SCAN_FLIPPER) ||
|
||||
@@ -4949,6 +5019,28 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color)
|
||||
(scan_mode == BT_SCAN_SIMPLE) ||
|
||||
(scan_mode == BT_SCAN_SIMPLE_TWO))
|
||||
{
|
||||
#ifdef HAS_GPS
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
if (scan_mode == BT_SCAN_WAR_DRIVE) {
|
||||
startLog("bt_wardrive");
|
||||
}
|
||||
else if (scan_mode == BT_SCAN_WAR_DRIVE_CONT) {
|
||||
startLog("bt_wardrive_cont");
|
||||
}
|
||||
else if (scan_mode == BT_SCAN_FLOCK_WARDRIVE) {
|
||||
startLog("flock_wardrive");
|
||||
this->startWardriverWiFi();
|
||||
this->wifi_initialized = true;
|
||||
}
|
||||
String header_line = "WigleWifi-1.4,appRelease=" + (String)MARAUDER_VERSION + ",model=ESP32 Marauder,release=" + (String)MARAUDER_VERSION + ",device=ESP32 Marauder,display=SPI TFT,board=ESP32 Marauder,brand=JustCallMeKoko\nMAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type\n";
|
||||
buffer_obj.append(header_line);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||
display_obj.tteBar = true;
|
||||
@@ -4973,6 +5065,10 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color)
|
||||
display_obj.tft.drawCentreString("Simple Sniff", TFT_WIDTH / 2, 16, 2);
|
||||
else if (scan_mode == BT_SCAN_SIMPLE_TWO)
|
||||
display_obj.tft.drawCentreString("Simple Sniff 2", TFT_WIDTH / 2, 16, 2);
|
||||
if (scan_mode == BT_SCAN_WAR_DRIVE)
|
||||
display_obj.tft.drawCentreString("BT Wardrive",TFT_WIDTH / 2,16,2);
|
||||
else if (scan_mode == BT_SCAN_WAR_DRIVE_CONT)
|
||||
display_obj.tft.drawCentreString("BT Wardrive Continuous",TFT_WIDTH / 2,16,2);
|
||||
#ifdef HAS_ILI9341
|
||||
display_obj.touchToExit();
|
||||
#endif
|
||||
@@ -4987,6 +5083,8 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color)
|
||||
pBLEScan->setScanCallbacks(new bluetoothScanAllCallback(), false);
|
||||
#endif
|
||||
else if ((scan_mode == BT_SCAN_FLIPPER) ||
|
||||
(scan_mode == BT_SCAN_WAR_DRIVE) ||
|
||||
(scan_mode == BT_SCAN_WAR_DRIVE_CONT) ||
|
||||
(scan_mode == BT_SCAN_FLOCK) ||
|
||||
(scan_mode == BT_SCAN_FLOCK_WARDRIVE) ||
|
||||
(scan_mode == BT_SCAN_SIMPLE) ||
|
||||
@@ -5016,6 +5114,8 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color)
|
||||
}
|
||||
else if (scan_mode == BT_SCAN_FLOCK_WARDRIVE) {
|
||||
startLog("flock_wardrive");
|
||||
this->startWardriverWiFi();
|
||||
this->wifi_initialized = true;
|
||||
}
|
||||
String header_line = "WigleWifi-1.4,appRelease=" + (String)MARAUDER_VERSION + ",model=ESP32 Marauder,release=" + (String)MARAUDER_VERSION + ",device=ESP32 Marauder,display=SPI TFT,board=ESP32 Marauder,brand=JustCallMeKoko\nMAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type\n";
|
||||
buffer_obj.append(header_line);
|
||||
@@ -5058,8 +5158,7 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color)
|
||||
#endif
|
||||
|
||||
}
|
||||
else if (scan_mode == BT_SCAN_SKIMMERS)
|
||||
{
|
||||
else if (scan_mode == BT_SCAN_SKIMMERS) {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.TOP_FIXED_AREA_2 = 160;
|
||||
display_obj.tteBar = true;
|
||||
@@ -10105,13 +10204,21 @@ void WiFiScan::main(uint32_t currentTime)
|
||||
this->ble_scanning = false;
|
||||
}
|
||||
else {
|
||||
pBLEScan->start(0, scanCompleteCB, false);
|
||||
this->ble_scanning = true;
|
||||
return;
|
||||
if (WiFi.scanComplete() != WIFI_SCAN_RUNNING) {
|
||||
pBLEScan->start(0, scanCompleteCB, false);
|
||||
this->ble_scanning = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (currentScanMode == BT_SCAN_FLOCK)
|
||||
channelHop();
|
||||
else if (currentScanMode == BT_SCAN_FLOCK_WARDRIVE) {
|
||||
#ifdef HAS_GPS
|
||||
if (gps_obj.getGpsModuleStatus())
|
||||
this->executeWarDrive();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (currentScanMode == WIFI_PING_SCAN) {
|
||||
|
||||
Reference in New Issue
Block a user