Commit Graph
82 Commits
Author SHA1 Message Date
jackandGitHub 327869cbdc Merge pull request #281 from zeugmaster/reduce-fragment-size
Reduce fragment size
2025-07-22 11:45:47 +02:00
jackandGitHub 06a7003924 Merge pull request #291 from permissionlesstech/cleanup-dead-code
Remove dead code and fix warnings
2025-07-22 11:44:46 +02:00
jack a09c5f6461 Remove CONSOLE_WARNINGS.md 2025-07-22 11:43:43 +02:00
jack b3d1d8e4e1 Document benign console warnings
Add documentation explaining the harmless system-level warnings:
- CFPrefsPlistSource warning from UserDefaults with app groups
- "Failed to get or decode unavailable reasons" from CoreBluetooth

These are Apple framework issues that don't affect functionality
and appear in many production iOS apps.
2025-07-22 11:42:34 +02:00
jack 128b19496d Fix remaining Swift 6 warnings about unused results
- 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.
2025-07-22 11:40:28 +02:00
jack 9e035c9c14 Fix Swift 6 warning about unused result
- 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.
2025-07-22 11:38:20 +02:00
jack d804b93488 Fix compilation errors and warnings
- 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).
2025-07-22 11:33:51 +02:00
jack 673f6a76dd Remove more dead code
- 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.
2025-07-22 11:26:18 +02:00
jack ce6e90701c Remove dead code and placeholders
- 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.
2025-07-22 11:20:07 +02:00
jackandGitHub 9fef19a595 Merge pull request #289 from permissionlesstech/implement-ed25519-signatures
Implement Ed25519 signatures and fix session management
2025-07-22 11:10:43 +02:00
jack 8fccbe69b9 Fix session destruction race condition causing handshake delays
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.
2025-07-22 11:06:57 +02:00
jack 0be35a5378 Fix Noise session persistence during peer ID rotation
- 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.
2025-07-22 11:01:24 +02:00
jack 83a808fce6 Implement Ed25519 signatures for identity announcements
- 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.
2025-07-22 10:50:47 +02:00
jackandGitHub 079f36664c Merge pull request #254 from permissionlesstech/remove-message-retention-and-save
Remove message retention and /save command
2025-07-16 16:00:08 +02:00
jack b61904bee9 Remove message retention and /save command
- Delete MessageRetentionService.swift
- Remove retentionEnabledChannels from ChatViewModel
- Remove /save command handling
- Remove retention UI elements from ContentView
- Remove channelRetention message type from protocol
- Update documentation and tests
2025-07-16 15:59:38 +02:00
jackandGitHub fcc0735928 Merge pull request #253 from permissionlesstech/ui/move-verified-badge-position
Move encryption status icons and implement slide-over navigation
2025-07-16 15:39:32 +02:00
jack ee2c7550d1 Move encryption status icons after peer names and implement slide-over navigation
- 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
2025-07-16 15:38:20 +02:00
jack 17e96e9993 Replace RSSI dot with radio wave icon in sidebar 2025-07-16 00:49:06 +02:00
jackandGitHub 92a8bab411 Merge pull request #246 from permissionlesstech/feat/protocol-version-negotiation
Add protocol version negotiation
2025-07-15 14:37:30 +02:00
jackandGitHub f0e7284cdf Update README.md 2025-07-15 14:36:27 +02:00
jackandGitHub 6ebd55fe18 Update README.md 2025-07-15 14:35:55 +02:00
jack 3fb39b8a30 Add protocol version negotiation for future compatibility
- 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.
2025-07-15 14:33:37 +02:00
jack 59927486eb Fix mermaid diagram syntax error in whitepaper
Replace SHA256(PublicKey) with quoted text to resolve mermaid rendering issue
2025-07-15 13:29:12 +02:00
jackandGitHub 1e0dd24626 Merge pull request #244 from permissionlesstech/feat/bring-the-noise
Implement Noise Protocol Framework and peer ID rotation
2025-07-15 13:24:02 +02:00
jack 3070a4d307 Implement Noise Protocol Framework and peer ID rotation for enhanced security and privacy
This major update replaces the basic encryption with the Noise Protocol Framework
and adds ephemeral peer ID rotation for enhanced privacy.

Key Changes:

