Skip to content

Fixed BLE_SPAM.cpp for Apple Continuity Spams that actually work and built an Bluetooth Companion App from Scratch with Firmware#2443

Open
m0lomalteser wants to merge 8 commits into
BruceDevices:mainfrom
m0lomalteser:main
Open

Fixed BLE_SPAM.cpp for Apple Continuity Spams that actually work and built an Bluetooth Companion App from Scratch with Firmware#2443
m0lomalteser wants to merge 8 commits into
BruceDevices:mainfrom
m0lomalteser:main

Conversation

@m0lomalteser

Copy link
Copy Markdown

Proposed Changes

Complete rewrite of ble_spam.cpp — ports the working BLE advertisement packet formats from the reference ble_spam.c (Flipper Zero ble_spam app) into Bruce's C++ NimBLE-Arduino codebase.
The previous implementation used static byte arrays for Apple payloads and called BLEDevice::init()/deinit() for every single advertisement packet — slow and often ignored by iOS/Android devices. This rewrite:

  1. Ports all packet builders from the working C reference: Apple Continuity (ProximityPair, NearbyAction, CustomCrash/iOS 17 lockup), Google FastPair (75+ models), Samsung EasySetup (Buds + Watch — Buds were missing), Microsoft SwiftPair
  2. FreeRTOS task architecture — spam runs in its own task instead of init/deinit per packet, dramatically increasing packet rate
  3. Semaphore-based task lifecycle — clean start/stop without race conditions
  4. Fixed Apple Continuity format — dynamic random fields (prefix, battery, lid counter, encrypted payload) matching Flipper Zero reference, which triggers popups on iOS devices where static payloads failed
  5. New menu option — "Apple Continuity" added to the BLE Spam menu, cycles between all 3 Apple packet types

Types of Changes

  • New feature (improved BLE spam with working Apple Continuity support)
  • Refactoring (task-based architecture replacing per-packet init/deinit loop)
  • Bugfix (static Apple payloads didn't trigger iOS popups; Samsung Buds missing)

Verification

  • Build: pio run -e m5stack-cplus2 (or any NimBLE-enabled target)
  • Navigate: Bluetooth → BLE Spam → Apple Continuity
  • Observe popups on nearby iPhone (AirPods, AppleTV Setup, HomePod, Vision Pro)
  • All existing modes preserved: Windows/Samsung/Android/Spam All/Custom/Legacy SourApple & AppleJuice
  • iBeacon function unchanged

Testing

No automated tests; tested by building and verifying on-device behavior. The packet formats are direct ports from the Flipper Zero ble_spam app which is widely tested.

Linked Issues

N/A — addresses user report that built-in BLE spam did not trigger popups on iPhone.

User-Facing Change

New menu entry "Apple Continuity" under Bluetooth → BLE Spam. This replaces none of the existing entries; all prior functionality remains. Users who previously saw no popups on iOS should now see AirPods/AppleTV/HomePod/Vision Pro setup dialogs.

Rewrite BLE Spam engine: ported Flipper Zero reference packet formats, FreeRTOS task architecture, working Apple Continuity popups on iOS
Further Comments ####
The key insight from the reference C implementation: Apple Continuity packets must be constructed with dynamic random fields (prefix byte, battery levels, lid-open counter, 16-byte encrypted payload). The previous static byte arrays were often silently ignored by iOS. Samsung EasySetup now also includes Buds models (20 variants) in addition to Watch models, matching the Flipper Zero feature set.

@m0lomalteser m0lomalteser left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Just Changed some stuff for Apple Continuity

@m0lomalteser

Copy link
Copy Markdown
Author

I added more Features and Reorganised the UI

Added Support for iOS and soon also Android BLE Companion App for Bruce: https://github.com/m0lomalteser/Bruce-App
@m0lomalteser m0lomalteser changed the title Fixed BLE_SPAM.cpp for Apple Continuity Spams that actually work Fixed BLE_SPAM.cpp for Apple Continuity Spams that actually work and built an Bluetooth Companion App from Scratch with Firmware May 17, 2026
@m0lomalteser

Copy link
Copy Markdown
Author

Heres my new Companion App(Android comming soon): https://github.com/m0lomalteser/Bruce-App

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant