Commit Graph

4392 Commits

Author SHA1 Message Date
James Rich
813316110e chore: KDoc cleanup, stale comments, and cruft removal
- Add KDoc to 3 JSON datasource interfaces and 7 repository implementations
- Remove IndoorAirQuality stub comments
- Remove commented-out WRITE_EXTERNAL_STORAGE permission from manifest
- Update foreground service comment to architecture note (Android 14+)
- Remove redundant inline comments in PacketDao.kt

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:06 -05:00
James Rich
07214bd307 refactor: decouple feature/connections from feature/settings
- Move ResponseState<T> to core/model
- Move PacketResponseStateDialog to core/ui/component
- Create RadioConfigStateProvider interface in core/model
- RadioConfigViewModel implements RadioConfigStateProvider
- ConnectionsScreen accepts interface instead of concrete VM
- ConnectionsNavigation receives provider via lambda from app/desktop
- Remove projects.feature.settings dependency from connections build

This eliminates a feature→feature dependency, improving build
parallelism and enforcing proper module boundaries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:06 -05:00
James Rich
27b2c19e69 refactor: narrow ViewModel injections, add ConnectionAware, delete dead code, integration tests
ViewModel Narrowing:
- V1: Created ConnectionAware interface; MessageSender, DeviceAdmin, DeviceControl extend it
- V2: Narrowed 6 ViewModels/actions to focused sub-interfaces (DeviceAdmin, MessageSender, DataRequester, DeviceControl)

Cleanup:
- C1: Deleted dead MeshDataMapper and its DI registration

Integration Tests:
- T2: SdkStateBridgeTest verifying WentOffline/CameOnline presence handling
- Verified Koin resolution, full test suite passes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
e9cb439849 feat: rearchitect around SDK — decompose RadioController, simplify DataPacket, integrate SDK utilities
Android rearchitecture consuming meshtastic-sdk improvements:

A1 — ConnectionState Enrichment:
- Rich sealed interface with Connecting(attempt), Configuring(phase, progress), Reconnecting(attempt)
- SdkStateBridge maps SDK states preserving metadata

A2 — MessageHandle Integration:
- MessageDeliveryTracker: tracks delivery via SDK MessageHandle
- SdkRadioController captures handles on send

A3 — RadioController Decomposition:
- Split into 5 focused interfaces: MessageSender, DeviceAdmin, RemoteAdmin, DeviceControl, DataRequester
- RadioController extends all; SdkRadioController binds all via Koin

A4 — DataPacket Simplification:
- to/from fields changed from String? to Int (node numbers directly)
- Removed string ID parsing layer; added BROADCAST/LOCAL constants
- Updated ~40 consumer files across feature modules

A5 — SDK Utility Consumption:
- DeviceVersion, Capabilities, SfppHasher, LocationUtils delegate to SDK
- Removed duplicated protocol logic

A6 — Presence Events:
- SdkStateBridge handles NodeChange.WentOffline/CameOnline
- Updates node online status via repository

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
f0aa99eaff refactor: delete POC ViewModels and stale references
- Delete SdkConfigViewModel, SdkMessagingViewModel, SdkTelemetryViewModel (unused POC)
- Delete RadioClientViewModel, SdkNodeListViewModel (POC logging only)
- Remove POC VM instantiation from Main.kt
- Delete NoopRadioInterfaceService (superseded by SdkRadioInterfaceService)
- Delete dead app/test/Fakes.kt (both classes unused)
- Fix stale KDoc references to MeshConnectionManager, RadioInterfaceService.connectionState

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
74ba959b24 feat: DRY SDK integration — shared bridge, Desktop cutover, dead infra deletion
Major architectural changes:

1. SHARED KMP BRIDGE (core/data/radio/):
   - RadioClientAccessor: Platform-agnostic interface for SDK RadioClient
   - SdkRadioController: Shared RadioController impl (replaces per-platform copies)
   - SdkStateBridge: Shared SDK→repository bridge (event dispatch, node sync)
   - SdkPacketHandler: Thin SDK-backed PacketHandler for MQTT/XModem/History

2. DESKTOP SDK CUTOVER:
   - DesktopRadioClientProvider: TCP + Serial transport support
   - Removed DirectRadioControllerImpl (old desktop radio path)
   - Desktop now shares the same SDK bridge code as Android