Security Infrastructure:
- Implemented Noise Protocol Framework (XX handshake pattern)
- End-to-end encryption with forward secrecy and identity hiding
- Session management with automatic rekey support
- Channel encryption with password-derived keys

Privacy Enhancements:
- Ephemeral peer ID rotation (5-15 minute random intervals)
- Persistent identity through public key fingerprints
- Favorites and verification persist across ID rotations
- Block list based on fingerprints, not ephemeral IDs

Core Components Added:
- NoiseEncryptionService: Main encryption service
- NoiseSession: Individual peer session management
- NoiseChannelEncryption: Password-protected channel support
- SecureIdentityStateManager: Persistent identity storage
- FingerprintView: Visual fingerprint verification UI

Bug Fixes:
- Fixed handshake storm with tie-breaker mechanism
- Fixed missing connect messages during peer rotation
- Fixed delivery ACK compression issues
- Fixed race conditions in message queue
- Fixed nickname resolution for rotated peer IDs

Testing:
- Comprehensive test suite for Noise implementation
- Security validator tests
- Channel encryption tests
- Identity persistence tests
- Rate limiter tests

Documentation:
- BRING_THE_NOISE.md: Technical implementation details
- Updated WHITEPAPER.md: Simplified and focused on core innovations
- Removed temporary debug documentation

