firmware icon indicating copy to clipboard operation
firmware copied to clipboard

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

Open m0lomalteser opened this issue 6 months ago • 2 comments

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 avatar May 13 '26 23:05 m0lomalteser

I added more Features and Reorganised the UI

m0lomalteser avatar May 15 '26 10:05 m0lomalteser

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

m0lomalteser avatar May 17 '26 15:05 m0lomalteser