mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-24 05:34:45 -07:00
Deauther Upd
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
App(
|
||||
appid="ESP8266_Wifi_Deauther",
|
||||
name="[ESP8266] WiFi (Deauther)",
|
||||
appid="ESP8266_Wifi_Deauther_V2",
|
||||
name="[ESP8266] WiFi (Deauther) V2",
|
||||
apptype=FlipperAppType.EXTERNAL,
|
||||
entry_point="wifi_deauther_app",
|
||||
cdefines=["APP_WIFI_deauther"],
|
||||
|
||||
@@ -7,13 +7,13 @@ void wifi_deauther_console_output_handle_rx_data_cb(uint8_t* buf, size_t len, vo
|
||||
// If text box store gets too big, then truncate it
|
||||
app->text_box_store_strlen += len;
|
||||
if(app->text_box_store_strlen >= WIFI_deauther_TEXT_BOX_STORE_SIZE - 1) {
|
||||
furi_string_right(app->text_box_store, app->text_box_store_strlen / 2);
|
||||
app->text_box_store_strlen = furi_string_size(app->text_box_store);
|
||||
string_right(app->text_box_store, app->text_box_store_strlen / 2);
|
||||
app->text_box_store_strlen = string_size(app->text_box_store);
|
||||
}
|
||||
|
||||
// Null-terminate buf and append to text box store
|
||||
buf[len] = '\0';
|
||||
furi_string_cat_printf(app->text_box_store, "%s", buf);
|
||||
string_cat_printf(app->text_box_store, "%s", buf);
|
||||
|
||||
view_dispatcher_send_custom_event(app->view_dispatcher, WifideautherEventRefreshConsoleOutput);
|
||||
}
|
||||
@@ -30,22 +30,22 @@ void wifi_deauther_scene_console_output_on_enter(void* context) {
|
||||
text_box_set_focus(text_box, TextBoxFocusEnd);
|
||||
}
|
||||
if(app->is_command) {
|
||||
furi_string_reset(app->text_box_store);
|
||||
string_reset(app->text_box_store);
|
||||
app->text_box_store_strlen = 0;
|
||||
if(0 == strncmp("help", app->selected_tx_string, strlen("help"))) {
|
||||
const char* help_msg =
|
||||
"For app support/feedback,\nreach out to me:\n@cococode#6011 (discord)\n0xchocolate (github)\n";
|
||||
furi_string_cat_str(app->text_box_store, help_msg);
|
||||
"For app support/feedback,\nreach out to me:\n@cococode#6011 (discord)\n0xchocolate (github)/B4 was here\n";
|
||||
string_cat_str(app->text_box_store, help_msg);
|
||||
app->text_box_store_strlen += strlen(help_msg);
|
||||
}
|
||||
|
||||
if(app->show_stopscan_tip) {
|
||||
const char* help_msg = "Press BACK to send stopscan\n";
|
||||
furi_string_cat_str(app->text_box_store, help_msg);
|
||||
const char* help_msg = "Press BACK button to stop your scan\n";
|
||||
string_cat_str(app->text_box_store, help_msg);
|
||||
app->text_box_store_strlen += strlen(help_msg);
|
||||
}
|
||||
} else { // "View Log" menu action
|
||||
text_box_set_text(app->text_box, furi_string_get_cstr(app->text_box_store));
|
||||
text_box_set_text(app->text_box, string_get_cstr(app->text_box_store));
|
||||
}
|
||||
|
||||
scene_manager_set_scene_state(app->scene_manager, WifideautherSceneConsoleOutput, 0);
|
||||
@@ -69,7 +69,7 @@ bool wifi_deauther_scene_console_output_on_event(void* context, SceneManagerEven
|
||||
bool consumed = false;
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
text_box_set_text(app->text_box, furi_string_get_cstr(app->text_box_store));
|
||||
text_box_set_text(app->text_box, string_get_cstr(app->text_box_store));
|
||||
consumed = true;
|
||||
} else if(event.type == SceneManagerEventTypeTick) {
|
||||
consumed = true;
|
||||
|
||||
@@ -54,8 +54,8 @@ WifideautherApp* wifi_deauther_app_alloc() {
|
||||
app->text_box = text_box_alloc();
|
||||
view_dispatcher_add_view(
|
||||
app->view_dispatcher, WifideautherAppViewConsoleOutput, text_box_get_view(app->text_box));
|
||||
app->text_box_store = furi_string_alloc();
|
||||
furi_string_reserve(app->text_box_store, WIFI_deauther_TEXT_BOX_STORE_SIZE);
|
||||
string_init(app->text_box_store);
|
||||
string_reserve(app->text_box_store, WIFI_deauther_TEXT_BOX_STORE_SIZE);
|
||||
|
||||
app->text_input = text_input_alloc();
|
||||
view_dispatcher_add_view(
|
||||
@@ -74,7 +74,7 @@ void wifi_deauther_app_free(WifideautherApp* app) {
|
||||
view_dispatcher_remove_view(app->view_dispatcher, WifideautherAppViewConsoleOutput);
|
||||
view_dispatcher_remove_view(app->view_dispatcher, WifideautherAppViewTextInput);
|
||||
text_box_free(app->text_box);
|
||||
furi_string_free(app->text_box_store);
|
||||
string_clear(app->text_box_store);
|
||||
text_input_free(app->text_input);
|
||||
|
||||
// View dispatcher
|
||||
@@ -84,7 +84,7 @@ void wifi_deauther_app_free(WifideautherApp* app) {
|
||||
wifi_deauther_uart_free(app->uart);
|
||||
|
||||
// Close records
|
||||
furi_record_close(RECORD_GUI);
|
||||
furi_record_close(RECORD_GUI); // GET PWNED
|
||||
|
||||
free(app);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ struct WifideautherApp {
|
||||
SceneManager* scene_manager;
|
||||
|
||||
char text_input_store[WIFI_deauther_TEXT_INPUT_STORE_SIZE + 1];
|
||||
FuriString* text_box_store;
|
||||
string_t text_box_store;
|
||||
size_t text_box_store_strlen;
|
||||
TextBox* text_box;
|
||||
TextInput* text_input;
|
||||
|
||||
Reference in New Issue
Block a user