The implementation maintains backward compatibility while significantly
improving security and privacy. All existing features (channels, private
messages, favorites, blocking) work seamlessly with the new system.
2025-07-15 13:15:31 +02:00
jackandGitHub 6d39222ea0 Update README.md 2025-07-15 12:01:46 +02:00
jackandGitHub 4ba720f111 Merge pull request #148 from vignesh1507/patch-1 2025-07-10 17:50:08 +02:00
jackandGitHub 214fa34dc5 Update README.md 2025-07-10 17:15:32 +02:00
jackandGitHub a9c5c7d468 Update README.md 2025-07-10 17:12:13 +02:00
jackandGitHub 0ece2d6610 Update README.md 2025-07-10 17:10:36 +02:00
jackandGitHub e69eaec9a8 Merge pull request #76 from marcusziade/feature/add-accessibility-labels 2025-07-10 17:07:34 +02:00
jackandGitHub e27b028922 Merge pull request #138 from jackjackbits/fix/mac-entitlements
Fix macOS Bluetooth entitlements
2025-07-10 12:57:54 +02:00
jack 022050193f Fix macOS Bluetooth entitlements and remove debug logging
- 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
2025-07-10 12:53:51 +02:00
jack c6d74b7574 Fix macOS Bluetooth permissions by adding proper entitlements
- 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
2025-07-10 12:45:00 +02:00
jack 7e78d0fe87 Add more Bluetooth debugging and disable scan duty cycling
- 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
2025-07-10 12:39:58 +02:00
jack d111a9537f Add extensive Bluetooth debug logging to diagnose peer discovery issues
- 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
2025-07-10 12:29:24 +02:00
jackandGitHub dd05089da9 Merge pull request #123 from michaelneale/micn/macos 2025-07-10 10:07:42 +02:00
jackandGitHub d3031b5a97 Update README.md 2025-07-09 21:49:12 +02:00
jack cb2a1801cd Update project configuration with code signing and launch settings
- 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
2025-07-09 19:48:26 +02:00
jack ccc09d6ce6 Fix iOS launch configuration requirements
- 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
2025-07-09 19:39:52 +02:00
jackandGitHub ad3afab943 Update README.md 2025-07-09 16:58:27 +02:00
jackandGitHub 2ad7b93535 Merge pull request #96 from Mirza-Samad-Ahmed-Baig/fix/compression-buffer-overflow
Fix: Prevent potential buffer overflow in CompressionUtil.swift
2025-07-09 16:31:39 +02:00
jack fc5e83612a Fix iPhone 16 screen display issue with proper launch screen
- 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
2025-07-09 16:28:56 +02:00
jack 76786bb199 Remove debug print statements from LinkPreviewView
Remove excessive debug logging that was spamming console output when checking for markdown links in messages
2025-07-09 16:21:56 +02:00
jackandGitHub 033a5881b4 Update project.yml 2025-07-09 16:17:34 +02:00
jack c352542331 Fix macOS build error and iPhone 16 display issues
- Split multi-platform target into separate iOS and macOS targets to prevent iOS share extension from being embedded in macOS build
- Add launch screen configuration and full screen support for proper iPhone 16 display
- Configure iOS-specific Info.plist entries for background modes and interface orientations
2025-07-09 16:08:37 +02:00
jack 1017017bd1 Update alert text to lowercase style 2025-07-09 15:19:57 +02:00
jack e00a6c1feb Fix build error and failing test
- Add CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION to share extension
- Fix test assertion to match lowercase error message
2025-07-09 15:19:57 +02:00
jackandGitHub d296f1d6a4 Merge pull request #20 from jmecom/jm/warning-readme
Add warning to readme
2025-07-09 13:45:26 +02:00
jackandGitHub 5ec79e8080 Merge pull request #75 from nanoterran/main
Fixing macOS build
2025-07-09 11:13:03 +02:00
jackandGitHub 7165eec85f Merge pull request #35 from utsavDave97/main
Fix for send message bug and other new features
2025-07-08 18:49:03 +02:00
jackandGitHub e3dd2079c1 Merge pull request #63 from richardsonnick/patch-1
Fix Unsupported markdown: blockquote in README.md
2025-07-08 18:37:24 +02:00
jackandGitHub 27ff9fcbdb Merge pull request #52 from wacumov/main
Set up CI using GitHub Actions
2025-07-08 18:31:25 +02:00
jackandGitHub 70c6307a90 Merge pull request #34 from nelsoncampoos/fix/message-duplication-sync-improvements
Fix message duplication and improve sync performance in mesh network
2025-07-08 18:26:10 +02:00
jackandGitHub 806291cecf Merge pull request #44 from PubliusPseudis/fix/update-peerlist-on-main-thread
Fix: Ensure peer list updates on main thread
2025-07-08 18:18:03 +02:00
jackandGitHub 5285c6064d Merge pull request #62 from jackjackbits/feature/ios-share-extension
Add iOS share extension with rich link previews
2025-07-08 17:54:14 +02:00
jack d5ccf6bc0b Add iOS share extension with rich link previews
- Implement share extension to receive URLs from other apps
- Display shared links with emoji indicator and rich preview cards
- Add custom compact link preview with image, title, and domain
- Configure app groups for data sharing between extension and main app
- Handle URL detection and parsing in share extension
- Update message formatting to show only emoji for shared links
- Add proper entitlements and activation rules for share extension
2025-07-08 17:47:53 +02:00
jack b8d930614e Add rich link previews for shared URLs
- Capture both URL and title when sharing links
- Create LinkPreviewView component with clickable cards
- Support markdown-style links [title](url)
- Auto-detect plain URLs in messages
- Add link metadata fetching on iOS
- Display clean preview cards with title, URL, and description
2025-07-08 04:32:57 +02:00
jack 244af2197c Fix share extension functionality
- Add debugging logs to help diagnose sharing issues
- Improve completion handling in share extension
- Check for shared content when app becomes active
- Fix async handling of shared content processing
2025-07-08 04:26:02 +02:00
jack 6a7b33047a Fix share extension Info.plist - add missing NSExtension dictionary 2025-07-08 04:22:56 +02:00
jack 7f6a32e350 Add iOS Share Extension support
- Create share extension to handle shared content from other apps
- Support sharing text, URLs, and prepare for future image support
- Use app groups for data sharing between extension and main app
- Add URL scheme handling for app communication
- Add entitlements for app groups
- Display system message when content is shared
- Update project configuration to include share extension
2025-07-08 04:18:42 +02:00
jackandGitHub 2afc32afbf Merge pull request #30 from jackjackbits/feature/screenshot-detection
Add screenshot detection notifications
2025-07-08 04:11:01 +02:00
jack cc2f231d16 Fix screenshot notifications and remove 'private:' from UI
- Screenshot notifications now properly appear as system messages
- Send messages directly via mesh service to avoid local echo
- Remove 'private:' prefix from private chat header
- Keep only lock icon and peer name in private chat header
2025-07-08 04:07:06 +02:00
jack a5865af292 Add screenshot detection and notification feature
- Detect when users take screenshots on iOS
- Send system notification to all participants
- Works in public chat, channels, and private messages
- Display screenshot notifications as system messages
2025-07-08 04:00:50 +02:00
jackandGitHub b4265a41b2 Merge pull request #29 from jackjackbits/feature/block-users
Add block/unblock commands
2025-07-08 03:04:34 +02:00
jack 9ec8008695 Fix block command documentation and add to autocomplete
- Change @user to @name in all documentation
- Change 'blocked users' to 'blocked peers' for consistency
- Add /block and /unblock commands to autocomplete menu
2025-07-08 03:03:21 +02:00
jack e4d5f5b940 Add block command to autocomplete, app info modal, and README 2025-07-08 02:47:04 +02:00
jack e0ce234d08 Add block/unblock user commands
Implemented user blocking functionality:
- /block <nickname> - blocks a user from private messaging and ignores their messages in channels
- /block - lists all blocked users
- /unblock <nickname> - unblocks a user

