Skip to content

Commit

Permalink
Squashed 'applications/external/' changes from 5890d08342..f6adf06956
Browse files Browse the repository at this point in the history
f6adf06956 BLE Spam: Fix back event deadlocks
2ee30f7b2d Format
862ed2cd26 Merge qrcode from https://github.com/bmatcuk/flipperzero-qrcode
c21a854bc9 Merge picopass from https://github.com/flipperdevices/flipperzero-good-faps
babee2eae7 Merge picopass from https://github.com/xMasterX/all-the-plugins
c9cf807a2c Merge nfc_magic from https://github.com/flipperdevices/flipperzero-good-faps
c34410d6f6 Merge nfc_magic from https://github.com/xMasterX/all-the-plugins
74a0df341c small UI fix
cf1b9842a8 nfc magic sync with gen4
ae5809a923 upd picopass
d71190837c Picopass: enum to track auth method (#198)
202576a6be Picopass: saved card save as lfrfid (#195)
ae1156e5be [FL-3745] Write NTAG password and PACK to gen4 special pages (#190)
b069a9c43c Fix BLE Spam
3d31963c35 Picopass: add subheader to loclass UI (#197)
21ca5d4709 Picopass: Save unknown blocks with ?? (#196)
266e7bc update to firmware 0.100.3
07710ce2b0 Fix build
4620da6755 Merge xremote from https://github.com/xMasterX/all-the-plugins
7dceef8ef5 Merge nfc_magic from https://github.com/flipperdevices/flipperzero-good-faps
89f1512828 Merge nfc_magic from https://github.com/xMasterX/all-the-plugins
b54abc8954 Merge mfkey from https://github.com/xMasterX/all-the-plugins
737fc40b54 Merge ir_intervalometer from https://github.com/xMasterX/all-the-plugins
4f409c03f0 Merge geiger from https://github.com/xMasterX/all-the-plugins
386f024d3e Merge flizzer_tracker from https://github.com/xMasterX/all-the-plugins
57de394f5b Merge bt_trigger from https://github.com/xMasterX/all-the-plugins
ace76b6647 fix icon
957f3ca49c bump versions
82b72d2bc3 return missing part
a6bf78714f no gen4 ? :(
4c66aeb2d2 upd flizzertracker
83bcab344c ir apps add support for new settings
9451bb16b0 ir apps add support for new settings
f2eda96df9 upd mfkey
666d3a4157 [FL-3357] Magic Gen2 support (#143)

git-subtree-dir: applications/external
git-subtree-split: f6adf0695636a0c4d048eec8756f66284636c789
  • Loading branch information
RogueMaster committed Apr 16, 2024
1 parent 621dc18 commit 1d9029b
Show file tree
Hide file tree
Showing 77 changed files with 3,662 additions and 320 deletions.
2 changes: 1 addition & 1 deletion ble_spam/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ App(
fap_file_assets="assets",
fap_author="@Willy-JL @ECTO-1A @Spooks4576",
fap_weburl="https://github.com/Next-Flip/Momentum-Apps/tree/dev/ble_spam",
fap_version="6.2",
fap_version="6.3",
fap_description="Flood BLE advertisements to cause spammy and annoying popups/notifications",
fap_icon_assets="icons",
fap_icon_assets_symbol="ble_spam",
Expand Down
8 changes: 7 additions & 1 deletion ble_spam/ble_spam.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static Attack attacks[] = {

#define ATTACKS_COUNT ((signed)COUNT_OF(attacks))

static uint16_t delays[] = {20, 50, 100, 200, 500};
static uint16_t delays[] = {30, 50, 100, 200, 500};

typedef struct {
Ctx ctx;
Expand Down Expand Up @@ -628,6 +628,11 @@ static void lock_timer_callback(void* _ctx) {
furi_timer_set_thread_priority(FuriTimerThreadPriorityNormal);
}

static bool custom_event_callback(void* _ctx, uint32_t event) {
State* state = _ctx;
return scene_manager_handle_custom_event(state->ctx.scene_manager, event);
}

static void tick_event_callback(void* _ctx) {
State* state = _ctx;
bool advertising;
Expand Down Expand Up @@ -668,6 +673,7 @@ int32_t ble_spam(void* p) {
state->ctx.view_dispatcher = view_dispatcher_alloc();
view_dispatcher_enable_queue(state->ctx.view_dispatcher);
view_dispatcher_set_event_callback_context(state->ctx.view_dispatcher, state);
view_dispatcher_set_custom_event_callback(state->ctx.view_dispatcher, custom_event_callback);
view_dispatcher_set_tick_event_callback(state->ctx.view_dispatcher, tick_event_callback, 100);
view_dispatcher_set_navigation_event_callback(state->ctx.view_dispatcher, back_event_callback);
state->ctx.scene_manager = scene_manager_alloc(&scene_handlers, &state->ctx);
Expand Down
98 changes: 63 additions & 35 deletions ble_spam/protocols/continuity.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ static void pp_model_callback(void* _ctx, uint32_t index) {
switch(index) {
case 0:
payload->mode = PayloadModeRandom;
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
break;
case pp_models_count + 1:
scene_manager_next_scene(ctx->scene_manager, SceneContinuityPpModelCustom);
Expand All @@ -832,14 +832,14 @@ static void pp_model_callback(void* _ctx, uint32_t index) {
payload->bruteforce.value = cfg->data.proximity_pair.model;
payload->bruteforce.size = 2;
cfg->data.proximity_pair.bruteforce_mode = ContinuityPpBruteforceModel;
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
break;
default:
if(payload->mode != PayloadModeBruteforce ||
cfg->data.proximity_pair.bruteforce_mode == ContinuityPpBruteforceModel)
payload->mode = PayloadModeValue;
cfg->data.proximity_pair.model = pp_models[index - 1].value;
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
break;
}
}
Expand Down Expand Up @@ -881,8 +881,11 @@ void scene_continuity_pp_model_on_enter(void* _ctx) {
view_dispatcher_switch_to_view(ctx->view_dispatcher, ViewSubmenu);
}
bool scene_continuity_pp_model_on_event(void* _ctx, SceneManagerEvent event) {
UNUSED(_ctx);
UNUSED(event);
Ctx* ctx = _ctx;
if(event.type == SceneManagerEventTypeCustom) {
scene_manager_previous_scene(ctx->scene_manager);
return true;
}
return false;
}
void scene_continuity_pp_model_on_exit(void* _ctx) {
Expand All @@ -898,8 +901,7 @@ static void pp_model_custom_callback(void* _ctx) {
cfg->data.proximity_pair.bruteforce_mode == ContinuityPpBruteforceModel)
payload->mode = PayloadModeValue;
cfg->data.proximity_pair.model = (ctx->byte_store[0] << 0x08) + (ctx->byte_store[1] << 0x00);
scene_manager_previous_scene(ctx->scene_manager);
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
}
void scene_continuity_pp_model_custom_on_enter(void* _ctx) {
Ctx* ctx = _ctx;
Expand All @@ -918,8 +920,12 @@ void scene_continuity_pp_model_custom_on_enter(void* _ctx) {
view_dispatcher_switch_to_view(ctx->view_dispatcher, ViewByteInput);
}
bool scene_continuity_pp_model_custom_on_event(void* _ctx, SceneManagerEvent event) {
UNUSED(_ctx);
UNUSED(event);
Ctx* ctx = _ctx;
if(event.type == SceneManagerEventTypeCustom) {
scene_manager_previous_scene(ctx->scene_manager);
scene_manager_previous_scene(ctx->scene_manager);
return true;
}
return false;
}
void scene_continuity_pp_model_custom_on_exit(void* _ctx) {
Expand Down Expand Up @@ -950,13 +956,13 @@ static void pp_color_callback(void* _ctx, uint32_t index) {
payload->bruteforce.value = cfg->data.proximity_pair.color;
payload->bruteforce.size = 1;
cfg->data.proximity_pair.bruteforce_mode = ContinuityPpBruteforceColor;
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
} else {
if(payload->mode != PayloadModeBruteforce ||
cfg->data.proximity_pair.bruteforce_mode == ContinuityPpBruteforceColor)
payload->mode = PayloadModeValue;
cfg->data.proximity_pair.color = pp_models[model_index].colors[index].value;
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
}
}
void scene_continuity_pp_color_on_enter(void* _ctx) {
Expand Down Expand Up @@ -1005,8 +1011,11 @@ void scene_continuity_pp_color_on_enter(void* _ctx) {
view_dispatcher_switch_to_view(ctx->view_dispatcher, ViewSubmenu);
}
bool scene_continuity_pp_color_on_event(void* _ctx, SceneManagerEvent event) {
UNUSED(_ctx);
UNUSED(event);
Ctx* ctx = _ctx;
if(event.type == SceneManagerEventTypeCustom) {
scene_manager_previous_scene(ctx->scene_manager);
return true;
}
return false;
}
void scene_continuity_pp_color_on_exit(void* _ctx) {
Expand All @@ -1022,8 +1031,7 @@ static void pp_color_custom_callback(void* _ctx) {
cfg->data.proximity_pair.bruteforce_mode == ContinuityPpBruteforceColor)
payload->mode = PayloadModeValue;
cfg->data.proximity_pair.color = (ctx->byte_store[0] << 0x00);
scene_manager_previous_scene(ctx->scene_manager);
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
}
void scene_continuity_pp_color_custom_on_enter(void* _ctx) {
Ctx* ctx = _ctx;
Expand All @@ -1041,8 +1049,12 @@ void scene_continuity_pp_color_custom_on_enter(void* _ctx) {
view_dispatcher_switch_to_view(ctx->view_dispatcher, ViewByteInput);
}
bool scene_continuity_pp_color_custom_on_event(void* _ctx, SceneManagerEvent event) {
UNUSED(_ctx);
UNUSED(event);
Ctx* ctx = _ctx;
if(event.type == SceneManagerEventTypeCustom) {
scene_manager_previous_scene(ctx->scene_manager);
scene_manager_previous_scene(ctx->scene_manager);
return true;
}
return false;
}
void scene_continuity_pp_color_custom_on_exit(void* _ctx) {
Expand All @@ -1056,14 +1068,14 @@ static void pp_prefix_callback(void* _ctx, uint32_t index) {
switch(index) {
case 0:
cfg->data.proximity_pair.prefix = 0x00;
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
break;
case pp_prefixes_count + 1:
scene_manager_next_scene(ctx->scene_manager, SceneContinuityPpPrefixCustom);
break;
default:
cfg->data.proximity_pair.prefix = pp_prefixes[index - 1].value;
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
break;
}
}
Expand Down Expand Up @@ -1098,8 +1110,11 @@ void scene_continuity_pp_prefix_on_enter(void* _ctx) {
view_dispatcher_switch_to_view(ctx->view_dispatcher, ViewSubmenu);
}
bool scene_continuity_pp_prefix_on_event(void* _ctx, SceneManagerEvent event) {
UNUSED(_ctx);
UNUSED(event);
Ctx* ctx = _ctx;
if(event.type == SceneManagerEventTypeCustom) {
scene_manager_previous_scene(ctx->scene_manager);
return true;
}
return false;
}
void scene_continuity_pp_prefix_on_exit(void* _ctx) {
Expand All @@ -1112,8 +1127,7 @@ static void pp_prefix_custom_callback(void* _ctx) {
Payload* payload = &ctx->attack->payload;
ContinuityCfg* cfg = &payload->cfg.continuity;
cfg->data.proximity_pair.prefix = (ctx->byte_store[0] << 0x00);
scene_manager_previous_scene(ctx->scene_manager);
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
}
void scene_continuity_pp_prefix_custom_on_enter(void* _ctx) {
Ctx* ctx = _ctx;
Expand All @@ -1131,8 +1145,12 @@ void scene_continuity_pp_prefix_custom_on_enter(void* _ctx) {
view_dispatcher_switch_to_view(ctx->view_dispatcher, ViewByteInput);
}
bool scene_continuity_pp_prefix_custom_on_event(void* _ctx, SceneManagerEvent event) {
UNUSED(_ctx);
UNUSED(event);
Ctx* ctx = _ctx;
if(event.type == SceneManagerEventTypeCustom) {
scene_manager_previous_scene(ctx->scene_manager);
scene_manager_previous_scene(ctx->scene_manager);
return true;
}
return false;
}
void scene_continuity_pp_prefix_custom_on_exit(void* _ctx) {
Expand All @@ -1146,7 +1164,7 @@ static void na_action_callback(void* _ctx, uint32_t index) {
switch(index) {
case 0:
payload->mode = PayloadModeRandom;
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
break;
case na_actions_count + 1:
scene_manager_next_scene(ctx->scene_manager, SceneContinuityNaActionCustom);
Expand All @@ -1156,12 +1174,12 @@ static void na_action_callback(void* _ctx, uint32_t index) {
payload->bruteforce.counter = 0;
payload->bruteforce.value = cfg->data.nearby_action.action;
payload->bruteforce.size = 1;
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
break;
default:
payload->mode = PayloadModeValue;
cfg->data.nearby_action.action = na_actions[index - 1].value;
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
break;
}
}
Expand Down Expand Up @@ -1201,8 +1219,11 @@ void scene_continuity_na_action_on_enter(void* _ctx) {
view_dispatcher_switch_to_view(ctx->view_dispatcher, ViewSubmenu);
}
bool scene_continuity_na_action_on_event(void* _ctx, SceneManagerEvent event) {
UNUSED(_ctx);
UNUSED(event);
Ctx* ctx = _ctx;
if(event.type == SceneManagerEventTypeCustom) {
scene_manager_previous_scene(ctx->scene_manager);
return true;
}
return false;
}
void scene_continuity_na_action_on_exit(void* _ctx) {
Expand All @@ -1216,8 +1237,7 @@ static void na_action_custom_callback(void* _ctx) {
ContinuityCfg* cfg = &payload->cfg.continuity;
payload->mode = PayloadModeValue;
cfg->data.nearby_action.action = (ctx->byte_store[0] << 0x00);
scene_manager_previous_scene(ctx->scene_manager);
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
}
void scene_continuity_na_action_custom_on_enter(void* _ctx) {
Ctx* ctx = _ctx;
Expand All @@ -1235,8 +1255,12 @@ void scene_continuity_na_action_custom_on_enter(void* _ctx) {
view_dispatcher_switch_to_view(ctx->view_dispatcher, ViewByteInput);
}
bool scene_continuity_na_action_custom_on_event(void* _ctx, SceneManagerEvent event) {
UNUSED(_ctx);
UNUSED(event);
Ctx* ctx = _ctx;
if(event.type == SceneManagerEventTypeCustom) {
scene_manager_previous_scene(ctx->scene_manager);
scene_manager_previous_scene(ctx->scene_manager);
return true;
}
return false;
}
void scene_continuity_na_action_custom_on_exit(void* _ctx) {
Expand All @@ -1245,7 +1269,7 @@ void scene_continuity_na_action_custom_on_exit(void* _ctx) {

static void na_flags_callback(void* _ctx) {
Ctx* ctx = _ctx;
scene_manager_previous_scene(ctx->scene_manager);
view_dispatcher_send_custom_event(ctx->view_dispatcher, 0);
}
void scene_continuity_na_flags_on_enter(void* _ctx) {
Ctx* ctx = _ctx;
Expand All @@ -1264,6 +1288,10 @@ void scene_continuity_na_flags_on_enter(void* _ctx) {
}
bool scene_continuity_na_flags_on_event(void* _ctx, SceneManagerEvent event) {
Ctx* ctx = _ctx;
if(event.type == SceneManagerEventTypeCustom) {
scene_manager_previous_scene(ctx->scene_manager);
return true;
}
if(event.type == SceneManagerEventTypeBack) {
ctx->byte_store[0] = 0x00;
}
Expand Down
Loading

0 comments on commit 1d9029b

Please sign in to comment.