Skip to content

Commit

Permalink
Merge pull request #28 from jaylikesbunda/main
Browse files Browse the repository at this point in the history
v1.1.8 "Polaris" 🛰️
  • Loading branch information
jaylikesbunda authored Dec 20, 2024
2 parents 8ba9977 + 1667031 commit c3a2db9
Show file tree
Hide file tree
Showing 14 changed files with 501 additions and 36 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## v1.1.8 Polaris 📡🌍
- Added GPS Info command to view real-time GPS data
- Added Stop GPS Info command
- UART Initialisation tweaks
- Add back EAPOL capture command
- Added BLE Raw Capture command
- Added Stop BLE Raw Capture command
- Added BLE Skimmer Detection command
- Expanded Stop on Back to include all stop commands
- Added wrap-around scrolling in command menus
- Add Scan Local command to scan for devices on connected network
- Respect Momentum settings for ESP UART Channel
- Added PCAP and Wardrive clearing options in Settings menu
- Added BLE Wardriving command
- Miscellaneous bug fixes and improvements

## v1.1.7
- added null checks before freeing resources
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ A Flipper Zero application for interfacing with the Ghost ESP32 firmware
- **Raw Packet Capture**: Capture raw Bluetooth packets for analysis

### 🌍 GPS
- **GPS Information**: View real-time GPS data including position, altitude, speed and signal quality
- **Wardriving Capabilities**: Enable Wardriving for location-based data collection

### ⚙️ Configuration Options
Expand Down
135 changes: 135 additions & 0 deletions src/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,139 @@ void app_info_ok_callback(void* context) {
void app_info_cancel_callback(void* context) {
// Use same callback as OK since both just return to previous view
app_info_ok_callback(context);
}

// Add these new callback declarations
void wardrive_clear_confirmed_callback(void* context) {
FURI_LOG_D("ClearWardrive", "Confirmed callback started, context: %p", context);

SettingsConfirmContext* ctx = context;
if(!ctx) {
FURI_LOG_E("ClearWardrive", "Null context");
return;
}

if(!ctx->state) {
FURI_LOG_E("ClearWardrive", "Null state in context");
free(ctx);
return;
}

AppState* app_state = ctx->state;
uint32_t prev_view = app_state->previous_view;

FURI_LOG_D("ClearWardrive", "Previous view: %lu", prev_view);
clear_wardrive_files(ctx->state);

// Reset callbacks
confirmation_view_set_ok_callback(app_state->confirmation_view, NULL, NULL);
confirmation_view_set_cancel_callback(app_state->confirmation_view, NULL, NULL);

free(ctx);

view_dispatcher_switch_to_view(app_state->view_dispatcher, prev_view);
app_state->current_view = prev_view;
}

void wardrive_clear_cancelled_callback(void* context) {
// Similar to logs_clear_cancelled_callback
SettingsConfirmContext* ctx = context;
if(!ctx || !ctx->state) {
FURI_LOG_E("ClearWardrive", "Invalid context");
free(ctx);
return;
}

AppState* app_state = ctx->state;
uint32_t prev_view = app_state->previous_view;

confirmation_view_set_ok_callback(app_state->confirmation_view, NULL, NULL);
confirmation_view_set_cancel_callback(app_state->confirmation_view, NULL, NULL);

free(ctx);

view_dispatcher_switch_to_view(app_state->view_dispatcher, prev_view);
app_state->current_view = prev_view;
}

void pcap_clear_confirmed_callback(void* context) {
FURI_LOG_D("ClearPCAP", "Confirmed callback started, context: %p", context);

SettingsConfirmContext* ctx = context;
if(!ctx) {
FURI_LOG_E("ClearPCAP", "Null context");
return;
}

if(!ctx->state) {
FURI_LOG_E("ClearPCAP", "Null state in context");
free(ctx);
return;
}

AppState* app_state = ctx->state;
uint32_t prev_view = app_state->previous_view;

FURI_LOG_D("ClearPCAP", "Previous view: %lu", prev_view);
clear_pcap_files(ctx->state);

confirmation_view_set_ok_callback(app_state->confirmation_view, NULL, NULL);
confirmation_view_set_cancel_callback(app_state->confirmation_view, NULL, NULL);

free(ctx);

view_dispatcher_switch_to_view(app_state->view_dispatcher, prev_view);
app_state->current_view = prev_view;
}

void pcap_clear_cancelled_callback(void* context) {
// Similar to logs_clear_cancelled_callback
SettingsConfirmContext* ctx = context;
if(!ctx || !ctx->state) {
FURI_LOG_E("ClearPCAP", "Invalid context");
free(ctx);
return;
}

AppState* app_state = ctx->state;
uint32_t prev_view = app_state->previous_view;

confirmation_view_set_ok_callback(app_state->confirmation_view, NULL, NULL);
confirmation_view_set_cancel_callback(app_state->confirmation_view, NULL, NULL);

free(ctx);

view_dispatcher_switch_to_view(app_state->view_dispatcher, prev_view);
app_state->current_view = prev_view;
}

// Add these variable item callbacks
void on_clear_wardrive_changed(VariableItem* item) {
AppState* app = variable_item_get_context(item);
uint8_t index = variable_item_get_current_value_index(item);
variable_item_set_current_value_text(item, SETTING_VALUE_NAMES_ACTION[index]);

if(index == 0) {
show_confirmation_dialog_ex(
app,
"Clear Wardrives",
"Are you sure you want to clear\nall wardrive files?\nThis action cannot be undone.",
wardrive_clear_confirmed_callback,
wardrive_clear_cancelled_callback);
}
}

void on_clear_pcaps_changed(VariableItem* item) {
AppState* app = variable_item_get_context(item);
uint8_t index = variable_item_get_current_value_index(item);
variable_item_set_current_value_text(item, SETTING_VALUE_NAMES_ACTION[index]);

if(index == 0) {
show_confirmation_dialog_ex(
app,
"Clear PCAPs",
"Are you sure you want to clear\nall PCAP files?\nThis action cannot be undone.",
pcap_clear_confirmed_callback,
pcap_clear_cancelled_callback);
}
}
6 changes: 5 additions & 1 deletion src/callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ void nvs_clear_confirmed_callback(void* context);
void nvs_clear_cancelled_callback(void* context);
void show_app_info(void* context);
void app_info_ok_callback(void* context);
void app_info_cancel_callback(void* context);
void app_info_cancel_callback(void* context);
void wardrive_clear_confirmed_callback(void* context);
void wardrive_clear_cancelled_callback(void* context);
void pcap_clear_confirmed_callback(void* context);
void pcap_clear_cancelled_callback(void* context);
4 changes: 3 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,6 @@ int32_t ghost_esp_app(void* p) {
}

return 0;
}
}

// 6675636B796F7564656B69
Loading

0 comments on commit c3a2db9

Please sign in to comment.