MX 2 лет назад
Родитель
Сommit
c5f4426370

+ 1 - 1
base_pack/ble_spam/application.fam

@@ -8,7 +8,7 @@ App(
     fap_category="Bluetooth",
     fap_author="@Willy-JL @ECTO-1A @Spooks4576",
     fap_weburl="https://github.com/Flipper-XFW/Xtreme-Apps/tree/dev/ble_spam",
-    fap_version="4.3",
+    fap_version="4.4",
     fap_description="Flood BLE advertisements to cause spammy and annoying popups/notifications",
     fap_icon_assets="icons",
     fap_icon_assets_symbol="ble_spam",

+ 1 - 1
base_pack/ble_spam/ble_spam.c

@@ -375,7 +375,7 @@ static void draw_callback(Canvas* canvas, void* _ctx) {
             "App+Spam: \e#WillyJL\e# XFW\n"
             "Apple+Crash: \e#ECTO-1A\e#\n"
             "Android+Win: \e#Spooks4576\e#\n"
-            "                                   Version \e#4.3\e#",
+            "                                   Version \e#4.4\e#",
             false);
         break;
     default: {

+ 47 - 6
base_pack/ble_spam/protocols/continuity.c

@@ -28,7 +28,13 @@ static const ContinuityColor colors_powerbeats_3[] = {
 };
 static const ContinuityColor colors_powerbeats_pro[] = {
     {0x00, "White"},
-    {0x01, "Black"},
+    {0x02, "Yellowish Green"},
+    {0x03, "Blue"},
+    {0x04, "Black"},
+    {0x05, "Pink"},
+    {0x06, "Red"},
+    {0x0B, "Gray ?"},
+    {0x0D, "Sky Blue"},
 };
 static const ContinuityColor colors_beats_solo_pro[] = {
     {0x00, "White"},
@@ -45,8 +51,16 @@ static const ContinuityColor colors_beats_x[] = {
 static const ContinuityColor colors_beats_studio_3[] = {
     {0x00, "White"},
     {0x01, "Black"},
-    {0x03, "Red"},
-    {0x43, "White marble"},
+    {0x02, "Red"},
+    {0x03, "Blue"},
+    {0x18, "Shadow Gray"},
+    {0x19, "Desert Sand"},
+    {0x25, "Black / Red"},
+    {0x26, "Midnight Black"},
+    {0x27, "Desert Sand 2"},
+    {0x28, "Clear blue/ gold"},
+    {0x42, "Green Forest camo"},
+    {0x43, "White Camo"},
 };
 static const ContinuityColor colors_beats_studio_pro[] = {
     {0x00, "White"},
@@ -438,6 +452,10 @@ static void pp_model_changed(VariableItem* item) {
     Payload* payload = &ctx->attack->payload;
     ContinuityCfg* cfg = &payload->cfg.continuity;
     uint8_t index = variable_item_get_current_value_index(item);
+    const char* color_name = NULL;
+    char color_name_buf[3];
+    uint8_t colors_count;
+    uint8_t value_index_color;
     if(index) {
         index--;
         if(payload->mode != PayloadModeBruteforce ||
@@ -445,13 +463,36 @@ static void pp_model_changed(VariableItem* item) {
             payload->mode = PayloadModeValue;
         cfg->data.proximity_pair.model = pp_models[index].value;
         variable_item_set_current_value_text(item, pp_models[index].name);
+        colors_count = pp_models[index].colors_count;
+        if(payload->mode == PayloadModeValue) {
+            for(uint8_t j = 0; j < colors_count; j++) {
+                if(cfg->data.proximity_pair.color == pp_models[index].colors[j].value) {
+                    color_name = pp_models[index].colors[j].name;
+                    value_index_color = j;
+                    break;
+                }
+            }
+            if(!color_name) {
+                snprintf(
+                    color_name_buf, sizeof(color_name_buf), "%02X", cfg->data.proximity_pair.color);
+                color_name = color_name_buf;
+                value_index_color = colors_count;
+            }
+        } else {
+            color_name = "Bruteforce";
+            value_index_color = colors_count;
+        }
     } else {
         payload->mode = PayloadModeRandom;
         variable_item_set_current_value_text(item, "Random");
+        color_name = "Random";
+        colors_count = 1;
+        value_index_color = 0;
     }
-    scene_manager_set_scene_state(ctx->scene_manager, SceneConfig, ConfigPpModel);
-    scene_manager_previous_scene(ctx->scene_manager);
-    scene_manager_next_scene(ctx->scene_manager, SceneConfig);
+    item = variable_item_list_get(ctx->variable_item_list, ConfigPpColor);
+    variable_item_set_values_count(item, colors_count);
+    variable_item_set_current_value_index(item, value_index_color);
+    variable_item_set_current_value_text(item, color_name);
 }
 static void pp_color_changed(VariableItem* item) {
     Payload* payload = variable_item_get_context(item);

+ 49 - 1
base_pack/ble_spam/protocols/fastpair.c

@@ -616,36 +616,84 @@ static void config_callback(void* _ctx, uint32_t index) {
         break;
     }
 }
+static void model_changed(VariableItem* item) {
+    Payload* payload = variable_item_get_context(item);
+    FastpairCfg* cfg = &payload->cfg.fastpair;
+    uint16_t index = variable_item_get_current_value_index(item);
+    switch(index) {
+    case 0:
+        cfg->_model_index--;
+        break;
+    case 1:
+        if(cfg->_model_index == 0) {
+            cfg->_model_index++;
+        } else {
+            cfg->_model_index--;
+        }
+        break;
+    case 2:
+        if(cfg->_model_index > models_count) {
+            cfg->_model_index--;
+        } else {
+            cfg->_model_index++;
+        }
+        break;
+    }
+    index = cfg->_model_index;
+    if(index) {
+        index--;
+        payload->mode = PayloadModeValue;
+        cfg->model = models[index].value;
+        variable_item_set_current_value_index(item, index == (models_count - 1) ? 2 : 1);
+        variable_item_set_current_value_text(item, models[index].name);
+    } else {
+        payload->mode = PayloadModeRandom;
+        variable_item_set_current_value_index(item, 0);
+        variable_item_set_current_value_text(item, "Random");
+    }
+}
 static void extra_config(Ctx* ctx) {
     Payload* payload = &ctx->attack->payload;
     FastpairCfg* cfg = &payload->cfg.fastpair;
     VariableItemList* list = ctx->variable_item_list;
     VariableItem* item;
+    uint8_t value_index;
+    uint16_t model_index;
 
-    item = variable_item_list_add(list, "Model Code", 0, NULL, NULL);
+    item = variable_item_list_add(list, "Model Code", 3, model_changed, payload);
     const char* model_name = NULL;
     char model_name_buf[9];
     switch(payload->mode) {
     case PayloadModeRandom:
     default:
         model_name = "Random";
+        value_index = 0;
+        model_index = 0;
         break;
     case PayloadModeValue:
         for(uint16_t i = 0; i < models_count; i++) {
             if(cfg->model == models[i].value) {
                 model_name = models[i].name;
+                value_index = i == (models_count - 1) ? 2 : 1;
+                model_index = i + 1;
                 break;
             }
         }
         if(!model_name) {
             snprintf(model_name_buf, sizeof(model_name_buf), "%06lX", cfg->model);
             model_name = model_name_buf;
+            value_index = 3;
+            model_index = models_count + 1;
         }
         break;
     case PayloadModeBruteforce:
         model_name = "Bruteforce";
+        value_index = 3;
+        model_index = models_count + 1;
         break;
     }
+    cfg->_model_index = model_index;
+    variable_item_set_current_value_index(item, value_index);
     variable_item_set_current_value_text(item, model_name);
 
     variable_item_list_add(list, "Requires Google services", 0, NULL, NULL);

+ 1 - 0
base_pack/ble_spam/protocols/fastpair.h

@@ -6,6 +6,7 @@
 
 typedef struct {
     uint32_t model;
+    uint16_t _model_index;
 } FastpairCfg;
 
 extern const Protocol protocol_fastpair;