Commit Graph

855 Commits

Author SHA1 Message Date
James Rich 431f0d77bf fix: resolve CI lint failures (spotless + detekt)
- spotlessApply across core:repository, core:service, core:ui
- Android LockdownPassphraseStoreImpl: inline requirePrefs() body
  (FunctionSignature)
- JVM LockdownPassphraseStoreImpl: suppress ReturnCount on deserialize()
2026-05-13 16:50:03 -05:00
James Rich 1d24b38746 fix: sync spec docs and add edge-case coordinator tests
Spec docs:
- lockdown-ui.md: TTL fields now shown in unlock mode, not just provision
- data-model.md: note Lazy<MeshConnectionManager> in relationships
- plan.md: correct module :core:datastore -> :core:service

Tests (2 new):
- NEEDS_PROVISION after lockNow does not trigger LockNowAcknowledged
- UNLOCKED with no deviceAddress skips save but still authorizes
2026-05-13 12:50:30 -05:00
James Rich d3324b1b12 fix: use positional format specifiers and show TTL fields in unlock mode
Compose Multiplatform stringResource requires positional specifiers
(%1$s, %1$d) — plain %s/%d renders literal format tokens.

Boot TTL and Hour TTL fields are now shown for both provision and
unlock, matching the original implementation. Confirm passphrase
field remains provisioning-only.
2026-05-13 12:44:22 -05:00
James Rich 2b1ccd653a fix: break Koin circular dependency with Lazy<MeshConnectionManager>
MeshConnectionManagerImpl and LockdownCoordinatorImpl constructor-inject
each other, causing a StackOverflowError at Koin resolution time.

The coordinator only needs MeshConnectionManager in two rare paths
(lock-now-ack and post-unlock config reload), so defer its resolution
with Lazy<T> — matching the existing Lazy<MeshRouter> pattern in
FromRadioPacketHandlerImpl.
2026-05-13 12:19:22 -05:00
James Rich 2a1734d932 fix: finish lockdown review follow-ups
Address remaining review items, add integration and JVM store tests,
and sync the lockdown spec docs with the implemented API and UI.
2026-05-13 11:59:56 -05:00
James Rich e1e678e374 feat(lockdown): implement encrypted JVM passphrase store
Replace no-op stub with PKCS12 KeyStore + AES-256-GCM file-backed
store at ~/.meshtastic/lockdown/. Passphrases now persist across
Desktop sessions with same error resilience as Android impl.
2026-05-13 11:02:28 -05:00
James Rich 7beb639761 feat: implement lockdown mode authentication
- Add LockdownCoordinator state machine with auto-replay, lock-now,
  and error-resilient passphrase store calls
- Add EncryptedSharedPreferences-backed Android passphrase store
  with nullable fallback on crypto init failure
- Add LockdownDialog (provision/unlock/backoff) with byte-length
  passphrase validation and string resources
- Add LockdownSessionStatus composable for token info display
- Gate region-unset banner on sessionAuthorized in ConnectionsScreen
- Wire Lock Now button in SecurityConfigScreen
- Add LockdownCoordinatorImplTest covering all state transitions,
  auto-replay, lock-now, error paths, and uint32 overflow
- Add FakeLockdownCoordinator and update test fakes
- Delete unused LockdownUnlockDialog.kt
2026-05-13 10:49:50 -05:00
James Rich d3ae49781b refactor(lockdown): extract interfaces and move coordinator to commonMain
Phase 2 foundational refactor:
- T006: Extract LockdownPassphraseStore interface to core/repository
- T007: Make concrete Android impl implement the interface (renamed to Impl)
- T008: Add JVM/Desktop no-op passphrase store stub
- T010: Move coordinator state machine from core/service/androidMain to
  core/data/commonMain as LockdownCoordinatorImpl (pure KMP, no Android deps)
- Remove old LockdownHandlerImpl (superseded)
- Convert KoinComponent lazy inject to constructor injection
2026-05-13 09:09:15 -05:00
James Rich d25136f83e fix: resolve compile errors from PR merge
- Replace java.text.DateFormat/java.util.Date usage in SecurityConfigScreen
  (constitution violation: no java.* in commonMain) with simplified Lock Now button