3. DEAD INFRASTRUCTURE DELETION (~5,100 LOC removed):
   - PacketHandlerImpl, MeshDataHandlerImpl, MeshRouterImpl
   - CommandSenderImpl, MeshActionHandlerImpl, MeshConfigFlowManagerImpl
   - MeshConnectionManagerImpl, AdminPacketHandlerImpl
   - ServiceBroadcasts (Android intent-based pub/sub)
   - NodeRepositoryImpl (Room-backed, replaced by SdkNodeRepositoryImpl)
   - 8 trivial UseCases (SetLocale, SetTheme, ToggleAnalytics, etc.)
   - All associated test files for deleted impls
   - Deleted interfaces: AdminPacketHandler, CommandSender, MeshActionHandler,
     MeshConfigFlowManager, MeshConnectionManager, MeshRouter, ServiceBroadcasts

4. NEW FEATURES:
   - NodeMetadataEntity + Room migration 38→39 (persistent favorites/notes)
   - AppMetadataRepository (clean access to node metadata)
   - MessagePersistenceHandler (focused rememberDataPacket for StoreForward)

All three targets compile clean: :app:compileGoogleDebugKotlin,
:desktop:compileKotlin, :core:data:jvmTest passes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
9319b0c3a3 refactor: tighten SDK integration — eliminate old pipeline indirection
SdkStateBridge:
- Remove redundant manual proto decode (telemetry/position/user) — SDK's
  NodeChange flow already provides updated NodeInfo with all fields
- Forward raw packets to meshPacketFlow for RadioConfigViewModel + TAK
- Handle ServiceActions directly via SDK AdminApi (Favorite, Ignore, Mute,
  Reaction, ImportContact, SendContact, GetDeviceMetadata)
- Bypasses entire CommandSender → MeshActionHandler → MeshRouter chain

MeshServiceOrchestrator:
- Remove radioInterfaceService.connect() — SDK owns transport now
- Remove receivedData → messageProcessor wiring — SDK handles packets
- Remove serviceAction → actionHandler subscription — SdkStateBridge handles
- Remove resetReceivedBuffer — no raw byte pipeline to drain
- Retain: TAK integration, database init, service notifications
- Remove unused constructor params (serviceRepository, messageProcessor, router)

Architecture after this commit:
- All in-app flows: Feature VM → RadioController → SdkRadioControllerImpl → SDK
- ServiceActions: UI → ServiceRepository.onServiceAction → SdkStateBridge → SDK
- AIDL binder: only remaining path to old CommandSender/MeshActionHandler (for
  external 3rd-party app compat only)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
f5e2aabc00 feat: add SdkRadioControllerImpl and SdkStateBridge for SDK hard cutover
Replace the legacy AIDL-based AndroidRadioControllerImpl with an SDK-backed
implementation that delegates all operations through RadioClient:

SdkRadioControllerImpl:
- Full RadioController interface impl (~35 methods)
- Local admin ops → SDK AdminApi/TelemetryApi/RoutingApi
- Remote admin ops → raw MeshPacket via RadioClient.send()
- Registered as @Single(binds = [RadioController::class]) in Koin

SdkStateBridge:
- Bridges SDK reactive flows (connection, nodes, packets, events) into
  ServiceRepository and NodeManager for legacy UI compatibility
- Connection state mapping (SDK states → app ConnectionState enum)
- Node snapshot/added/updated/removed → NodeManager
- Inbound telemetry/position/user packets → NodeManager handlers
- Events (reboot, security warnings, drops) → notification layer

AndroidRadioControllerImpl:
- @Single annotation disabled (commented out) to prevent Koin conflict
- Class retained for reference/fallback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
384746cc75 feat: enrich Android POC with SDK integration improvements
- RadioClientProvider: support BLE, TCP, and Serial transports via
  InterfaceId routing; handle MOCK/NOP gracefully
- SdkNodeListViewModel: use SDK's MeshNode model for 20+ enriched
  fields (isOnline, battery, position, signal quality, etc.)
- SdkConfigViewModel: remove Gap G workaround (_localConfigOverrides),
  add reactive channels StateFlow from SDK

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
dd67120b5c refactor(radio): use SDK BleTransport(address) factory (Gap F resolved)
Replace the two-step buildPeripheralForSavedAddress() + BleTransport(peripheral, address)
with the new SDK factory BleTransport(address) { autoConnectIf { true } }.

