Skip to content

Commit 8a35240

Browse files
committed
update blespam
1 parent 3ee5280 commit 8a35240

File tree

8 files changed

+45
-29
lines changed

8 files changed

+45
-29
lines changed

base_pack/ble_spam/application.fam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ App(
33
name="BLE Spam",
44
apptype=FlipperAppType.EXTERNAL,
55
entry_point="ble_spam",
6-
stack_size=6 * 1024,
6+
stack_size=2 * 1024,
77
fap_icon="ble_spam_10px.png",
88
fap_category="Bluetooth",
99
fap_author="@Willy-JL @ECTO-1A @Spooks4576",

base_pack/ble_spam/ble_spam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ int32_t ble_spam(void* p) {
620620
state->thread = furi_thread_alloc();
621621
furi_thread_set_callback(state->thread, adv_thread);
622622
furi_thread_set_context(state->thread, state);
623-
furi_thread_set_stack_size(state->thread, 4096);
623+
furi_thread_set_stack_size(state->thread, 2048);
624624
state->ctx.led_indicator = true;
625625
state->lock_timer = furi_timer_alloc(lock_timer_callback, FuriTimerTypeOnce, state);
626626

base_pack/ble_spam/protocols/continuity.c

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,6 @@ void scene_continuity_pp_model_on_enter(void* _ctx) {
844844
ContinuityCfg* cfg = &payload->cfg.continuity;
845845
Submenu* submenu = ctx->submenu;
846846
uint32_t selected = 0;
847-
submenu_reset(submenu);
848847
bool value = payload->mode == PayloadModeValue ||
849848
(payload->mode == PayloadModeBruteforce &&
850849
cfg->data.proximity_pair.bruteforce_mode != ContinuityPpBruteforceModel);
@@ -882,7 +881,8 @@ bool scene_continuity_pp_model_on_event(void* _ctx, SceneManagerEvent event) {
882881
return false;
883882
}
884883
void scene_continuity_pp_model_on_exit(void* _ctx) {
885-
UNUSED(_ctx);
884+
Ctx* ctx = _ctx;
885+
submenu_reset(ctx->submenu);
886886
}
887887

888888
static void pp_model_custom_callback(void* _ctx) {
@@ -918,7 +918,9 @@ bool scene_continuity_pp_model_custom_on_event(void* _ctx, SceneManagerEvent eve
918918
return false;
919919
}
920920
void scene_continuity_pp_model_custom_on_exit(void* _ctx) {
921-
UNUSED(_ctx);
921+
Ctx* ctx = _ctx;
922+
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
923+
byte_input_set_header_text(ctx->byte_input, "");
922924
}
923925

924926
static void pp_color_callback(void* _ctx, uint32_t index) {
@@ -960,7 +962,6 @@ void scene_continuity_pp_color_on_enter(void* _ctx) {
960962
ContinuityCfg* cfg = &payload->cfg.continuity;
961963
Submenu* submenu = ctx->submenu;
962964
uint32_t selected = 0;
963-
submenu_reset(submenu);
964965
bool value = payload->mode == PayloadModeValue ||
965966
(payload->mode == PayloadModeBruteforce &&
966967
cfg->data.proximity_pair.bruteforce_mode != ContinuityPpBruteforceColor);
@@ -1006,7 +1007,8 @@ bool scene_continuity_pp_color_on_event(void* _ctx, SceneManagerEvent event) {
10061007
return false;
10071008
}
10081009
void scene_continuity_pp_color_on_exit(void* _ctx) {
1009-
UNUSED(_ctx);
1010+
Ctx* ctx = _ctx;
1011+
submenu_reset(ctx->submenu);
10101012
}
10111013

10121014
static void pp_color_custom_callback(void* _ctx) {
@@ -1041,7 +1043,9 @@ bool scene_continuity_pp_color_custom_on_event(void* _ctx, SceneManagerEvent eve
10411043
return false;
10421044
}
10431045
void scene_continuity_pp_color_custom_on_exit(void* _ctx) {
1044-
UNUSED(_ctx);
1046+
Ctx* ctx = _ctx;
1047+
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
1048+
byte_input_set_header_text(ctx->byte_input, "");
10451049
}
10461050

10471051
static void pp_prefix_callback(void* _ctx, uint32_t index) {
@@ -1069,7 +1073,6 @@ void scene_continuity_pp_prefix_on_enter(void* _ctx) {
10691073
Submenu* submenu = ctx->submenu;
10701074
uint32_t selected = 0;
10711075
bool found = false;
1072-
submenu_reset(submenu);
10731076

10741077
submenu_add_item(submenu, "Automatic", 0, pp_prefix_callback, ctx);
10751078
if(cfg->data.proximity_pair.prefix == 0x00) {
@@ -1099,7 +1102,8 @@ bool scene_continuity_pp_prefix_on_event(void* _ctx, SceneManagerEvent event) {
10991102
return false;
11001103
}
11011104
void scene_continuity_pp_prefix_on_exit(void* _ctx) {
1102-
UNUSED(_ctx);
1105+
Ctx* ctx = _ctx;
1106+
submenu_reset(ctx->submenu);
11031107
}
11041108

11051109
static void pp_prefix_custom_callback(void* _ctx) {
@@ -1131,7 +1135,9 @@ bool scene_continuity_pp_prefix_custom_on_event(void* _ctx, SceneManagerEvent ev
11311135
return false;
11321136
}
11331137
void scene_continuity_pp_prefix_custom_on_exit(void* _ctx) {
1134-
UNUSED(_ctx);
1138+
Ctx* ctx = _ctx;
1139+
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
1140+
byte_input_set_header_text(ctx->byte_input, "");
11351141
}
11361142

11371143
static void na_action_callback(void* _ctx, uint32_t index) {
@@ -1166,7 +1172,6 @@ void scene_continuity_na_action_on_enter(void* _ctx) {
11661172
ContinuityCfg* cfg = &payload->cfg.continuity;
11671173
Submenu* submenu = ctx->submenu;
11681174
uint32_t selected = 0;
1169-
submenu_reset(submenu);
11701175

11711176
submenu_add_item(submenu, "Random", 0, na_action_callback, ctx);
11721177
if(payload->mode == PayloadModeRandom) {
@@ -1202,7 +1207,8 @@ bool scene_continuity_na_action_on_event(void* _ctx, SceneManagerEvent event) {
12021207
return false;
12031208
}
12041209
void scene_continuity_na_action_on_exit(void* _ctx) {
1205-
UNUSED(_ctx);
1210+
Ctx* ctx = _ctx;
1211+
submenu_reset(ctx->submenu);
12061212
}
12071213

12081214
static void na_action_custom_callback(void* _ctx) {
@@ -1235,7 +1241,9 @@ bool scene_continuity_na_action_custom_on_event(void* _ctx, SceneManagerEvent ev
12351241
return false;
12361242
}
12371243
void scene_continuity_na_action_custom_on_exit(void* _ctx) {
1238-
UNUSED(_ctx);
1244+
Ctx* ctx = _ctx;
1245+
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
1246+
byte_input_set_header_text(ctx->byte_input, "");
12391247
}
12401248

12411249
static void na_flags_callback(void* _ctx) {
@@ -1269,4 +1277,6 @@ void scene_continuity_na_flags_on_exit(void* _ctx) {
12691277
Payload* payload = &ctx->attack->payload;
12701278
ContinuityCfg* cfg = &payload->cfg.continuity;
12711279
cfg->data.nearby_action.flags = (ctx->byte_store[0] << 0x00);
1280+
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
1281+
byte_input_set_header_text(ctx->byte_input, "");
12721282
}

base_pack/ble_spam/protocols/easysetup.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ void scene_easysetup_buds_model_on_enter(void* _ctx) {
398398
EasysetupCfg* cfg = &payload->cfg.easysetup;
399399
Submenu* submenu = ctx->submenu;
400400
uint32_t selected = 0;
401-
submenu_reset(submenu);
402401

403402
submenu_add_item(submenu, "Random", 0, buds_model_callback, ctx);
404403
if(payload->mode == PayloadModeRandom) {
@@ -434,7 +433,8 @@ bool scene_easysetup_buds_model_on_event(void* _ctx, SceneManagerEvent event) {
434433
return false;
435434
}
436435
void scene_easysetup_buds_model_on_exit(void* _ctx) {
437-
UNUSED(_ctx);
436+
Ctx* ctx = _ctx;
437+
submenu_reset(ctx->submenu);
438438
}
439439

440440
static void buds_model_custom_callback(void* _ctx) {
@@ -470,7 +470,9 @@ bool scene_easysetup_buds_model_custom_on_event(void* _ctx, SceneManagerEvent ev
470470
return false;
471471
}
472472
void scene_easysetup_buds_model_custom_on_exit(void* _ctx) {
473-
UNUSED(_ctx);
473+
Ctx* ctx = _ctx;
474+
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
475+
byte_input_set_header_text(ctx->byte_input, "");
474476
}
475477

476478
static void watch_model_callback(void* _ctx, uint32_t index) {
@@ -505,7 +507,6 @@ void scene_easysetup_watch_model_on_enter(void* _ctx) {
505507
EasysetupCfg* cfg = &payload->cfg.easysetup;
506508
Submenu* submenu = ctx->submenu;
507509
uint32_t selected = 0;
508-
submenu_reset(submenu);
509510

510511
submenu_add_item(submenu, "Random", 0, watch_model_callback, ctx);
511512
if(payload->mode == PayloadModeRandom) {
@@ -541,7 +542,8 @@ bool scene_easysetup_watch_model_on_event(void* _ctx, SceneManagerEvent event) {
541542
return false;
542543
}
543544
void scene_easysetup_watch_model_on_exit(void* _ctx) {
544-
UNUSED(_ctx);
545+
Ctx* ctx = _ctx;
546+
submenu_reset(ctx->submenu);
545547
}
546548

547549
static void watch_model_custom_callback(void* _ctx) {

base_pack/ble_spam/protocols/fastpair.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,6 @@ void scene_fastpair_model_on_enter(void* _ctx) {
746746
FastpairCfg* cfg = &payload->cfg.fastpair;
747747
Submenu* submenu = ctx->submenu;
748748
uint32_t selected = 0;
749-
submenu_reset(submenu);
750749

751750
submenu_add_item(submenu, "Random", 0, model_callback, ctx);
752751
if(payload->mode == PayloadModeRandom) {
@@ -781,7 +780,8 @@ bool scene_fastpair_model_on_event(void* _ctx, SceneManagerEvent event) {
781780
return false;
782781
}
783782
void scene_fastpair_model_on_exit(void* _ctx) {
784-
UNUSED(_ctx);
783+
Ctx* ctx = _ctx;
784+
submenu_reset(ctx->submenu);
785785
}
786786

787787
static void model_custom_callback(void* _ctx) {
@@ -817,5 +817,7 @@ bool scene_fastpair_model_custom_on_event(void* _ctx, SceneManagerEvent event) {
817817
return false;
818818
}
819819
void scene_fastpair_model_custom_on_exit(void* _ctx) {
820-
UNUSED(_ctx);
820+
Ctx* ctx = _ctx;
821+
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
822+
byte_input_set_header_text(ctx->byte_input, "");
821823
}

base_pack/ble_spam/protocols/lovespouse.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ void scene_lovespouse_mode_on_enter(void* _ctx) {
216216
LovespouseCfg* cfg = &payload->cfg.lovespouse;
217217
Submenu* submenu = ctx->submenu;
218218
uint32_t selected = 0;
219-
submenu_reset(submenu);
220219

221220
submenu_add_item(submenu, "Random", 0, mode_callback, ctx);
222221
if(payload->mode == PayloadModeRandom) {
@@ -252,7 +251,8 @@ bool scene_lovespouse_mode_on_event(void* _ctx, SceneManagerEvent event) {
252251
return false;
253252
}
254253
void scene_lovespouse_mode_on_exit(void* _ctx) {
255-
UNUSED(_ctx);
254+
Ctx* ctx = _ctx;
255+
submenu_reset(ctx->submenu);
256256
}
257257

258258
static void mode_custom_callback(void* _ctx) {
@@ -288,5 +288,7 @@ bool scene_lovespouse_mode_custom_on_event(void* _ctx, SceneManagerEvent event)
288288
return false;
289289
}
290290
void scene_lovespouse_mode_custom_on_exit(void* _ctx) {
291-
UNUSED(_ctx);
291+
Ctx* ctx = _ctx;
292+
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
293+
byte_input_set_header_text(ctx->byte_input, "");
292294
}

base_pack/ble_spam/protocols/swiftpair.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ void scene_swiftpair_name_on_enter(void* _ctx) {
111111
Payload* payload = &ctx->attack->payload;
112112
SwiftpairCfg* cfg = &payload->cfg.swiftpair;
113113
TextInput* text_input = ctx->text_input;
114-
text_input_reset(text_input);
115114

116115
text_input_set_header_text(text_input, "Press back for random");
117116

@@ -131,5 +130,6 @@ bool scene_swiftpair_name_on_event(void* _ctx, SceneManagerEvent event) {
131130
return false;
132131
}
133132
void scene_swiftpair_name_on_exit(void* _ctx) {
134-
UNUSED(_ctx);
133+
Ctx* ctx = _ctx;
134+
text_input_reset(ctx->text_input);
135135
}

base_pack/ble_spam/scenes/config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ static void config_callback(void* _ctx, uint32_t index) {
4040
void scene_config_on_enter(void* _ctx) {
4141
Ctx* ctx = _ctx;
4242
VariableItemList* list = ctx->variable_item_list;
43-
variable_item_list_reset(list);
4443

4544
// Add item to be used as attack name header
4645
//variable_item_list_add(list, ctx->attack->title, 0, NULL, NULL);
@@ -73,5 +72,6 @@ bool scene_config_on_event(void* _ctx, SceneManagerEvent event) {
7372
}
7473

7574
void scene_config_on_exit(void* _ctx) {
76-
UNUSED(_ctx);
75+
Ctx* ctx = _ctx;
76+
variable_item_list_reset(ctx->variable_item_list);
7777
}

0 commit comments

Comments
 (0)