- Add explicit discarding of Set.remove results in sync blocks
- Add explicit discarding of Dictionary.removeValue results
- Ensures completely clean builds with no warnings
All instances of remove/removeValue inside sync blocks now
explicitly discard their return values to satisfy Swift 6.
- Add explicit discarding of removeValue results in NoiseSession
- Remove unnecessary _ = from BluetoothMeshService sync block
- Ensures clean builds with no warnings (except AppIntents metadata)
The warning was caused by Swift 6 being stricter about unused
results from methods that return values inside sync blocks.
- Fix redundant underscore warnings in NoiseSession.swift
- Replace non-existent handlePeerDisconnection with proper cleanup code
- Remove invalid showSystemMessage call, use didDisconnectFromPeer instead
- Clean up peer state when version negotiation fails
The project now builds successfully for iOS with only minor warnings
about metadata extraction for app intents (which can be ignored).
- Remove unused loggedCryptoErrors property from BluetoothMeshService
- Remove unused error cases from NoiseEncryptionError:
- invalidMessage (never thrown)
- handshakeFailed(Error) (never thrown)
These were identified during deeper code analysis and are
confirmed to be unused throughout the codebase.
- Remove NoisePostQuantum.swift entirely (placeholder with no implementation)
- Remove Double Ratchet placeholder code from NoiseChannelKeyRotation.swift
- Remove NoisePostQuantumTests that tested mock implementations
- Handle TODO for version negotiation rejection (now properly disconnects)
- Remove legacy comment about removed message type 0x02
- Keep deprecated ownerID field as it's still used for compatibility
This cleanup removes ~400 lines of placeholder code that was not
being used and unlikely to be implemented in the near future.
Root cause: When receiving a handshake initiation (32 bytes) from a peer
with whom we already had an established session, the code would destroy
the existing session to "help" the other side. This created a cascade:
- Peer A completes handshake with Peer B
- Peer A sends message, realizes no session, initiates handshake
- Peer B destroys its working session to "help"
- Peer B now has no session, initiates handshake
- Both peers keep destroying each other's sessions
Fix:
- Never destroy an established session when receiving new handshake attempts
- Add early check in handshake initiation to skip if session exists
- Clear handshake rate limit timers when session already established
This eliminates the delays and repeated handshakes seen in the logs.
- Add session migration when peer IDs rotate
- Sessions now follow peers across ID changes via fingerprint
- Add migratePeerSession to NoiseEncryptionService
- Add migrateSession to NoiseSessionManager
- Integrate migration in BluetoothMeshService updatePeerBinding
This fixes the issue where established Noise sessions were lost
when peer IDs rotated, causing "No Noise session" errors and
requiring re-handshake.
- Add Ed25519 signing key pair to NoiseEncryptionService
- Update NoiseIdentityAnnouncement to include signingPublicKey
- Replace HMAC signatures with proper Ed25519 signatures
- Fix timestamp synchronization between signing and verification
- Add signature verification in PeerIdentityBinding
- Persist signing keys in keychain alongside Noise static keys
This provides cryptographic non-repudiation for peer identity claims
and strengthens the security of the identity rotation mechanism.
In my testing the app crashes in the background when receiving a notification. This is probably due to UIFeedbackGenerator requiring the main thread which isn't available
- Moved encryption/handshake status icons to appear after peer names in sidebar and private message headers
- Converted private messages and channels to slide-over views with smooth transitions
- Added swipe-right gesture to dismiss private chats and channels
- Added vertical separator bars to slide-over views for visual consistency
- Add version negotiation messages (0x20 versionHello, 0x21 versionAck)
- Implement VersionHello and VersionAck message types with platform info
- Add ProtocolVersion struct for version management and negotiation
- Update BinaryProtocol to check supported versions
- Add version negotiation to connection flow before Noise handshake
- Maintain backward compatibility with legacy peers (assume v1)
- Add comprehensive test suite with 40+ test cases
- Update documentation with version negotiation details
This ensures BitChat clients can negotiate protocol versions for smooth
upgrades while maintaining full backward compatibility with existing clients.
- Created separate macOS entitlements file with required Bluetooth permission
- Fixed "Bluetooth unsupported" issue on Mac by adding com.apple.security.device.bluetooth entitlement
- Removed all debug logging from BluetoothMeshService
- Re-enabled scan duty cycling
- Reverted RSSI threshold back to -90 dBm from temporary -100 dBm debug value
- Create separate bitchat-macOS.entitlements file with com.apple.security.device.bluetooth
- Update project.yml to use the macOS-specific entitlements for the macOS target
- Regenerate Xcode project with proper entitlements configuration
This fixes the 'Bluetooth unsupported' issue on macOS which was caused by missing
device.bluetooth entitlement required for sandboxed apps
- Add better state descriptions for both central and peripheral managers
- Add logging when setting up peripheral and adding service
- Temporarily disable scan duty cycling to ensure continuous scanning
- Add service UUID logging during peripheral setup
This should help identify:
1. Why Mac shows 'unsupported' state for Bluetooth
2. Whether services are being added successfully
3. If advertising is actually starting
- Add debug logs to centralManagerDidUpdateState and peripheralManagerDidUpdateState
- Add logging to startServices to show manager states at initialization
- Add logging when peripherals are discovered with RSSI values
- Temporarily lower RSSI threshold from -90 to -100 dBm for testing
- Add logging to show when scanning starts and if it's blocked
- Add development team L3N5LHJD5Y to all targets in project.yml
- Add automatic code signing settings to test targets
- Fix UIRequiresFullScreen setting to false for launch storyboard compatibility
- Update Info.plist with proper launch configuration
- Ensure all targets have consistent code signing configuration
- Add UILaunchStoryboardName to Info.plist
- Add UIRequiresFullScreen setting
- Add UIBackgroundModes for Bluetooth background operations
- Add interface orientation support for iPhone and iPad
- Add development team to all project targets
- Add LaunchScreen.storyboard to properly support all iPhone models
- Configure UILaunchStoryboardName in Info.plist for full screen display
- Add UIRequiresFullScreen to prevent black bars on newer devices
- Update project.yml to include launch screen in iOS target resources
- Add proper interface orientation support for iPhone and iPad