The SDK's transport-ble androidMain now exposes BleTransport(address: String,
builderAction: PeripheralBuilder.() -> Unit) directly, removing the need for
the core:ble workaround. The autoConnectIf { true } flag preserves bonded-device
behavior (avoids GATT 133 on reconnect without a fresh advertisement).

Gap F note removed from RadioClientProvider KDoc — gap is resolved in SDK.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
8b459881e0 feat: integrate meshtastic-sdk POC vertical slice
Wires core flows to the meshtastic-sdk (0.1.0-SNAPSHOT) while keeping the
legacy path alive. Goal: prove the SDK works with a real Android app and
surface API deficiencies.

Build:
- settings.gradle.kts: composite build inclusion for meshtastic-sdk
  (../meshtastic-sdk) with dependency substitution for all SDK artifacts
- libs.versions.toml: sdk = "0.1.0-SNAPSHOT", mavenCentral snapshots repo
- app/build.gradle.kts: sdk-core, sdk-proto, sdk-transport-ble,
  sdk-storage-sqldelight dependencies

Bootstrap:
- MeshUtilApplication: AndroidContextHolder.context set in onCreate()
  before startKoin so SqlDelightStorageProvider can locate app files
- RadioClientProvider (@Single, binds SdkClientLifecycle): mutex-serialized
  rebuildAndConnect(), strips 'x' prefix from BLE devAddr, holds
  RadioClient StateFlow
- RadioClientViewModel: exposes RadioClientProvider to UI layer

SDK ViewModels (POC quality, compile-verified):
- SdkNodeListViewModel: NodeChange.Snapshot/Added/Updated/Removed → UiNode
- SdkMessagingViewModel: sendText() via client.sendText(), incomingText
  via client.textMessages (Gap B — now fixed in SDK)
- SdkConfigViewModel: configBundle reads, setConfig/setOwner writes,
  loadChannels() via admin, Gap G workaround (local override map)
- SdkTelemetryViewModel: TelemetryApi.observe(NodeId), requestDeviceMetrics

Service lifecycle:
- SdkClientLifecycle interface in core:service (avoids reverse dep from
  service → app); RadioClientProvider implements it
- MeshService.onDestroy: calls sdkClientLifecycle.disconnect() before
  serviceJob.cancel()
- BlePeripheralFactory.kt in core:ble: public buildPeripheralForAddress()
  wrapper (Gap F workaround; proper fix needed in SDK transport-ble)

SDK gaps discovered and logged:
  Gap B - textMessages flow (FIXED in SDK feat/meshtastic-android-integration-gaps)
  Gap C - channels StateFlow (no reactive cache, only admin.listChannels())
  Gap F - BleTransport MAC string factory (requires live Peripheral today)
  Gap G - configBundle not refreshed after editSettings writes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
