Commit Graph
377 Commits
Author SHA1 Message Date
+4 f6ac7b59ad Wifi aware refactor mesh core (#545)
* Fix notification user try 2 (#541)

* count peers in notification

* cleanup

* Automated update of relay data - Sun Jan  4 06:08:02 UTC 2026

* Fix: Add @ConscryptMode annotation to FileTransferTest to resolve UnsatisfiedLinkError (#543)

Robolectric 4.9+ uses Conscrypt as the default security provider, which
requires native libraries that aren't available in the test environment.
Adding @ConscryptMode(Mode.OFF) disables Conscrypt and uses BouncyCastle
instead, which resolves the test failures.

This fixes the build failures in FileTransferTest where all 9 tests were
failing with UnsatisfiedLinkError when Conscrypt tried to load native
libraries.

Fixes #542

* Fix small-screen header clipping (#519) (#532)

* Fix small-screen header clipping: reserve status-bar space and center-constrain titles (fixes #519)

* Remove redundant Gradle configuration lines

* refactor mesh core

* tests

* QR and Verification feature (#529)

* Automated update of relay data - Sun Sep 21 06:21:05 UTC 2025

* Automated update of relay data - Sun Sep 28 06:20:40 UTC 2025

* refactor: new close button like ios(but not liquid glass)

* Automated update of relay data - Sun Oct  5 06:20:09 UTC 2025

* Automated update of relay data - Sun Oct 12 06:20:12 UTC 2025

* Automated update of relay data - Sun Oct 19 06:21:51 UTC 2025

* Automated update of relay data - Sun Oct 26 06:21:31 UTC 2025

* Automated update of relay data - Sun Nov  2 06:22:16 UTC 2025

* Automated update of relay data - Sun Nov  9 06:21:43 UTC 2025

* Automated update of relay data - Sun Nov 16 06:22:37 UTC 2025

* Automated update of relay data - Sun Nov 23 06:22:51 UTC 2025

* Automated update of relay data - Sun Nov 30 06:24:08 UTC 2025

* Automated update of relay data - Sun Dec  7 06:22:59 UTC 2025

* Automated update of relay data - Sun Dec 14 06:24:33 UTC 2025

* Automated update of relay data - Sun Dec 21 06:24:49 UTC 2025

* Automated update of relay data - Sun Dec 28 06:25:38 UTC 2025

* feat: Add ZXing dependency for QR code scanning

* feat: Request camera permission for QR verification

* Add QR verification payloads and mesh wiring

* Wire verification state, system messages, and notifications

* Add verification sheets and UI affordances

* Show verified badges in sidebar and add strings

* Persist fingerprint caches for offline verification

* Handle bitchat://verify deep links

* feat: Replace zxing-android-embedded with ML Kit and CameraX

* Refactor(Verification): Replace zxing with MLKit for QR scanning

* Replace `AndroidView` with `CameraXViewfinder` for camera preview

* Refactor QR verification: Extract VerificationHandler and fix concurrency issues

* Extract and translate strings for QR verification feature

* Fix build errors: Escape ampersands in strings and restore missing methods in ChatViewModel

* return to main

* return to main 2

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* Enforce mandatory packet signature verification (#546)

* security: enforce mandatory packet signature verification

* tests: add comprehensive unit tests for packet signature verification

* Revert "Fix small-screen header clipping (#519) (#532)" (#548)

This reverts commit d73976537d.

* fix: location channel manager (#516)

* location channel manager fix

* fix: use interval arg in beginLiveRefresh & remove unused code

* fix: sync notification peer count with sidebar (#547)

* share gossip

* refresh peer list more often

* bump versioncode to 28 (#551)

* verift signature only for ANNOUNCE, MESSAGE, and FILE_TRANSFER like ios (#552)

* bump to 29 (#553)

* patches: wifi aware mesh refactor core (#549)

* Refactor WifiAware memory management and lifecycle handling

* Fix Wi-Fi Aware reconnection by ensuring callback unregistration and session watchdog

* fix(wifiaware): allow WifiAwareController to restart service if session drops

* Enhance WiFi Aware logging with network request timeouts and detailed callback status

* Ensure explicit release of WiFi Aware network callbacks on failure or disconnection

---------

Co-authored-by: aidenvalue <>

* Fix/foreground permissions scanning (#556)

* try catch the foreground location service if not available

* ask for background permissions

* background permissions in onboarding

* small improvements

* drop duplicate announces based on TTL (#558)

* scan duration fix (#557)

* feat: Build and release per-architecture APKs (#550)

* feat: Build and release per-architecture APKs

This commit modifies the build process to generate separate APKs for different CPU architectures (arm64-v8a, x86_64) and a universal APK. This allows for smaller, optimized downloads for users and provides specific builds for platforms like Chromebooks.

Key changes:
- In `app/build.gradle.kts`, enables ABI splits to create `arm64-v8a`, `x86_64`, and `universal` APKs during the `assembleRelease` task.
- Updates the `release.yml` GitHub Actions workflow to rename and upload each of these APKs as distinct release assets.
- Removes the previous `arm64-v8a` only filter to allow for multi-architecture builds.

* feat: Allow manual triggering of Android CI workflow

This adds the `workflow_dispatch` event to the `android-build.yml` GitHub Actions workflow.

This change enables the Android CI pipeline to be run manually from the GitHub UI, in addition to the existing triggers for pushes and pull requests.

* bump vc to 30 (#559)

* fix: r8 exception for LocationManager (#566)

* fix: MessageRouter uses stale BluetoothMeshService reference (#571)

* fix: MessageRouter uses stale BluetoothMeshService reference

* fix: unconditionally update mesh reference in MessageRouter.getInstance

* fix camera button (#572)

* fix camera button

* fix

* Fix: Add runtime camera permission check for image picker

* fix: wifi aware mesh private dms (#561)

* fix(wifi-aware): restore peer check and remove aggressive session restarts

* synchronized access to sockets.

* clear old peer socket `onClientConnected` if one was found.

* address second round of review

* fix: Restart publish session on termination in WifiAwareMeshService

* fix: cleanup connection tracker resources when handling peer disconnection without active socket

---------

Co-authored-by: aidenvalu3 <>

* fix(mesh): address memory leaks and background persistence issues in Wi-Fi Aware

- Move message persistence and background notifications for Wi-Fi Aware into the service layer via MeshCore hooks.
- Fix memory leak in MainActivity by properly detaching WifiAwareMeshDelegate on pause.
- Ensure BluetoothMeshService is initialized before WifiAwareMeshService to guarantee shared GossipSyncManager instance.
- Deduplicate persistence logic from MainActivity delegate.

* Automated update of relay data - Sun Jan 11 06:07:53 UTC 2026

* Fix scroll bug(#568) (#570)

* Automated update of relay data - Sun Sep 21 06:21:05 UTC 2025

* Automated update of relay data - Sun Sep 28 06:20:40 UTC 2025

* refactor: new close button like ios(but not liquid glass)

* Automated update of relay data - Sun Oct  5 06:20:09 UTC 2025

* Automated update of relay data - Sun Oct 12 06:20:12 UTC 2025

* Automated update of relay data - Sun Oct 19 06:21:51 UTC 2025

* Automated update of relay data - Sun Oct 26 06:21:31 UTC 2025

* Automated update of relay data - Sun Nov  2 06:22:16 UTC 2025

* Automated update of relay data - Sun Nov  9 06:21:43 UTC 2025

* Automated update of relay data - Sun Nov 16 06:22:37 UTC 2025

* Automated update of relay data - Sun Nov 23 06:22:51 UTC 2025

* Automated update of relay data - Sun Nov 30 06:24:08 UTC 2025

* Automated update of relay data - Sun Dec  7 06:22:59 UTC 2025

* Automated update of relay data - Sun Dec 14 06:24:33 UTC 2025

* Automated update of relay data - Sun Dec 21 06:24:49 UTC 2025

* Automated update of relay data - Sun Dec 28 06:25:38 UTC 2025

* Automated update of relay data - Sun Jan  4 06:26:28 UTC 2026

* fix bug(568): Improve scroll-to-bottom logic

Replaced the "smart scroll" mechanism with a simpler "follow" behavior. The message list now automatically scrolls to the latest message unless the user has scrolled up.

- A new `followIncomingMessages` state tracks whether to auto-scroll.
- Scrolling now uses `scrollToItem` instead of `animateScrollToItem` for immediate updates.

---------

Co-authored-by: GitHub Action <action@github.com>

* fix nostr private messages processing (#563)

* fix nostr private messages processing

* persisted geohash registry

---------

Co-authored-by: a1denvalu3 <>

* New MeshPeerListSheet as Ios like  (#498)

* Automated update of relay data - Sun Sep 21 06:21:05 UTC 2025

* Automated update of relay data - Sun Sep 28 06:20:40 UTC 2025

* refactor: new close button like ios(but not liquid glass)

* Automated update of relay data - Sun Oct  5 06:20:09 UTC 2025

* Automated update of relay data - Sun Oct 12 06:20:12 UTC 2025

* Automated update of relay data - Sun Oct 19 06:21:51 UTC 2025

* Refactor: Redesign peer and channel list as a bottom sheet

Replaced the right-hand sidebar with a Material 3 `ModalBottomSheet` for displaying mesh peers and channels. This modernizes the UI and improves usability.

- Renamed `SidebarComponents.kt` to `MeshPeerListSheet.kt`.
- Replaced the custom sidebar implementation with `ModalBottomSheet`.
- Added a floating top bar to the sheet that appears on scroll, displaying the title and a close button.
- Updated the row layouts for both channels and peers to use `Surface` for better visual grouping and selection state handling.
- Added a checkmark icon to indicate the currently selected channel or private chat peer.
- Improved styling for section headers, unread badges, and empty-state text.
- Removed the `SignalStrengthIndicator` as it was no longer used.

* Refactor: Remove sidebar state management from ViewModel

This commit removes the state management for the sidebar's visibility from `ChatViewModel` and `ChatState`.

The sidebar's visibility is now a purely UI-level concern and is no longer coupled with the ViewModel's logic. This change simplifies the ViewModel by removing unnecessary LiveData and related methods (`showSidebar`, `hideSidebar`). The back navigation handler has also been updated to remove the case for closing the sidebar.

* Refactor: Replace Sidebar with MeshPeerList Bottom Sheet

* feat: Add nested private chat sheet

* Feat: Enhance UI/UX of LocationNotesSheet

This commit refactors the `LocationNotesSheet` to more closely align with its iOS counterpart, improving both its appearance and user experience.

The layout has been updated to use a `Box` with aligned elements instead of a single `Column`, allowing for a floating input section at the bottom and a floating close button at the top right.

**Key Changes:**

-   **Floating Top Bar and Input:**
    -   The main content is now a `LazyColumn` that scrolls underneath a new floating top bar and a floating input section at the bottom.
    -   The top bar's background animates from transparent to semi-opaque as the user scrolls, providing a "blur" effect.

-   **iOS-Style Close Button:**
    -   The close button is moved from the header row to the top-right corner of the sheet, where it remains fixed.

-   **Structural Refinements:**
    -   Replaced the main `Column` with a `Box` to manage the layout of the scrollable content, top bar, and input section.
    -   Removed the `onClose` parameter from `LocationNotesHeader` as the close button is now managed separately.
    -   Added `statusBarsPadding` to the `ModalBottomSheet` to prevent content from rendering under the system status bar.
    -   Adjusted spacing and padding for better visual consistency.

* refactor: Use collectAsStateWithLifecycle

Migrates LiveData observation from `observeAsState` to `collectAsStateWithLifecycle` for improved lifecycle-aware state collection in `MeshPeerListSheet`.

This also includes the following related changes:
*   Removes an unused `showSidebar` state flow from `ChatViewModel`.
*   Replaces fully qualified `com.bitchat.android.ui.splitSuffix` calls with a direct `splitSuffix` call.
*   Updates resource string access to use the `R` import.

* feat: Add verification status indicators

- Add peer verification status icons to the peer list.
- Add a button to the channel list to show the verification QR code.
- Remove the unused `SidebarComponents.kt` file.

* Refactor: Add state for mesh peer list visibility

* Refactor: Move mesh peer list state to ViewModel

* refactor: Move QR code icon from channel items to footer

The verification (QR code) icon is relocated from being repeated on each channel list item to a single, centralized position in the sheet's footer.

This icon is now only displayed when not in a location-based channel. The `onShowVerification` parameter has been removed from `ChannelListItem` as it's no longer needed there.

* feat: Show verified status for peers

---------

Co-authored-by: GitHub Action <action@github.com>

* UI Refactor (#562)

* Automated update of relay data - Sun Sep 21 06:21:05 UTC 2025

* Automated update of relay data - Sun Sep 28 06:20:40 UTC 2025

* refactor: new close button like ios(but not liquid glass)

* Automated update of relay data - Sun Oct  5 06:20:09 UTC 2025

* Automated update of relay data - Sun Oct 12 06:20:12 UTC 2025

* Automated update of relay data - Sun Oct 19 06:21:51 UTC 2025

* Automated update of relay data - Sun Oct 26 06:21:31 UTC 2025

* Automated update of relay data - Sun Nov  2 06:22:16 UTC 2025

* Automated update of relay data - Sun Nov  9 06:21:43 UTC 2025

* Automated update of relay data - Sun Nov 16 06:22:37 UTC 2025

* Automated update of relay data - Sun Nov 23 06:22:51 UTC 2025

* Automated update of relay data - Sun Nov 30 06:24:08 UTC 2025

* Automated update of relay data - Sun Dec  7 06:22:59 UTC 2025

* Automated update of relay data - Sun Dec 14 06:24:33 UTC 2025

* Automated update of relay data - Sun Dec 21 06:24:49 UTC 2025

* Automated update of relay data - Sun Dec 28 06:25:38 UTC 2025

* Automated update of relay data - Sun Jan  4 06:26:28 UTC 2026

* refactor: Extract CloseButton to core UI components

* feat: Add BitchatBottomSheet component

* refactor: Use BitchatBottomSheet component and minor ui change(CloseButton, colors)

* Refactor: Use BitchatBottomSheet in MeshPeerListSheet

---------

Co-authored-by: GitHub Action <action@github.com>

* Implement Geohash Presence (Heartbeats) (#576)

* geohash announce

* only for some geohashes

* global presence right away

* jitter delays

* show ? people for high-precision geohashes

* 1000 events

* Gossip mesh topology + source-based routing (#445)

* wip mesh graph

* gossip fix

* gossip works

* source-based routing wip

* log

* update spec to be explicit about intermediate hops only

* drop duplicate hops

* add to spec

* test

* forgot comma

* source routing v2

* add compression bomb protection

* v2 source routing

* fragmented packets inherit route

* update spec

* Gossip routing tmp with connection limit fixed (#569)

* fix: r8 exception for LocationManager (#566)

* fragmented packets inherit route

* update spec

* fix connection limits

* fix: deserialization issue with routed packets

* log

* dynamic fragment size

* fragment size

* add tests

* feat(gossip): implement two-way handshake for source routing edges

- Update MeshGraphService to track directed announcements
- Require bidirectional announcements for a 'confirmed' edge
- Update RoutePlanner to strictly use confirmed edges
- Update Mesh Topology debug view to show confirmed vs unconfirmed edges (solid vs dotted)

* docs: update SOURCE_ROUTING.md with two-way handshake requirement

* evict stale peers from mesh graph service

* better logging

* fix announce spe

* fix: empty route

* fix spec

* fix: compile error in DebugSettingsSheet and potential NPE in RoutePlanner

* revert

* try again

* Feat/graph force (#581)

* mesh topology wip

* graph

* graph animated

* visual logger refactor (#583)

* Update arti to 1.9.0 and produce 32 bit builds (#585)

* x86

* update arti to 1.9.0

* Move PrivateChatSheet hosting into ChatDialogs and unify sheet state (#586)

* Automated update of relay data - Sun Sep 21 06:21:05 UTC 2025

* Automated update of relay data - Sun Sep 28 06:20:40 UTC 2025

* refactor: new close button like ios(but not liquid glass)

* Automated update of relay data - Sun Oct  5 06:20:09 UTC 2025

* Automated update of relay data - Sun Oct 12 06:20:12 UTC 2025

* Automated update of relay data - Sun Oct 19 06:21:51 UTC 2025

* Automated update of relay data - Sun Oct 26 06:21:31 UTC 2025

* Automated update of relay data - Sun Nov  2 06:22:16 UTC 2025

* Automated update of relay data - Sun Nov  9 06:21:43 UTC 2025

* Automated update of relay data - Sun Nov 16 06:22:37 UTC 2025

* Automated update of relay data - Sun Nov 23 06:22:51 UTC 2025

* Automated update of relay data - Sun Nov 30 06:24:08 UTC 2025

* Automated update of relay data - Sun Dec  7 06:22:59 UTC 2025

* Automated update of relay data - Sun Dec 14 06:24:33 UTC 2025

* Automated update of relay data - Sun Dec 21 06:24:49 UTC 2025

* Automated update of relay data - Sun Dec 28 06:25:38 UTC 2025

* Automated update of relay data - Sun Jan  4 06:26:28 UTC 2026

* Automated update of relay data - Sun Jan 11 06:26:19 UTC 2026

* feat: Show private chat in sheet from notification

* Refactor: Hoist private chat sheet state to ChatViewModel

* remove icon

* remove old bottom sheet

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* use bluetooth icon (#597)

* Fix/nostr dm bottom sheet (#598)

* nostr in new dm sheets

* open sheet for nostr peers

* Fix and Improve LocationManager logic (#599)

* location manager improvements

* fix: resolve compilation errors and improve location state handling

- Fix missing imports and stray braces in LocationChannelManager
- Implement checkSystemLocationEnabled and BroadcastReceiver for location state
- Order class members for correct initialization
- Consolidate UI refresh logic in LocationChannelsSheet

* fix: guard against stale geocoding results on legacy devices

- Add isActive check after blocking Geocoder.getFromLocation call
- Prevent stale results from overwriting state after job cancellation

* OSM fallback for geocoding (#611)

* OSM fallback for geocoding

* fallback to city for missing province

* security: prevent storage exhaustion by saving incoming files to cache (#606)

Closes #592
- Changed FileUtils.saveIncomingFile to use context.cacheDir instead of context.filesDir.
- This ensures incoming files are treated as temporary and can be cleared by the OS if space is needed.

Co-authored-by: a1denvalu3 <>

* announce peer ID in servicedata to prevent duplicate connections (#613)

* Refactor: Implement Hybrid Location Provider (System/Fused) (#612)

* refactor: abstract LocationProvider, use FusedLocationProvider

* Refactor: Sync permission state on check

Replaces manual updatePermissionState calls with a unified checkAndSyncPermission method. This ensures that _permissionState flow always reflects the actual system permission status whenever it is checked (e.g. in requestOneShotLocation), preventing desync issues when permissions are revoked at runtime.

* Refactor: Add timeout and tracking to SystemLocationProvider

Implements robust cleanup and timeout logic for location requests.
- SystemLocationProvider: Adds 30s timeout and listener tracking for legacy one-shot requests to prevent memory leaks on pre-Android 11 devices.
- FusedLocationProvider: Adds 30s duration to requests.
- LocationProvider: Adds cancel() method for full resource cleanup.
- LocationChannelManager: Ensures cancel() is called during cleanup.

* try catch

* fix(security): Clear in-memory keys during panic mode (#596)

* fix(security): Clear in-memory keys during panic mode #588

* feat: Recreate mesh service after panic clear (#602)

* feat: Recreate mesh service after panic clear

This commit refactors the panic clear process to ensure a new mesh identity is immediately created and applied.

Previously, the `ChatViewModel` would clear sensitive data, but the recreation of the `BluetoothMeshService` was handled externally. This could lead to a delay or failure in adopting the new identity.

Key changes:
- Introduces `MeshServiceHolder` to manage the lifecycle of the `BluetoothMeshService` instance.
- Adds `recreateMeshServiceAfterPanic()` to `ChatViewModel`, which now explicitly clears the old service instance and creates a new one with a regenerated identity.
- The `meshService` property in `ChatViewModel` is now a `var` to allow it to be replaced with the fresh instance post-panic.
- The new service is started, and a broadcast announcement is sent immediately, ensuring the new peer ID is used on the network.

* fix: Ensure mesh service is properly managed in foreground service

* refactor: Decouple handlers from direct service reference

This commit updates the `VerificationHandler` and `MediaSendingManager` to receive the `meshService` via a lambda function (`getMeshService`) instead of a direct reference.

This change decouples the handlers from the service instance, preventing them from holding a stale reference if the service reconnects or changes. By invoking the lambda to get the current service instance when needed, it ensures they always interact with the active `meshService`.

* fix: restart bluetooth

---------

Co-authored-by: Moe Hamade <69801237+moehamade@users.noreply.github.com>

* improve verification sheet (#615)

* Implement iOS-compatible Direct Peer Detection (TTL Logic) (#574)

* Clean up direct peer detection logic (Max TTL) and remove unrelated routing/media changes

* cleanup fix

* fix: centralize and strictly enforce connection limits (#618)

* Fix: Correctly parse recipient/sender IDs in broadcaster to enable unicast (#619)

* Fix: Unicast source-routed packets at origin instead of broadcasting

* Fix: Correctly parse recipient/sender IDs as hex strings in broadcaster

* security: ensure media files are deleted during panic mode (#607)

Closes #591
- Added FileUtils.clearAllMedia() to recursively delete media directories and cache.
- Called clearAllMedia() in ChatViewModel.panicClearAllData().

fix: correct voice notes directory path for cleanup

- Updated FileUtils.clearAllMedia to use 'voicenotes' instead of 'voice_notes' to match VoiceRecorder.kt

fix: update media cleanup to include cache directories

- Updated FileUtils.clearAllMedia to explicitly clean 'files/incoming' and 'images/incoming' from context.cacheDir, reflecting the storage location change from issue #592.
- Maintained legacy cleanup for context.filesDir.

Co-authored-by: a1denvalu3 <>

* fix: Ensure empty neighbor lists in newer announcements clear mesh edges (#620)

* fix: Ensure empty neighbor lists in newer announcements clear mesh edges

- Refactored MeshGraphService.updateFromAnnouncement to prioritize timestamp checks.
- Treated null neighbor lists (omitted TLV) as empty lists to allow peer disconnection/isolation updates to propagate.
- Added MeshGraphServiceTest to verify timestamp logic and edge eviction.

* fix(test): Use TestOnly API to reset singleton instead of reflection

- Added MeshGraphService.resetForTesting()
- Updated MeshGraphServiceTest to use the new API, avoiding fragile reflection on companion object fields.

* fix(ui): Show acquiring location state instead of unavailable (#621)

* fix(ui): Show acquiring location state instead of unavailable

This change updates the LocationNotesSheetPresenter to display an 'Acquiring Location' sheet when location permissions are granted but the location is still loading. This prevents the misleading 'Location Unavailable' error on devices with slow GPS start-up (e.g., GrapheneOS).

Fixes #578

* Adjust text

---------

Co-authored-by: a1denvalu3 <>

* Fix/590-Private-key-stored-as-Plain-text (#603)

* Private Key Stored in Plaintext(SharedPreference) in EncryptionService migrated to EncryptedSharedPreferences.

* Fix: Safe migration to EncryptedSharedPreferences and restore testability

- Use distinct filename for encrypted prefs to avoid collision with legacy plaintext file
- Move Keystore setup to initialize() to support Robolectric test mocks
- Implement safe read-old/write-new migration logic

---------

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* Refactored BottomSheetTopBar to  BitchatSheetTopBar (#601)

* Automated update of relay data - Sun Sep 21 06:21:05 UTC 2025

* Automated update of relay data - Sun Sep 28 06:20:40 UTC 2025

* refactor: new close button like ios(but not liquid glass)

* Automated update of relay data - Sun Oct  5 06:20:09 UTC 2025

* Automated update of relay data - Sun Oct 12 06:20:12 UTC 2025

* Automated update of relay data - Sun Oct 19 06:21:51 UTC 2025

* Automated update of relay data - Sun Oct 26 06:21:31 UTC 2025

* Automated update of relay data - Sun Nov  2 06:22:16 UTC 2025

* Automated update of relay data - Sun Nov  9 06:21:43 UTC 2025

* Automated update of relay data - Sun Nov 16 06:22:37 UTC 2025

* Automated update of relay data - Sun Nov 23 06:22:51 UTC 2025

* Automated update of relay data - Sun Nov 30 06:24:08 UTC 2025

* Automated update of relay data - Sun Dec  7 06:22:59 UTC 2025

* Automated update of relay data - Sun Dec 14 06:24:33 UTC 2025

* Automated update of relay data - Sun Dec 21 06:24:49 UTC 2025

* Automated update of relay data - Sun Dec 28 06:25:38 UTC 2025

* Automated update of relay data - Sun Jan  4 06:26:28 UTC 2026

* Automated update of relay data - Sun Jan 11 06:26:19 UTC 2026

* feat: Add BitchatSheetTopBar component

* Refactor: Use BitchatSheetTopBar in bottom sheets

This commit refactors several bottom sheet components to use the new reusable `BitchatSheetTopBar` composable.

This change provides a consistent look and feel for top bars across the following sheets:
- DebugSettingsSheet
- MeshPeerListSheet
- LocationNotesSheet
- LocationChannelsSheet
- LocationNotesSheetPresenter (for the location unavailable state)

The `BitchatSheetCenterTopBar` has been removed as its functionality is now covered by the more flexible `BitchatSheetTopBar`.

* Refactor: Use BitchatSheetTopBar in MeshPeerListSheet

---------

Co-authored-by: GitHub Action <action@github.com>

* spacing for geohash sheet text (#623)

* feat: Introduce Gradle property to control APK splits (#560)

* feat: Introduce Gradle property to control APK splits

This commit introduces a new Gradle project property, `buildSplitApks`, to conditionally enable or disable the generation of ABI-specific (arm64, x86_64) and universal APKs.

Key changes:
- In `app/build.gradle.kts`, the `splits.abi.isEnable` flag is now dynamically set based on the `buildSplitApks` property.
- APK splitting is disabled by default to support standard Android App Bundle (`bundleRelease`) builds.
- The release workflow (`release.yml`) is updated to pass `-PbuildSplitApks=true` when building release APKs for GitHub.
- The general Android build workflow (`android-build.yml`) is also modified to enable splits only for the `Release` variant, ensuring debug builds are not affected.

* chore: Simplify and automate APK split builds

This commit simplifies the build process by automatically enabling ABI splits for APKs (`assemble`) and disabling them for AABs (`bundle`).

This removes the need to manually pass the `-PbuildSplitApks=true` property. The build script now intelligently determines whether to create architecture-specific APKs based on the task being executed (e.g., `assembleRelease` vs. `bundleRelease`).

The GitHub Actions workflows (`release.yml`, `android-build.yml`) have been updated to remove this now-redundant property, streamlining the CI configuration.

* bump to 1.7.0 (#624)

* Fix location update in notes sheet and Nostr subscription leaks (#636)

- Fixes #634: Trigger location refresh when LocationNotesSheet opens
- Fixes #635: Implement proper subscription diffing and cleanup in GeohashViewModel

* Automated update of relay data - Sun Jan 18 06:07:42 UTC 2026

* Automated update of relay data - Sun Jan 25 06:07:49 UTC 2026

* fix(geohash): cleanup sampling subscriptions when closing location sheet (#659)

- Added DisposableEffect to LocationChannelsSheet to ensure cleanup runs when composable is removed
- Fixed ChatViewModel.endGeohashSampling() to correctly delegate to GeohashViewModel instead of being a no-op
- Prevents lingering kind 20001 subscriptions after closing the sheet

* Automated update of relay data - Sun Feb  1 06:19:30 UTC 2026

* fix: pause geohash heartbeat (kind 20001) sampling when backgrounded (#660)

* bump (#661)

* edit

* Automated update of relay data - Sun Feb  8 06:20:17 UTC 2026

* Automated update of relay data - Sun Feb 15 06:19:54 UTC 2026

* Automated update of relay data - Sun Feb 22 06:17:38 UTC 2026

* chore: change license from MIT to GPLv3 (#674)

* Automated update of relay data - Sun Mar  1 06:17:19 UTC 2026

* voice note player ui (#680)

* Unit tests for BinaryProtocol (#678)

* Comprehensive tests for BinaryProtocol

* Test feedback

* Automated update of relay data - Sun Mar  8 06:15:21 UTC 2026

* Automated update of relay data - Sun Mar 15 06:23:41 UTC 2026

* Automated update of relay data - Sun Mar 22 06:19:38 UTC 2026

* update input button styling (#682)

* fix: use CSPRNG for heartbeat intervals (#685)

* Add 'Send private message' action to chat user sheet (#649)

* Add 'Send private message' action to chat user sheet

* Change 'Send private message' action color to purple

* Fix: Resolve short ID against all participants, not just cached nicknames

* Fix: Correctly open private chat sheet for mesh peers

---------

Co-authored-by: a1denvalu3 <>

* fix: add input validation for protocol decoding and fragment reassembly (#666)

* fix: add input validation for protocol decoding and fragment reassembly

* fix:subtract the old entry's size before adding the new one, so duplicate/retransmitted fragments don't inflate the counter

* fix: FragmentManager.handleFragment() can be entered concurrently (e.g., fragments for the same fragmentID arriving from multiple peers/relays). In order for this to happen multiple devices would be needed to connect to the mesh. even with a per-fragmentID byte cap, an attacker could open many fragment IDs at once and force the device to buffer lots of fragment data overall (risking memory pressure/OOM). In this fix we made fragments atomic and thread safe. When a fragment index is retransmitted, we compute the size delta (new - old) so duplicates don’t inflate counters and can’t be used to bypass limits. Under heavy load/attack the app will drop/reject fragment sets earlier instead of growing memory usage without bound to reduce risk of oom. tested on pixel 6 and pixel 8.

* fix: add fragmenttest

* Automated update of relay data - Sun Mar 29 06:27:23 UTC 2026

* update version (#688)

* Revert "update input button styling (#682)" (#689)

This reverts commit ce86f4ec2f.

* Revert "voice note player ui (#680)" (#690)

This reverts commit bc8909bab0.

* Automated update of relay data - Sun Apr  5 06:29:20 UTC 2026

* Automated update of relay data - Sun Apr 12 06:35:32 UTC 2026

* Automated update of relay data - Sun Apr 19 06:37:36 UTC 2026

* Automated update of relay data - Sun Apr 26 06:41:15 UTC 2026

* Automated update of relay data - Sun May  3 06:54:32 UTC 2026

* Automated update of relay data - Sun May 10 06:58:05 UTC 2026

* Automated update of relay data - Sun May 17 07:01:09 UTC 2026

* Automated update of relay data - Sun May 24 07:09:35 UTC 2026

* Automated update of relay data - Sun May 31 07:22:04 UTC 2026

* Automated update of relay data - Sun Jun  7 07:27:22 UTC 2026

* Fix request sync duplicate public messages (#707)

Co-authored-by: CC <cc@ggg.local>

* wifi aware working

* more robust

* fragments work

* new files

* wifi improvements

* handshake works

* fix(sync): resolve hash alignment and early break bugs on GCS filter trimming (#708)

* fix(sync): resolve hash alignment and early break bugs on GCS filter trimming

* fix(sync): filter out zero bucket and deduplicate buckets before encoding

* fix(sync): preserve zero-bucket mapping by clamping 0 to 1 during encoding and decoding

* improve

* wifi mesh more robust

* fix review

* check for support

* wifi aware fixes

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Rebroad <rebroad@users.noreply.github.com>
Co-authored-by: kargathara Aakash <97916053+Kargatharaakash@users.noreply.github.com>
Co-authored-by: yet300 <96379204+yet300@users.noreply.github.com>
Co-authored-by: aidenvalu3 <erendentman@gmail.com>
Co-authored-by: Moe Hamade <69801237+moehamade@users.noreply.github.com>
Co-authored-by: a1denvalu3 <43107113+a1denvalu3@users.noreply.github.com>
Co-authored-by: Anupam Kumar <101698944+anupamjhabbl@users.noreply.github.com>
Co-authored-by: Clare Kinery <39098724+kinerycl@users.noreply.github.com>
Co-authored-by: rollforsats <59777267+rollforsats@users.noreply.github.com>
Co-authored-by: Ovi <137784219+0x0v1@users.noreply.github.com>
Co-authored-by: CC <cc@ggg.local>
2026-06-10 06:02:39 -05:00
callebtcandGitHub 35030a05d8 Wifi aware skip bluetooth (#538)
* unify connection tracker for ble and wifi

* bluetooth optional
2026-01-04 02:02:24 +07:00
callebtcandGitHub 12eb3e5a91 unify connection tracker for ble and wifi (#537)
* unify connection tracker for ble and wifi

* cleanup nicely
2026-01-04 02:00:43 +07:00
c12af45b6b Fix wifi aware routing (#534)
* Background persistence (#505)

* persistence step 1

* fix build

* messages in the background work, notifications not yet

* app state store

* DM icon shows up

* notification launches when app is closed!

* keep ui updated

* lifecycle fixes

* extensive logging, maybe revert later

* send nickname in announcement

* quit in notification

* setting in about sheet

* fix quit bitchat

* lifecycle fixes

* power mode based on background state

* stats for both direciotns

* fix graph persistence

* better counting

* count per device

* only compute when debug sheet is open? untested

* fix read receipts

* fix read receipts fully

* fix unread badge if messages have been read in focus

* foreground promotion fix

* fix app kill in notification

* adjust to new tor

* nice

* about sheet design

* bump version 1.6.0 (#524)

* Automated update of relay data - Sun Dec 14 06:06:53 UTC 2025

* bump targetSdk (#526)

* Automated update of relay data - Sun Dec 21 06:06:56 UTC 2025

* Automated update of relay data - Sun Dec 28 06:07:12 UTC 2025

* Prevent quit notification from reappearing (#530)

* shutdown sequence

* Prevent quit notification from reappearing

* Restrict force-finish broadcast

* Cancel quit shutdown on relaunch

* fix(wifi-aware): use bindSocket and scoped IPv6 instead of bindProcessToNetwork

* Merge branch 'upstream/main' into fix/wifi-aware-socket-binding

* Fix Wi-Fi Aware connectivity and UI integration post-merge

- Replace bindProcessToNetwork with bindSocket for VPN compatibility.
- Implement Scoped IPv6 address resolution (aware0) for mesh routing.
- Bridge Wi-Fi Aware incoming messages to AppStateStore for UI visibility.
- Fix syntax errors and variable name conflicts in Debug UI.

* Enhance Wi-Fi Aware robustness and debug UI display

- Clean up transport resources (sockets, server sockets, network callbacks) immediately on peer disconnection.
- Implement resolveScopedAddress to show scoped IPv6 (e.g., %aware0) in Debug UI.
- Fix Map type mismatch warning in ChatViewModel bridge.
- Filter self-ID from peer cleanup tables to prevent recursive self-removal.

* Share GossipSyncManager across transports to prevent redundant message synchronization

- Registered BluetoothMeshService's GossipSyncManager as a singleton in MeshServiceHolder.
- Modified WifiAwareMeshService to use the shared GossipSyncManager if available.
- Added background cleanup for peer mappings on socket disconnection.
- Fixed Kotlin type mismatch during nickname map merging.

* Restore VPN acquisition logic and improve peer cleanup

- Revert removal of NET_CAPABILITY_NOT_VPN to allow hardware handle acquisition while VPN is active.
- Refactor handlePeerDisconnection to more reliably cleanup initial and routed IDs.
- Switch cleanup logging to debug level to reduce log noise.

* fix wifi aware routing

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: aidenvalue <>
2026-01-04 01:12:40 +07:00
callebtc bd272bb5ea Merge branch 'main' into wifi-aware 2026-01-04 01:07:12 +07:00
callebtc ec2684df7a Merge branch 'main' of https://github.com/callebtc/bitchat-android 2026-01-04 01:04:52 +07:00
463600a6c3 Fix wifi aware socket binding 2 (#536)
* Background persistence (#505)

* persistence step 1

* fix build

* messages in the background work, notifications not yet

* app state store

* DM icon shows up

* notification launches when app is closed!

* keep ui updated

* lifecycle fixes

* extensive logging, maybe revert later

* send nickname in announcement

* quit in notification

* setting in about sheet

* fix quit bitchat

* lifecycle fixes

* power mode based on background state

* stats for both direciotns

* fix graph persistence

* better counting

* count per device

* only compute when debug sheet is open? untested

* fix read receipts

* fix read receipts fully

* fix unread badge if messages have been read in focus

* foreground promotion fix

* fix app kill in notification

* adjust to new tor

* nice

* about sheet design

* bump version 1.6.0 (#524)

* Automated update of relay data - Sun Dec 14 06:06:53 UTC 2025

* bump targetSdk (#526)

* Automated update of relay data - Sun Dec 21 06:06:56 UTC 2025

* Automated update of relay data - Sun Dec 28 06:07:12 UTC 2025

* Prevent quit notification from reappearing (#530)

* shutdown sequence

* Prevent quit notification from reappearing

* Restrict force-finish broadcast

* Cancel quit shutdown on relaunch

* fix(wifi-aware): use bindSocket and scoped IPv6 instead of bindProcessToNetwork

* Merge branch 'upstream/main' into fix/wifi-aware-socket-binding

* Fix Wi-Fi Aware connectivity and UI integration post-merge

- Replace bindProcessToNetwork with bindSocket for VPN compatibility.
- Implement Scoped IPv6 address resolution (aware0) for mesh routing.
- Bridge Wi-Fi Aware incoming messages to AppStateStore for UI visibility.
- Fix syntax errors and variable name conflicts in Debug UI.

* Enhance Wi-Fi Aware robustness and debug UI display

- Clean up transport resources (sockets, server sockets, network callbacks) immediately on peer disconnection.
- Implement resolveScopedAddress to show scoped IPv6 (e.g., %aware0) in Debug UI.
- Fix Map type mismatch warning in ChatViewModel bridge.
- Filter self-ID from peer cleanup tables to prevent recursive self-removal.

* Share GossipSyncManager across transports to prevent redundant message synchronization

- Registered BluetoothMeshService's GossipSyncManager as a singleton in MeshServiceHolder.
- Modified WifiAwareMeshService to use the shared GossipSyncManager if available.
- Added background cleanup for peer mappings on socket disconnection.
- Fixed Kotlin type mismatch during nickname map merging.

* Restore VPN acquisition logic and improve peer cleanup

- Revert removal of NET_CAPABILITY_NOT_VPN to allow hardware handle acquisition while VPN is active.
- Refactor handlePeerDisconnection to more reliably cleanup initial and routed IDs.
- Switch cleanup logging to debug level to reduce log noise.

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: aidenvalue <>
2026-01-03 23:39:54 +07:00
callebtcandGitHub fa1978d587 Revert "fix: wifi aware socket binding (#533)" (#535)
This reverts commit 0c7505b588.
2026-01-03 23:37:49 +07:00
0c7505b588 fix: wifi aware socket binding (#533)
* wifi aware wip

* wifi aware wip

* starting to work

* werk

* dms work

* wip

* fix(wifi-aware): use bindSocket and scoped IPv6 instead of bindProcessToNetwork

* Merge branch 'upstream/main' into fix/wifi-aware-socket-binding

* Fix Wi-Fi Aware connectivity and UI integration post-merge

- Replace bindProcessToNetwork with bindSocket for VPN compatibility.
- Implement Scoped IPv6 address resolution (aware0) for mesh routing.
- Bridge Wi-Fi Aware incoming messages to AppStateStore for UI visibility.
- Fix syntax errors and variable name conflicts in Debug UI.

* Enhance Wi-Fi Aware robustness and debug UI display

- Clean up transport resources (sockets, server sockets, network callbacks) immediately on peer disconnection.
- Implement resolveScopedAddress to show scoped IPv6 (e.g., %aware0) in Debug UI.
- Fix Map type mismatch warning in ChatViewModel bridge.
- Filter self-ID from peer cleanup tables to prevent recursive self-removal.

* Share GossipSyncManager across transports to prevent redundant message synchronization

- Registered BluetoothMeshService's GossipSyncManager as a singleton in MeshServiceHolder.
- Modified WifiAwareMeshService to use the shared GossipSyncManager if available.
- Added background cleanup for peer mappings on socket disconnection.
- Fixed Kotlin type mismatch during nickname map merging.

* Restore VPN acquisition logic and improve peer cleanup

- Revert removal of NET_CAPABILITY_NOT_VPN to allow hardware handle acquisition while VPN is active.
- Refactor handlePeerDisconnection to more reliably cleanup initial and routed IDs.
- Switch cleanup logging to debug level to reduce log noise.

---------

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
Co-authored-by: aidenvalue <>
2026-01-03 23:31:20 +07:00
aidenvalueandaidenvalue 2bd8f84e6a Restore VPN acquisition logic and improve peer cleanup
- Revert removal of NET_CAPABILITY_NOT_VPN to allow hardware handle acquisition while VPN is active.
- Refactor handlePeerDisconnection to more reliably cleanup initial and routed IDs.
- Switch cleanup logging to debug level to reduce log noise.
2026-01-03 15:24:59 +01:00
aidenvalueandaidenvalue ddba841280 Share GossipSyncManager across transports to prevent redundant message synchronization
- Registered BluetoothMeshService's GossipSyncManager as a singleton in MeshServiceHolder.
- Modified WifiAwareMeshService to use the shared GossipSyncManager if available.
- Added background cleanup for peer mappings on socket disconnection.
- Fixed Kotlin type mismatch during nickname map merging.
2026-01-03 15:03:30 +01:00
aidenvalueandaidenvalue ae87530afb Enhance Wi-Fi Aware robustness and debug UI display
- Clean up transport resources (sockets, server sockets, network callbacks) immediately on peer disconnection.
- Implement resolveScopedAddress to show scoped IPv6 (e.g., %aware0) in Debug UI.
- Fix Map type mismatch warning in ChatViewModel bridge.
- Filter self-ID from peer cleanup tables to prevent recursive self-removal.
2026-01-03 14:54:24 +01:00
aidenvalueandaidenvalue a511945838 Fix Wi-Fi Aware connectivity and UI integration post-merge
- Replace bindProcessToNetwork with bindSocket for VPN compatibility.
- Implement Scoped IPv6 address resolution (aware0) for mesh routing.
- Bridge Wi-Fi Aware incoming messages to AppStateStore for UI visibility.
- Fix syntax errors and variable name conflicts in Debug UI.
2026-01-03 14:22:40 +01:00
aidenvalueandaidenvalue 64f73df362 Merge branch 'upstream/main' into fix/wifi-aware-socket-binding 2026-01-03 12:44:43 +01:00
aidenvalueandaidenvalue 923366a944 Merge branch 'upstream/main' into fix/wifi-aware-socket-binding 2026-01-03 12:44:25 +01:00
aidenvalueandaidenvalue 37c764b55a fix(wifi-aware): use bindSocket and scoped IPv6 instead of bindProcessToNetwork 2026-01-03 11:55:13 +01:00
callebtcandGitHub 903a4584a8 Prevent quit notification from reappearing (#530)
* shutdown sequence

* Prevent quit notification from reappearing

* Restrict force-finish broadcast

* Cancel quit shutdown on relaunch
2026-01-02 16:52:06 +07:00
GitHub Action ab555f25f5 Automated update of relay data - Sun Dec 28 06:07:12 UTC 2025 2025-12-28 06:07:12 +00:00
GitHub Action 7f434a34e7 Automated update of relay data - Sun Dec 21 06:06:56 UTC 2025 2025-12-21 06:06:56 +00:00
callebtcandGitHub 743bbd0b1c bump targetSdk (#526) 2025-12-14 21:55:41 +07:00
GitHub Action 2a11d52d3c Automated update of relay data - Sun Dec 14 06:06:53 UTC 2025 2025-12-14 06:06:53 +00:00
callebtcandGitHub 8767cfdea3 bump version 1.6.0 (#524) 1.6.0-rc1 2025-12-13 16:46:09 +07:00
callebtcandGitHub 3f8c236a72 Background persistence (#505)
* persistence step 1

* fix build

* messages in the background work, notifications not yet

* app state store

* DM icon shows up

* notification launches when app is closed!

* keep ui updated

* lifecycle fixes

* extensive logging, maybe revert later

* send nickname in announcement

* quit in notification

* setting in about sheet

* fix quit bitchat

* lifecycle fixes

* power mode based on background state

* stats for both direciotns

* fix graph persistence

* better counting

* count per device

* only compute when debug sheet is open? untested

* fix read receipts

* fix read receipts fully

* fix unread badge if messages have been read in focus

* foreground promotion fix

* fix app kill in notification

* adjust to new tor

* nice

* about sheet design
2025-12-13 16:43:39 +07:00
callebtc ecc7e93930 Merge branch 'main' into wifi-aware 2025-12-13 16:15:38 +07:00
e96330e50b Migrate from LiveData to Kotlin Flow (#518)
* Automated update of relay data - Sun Sep 21 06:21:05 UTC 2025

* Automated update of relay data - Sun Sep 28 06:20:40 UTC 2025

* refactor: new close button like ios(but not liquid glass)

* Automated update of relay data - Sun Oct  5 06:20:09 UTC 2025

* Automated update of relay data - Sun Oct 12 06:20:12 UTC 2025

* Automated update of relay data - Sun Oct 19 06:21:51 UTC 2025

* Automated update of relay data - Sun Oct 26 06:21:31 UTC 2025

* Automated update of relay data - Sun Nov  2 06:22:16 UTC 2025

* Automated update of relay data - Sun Nov  9 06:21:43 UTC 2025

* Automated update of relay data - Sun Nov 16 06:22:37 UTC 2025

* Automated update of relay data - Sun Nov 23 06:22:51 UTC 2025

* Automated update of relay data - Sun Nov 30 06:24:08 UTC 2025

* Chore: Remove unused `lifecycle-livedata-ktx` dependency

This commit removes the `androidx.lifecycle:lifecycle-livedata-ktx` library from the project's dependencies.

The `[libraries]` and `[bundles]` sections in `gradle/libs.versions.toml` have been updated to reflect this removal, as the dependency is no longer in use.

* Refactor: Remove unused `runtime-livedata` dependency

* Refactor: Migrate `LocationChannelManager` and `GeohashBookmarksStore` to StateFlow

This commit refactors `LocationChannelManager` and `GeohashBookmarksStore` to use `StateFlow` instead of `LiveData` for managing and exposing their state. This change aligns with modern Android development practices and improves testability.

**Key Changes:**

- **`LocationChannelManager`**:
    - All `MutableLiveData` properties (`permissionState`, `availableChannels`, `selectedChannel`, etc.) have been replaced with `MutableStateFlow`.
    - Consumers now access these properties as `StateFlow`.
    - State updates have been changed from `postValue()` to direct `.value` assignments, simplifying thread management within the manager which already uses a dedicated coroutine scope.

- **`GeohashBookmarksStore`**:
    - `bookmarks` and `bookmarkNames` are now exposed as `StateFlow` instead of `LiveData`.
    - State updates similarly use `.value` assignment.

- **Nullability**:
    - The non-nullable nature of `StateFlow`'s value reduces the need for null-checks in both the manager classes and their consumers, leading to safer code.

* Refactor: Migrate from LiveData to StateFlow for Nostr components

This commit replaces `LiveData` with `StateFlow` across core Nostr-related classes to align with modern Android architecture and improve state management. This change affects `NostrClient`, `NostrRelayManager`, `LocationNotesManager`, and `GeohashRepository`.

**Key Changes:**

-   **`NostrClient`**:
    -   `isInitialized` and `currentNpub` are now `StateFlow` instead of `LiveData`.
    -   `relayConnectionStatus` and `relayInfo` now return `StateFlow` from `NostrRelayManager`.

-   **`NostrRelayManager`**:
    -   Public properties `relays` and `isConnected` are migrated from `MutableLiveData` to `MutableStateFlow`.
    -   Updates are now pushed using `.value` instead of `.postValue()`.

-   **`LocationNotesManager`**:
    -   All public `LiveData` properties (`notes`, `geohash`, `initialLoadComplete`, `state`, `errorMessage`) are converted to `StateFlow`.
    -   The class documentation is updated to reflect the use of `StateFlow`.

-   **`GeohashRepository`**:
    -   Methods `updateGeohashPeople` and `updateReactiveParticipantCounts` now call `set...` methods on the `state` object instead of `post...`, reflecting the removal of `LiveData` from the underlying state management.

* Refactor: Migrate ChatState from LiveData to StateFlow

This commit refactors the `ChatState`, `ChatViewModel`, and `GeohashViewModel` to use `StateFlow` instead of `LiveData` for managing and exposing UI state. This migration improves state management by leveraging modern coroutine-based flows.

**Key Changes:**

- **`ChatState.kt`**:
    - Replaced all `MutableLiveData` instances with `MutableStateFlow`.
    - Exposed state properties as `StateFlow` instead of `LiveData`.
    - Removed `MediatorLiveData` for computed properties (`hasUnreadChannels`, `hasUnreadPrivateMessages`) and replaced them with `Flow.combine` to create derivative `StateFlows`.
    - Simplified non-nullable `getters` to directly return the `.value` of the `StateFlows`.
    - Removed `postValue` helpers that are no longer necessary.

- **`ChatViewModel.kt`**:
    - Updated all state properties to be `StateFlow`, reflecting the changes in `ChatState`.

- **`GeohashViewModel.kt`**:
    - Changed state properties (`geohashPeople`, `geohashParticipantCounts`, etc.) from `LiveData` to `StateFlow`.
    - Replaced `observeForever` on `LiveData` from `LocationChannelManager` with `viewModelScope.launch` blocks that `.collect()` from the underlying flows.

* Refactor: Migrate UI from LiveData to StateFlow

This commit replaces `LiveData.observeAsState()` with `StateFlow.collectAsState()` across various UI components. This change aligns the codebase with modern Android development practices, using Kotlin Flows for reactive UI state management.

No functional changes are intended. The primary goal is to remove the dependency on `androidx.lifecycle.livedata` from the composable functions.

**Affected Components:**
- `ChatScreen`
- `SidebarComponents`
- `ChatHeader`
- `LocationChannelsSheet`
- `LocationNotesSheet`
- `LocationNotesButton`
- `GeohashPeopleList`
- `LocationNotesSheetPresenter`

* Refactor: Use `collectAsStateWithLifecycle` for UI state collection

* Refactor: move CloseButton to core/ui/component

* Refactor: remove AI generated comments

* Refactor: fix combine to map and use WhileSubscribed

* Refactor: Pass CoroutineScope to ChatState

This commit refactors the `ChatState` class to accept a `CoroutineScope` in its constructor instead of creating its own.

**Key Changes:**

- **`ChatState.kt`**: The constructor now requires a `CoroutineScope`. This scope is used for the `stateIn` operators that convert `Flows` into `StateFlows` (`hasUnreadChannels`, `hasUnreadPrivateMessages`), ensuring they operate within the lifecycle of the provided scope.
- **`ChatViewModel.kt`**: The `viewModelScope` is now passed to the `ChatState` constructor during its instantiation. This ties the lifecycle of the state's coroutines directly to the `ViewModel`'s lifecycle.

* Test: Use `TestScope` for coroutines in `CommandProcessorTest`

This commit refactors `CommandProcessorTest` to use a `TestScope` and `UnconfinedTestDispatcher` for managing coroutines.

This ensures that coroutine-based operations within the test are executed in a controlled and predictable manner, improving test reliability. The `coroutineScope` for `CommandProcessor` and the `scope` for `ChatState` are now both configured to use this test-specific scope.

---------

Co-authored-by: GitHub Action <action@github.com>
2025-12-13 15:58:48 +07:00
b2febcee88 feat: add product flavors and TorProvider abstraction (#508)
* feat: add product flavors and TorProvider abstraction

Introduces build flavors to separate Tor functionality from the standard build, reducing APK size for users who don't need Tor.

- Creates `standard` and `tor` product flavors.
- The `standard` flavor is the default, lightweight build.
- The `tor` flavor includes the Arti (Tor) dependency and is identified by the `.tor` application ID suffix.
- Adds a `TorProvider` interface and a `TorProviderFactory` to abstract Tor implementation details between flavors.

Prepares architecture for optional Tor support to reduce APK size
from 142MB to ~4-5MB for standard builds

Related to #454

* Refactor: implement StandardTorProvider and RealTorProvider

This commit refactors the Tor integration by introducing a `TorProvider` interface and creating separate implementations for 'tor' and 'standard' product flavors.

- The original `TorManager` singleton has been moved into `RealTorProvider` for the 'tor' flavor.
- A no-op `StandardTorProvider` is introduced for the 'standard' flavor, which reports Tor as unavailable.
- A `TorProviderFactory` is used to create the appropriate provider at runtime based on the build variant.

* refactor: migrate to TorProvider abstraction

Replaced direct calls to the static `TorManager` with an instance obtained from `TorProviderFactory`.

This change allows for different Tor implementations based on build flavors, improving modularity and abstracting the Tor provider logic.

Updated `BitchatApplication`, `ChatHeader`, `OkHttpProvider`, and `AboutSheet` to use the new factory pattern for accessing Tor functionalities.

* build: add flavor-specific ProGuard rules and CI/CD

 - Split ProGuard rules: base, standard-specific, tor-specific
  - Move Arti/Guardian Project rules to proguard-tor.pro
  - Update CI/CD workflow to build both flavors
  - Add separate artifact uploads for each flavor
  - Add descriptive release notes template

  CI now builds both standard (~4-5MB) and tor (~140MB) APKs."

  resolves #454

* refactor: centralize network reset logic

Extracts the repeated network connection reset logic into a new private function `resetNetworkConnections()`.

This change also replaces direct `_statusFlow.value = ...` assignments with the safer `_statusFlow.update { ... }` function to prevent race conditions.

* ci: run separate build steps for flavors

* feat: disable Tor toggle if not available in build

* ci: parallelize builds and add conditional tor lint

Optimizes CI workflow:
- Parallel matrix builds (4 runners instead of sequential)
- Conditional tor lint only when app/src/tor/ changes in PRs
- Merged test+lint jobs to reduce setup overhead

Reduces CI time by ~50% (8-11 min vs 18-26 min)

* refactor: Unify Tor implementation and remove build flavors

This commit refactors the Tor integration by removing the `standard` and `tor` product flavors in favor of a single, unified build that always includes a custom-built Arti (Tor) library.

Key changes include:
*   **Removed Build Flavors:** Deleted the `standard` and `tor` product flavors from `build.gradle.kts`, simplifying the build process and CI configuration.
*   **Unified Tor Manager:** Replaced the `TorProvider` interface and flavor-specific implementations (`StandardTorProvider`, `RealTorProvider`) with a new singleton, `ArtiTorManager`. This class now manages the Arti lifecycle for all builds.
*   **Custom Arti Wrapper:** Introduced a new `ArtiProxy` class to provide a compatible API wrapper around the custom-built native Arti library (`libarti_android.so`). This replaces the dependency on the external `arti-mobile-ex` library.
*   **Updated Proguard:** Consolidated and updated Proguard rules into the main `proguard-rules.pro` file to keep the necessary `ArtiTorManager` and native library classes.
*   **CI/CD Simplification:** Updated GitHub Actions workflows (`release.yml`, `android-build.yml`) to build and release a single APK instead of separate ones for each flavor.

* build: Configure ABI filters for debug and release builds

For debug builds, include `x86_64` to support emulators.

For release builds, only include `arm64-v8a` to minimize the final APK size.

* feat: Ignore jniLibs directory

This change adds the `app/src/main/jniLibs/` directory to the `.gitignore` file to prevent native libraries from being committed to the repository.

* feat: Refine .gitignore for Arti build artifacts

Improves the `.gitignore` file by:
- Ignoring all `build/` directories except for `tools/arti-build/`.
- Adding specific ignores for Arti build artifacts, including the cloned source repository and the Rust build cache directory.

* feat: Update arti android native library

* feat: add build script and JNI wrapper for Arti

Adds a comprehensive build system for creating custom Arti (Tor in Rust) shared libraries for Android. This replaces the dependency on external, outdated AARs with a fully transparent and reproducible build process.

Key changes:
- Introduces `build-arti.sh`, a script to clone the official Arti repository, apply a JNI wrapper, and build `.so` files for Android.
- Adds `ARTI_VERSION` to pin the build to a specific Arti release (v1.7.0).
- Implements a new Rust JNI wrapper (`src/lib.rs`) that exposes core functions like `initialize`, `startSocksProxy`, and `stop` to the Android app.
- Includes a `Cargo.toml` with release profile optimizations for size (`lto`, `strip`, `opt-level = "z"`).
- Provides detailed documentation in `README.md` explaining the build process, prerequisites, and architecture.

* build script for mac

* consolidate both scripts

* improve script

---------

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2025-12-12 23:27:52 +07:00
Mafiadöner36andGitHub a174ac5185 Add Network permission requirement to README (#522)
It forces Network permission prompt right down your throat, so please explain in readme, I was super irritated as its counter intuitive in regards to apps main selling point!
2025-12-12 19:20:09 +07:00
GitHub Action 4511cef619 Automated update of relay data - Sun Dec 7 06:06:39 UTC 2025 2025-12-07 06:06:39 +00:00
GitHub Action 7a628f2fec Automated update of relay data - Sun Nov 30 06:06:53 UTC 2025 2025-11-30 06:06:53 +00:00
GitHub Action b4142c7f1f Automated update of relay data - Sun Nov 23 06:06:51 UTC 2025 2025-11-23 06:06:51 +00:00
callebtcandGitHub 04ea2a3162 refactor app constants: service UUID for BLE (#500) 2025-11-18 21:26:20 +01:00
GitHub Action 466c8176a1 Automated update of relay data - Sun Nov 16 06:06:45 UTC 2025 2025-11-16 06:06:45 +00:00
GitHub Action 02cc6301e0 Automated update of relay data - Sun Nov 9 06:06:33 UTC 2025 2025-11-09 06:06:33 +00:00
callebtcandGitHub 282ac0fe5a Fix: do not reject empty packets that arent message type (#510)
* do not reject empty packets that arent message type

* leave message with empty byte array

* clean up comments
2025-11-03 20:37:31 +01:00
GitHub Action cf53c65cfe Automated update of relay data - Sun Nov 2 06:06:38 UTC 2025 2025-11-02 06:06:38 +00:00
callebtcandGitHub 292ca4532b fix connection attempt counter tracker (#503) 2025-10-30 13:50:47 +01:00
callebtcandGitHub a4ce8cc979 better tracking of first announce seen (#502) 2025-10-30 00:39:24 +01:00
GitHub Action 80d897a022 Automated update of relay data - Sun Oct 26 06:06:36 UTC 2025 2025-10-26 06:06:36 +00:00
callebtcandGitHub c3f5739fea refactor app constants: service UUID for BLE (#494) 2025-10-22 13:48:35 +02:00
callebtc ddff565bdd wip 2025-10-22 13:05:32 +02:00
callebtc fcbecd4ef6 dms work 2025-10-22 05:09:16 +02:00
callebtc 1296e117ba werk 2025-10-22 04:58:05 +02:00
callebtc 13d4c5145e starting to work 2025-10-22 04:15:48 +02:00
callebtc f6cb73ff89 wifi aware wip 2025-10-22 04:09:00 +02:00
callebtc f4341ae1c1 wifi aware wip 2025-10-21 22:24:55 +02:00
callebtcandGitHub da7fdd0f23 suppress relay of reassambled packet by setting TTL=0 (#492) 2025-10-21 12:52:14 +02:00
Developer ChunkandGitHub 9535ca8940 feat: Add tablet landscape orientation support (#490)
- Tablets now support landscape mode, phones remain portrait-only
- Add OrientationAwareActivity base class for orientation management
- Add DeviceUtils.isTablet() for runtime device detection
- Update MainActivity and GeohashPickerActivity to extend OrientationAwareActivity
- Uses multiple detection criteria (screen size, density, configuration)
Fixes #480
2025-10-20 20:14:50 +02:00
callebtcandGitHub f633509848 bump to 1.5.1 (#488) 1.5.1 2025-10-19 12:43:55 +02:00
callebtcandGitHub 59ee530d54 show media buttons only in mesh (#487) 2025-10-19 12:32:56 +02:00
GitHub Action 7881210785 Automated update of relay data - Sun Oct 19 06:06:46 UTC 2025 2025-10-19 06:06:46 +00:00