- Replace material.icons imports with MeshtasticIcons in LockdownUnlockDialog
- Proper token info display to be re-implemented in Phase 5 (T025-T026)
2026-05-13 09:03:11 -05:00
James Rich c9c416ee1c Merge branch 'features/lockdown-v2' of https://github.com/meshtastic/Meshtastic-Android into feat/lockdown-mode
# Conflicts:
#	app/src/main/kotlin/org/meshtastic/app/ui/Main.kt
#	core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/CommandSenderImpl.kt
#	core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/FromRadioPacketHandlerImpl.kt
#	core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/MeshActionHandlerImpl.kt
#	core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/MeshConnectionManagerImpl.kt
#	core/repository/src/commonMain/kotlin/org/meshtastic/core/repository/MeshConnectionManager.kt
#	feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/ConnectionsScreen.kt
#	feature/settings/src/commonMain/kotlin/org/meshtastic/feature/settings/radio/RadioConfigViewModel.kt
2026-05-13 08:54:22 -05:00
niccellular 0c8e5302e4 feat(lockdown): wire AIDL, RadioController, and ViewModels
- IMeshService: sendLockdownUnlock(passphrase, bootTtl, hourTtl) and
  sendLockNow() AIDL methods.
- MeshService: AIDL stubs forwarding to MeshActionHandler.
- AndroidRadioControllerImpl: forward to meshService over AIDL.
- DirectRadioControllerImpl: forward directly to actionHandler (in-process
  non-Android targets).
- FakeIMeshService: test stubs.
- UIViewModel: lockdownState/lockdownTokenInfo flows, sendLockdownUnlock,
  sendLockNow, clearLockdownState. Routed through radioController so the
  commonMain code does not depend on the AIDL service directly.
- ConnectionsViewModel: expose lockdownState.
- RadioConfigViewModel: lockdownTokenInfo + sendLockNow for the Lock Now
  button in security settings.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 09:01:03 -04:00
niccellular f6e97d7ff7 feat(lockdown): implement coordinator and typed status dispatch
- CommandSenderImpl: build AdminMessage.lockdown_auth = LockdownAuth(...)
  for provision/unlock and lock_now=true for the lock command.
- FromRadioPacketHandlerImpl: route the new FromRadio.lockdown_status
  variant to the coordinator; also notify the coordinator on
  config_complete_id.
- MeshActionHandlerImpl: forward handleSendLockdownUnlock/handleSendLockNow
  to the coordinator.
- MeshConnectionManagerImpl: call coordinator.onConnect/onDisconnect; add
  clearRadioConfig to purge cached config after a lock-now ACK.
- ServiceRepositoryImpl: back the lockdownState/lockdownTokenInfo/
  sessionAuthorized flows.
- LockdownHandlerImpl: orchestration. Switches on LockdownStatus.State
  (NEEDS_PROVISION / LOCKED / UNLOCKED / UNLOCK_FAILED), auto-replays
  stored passphrase on LOCKED, clears stored passphrase on a fresh
  UNLOCK_FAILED, surfaces backoff_seconds on rate-limit. Tracks a
  wasLockNow flag locally so the next LOCKED status after a lock-now
  command is translated to LockdownState.LockNowAcknowledged for an
  immediate UI disconnect (the new schema has no explicit ACK type).
- LockdownPassphraseStore: per-device EncryptedSharedPreferences store
  for auto-unlock. Not biometric-gated by design.
- Add androidx.security:security-crypto dependency.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 09:00:53 -04:00
niccellular 913c3c2ad1 feat(lockdown): add LockdownState model and coordinator interfaces
Introduce the TAK passphrase lockdown abstractions:

- LockdownState sealed class + LockdownTokenInfo for UI to observe.
- LockdownCoordinator interface for the authentication lifecycle
  (onConnect/onDisconnect/onConfigComplete/handleLockdownStatus,
  plus submitPassphrase/lockNow).
- Add sendLockdownPassphrase/sendLockNow to CommandSender, RadioController.
- Add handleSendLockdownUnlock/handleSendLockNow to MeshActionHandler.
- Add clearRadioConfig to MeshConnectionManager (used during lock-now).
- Add lockdownState/lockdownTokenInfo/sessionAuthorized flows to
  ServiceRepository.

