Skip to content

Commit

Permalink
Fix some bluetooth stuff for rev feather
Browse files Browse the repository at this point in the history
  • Loading branch information
justcallmekoko committed Nov 25, 2024
1 parent 3ceac18 commit 035dae4
Showing 1 changed file with 43 additions and 41 deletions.
84 changes: 43 additions & 41 deletions esp32_marauder/MenuFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2030,53 +2030,55 @@ void MenuFunctions::RunSetup()
#endif

#ifndef HAS_ILI9341
#ifdef HAS_BT
// Select Airtag on Mini
this->addNodes(&bluetoothAttackMenu, "Spoof Airtag", TFT_WHITE, NULL, ATTACKS, [this](){
// Clear nodes and add back button
airtagMenu.list->clear();
this->addNodes(&airtagMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
this->changeMenu(airtagMenu.parentMenu);
});

// Add buttons for all airtags
// Find out how big our menu is going to be
int menu_limit;
if (airtags->size() <= BUTTON_ARRAY_LEN)
menu_limit = airtags->size();
else
menu_limit = BUTTON_ARRAY_LEN;

// Create the menu nodes for all of the list items
for (int i = 0; i < menu_limit; i++) {
this->addNodes(&airtagMenu, airtags->get(i).mac, TFT_WHITE, NULL, BLUETOOTH, [this, i](){
AirTag new_at = airtags->get(i);
new_at.selected = true;

airtags->set(i, new_at);
this->addNodes(&bluetoothAttackMenu, "Spoof Airtag", TFT_WHITE, NULL, ATTACKS, [this](){
// Clear nodes and add back button
airtagMenu.list->clear();
this->addNodes(&airtagMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
this->changeMenu(airtagMenu.parentMenu);
});

// Set all other airtags to "Not Selected"
for (int x = 0; x < airtags->size(); x++) {
if (x != i) {
AirTag new_atx = airtags->get(x);
new_atx.selected = false;
airtags->set(x, new_atx);
// Add buttons for all airtags
// Find out how big our menu is going to be
int menu_limit;
if (airtags->size() <= BUTTON_ARRAY_LEN)
menu_limit = airtags->size();
else
menu_limit = BUTTON_ARRAY_LEN;

// Create the menu nodes for all of the list items
for (int i = 0; i < menu_limit; i++) {
this->addNodes(&airtagMenu, airtags->get(i).mac, TFT_WHITE, NULL, BLUETOOTH, [this, i](){
AirTag new_at = airtags->get(i);
new_at.selected = true;

airtags->set(i, new_at);

// Set all other airtags to "Not Selected"
for (int x = 0; x < airtags->size(); x++) {
if (x != i) {
AirTag new_atx = airtags->get(x);
new_atx.selected = false;
airtags->set(x, new_atx);
}
}
}

// Start the spoof
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(BT_SPOOF_AIRTAG, TFT_WHITE);
// Start the spoof
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(BT_SPOOF_AIRTAG, TFT_WHITE);

});
}
this->changeMenu(&airtagMenu);
});
});
}
this->changeMenu(&airtagMenu);
});

airtagMenu.parentMenu = &bluetoothAttackMenu;
this->addNodes(&airtagMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
this->changeMenu(airtagMenu.parentMenu);
});
airtagMenu.parentMenu = &bluetoothAttackMenu;
this->addNodes(&airtagMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
this->changeMenu(airtagMenu.parentMenu);
});
#endif

#endif

Expand Down

0 comments on commit 035dae4

Please sign in to comment.