Commit Graph
27 Commits
Author SHA1 Message Date
IslamandGitHub 56f1c37129 Regenerate info.plist by adding the missing keys (#576)
`xcodegen` probably uses alphabetical sorting so had to commit the info.plist to avoid discrepancies
2025-09-11 19:14:27 +02:00
IslamandGitHub 2ade3a3300 Add TransportConfig to bitchatShareExtension target (#579)
ShareViewController uses TransportConfig and without this target membership the code doesn’t compile
2025-09-11 19:13:54 +02:00
5f44af19da tor by default, small (#564)
* feat(tor): Tor-by-default scaffold and integration

- Add TorManager with static/dlopen start, torrc generation, SOCKS probe
- Add TorURLSession; route Nostr/Web fetches via SOCKS proxy
- Add chat system messages for Tor status; show progress (macOS) and ready
- Disable ControlPort bootstrap monitor on iOS; keep it on macOS
- Make Tor waits non-blocking; avoid main-actor stalls on startup
- Queue & flush Nostr subscriptions on relay connect; skip duplicates
- Always rewrite torrc at launch to fix iOS container path mismatches
- Link libz; add project wiring for tor-nolzma.xcframework
- Minor fixes: SOCKS probe resumeOnce guard, entitlement for network.server (macOS)

* iOS: deterministic Tor recovery + 100% gating; BLE-first; session rebuild

- Restart/wake Tor on foreground via ControlPort (ACTIVE/SHUTDOWN),
  avoid restarts during bootstrap; add NWPathMonitor to trigger checks
- Use NWConnection control polling for GETINFO; remove blocking CFStream
  readers to avoid QoS inversions; compute readiness from SOCKS + 100%
- Rebuild TorURLSession on resume; reset Nostr connections to rebind
- Gate all internet after full bootstrap; keep BLE mesh startup fast
- Fix Swift 6 capture issues; hop UI updates to @MainActor
- Remove Tor progress spam; persist initial "starting tor..." system message

* UI: show Tor system messages only in geohash channels (not mesh)

- Gate "starting tor..." and readiness/timeout messages to geohash view
- Add helper addGeohashOnlySystemMessage() to avoid posting to mesh timeline
- Persist system messages in geohash backing store via addPublicSystemMessage()

* Relays: treat repeated -1011 handshake failures as permanent; skip reconnects

- Classify NSURLErrorBadServerResponse as permanent and stop retrying
- Filter permanently-failed relays from subscribe/connect attempts
- Avoid reconnect scheduling for permanently failed relays

* Embed Tor via tor_api; deterministic restart + Nostr gating; add Tor notifications

- Run Tor via tor_api in a dedicated thread with OwningControllerFD
- Cleanly stop Tor on background; restart on .active (single instance)
- Avoid fallback to tor_main/dlopen; add is-running check to prevent duplicates
- Fix argv lifetime in C glue to avoid strcmp crash on start
- Gate Nostr connect/subscribe/send until Tor is fully ready
- Rebuild URLSession + reset relays after Tor readiness (scene-based)
- Remove TorDidBecomeReady double-reset and appDidBecomeActive resubscribe
- Add TorWillRestart/TorDidBecomeReady notifications and chat system messages
- Debounce path-change restarts; ACTIVE poke first; coalesce subs; cancel stale reconnect timers
- Project: add CTorHost.c and TorNotifications.swift to targets; fix libz.tbd path

* Defer Nostr setup logs until Tor is ready; fix subscribe coalescing and reconnect generation

- Move "Connecting to Nostr relays" log after awaitReady()
- Log "Queuing subscription" when Tor not ready; only coalesce when handler exists
- Clear coalescer on unsubscribe
- Cancel stale reconnect timers using connectionGeneration
- Remove app-level TorDidBecomeReady reset to avoid duplicate reconnects
- Debounce path-change restarts

* Gate Nostr init/subscription logs until Tor is ready

- ChatViewModel: await Tor readiness before initializing Nostr and logging
- Only log GeoDM subscription when Tor is ready to avoid early noise

* Make Nostr connect single-sourced; defer DM subscription until connected

- Remove duplicate connect call from ChatViewModel; let scene-based flow connect
- Setup DM subscription once on first connection via  sink
- Reduce early subscription send/cancel noise after Tor restarts

* On launch, queue Nostr subscriptions without initiating connects; let centralized connect handle it

- In subscribe(), if no connections exist, just list relays and queue subs
- Avoids early send/cancel churn before connect() runs post-Tor-ready

* Always queue subscriptions and flush on connection; avoid immediate sends

- Prevents early send/cancel churn at launch and during reconnects
- If relays are already connected, flush immediately; otherwise pending until connected

* UI: scope Tor restart messages to geohash channels; skip initial foreground restart on cold launch to avoid confusing system message in #mesh

* geo: disable background sampling + notifications\n- Gate sampling to foreground only (beginGeohashSampling, watchers)\n- Suppress geohash activity notifications unless app is active\n- Stop sampling explicitly on background scene phase

* Update BitchatApp.swift

Co-authored-by: asmo <asmogo@protonmail.com>

* Update BitchatApp.swift

Co-authored-by: asmo <asmogo@protonmail.com>

* Update BitchatApp.swift

Co-authored-by: asmo <asmogo@protonmail.com>

* Update bitchat/BitchatApp.swift

Co-authored-by: asmo <asmogo@protonmail.com>

* Update bitchat/BitchatApp.swift

Co-authored-by: asmo <asmogo@protonmail.com>

* fix(iOS App): resolve merge artifacts in scenePhase handler\n- Remove duplicate didEnterBackground state\n- Fix switch/if braces and logic for foreground restart gating

---------

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
Co-authored-by: asmo <asmogo@protonmail.com>
2025-09-11 19:08:43 +02:00
Mateusz MatoszkoandGitHub 5a44b32719 Adds swift-secp256k1 to project.yml (#366) 2025-07-31 21:24:03 +02:00
e282d077a3 fix iOS app zoom/compat mode issue (issue #236) (#327)
Co-authored-by: kevin <kevin@none>
2025-07-27 08:01:59 +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 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 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
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 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
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 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
jack 4529a68309 Revert project configuration changes and add DeliveryTracker
- Reverted project.yml to simpler original format
- Reverted project.pbxproj to avoid screen issues
- Added DeliveryTracker.swift to the project files
2025-07-06 21:35:35 +02:00
jack 78cb8b1039 Fix delivery confirmation for private messages
- Pass message ID from ChatViewModel to BluetoothMeshService
- Preserve original message ID when creating ACK messages
- Move delivery tracking to ChatViewModel for consistent IDs
- Update project.yml to match current project structure
2025-07-06 21:25:41 +02:00
jack 7151896102 feat: enhance password-protected rooms with key commitments and management
- Add key commitment scheme for immediate password verification
- Implement ownership transfer with /transfer command
- Add password change functionality with /pass command
- Include room metadata in initialization messages
- Remove /help command and rename /changepass to /pass
- Make room names tappable to show sidebar
- Remove spaces in person/room counter display
- Update UI to show lock icons and orange colors for protected rooms
- Fix password verification to work with empty rooms
- Add comprehensive tests for new functionality

This update significantly improves the security and usability of
password-protected rooms by allowing immediate verification without
waiting for encrypted messages.
2025-07-05 19:35:37 +02:00
jack cbcfaed7a2 Fix compilation errors and prepare for App Store submission
- Fix NotificationService warnings by replacing unused error parameters with _
- Add public domain header to NotificationService.swift
- Fix BluetoothMeshService compilation errors:
  - Replace removeAll with filter for processedKeyExchanges cleanup
  - Remove duplicate cleanupStalePeers function declaration
  - Remove duplicate peerLastSeenTimestamps property declaration
- All code now compiles cleanly for both iOS and macOS targets
2025-07-04 17:28:36 +02:00
jack 00e75fff72 Fix connect/disconnect/connect pattern on initial connection
- Added duplicate connection detection in key exchange handler
- When same peer connects through multiple peripherals, keep only one
- Track intentional disconnects to suppress disconnect messages
- Don't show disconnect message when dropping duplicate connections
- This prevents the confusing connect/disconnect/connect pattern

The issue was that both devices try to connect to each other simultaneously,
creating duplicate connections. One gets dropped, but now it's handled gracefully.
2025-07-04 17:05:25 +02:00
jack f2031f3973 Update project configuration and generate Xcode project
- Removed test targets from project.yml (causing dependency issues)
- Generated fresh Xcode project with xcodegen
- Project now includes proper Assets.xcassets configuration
- Ready for App Store build and submission
2025-07-04 16:45:42 +02:00
jack 4d61cec032 Prepare for App Store submission
- Added public domain headers to all test files
- Updated Info.plist with required App Store keys:
  - ITSAppUsesNonExemptEncryption = NO
  - LSApplicationCategoryType = Social Networking
  - UIRequiresFullScreen = YES
- Created proper Assets.xcassets structure
- Configured AppIcon.appiconset with all icon references
- Removed last TODO comment
- Created comprehensive App Store submission checklist
- Updated project.yml to include Assets.xcassets

The app is now ready for App Store submission. All debug code has been removed,
icons are configured, and privacy/security compliance is documented.
2025-07-04 16:44:00 +02:00
jack 986106fea4 Fix warnings and improve autocomplete positioning, add unit tests
- Remove unused variables (beforeCount, beforeFavCount)
- Remove Tx Power Level from advertising (not allowed)
- Fix autocomplete popup to appear near cursor position
- Calculate position based on nickname width and @ location
- Add comprehensive unit tests for:
  - Binary protocol encoding/decoding
  - Message padding for privacy
  - Bloom filter duplicate detection
  - BitchatMessage serialization
- Add test target to project.yml
2025-07-04 15:40:47 +02:00
jack e3cc469bf8 Remove voice memo references and improve duplicate message prevention
- Remove NSMicrophoneUsageDescription from Info.plist and project.yml
- Add millisecond timestamps to prevent same-second message collisions
- Include payload hash in message ID for absolute uniqueness
- Add recentlySentMessages tracking to prevent any duplicate sends
- Reduce retries from 2 to 1 for broadcast messages
- Clean up sent message tracking after 10 seconds
2025-07-04 15:35:26 +02:00
jack cce43fcfc7 Add interactive logo with info/panic modes and battery optimization
- Single tap logo shows comprehensive app info and features
- Triple tap logo triggers panic mode (instant data wipe)
- Implement adaptive Bluetooth scanning based on battery level
- Remove hardcoded development team ID for security
- Fix store-and-forward description (12h for all, indefinite for favorites)
- Add technical debt remediation plan
- Fix macOS compatibility issues with navigation
2025-07-04 02:21:59 +02:00
jack 2993fc3e06 Implement favorites, notifications, and improve fragment handling
- Add favorites functionality for peers with persistent storage
  - Star icon to toggle favorites in sidebar
  - Favorites appear at top of peer list
  - Storage persists across app launches using peer ID

- Add local notifications for mentions and private messages
  - Notifications appear when app is in background
  - Separate notification types for mentions vs private messages
  - Request notification permissions on app launch

- Fix sidebar header alignment to match main toolbar (44pt)
  - Add background color to sidebar header for visual consistency

- Improve voice note fragment transmission
  - Send fragments in batches of 5 with delays to prevent congestion
  - Better logging to debug fragment transmission issues
  - Reduce delay between fragments from 50ms to batch-based timing

- Fix other UI issues
  - Ensure mic recording ripples originate from mic button
  - Update sidebar to swipe from right edge smoothly
2025-07-03 22:13:28 +02:00
jack 94a9888ef5 Add push-to-talk voice notes functionality
- Added voice note support to BitchatMessage with audio data and duration
- Updated binary protocol to encode/decode voice notes (flag 0x40)
- Created AudioRecordingService for recording up to 10s voice clips
- Created AudioPlaybackService for playing voice notes
- Added microphone permission to Info.plist and project.yml
- Implemented push-to-talk UI with mic button in ContentView
- Voice notes use AAC compression at 16kHz/32kbps for small file sizes
- Added play/pause buttons for voice notes in message list
- Voice notes display as '🎤 Voice note (X.Xs)' in chat
- Platform-specific audio session handling for iOS/macOS
2025-07-03 01:13:16 +02:00
jack 4b98aa7918 Fix iOS background BLE, RSSI tracking, and peer nickname display
- Add UIBackgroundModes for bluetooth-central/peripheral to restore background messaging
- Implement RSSI tracking with proper peer ID mapping and UI updates
- Fix announce packet delivery for immediate nickname display
- Convert to binary protocol for 62-69% size reduction
- Fix peer count to exclude self from display
- Add platform-specific UI improvements (font sizes, dropdown styling)
2025-07-03 00:51:59 +02:00
jack 7e90bf6369 Initial commit: Bluetooth mesh chat app with end-to-end encryption 2025-07-02 19:18:35 +02:00