handleLockdownStatus consumes the typed firmware LockdownStatus message
from FromRadio (protobufs#911) instead of parsing string-prefixed
ClientNotification messages.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 09:00:41 -04:00
James Rich dcb147163c fix: clarify position precision as ± radius (#5428) 2026-05-12 10:24:29 -05:00
renovate[bot] 05b1ea918e chore(deps): update core/proto/src/main/proto digest to 1c62540 (#5421)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-12 08:25:55 -05:00
James Rich 0f2b1c064a fix: clamp future lastHeard timestamps to current time on ingestion (#5418)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-12 07:35:11 -05:00
James Rich 09a0d123be chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5416)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2026-05-12 06:21:59 -05:00
renovate[bot] 56077db6d9 chore(deps): update core/proto/src/main/proto digest to 1c62540 (#5413)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-12 06:20:48 -05:00
James Rich 85c840de32 feat: add Compose Preview Screenshot Testing infrastructure (#5410)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-12 02:18:23 +00:00
James Rich 10c5b5db2e feat(api): add hasAnyEntries method to local data sources and improve… (#5406) 2026-05-11 19:34:41 -05:00
James Rich 82135df865 Update notification intents and deep link URI format (#5408)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 19:34:24 -05:00
renovate[bot] d847818487 chore(deps): update core/proto/src/main/proto digest to 1c62540 (#5404)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-11 17:31:01 -05:00
James Rich 313dc1c2f7 chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5400) 2026-05-11 17:28:06 -05:00
James Rich 95c3bc0bce Brownfield gap remediation: 28 tasks + intro commonMain migration (#5401)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 20:10:23 +00:00
renovate[bot] f89fdaf99d chore(deps): update core/proto/src/main/proto digest to b302d92 (#5398)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-11 10:48:40 -05:00
Austin 484518195e Gradle: Add flatpakGradleGenerator task (#5369) 2026-05-11 14:44:29 +00:00
renovate[bot] 2d5bcc1e50 chore(deps): update core/proto/src/main/proto digest to 03eb534 (#5397)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-11 12:50:08 +00:00
James Rich 443de4a34d chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5383)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2026-05-10 05:57:23 -05:00
James Rich 924f8a507b chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5378)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2026-05-07 07:34:30 -05:00
James Rich 213c380514 refactor(firmware): replace PlatformBackHandler with NavigationBackHandler (#5376)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 20:01:40 +00: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 3e55579250 chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5357)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2026-05-06 12:02:01 -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 78ff3f599c chore(ble): don't surface ui message when canceling scope (#5352) 2026-05-04 17:23:57 +00:00
James Rich fa3437b147 chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5349)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2026-05-04 11:45:11 -05:00
James Rich 26c50258da chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5347)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2026-05-04 11:30:59 -05:00
James Rich f1423e4ee2 chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5339)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2026-05-03 14:51:57 -05: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 9e396cdecc chore: optimize AI agent context and implement CI cost controls (#5335)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-02 13:19:11 -05:00
James Rich c0b0b9edd4 fix(network): resolve empty MQTT address and enforce TLS on default server (#5333)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-02 14:59:44 +00:00
James Rich 5a95201b4e fix(connections): improve BLE scan reliability and UI lifecycle (#5329) 2026-05-02 14:25:40 +00:00
Andrew Smith 2914bc6ff6 Change default ContrastLevel from STANDARD to MEDIUM (#5325)
Co-authored-by: James Rich <james.a.rich@gmail.com>
2026-05-02 06:29:47 -05:00
James Rich 400e0404f6 fix(data): default new-node notifications off for event firmware (#5323) 2026-05-02 02:02:30 +00:00
James Rich 68a1c578a7 fix: add explicit DI binds and ensure scans start after DataStore load (#5319) 2026-05-01 15:39:40 +00:00
renovate[bot] 70a26f0def chore(deps): update core/proto/src/main/proto digest to 1d6f1a7 (#5309)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-01 11:37:29 +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 9d64dd697e chore: Scheduled updates (Firmware, Hardware, Translations, Graphs, Licenses) (#5298) 2026-04-29 14:02:03 -05:00
James Rich 7f578906fa revert: replace extra newline on traceroute route strings
fix translations?
2026-04-29 13:48:26 -05:00