Skip to content

Commit

Permalink
BLE Spam tweak some text and better help section
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Oct 21, 2023
1 parent 9d3e347 commit 27a2138
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
33 changes: 25 additions & 8 deletions applications/external/ble_spam/ble_spam.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

static Attack attacks[] = {
{
.title = "+ Kitchen Sink",
.title = "The Kitchen Sink",
.text = "Flood all attacks at once",
.protocol = NULL,
.payload =
Expand Down Expand Up @@ -75,7 +75,7 @@ static Attack attacks[] = {
},
},
{
.title = "Android Device Pair",
.title = "Android Device Connect",
.text = "Reboot cooldown, long range",
.protocol = &protocol_fastpair,
.payload =
Expand Down Expand Up @@ -192,12 +192,13 @@ static void toggle_adv(State* state) {
}
}

#define PAGE_MIN (-3)
#define PAGE_MIN (-4)
#define PAGE_MAX ATTACKS_COUNT
enum {
PageHelpApps = PAGE_MIN,
PageHelpDelay,
PageHelpDistance,
PageHelpInfoConfig,
PageStart = 0,
PageEnd = ATTACKS_COUNT - 1,
PageAboutCredits = PAGE_MAX,
Expand Down Expand Up @@ -279,9 +280,25 @@ static void draw_callback(Canvas* canvas, void* _ctx) {
48,
AlignLeft,
AlignTop,
"\e#Distance\e# is limited, attacks\n"
"work under 1 meter but a\n"
"few are marked 'long range'",
"\e#Distance\e# varies greatly:\n"
"some are long range (>30 m)\n"
"others are close range (<1 m)",
false);
break;
case PageHelpInfoConfig:
canvas_set_font(canvas, FontBatteryPercent);
canvas_draw_str_aligned(canvas, 124, 12, AlignRight, AlignBottom, "Help");
elements_text_box(
canvas,
4,
16,
120,
48,
AlignLeft,
AlignTop,
"See \e#more info\e# and change\n"
"\e#attack options\e# by holding\n"
"Ok on each attack page",
false);
break;
case PageAboutCredits:
Expand Down Expand Up @@ -318,11 +335,11 @@ static void draw_callback(Canvas* canvas, void* _ctx) {
"%02i/%02i: %s",
state->index + 1,
ATTACKS_COUNT,
protocol ? protocol->get_name(&payload->cfg) : "Everything");
protocol ? protocol->get_name(&payload->cfg) : "Everything AND");
canvas_draw_str(canvas, 4 - (state->index < 19 ? 1 : 0), 21, str);

canvas_set_font(canvas, FontPrimary);
canvas_draw_str(canvas, 4, 32, attack->title);
canvas_draw_str(canvas, 4, 33, attack->title);

canvas_set_font(canvas, FontSecondary);
canvas_draw_str(canvas, 4, 46, attack->text);
Expand Down
6 changes: 3 additions & 3 deletions applications/external/ble_spam/protocols/continuity.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ const uint8_t na_actions_count = COUNT_OF(na_actions);

static const char* type_names[ContinuityTypeCOUNT] = {
[ContinuityTypeAirDrop] = "AirDrop",
[ContinuityTypeProximityPair] = "Proximity Pair",
[ContinuityTypeProximityPair] = "Continuity Pair",
[ContinuityTypeAirplayTarget] = "Airplay Target",
[ContinuityTypeHandoff] = "Handoff",
[ContinuityTypeTetheringSource] = "Tethering Source",
[ContinuityTypeNearbyAction] = "Nearby Action",
[ContinuityTypeNearbyAction] = "Continuity Action",
[ContinuityTypeNearbyInfo] = "Nearby Info",
[ContinuityTypeCustomCrash] = "Custom Packet",
[ContinuityTypeCustomCrash] = "Continuity Custom",
};
static const char* continuity_get_name(const ProtocolCfg* _cfg) {
const ContinuityCfg* cfg = &_cfg->continuity;
Expand Down

0 comments on commit 27a2138

Please sign in to comment.