3c75510f01 fix(mqtt): harden TLS enforcement, add user CA trust, and improve error diagnostics (#5365)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 12:09:49 -05:00
James Rich
2de57a9e81 feat: align theme with Design Standards v1.3, remove contrast setting (#5355)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-04 16:10:06 -05:00
James Rich
82926fd734 feat: event firmware easter egg with ambient branding (#5354)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-04 19:37:47 +00:00
James Rich
1c984d54f4 chore: Integrate MQTT logging with Kermit and enhance PII sanitization (#5338) 2026-05-02 18:53:19 +00:00
James Rich
e198f52de5 refactor(coroutines): migrate to kotlinx-coroutines 1.11.0-rc02 (#5312)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-01 03:11:22 +00:00
James Rich
2822290908 refactor(build): build-logic cleanup, CC safety, and detekt 2.0 upgrade (#5311) 2026-05-01 02:48:37 +00:00
James Rich
08c3f676be chore: Scheduled updates (Firmware, Hardware, Translations, Graphs, Licenses) (#5306)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2026-04-30 12:47:03 +00:00
James Rich
e8f8e14984 fix: persist language switching and correctly map locales (#5287) 2026-04-29 14:59:10 +00:00
James Rich
e0c1934d96 fix: Resolve top Crashlytics issues for 29320633 beta release (#5278) 2026-04-29 11:13:52 +00:00
Michael Riddle
5483f4a6e8 feat(auto): enable Android Auto messaging notifications (#5265) 2026-04-28 02:37:22 +00:00
James Rich
247f342210 chore: project-wide cruft cleanup and dead code removal (#5249)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-04-27 16:09:37 +00:00
James Rich
2c001c47d1 fix(desktop): unbreak release builds (CMP beta03 + pwsh -P quoting) (#5230)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 06:22:31 -05:00
James Rich
0b873be228 fix(ble): unblock reconnect + kable audit (logging, priority, backoff, StateFlow) (#5222)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-22 18:35:22 -05:00
James Rich
228d872f9d feat(connections): unified device list, ACCESS_LOCAL_NETWORK, transport filter chips (#5219)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-22 19:34:22 +00:00
James Rich
ba559549ba refactor: eliminate Accompanist permissions library (#5211)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-22 11:04:57 -05:00
James Rich
2b14467de3 fix(fdroid): prevent NotImplementedError crash on firmware release fetch (#5197)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-21 01:02:07 +00:00
James Rich
f21d8af9ae fix(transport): improve BLE / TCP / USB reconnect and handshake resilience (#5196)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-20 17:34:16 +00:00
James Rich
cdeb1ac532 fix: redact MeshLog proto secrets and centralize Compose keep-rules (#5166)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-17 16:20:50 +00:00
James Rich
17e69c6d4c chore: review-cleanup fleet (audit + fix + hardening) (#5158) 2026-04-17 00:02:59 +00:00
James Rich
a580cd0467 chore(analytics): disable Datadog Compose action tracking (#5153)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-15 23:09:21 +00:00
James Rich
8e5d99410c refactor(di): adopt @KoinApplication with startKoin<T>() compiler plugin API (#5152)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-15 22:52:59 +00:00
James Rich
9ac02cf851 fix(app): disable R8 optimization to fix Compose animation freeze (#5150)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-15 17:45:27 +00:00
James Rich
dea364dd17 fix(app): add R8 keep rules for Compose animation/runtime/ui (#5146)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-15 14:30:33 +00:00
James Rich
60ff495037 chore(r8): clean up ProGuard rules and enable Compose Hot Reload (#5139)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-15 03:26:39 +00:00
James Rich
72b981f73b chore: KMP audit — commonize code, centralize utilities, eliminate dead abstractions (#5133)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-15 02:17:50 +00:00
James Rich
79ed0a865a chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5128)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2026-04-15 01:14:38 +00:00
James Rich
fa63a4ac50 feat: add high-contrast theme with accessible message bubbles (#5135)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-15 01:14:20 +00:00
James Rich
9acdf5309f refactor: modern APIs — Koin 4.2, CMP 1.11, Ktor resilience, Room @Upsert, injected dispatchers (#5119) 2026-04-14 11:41:01 +00:00
James Rich
28be6933c8 fix(proguard): disable shrinking for Compose animation classes (#5116) 2026-04-13 21:55:52 +00:00
James Rich
b13f9bf989 fix(resources): add resourcePrefix to KMP + widget modules, rename prefixed resources (#5111) 2026-04-13 18:25:23 +00:00
James Rich
087fbbfb45 fix(build): overhaul R8 rules and DRY up build-logic conventions (#5109) 2026-04-13 17:11:42 +00:00
James Rich
048c74db13 chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5105)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2026-04-13 12:37:53 +00:00
James Rich
b0c603c7ed fix(build): align AndroidX Compose versions with CMP and migrate to runComposeUiTest (#5096) 2026-04-13 02:49:11 +00:00
James Rich
e424d4d076 fix(build): add explicit compose-multiplatform-animation dependency (#5095) 2026-04-12 22:36:37 +00:00
James Rich
a11dee42a7 test: migrate Compose UI tests from androidTest to commonTest (#5091) 2026-04-12 20:20:00 +00:00
James Rich
7ca7179197 build: migrate Compose dependencies to Compose Multiplatform (#5084) 2026-04-12 14:45:11 +00:00
James Rich
19502cd1e0 chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5078) 2026-04-12 01:48:42 +00:00
James Rich
62264b10c6 refactor(model): remove ConnectionState helper methods and fix updateStatusNotification return type (#5074) 2026-04-11 23:41:34 +00:00
James Rich
a3c0a4832d fix(transport): Kable BLE audit + thread-safety, MQTT, and logging fixes across transport layers (#5071) 2026-04-11 22:56:29 +00:00