Implementation details:
- Blocks are stored by public key fingerprint for persistence across sessions
- Blocked users cannot send private messages or have their public messages displayed
- Blocked users are silently ignored (they don't know they're blocked)
- Blocking a user automatically removes them from favorites
- Added getPeerPublicKey() method to BluetoothMeshService for accessing peer identity keys
2025-07-08 02:36:23 +02:00
jackandGitHub ccf0ba2ef2 Merge pull request #27 from jackjackbits/fix/crash-reports
Fix thread safety crashes in BluetoothMeshService
2025-07-08 02:24:04 +02:00
jack 4cecffca98 Fix thread safety crashes in BluetoothMeshService
Fixed multiple threading issues that were causing crashes when users sent messages:

- Added NSLock to synchronize access to recentlySentMessages Set
- Fixed thread-unsafe access to activePeers Set using existing lock
- Removed force unwrapping that could cause crashes
- Added defensive input validation for message sending methods

These fixes address crashes reported in TestFlight where the app would crash when typing and sending messages.
2025-07-08 02:22:05 +02:00
jackandGitHub d0522e806f Merge pull request #26 from jackjackbits/feature/ui-improvements-only
UI improvements and rename rooms to channels
2025-07-08 01:46:11 +02:00
jack 9794f3ebdc UI improvements and rename rooms to channels
- Changed system messages from green to grey with consistent 12pt font
- Fixed text wrapping to flow naturally under timestamps
- Changed default nickname to anonXXXX format
- Replaced text with icon representations in status bar
- Added icons to sidebar section headers
- Made autocomplete UI consistent between commands and @mentions
- Added welcome message for new users (3 second delay)
- Changed sidebar header to 'YOUR NETWORK'
- Added command aliases (/join, /msg)
- Implemented /hug and /slap commands with haptic feedback
- Improved command help display with alphabetization
- Renamed 'rooms' to 'channels' throughout entire codebase
2025-07-08 01:42:35 +02:00
jack d3c1b77015 Fix thread safety crash in BluetoothMeshService
- Fix race condition where recentlySentMessages Set was being modified from different queues
- Move all Set.remove operations to messageQueue instead of main queue
- Prevents EXC_BREAKPOINT crash when removing elements during concurrent access
2025-07-07 00:26:22 +02:00
jack 0db5312584 Fix Swift warnings: replace unused variables with _ 2025-07-07 00:07:53 +02:00
jack 30f548eb73 Fix Swift compile error: add break statements to empty switch cases 2025-07-07 00:04:11 +02:00
jackandGitHub 2540928387 Delete test_delivery_confirmation.md 2025-07-06 23:55:52 +02:00
jackandGitHub a39c77aa69 Delete DELIVERY_BRANCH_SUMMARY.md 2025-07-06 23:55:39 +02:00
jackandGitHub 42123abea0 Delete COMMIT_MESSAGE.txt 2025-07-06 23:55:26 +02:00
jackandGitHub 7c7e23b154 Delete .github/workflows/swift.yml 2025-07-06 19:58:12 +02:00
jackandGitHub 1f9c6ac976 Create swift.yml 2025-07-05 20:49:32 +02:00
jackandGitHub bb2edd4e23 Update README.md 2025-07-05 18:14:54 +02:00
jackandGitHub fd9594bdd2 Update README.md 2025-07-05 18:09:51 +02:00