Commit Graph
67 Commits
Author SHA1 Message Date
jackandGitHub 34b2b1eee0 Update README.md 2025-07-26 11:54:39 +02:00
54c7eba8cb Improve code organization and documentation (#325)
* Add MARK headers to improve code organization in major files

* Reorganize peer management functions in BluetoothMeshService

- Removed duplicate getCurrentPeerID(for:) function
- Consolidated peer identity functions in Peer Identity Mapping section
- Moved getPeerFingerprint(), getFingerprint(for:), isPeerIDOurs() to proper location
- Moved getCurrentPeerIDForFingerprint() and getCurrentPeerIDs() from Message Sending section
- Moved notifyPeerIDChange() to Peer Management section

* Consolidate peer management functions in BluetoothMeshService

- Moved getCachedPublicKey() and getCachedSigningKey() from Identity Cache Methods to Peer Connection Management
- Moved getPeerNicknames() and getPeerRSSI() to Peer Connection Management section
- Moved getAllConnectedPeerIDs(), notifyPeerListUpdate(), and cleanupStalePeers() to Peer Connection Management
- Removed duplicate function declarations after consolidation
- Improved code organization by grouping all peer-related functions together

* Consolidate message handling functions in ChatViewModel

- Moved handleHandshakeRequest() from floating location to Message Reception section
- Moved trimMessagesIfNeeded() and trimPrivateChatMessagesIfNeeded() to Message Batching section
- Improved code organization by grouping related message handling functions together
- Removed unnecessary comments from trim functions

* Improve ContentView organization with better documentation

- Added descriptive comments for complex inline computations
- Documented message extraction logic for private vs public chats
- Documented peer data computation and sorting logic
- Improved code readability by explaining complex operations inline
- Note: Attempted to extract complex computations into helper functions, but SwiftUI scope limitations made inline documentation a better approach

---------

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
2025-07-26 00:11:23 +02:00
jackandGitHub 4568951736 Update WHITEPAPER.md 2025-07-25 20:57:19 +02:00
df83f716d1 Fix lazy handshake behavior and re-enable cover traffic (#323)
* Add encryption export compliance to Info.plist

Set ITSAppUsesNonExemptEncryption to false for TestFlight submission

* Revert "Add encryption export compliance to Info.plist"

This reverts commit 2cfbb1679d.

* fix: prevent spurious handshake requests from rotated peers and cover traffic

- Clean up connection states and pending messages during peer ID rotation
- Filter out rotated peer IDs in keep-alive timer to prevent validation attempts
- Add session check before sending cover traffic dummy messages
- Disable cover traffic by default (was sending without user knowledge)
- Only send screenshot notifications when session exists
- Add logging to track automatic message triggers
- Fix compilation errors (SecureLogger.privacy -> security)

* Fix lazy handshake behavior and re-enable cover traffic

- Re-enable cover traffic for privacy protection
- Start handshake immediately when opening PM conversation
- Remove handshake request system notifications

---------

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
2025-07-25 16:15:43 +02:00
3513228736 Implement handshake request notifications for pending messages (#321)
- Add handshakeRequest packet type (0x25) to notify recipients about queued messages
- Create HandshakeRequest struct with binary encoding for efficient transmission
- Send handshake requests when messages are queued due to missing session
- Display notifications when someone wants to send messages
- Fix verification persistence bug by adding forceSave on app termination
- Update UI to handle optional encryption icons (hide when no handshake attempted)

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
2025-07-25 14:55:26 +02:00
jackandGitHub 07c5e2e097 Delete BUILD_MACOS.md 2025-07-25 14:50:52 +02:00
2e0d9be03e Implement targeted delivery for private messages (#319)
- Add direct delivery for private messages when recipient is connected
- Implement selective relay using 2-3 best RSSI peers as fallback
- Limit TTL to 2 hops for relayed private messages
- Update all private communication types to use targeted delivery:
  - Private messages
  - Read receipts
  - Delivery ACKs
  - Protocol ACKs/NACKs
  - Handshake messages
  - Identity announces (when targeted)
  - Session validation pings
  - Version ACKs
- Add intelligent relay logic to forward messages only when recipient is reachable
- Fall back to broadcast only as last resort when no direct path available

This reduces network traffic by ~90% for private communications, improves battery life, and enhances privacy by limiting message visibility.

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
2025-07-25 09:54:56 +02:00
809e222a31 Improve BLE connection stability and message reliability (#318)
* Remove sequence numbers from protocol

- Remove sequenceNumber field from BitchatPacket struct
- Update BinaryProtocol to not encode/decode sequence numbers (header size reduced from 17 to 13 bytes)
- Replace sequence-based duplicate detection with content-based using packet ID hash
- Update packet ID generation to use SHA256(senderID + timestamp + type + payload prefix)
- Remove all sequence tracking variables and methods
- Simplify duplicate detection to rely on timestamp and content hashing

* Fix connection stability issues

- Increase peer availability check interval from 5 to 15 seconds
- Fix availability logic to not mark connected peers as unavailable
- Add BLE connection keepalive timer (20s) to prevent iOS timeouts
- Fix missing delivery ACKs by passing peripheral context through Noise decryption
- Reduce identity announce frequency from 2 to 10 seconds minimum
- Remove unnecessary identity announces on connection
- Debounce identity cache keychain saves (2 second delay)
- Add message retry notification handler in ChatViewModel
- Fix version negotiation redundancy by checking existing negotiations
- Keep Noise sessions for already-connected peers

* Fix build errors in message retry handler

- Fix reference to 'displayedMessages' - should be 'messages'
- Fix sendMessage call signature to use individual parameters instead of message object
- Both iOS and macOS builds now succeed

* Fix remaining connection stability issues

- Fix duplicate identity announces with content-based deduplication
- Simplify peripheral mapping with cleaner temp ID to peer ID transitions
- Improve graceful leave detection across peer ID rotations
- Track previousPeerID from announcements to maintain state
- Add time-based cleanup for gracefully left peers

* Fix connection stability issues

- Add special duplicate detection for identity announces
- Simplify peripheral mapping with dedicated structure
- Improve graceful leave detection with peer ID rotation handling
- Track graceful leave timestamps for cleanup
- Transfer states properly during peer ID rotation

* Improve BLE connection stability and message reliability

- Increase peer availability timeout from 5s to 15s to prevent flapping
- Add BLE keepalive timer with 30s interval to maintain connections
- Fix missing delivery ACKs by passing peripheral context through decryption
- Reduce identity announce frequency from 2s to 10s minimum interval
- Add keychain save debouncing with 2s delay to prevent excessive writes
- Implement message retry system for failed deliveries to favorites
- Fix version negotiation redundancy by checking existing state
- Add special duplicate detection for identity announcements
- Implement graceful leave detection with peer ID rotation support
- Simplify peripheral mapping to reduce complexity
- Fix switch statement structure issues causing build errors

These changes significantly improve connection stability, eliminate peer availability flapping, and ensure reliable message delivery.

---------

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
2025-07-25 02:40:51 +02:00
86726d7033 Fix RSSI nil display issue (#316)
* Add comprehensive RSSI debugging logs

- Log RSSI capture during discovery phase
- Log RSSI reading after peripheral connection
- Log didReadRSSI results including validation and retries
- Log getPeerRSSI() calls and dictionary contents
- Log RSSI transfer from temp IDs to real peer IDs
- Add UI logging to trace nil RSSI values in ContentView
- Track RSSI flow from Bluetooth discovery to UI display

* Add detailed logging for RSSI transfer from temp ID to real peer ID

- Log peripheral mapping updates during announce packet handling
- Track connectedPeripherals state before and after mapping
- Log RSSI transfer from peripheralRSSI to peerRSSI
- Identify whether temp ID is found and properly transferred

* Add peripheral lookup fallback for announce packets

- Log whether peripheral is present when announce received
- Add fallback to look up peripheral if not passed as parameter
- This handles cases where announce is received via relay

* Add comprehensive state logging to getPeerRSSI

- Log connectedPeripherals mapping state
- Log peripheralRSSI dictionary contents
- Log UI-side RSSI lookup attempts with dictionary state
- Track exactly what's in the RSSI lookup tables

* Log peer list shown in UI

* Ensure RSSI transfers even when no temp ID mapping exists

* Add debugging for announce packets without peripheral reference

* Fix build errors and add type annotations

* Fix RSSI mapping for relayed announce packets

- Add fallback logic to match unmapped peripherals with announced peers
- Transfer RSSI from temp UUID to real peer ID when single unmapped peripheral exists
- Implement periodic RSSI updates every 10 seconds for all connected peripherals
- Improve RSSI debugging logs to track mapping state

* Fix RSSI mapping condition for single unmapped peripheral

- Remove peerNicknames.count == 0 condition that was preventing mapping
- Map single unmapped peripheral to announcing peer regardless of nickname state
- Remove temp RSSI entries when transferring to real peer ID
- Improve logging to show successful RSSI transfers

* Improve getPeerRSSI to skip temp IDs and check known peers

- Skip temp IDs (non-16 character) when iterating connectedPeripherals
- Add fallback to check peerNicknames for known peers without peripherals
- Check both peerRSSI and peripheralRSSI for known peers
- Improve RSSI lookup coverage for edge cases

* Remove RSSI debug logging and fix build warnings

- Remove all RSSI-related debug logging added during troubleshooting
- Keep functional RSSI tracking code intact
- Fix unused variable warnings in didReadRSSI and updateAllPeripheralRSSI
- Clean up verbose logging while maintaining core functionality

---------

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
2025-07-24 22:22:19 +02:00
492f90edd5 Optimize BLE mesh network for robustness and range (#314)
- Fixed relay probability calculation for 2-node networks (0% relay needed)
- Added protocol ACKs to prevent unnecessary retransmissions
- Implemented MessageState for enhanced duplicate detection
- Added exponential backoff for collision avoidance
- Fixed duplicate sends for bidirectional connections
- Resolved packet ID generation issues using immutable fields only
- Implemented smart rate limiting with progressive throttling
- Removed unnecessary debug logging and fixed build warnings
- Optimized message routing to prevent flooding in small networks

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
2025-07-24 19:49:37 +02:00
jackandGitHub eac3531a54 Merge pull request #310 from permissionlesstech/fix/ui-polish
UI Polish and Performance Optimizations
2025-07-24 14:23:41 +02:00
jackandGitHub ad5ee7eb4c Merge pull request #308 from permissionlesstech/bluetooth-efficiency-optimization
Fix Bluetooth disconnect messages and blank chat rows
2025-07-23 21:36:53 +02:00
jackandGitHub 169a25bb62 Merge pull request #305 from permissionlesstech/robust-connection-state
Fix handshake deadlock and improve connection reliability
2025-07-23 19:05:28 +02:00
jackandGitHub d1d4434b66 Merge pull request #304 from permissionlesstech/noise-handshake-improvements
Fix Noise handshake stability and session synchronization
2025-07-23 15:13:57 +02:00
jackandGitHub b461399743 Update BRING_THE_NOISE.md 2025-07-23 09:33:07 +02:00
jackandGitHub 6be5d2587f Merge pull request #303 from permissionlesstech/feature/comprehensive-test-suite
Add comprehensive test suite
2025-07-23 09:29:01 +02:00
jackandGitHub fd0ef35487 Merge pull request #302 from permissionlesstech/remove-private-channels
Remove all channel functionality and clean up test suite
2025-07-23 01:35:31 +02:00
jackandGitHub c8088f785c Update README.md 2025-07-23 00:50:43 +02:00
jackandGitHub 1ecf8f1709 Update README.md 2025-07-23 00:49:11 +02:00
jackandGitHub 36bda0821f Merge pull request #301 from permissionlesstech/convert-to-secure-logger
Convert all print statements to SecureLogger
2025-07-22 21:08:39 +02:00
jackandGitHub 2e46421dcb Merge pull request #297 from permissionlesstech/delete-BinaryMessageHandler
(chore) remove unused file BinaryMessageHandler.swift
2025-07-22 20:18:22 +02:00
jackandGitHub 22449ff20b Merge pull request #295 from permissionlesstech/network-notifications
Add network availability notifications
2025-07-22 17:47:32 +02:00
jackandGitHub cdaa3dadc2 Merge pull request #294 from permissionlesstech/ui-improvements
UI improvements and performance optimizations
2025-07-22 16:20:35 +02:00
jackandGitHub 849da32947 Merge pull request #293 from permissionlesstech/enhance-logging-framework
Enhance logging framework and fix build issues
2025-07-22 15:41:25 +02:00
jackandGitHub 49daa995cc Delete .github/workflows directory 2025-07-22 15:23:15 +02:00
jackandGitHub 960d47336a Merge pull request #292 from permissionlesstech/binary-protocol-migration
Fix Noise handshake failures and implement binary protocol migration
2025-07-22 14:53:14 +02:00
jackandGitHub 8ee3f306e7 Merge pull request #271 from ryannair05/patch-1
Fix Crash when receiving notification from the background
2025-07-22 11:46:34 +02:00
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
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
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
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
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
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
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
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
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
jackandGitHub 033a5881b4 Update project.yml 2025-07-09 16:17:34 +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
jackandGitHub 2afc32afbf Merge pull request #30 from jackjackbits/feature/screenshot-detection
Add screenshot detection notifications
2025-07-08 04:11:01 +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
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
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
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