Skip to content

Conversation

@WillyJL
Copy link
Contributor

@WillyJL WillyJL commented Mar 3, 2025

What's new

  • Backport of most features/changes from "BadKB" found on some CFW (mostly my work):
    • Full on-device customization of:
      • USB Manufacturer name
      • USB Product name
      • USB VID and PID (Vendor and Product numeric IDs)
      • BLE Device Name
      • BLE MAC Addess
      • BLE Remember (whether to save paired devices or forget them on disconnect)
      • BLE Pairing (security mode for pairing: show PIN code, PIN confirm yes/no, simple yes/no (not supported on all devices, iPhones support it))
      • Default values for these parameters respect what BadUSB used previously
    • Added commands BLE_ID and BT_ID (alias for backwards compatibility), similar to ID command but they set BLE MAC address and device name
    • ID, BLE_ID and BT_ID commands will automatically switch connection mode to their own (if user had selected USB mode, opening a script with BLE_ID command will switch to BLE mode on first open), can be changed after opening script of course
    • UI additions/improvements:
      • Show script elapsed/run timer
      • Show script current line / total lines below big percentage
    • Expanded allowed BLE name length to max possible based on currently used AD types/segments (calculated by dissecting BLE advertisement in wireshark, math shown for future reference in code comment)
  • Added de-DE-mac and fi-FI keyboard layouts from third party contributors
  • Some random cleanup

Verification

  • Play around with BadUSB, make sure all works as expected
  • Try BLE_ID 11:22:33:44:55:AA Test123 command and see different values used
  • Check custom user-input values saving (values set by ID/BLE_ID/BT_ID are not saved to user config)
  • Check connection mode autoswitch based on ID and BLE_ID/BT_ID command

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@WillyJL WillyJL requested a review from portasynthinca3 as a code owner April 1, 2025 11:16
@@ -0,0 +1,325 @@
#include "ble_hid_service.h"

// Based on <lib/ble_profile/extra_services/hid_service.c>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why create a new version of it? Why not just update the ble_profile version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly due to API. it would be a breaking change, but also i was under the impression that it is preferred for app developers to keep the [app prefix] [flipper name] and xor'ed default mac conventions.

if thats not the case, sure this can be added to the default profile. maybe not as a replacement, but provide a way to choose if you want to just provide prefix + mac xor, or full parameter customization.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i changed it to be a wrapper profile: it uses the profile from API, but changes name, mac etc... after the base HID profile is setup. imo this is a solid compromise, keeps API the same, and app authors could use this easily if they want more options for HID profile config.

if instead you feel it would be better to provide these extra parameters in API, let me know and i can change it; if so, also not sure if in that case it would be best to change the base profile, or provide a second "thin" profile (like this wrapper) with same logic but different parameters. the second option would mean no API break.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi Willy i need this program

@hedger hedger added USB BadUSB + physical USB interface UI Affects UI New Feature Contains an IMPLEMENTATION of a new feature Bluetooth labels Apr 1, 2025
@hedger hedger self-assigned this Apr 1, 2025
variable_item_set_current_value_index(item, ble_hid_cfg->pairing);
variable_item_set_current_value_text(item, ble_pairing_names[ble_hid_cfg->pairing]);

variable_item_list_add(var_item_list, "BLE Device Name", 0, NULL, NULL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can omit BLE from item names since they all are only available in BLE pairing mode

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Remove BLE Pairing" too?

@WillyJL WillyJL marked this pull request as draft April 2, 2025 07:39
@WillyJL WillyJL marked this pull request as ready for review August 4, 2025 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bluetooth New Feature Contains an IMPLEMENTATION of a new feature UI Affects UI USB BadUSB + physical USB interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants