feat(lockdown): firmware lockdown mode (provision / unlock / lock-now)#5939
Conversation
Re-applies the lockdown feature onto main (which absorbed release/2.8.0 +146 commits: takpacket 0.7.0 full-KMP, traffic-mgmt removal #5878, RECONNECTING progress, MeshConnectionManager test refactor, etc.). Replaces the stale lockdown-integ branch (built on the old release/2.8.0 line). Applied as a 3-way patch of the prior re-port; 7 integration points re-resolved against main's evolution: - ConnectionsViewModel/Test: main keeps serviceRepository (no ConnectionStateProvider split) — just graft lockdownState/sessionAuthorized onto it. - ServiceRepository: keep both main's RECONNECTING_PROGRESS_TEXT companion and the lockdown flows. - ConnectionsScreen: region banner gated on sessionAuthorized AND main's REPLAY_DEVICE_PREFIX. - MeshConnectionManagerImpl: keep main's handshakeCompleteLatch reset + lockdownCoordinator.onConnect(). - MeshConnectionManagerImplTest: adopt main's lateinit/setUp pattern + lockdownCoordinator fake. proto pinned to v2.7.26-497cd88-SNAPSHOT (RB snapshot, #959) for #916/#929 + TINY presets. takpacket-sdk 0.7.0 (KMP) no longer supplies a conflicting transitive protobufs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📄 Docs staleness check — advisoryThis PR modifies user-facing UI source files but does not update any page under
Changed source files: What to check:
New page checklist (if adding a new doc page):
If this PR does not require a doc update (e.g., internal refactor, bug fix, test change), add the
|
🖼️ Preview staleness check — advisoryThis PR modifies UI composables but does not update any
Changed UI files: What to check:
Adding previews checklist:
If this PR does not require preview updates (e.g., logic-only change, non-visual refactor), add the |
takpacket-sdk 0.7.0 still declares protobufs-jvm:2.7.25 (runtime); it out-ranked the app's v2.7.26 snapshot pin on the host-test classpath -> proto-ctor NoSuchMethodError in JVM/host tests. Exclude it so the app's single protobufs version is authoritative. Verified: full suite incl. :core:takserver green. Drop when takpacket stops exporting protobufs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts: # core/data/src/commonTest/kotlin/org/meshtastic/core/data/manager/FromRadioPacketHandlerImplTest.kt
…ondition The region-warning guard hit 5 && conditions (max 4) after unioning the lockdown sessionAuthorized gate with main's REPLAY_DEVICE_PREFIX check. Fold the two device-prefix checks into a named val. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Why
Adds end-to-end client support for the firmware's hardened LOCKDOWN build: a locked device prompts for a passphrase, optionally auto-replays a stored one, surfaces backoff/lock-reason, and offers Lock Now. Supersedes #5439, which was built on the pre-AIDL architecture and went stale after
release/2.8.0ff-merged ontomain. This branch re-applies the same feature, re-resolved against currentmain(post-AIDLCommandSender/coordinator, takpacket 0.7.0, traffic-mgmt removal, etc.).🌟 Features
LockdownCoordinatorowns the lockdown lifecycle: processesLockdownStatusfrom firmware, drivesLockdownState(None/NeedsProvision/Locked/Unlocked/UnlockFailed/UnlockBackoff/Disabled/LockNowAcknowledged), auto-replays cached passphrases.EncryptedSharedPreferences(AES-256-GCM); JVM/Desktop PKCS12 + AES-256-GCM.LockdownDialog(provision/unlock/backoff) +LockdownSessionStatus, wired throughUIViewModel/RadioConfigViewModel→LockdownCoordinator. Region-unset banner gated onsessionAuthorized.🛠️ Integration onto current
mainAdminMessage(lockdown_auth=…)and dispatches viaPacketHandler.sendToRadioto self (channel 0, ADMIN_APP, RELIABLE) — the firmware-bootstrap path (pre-session, no passkey).FromRadio.lockdown_status→ coordinator;config_complete→coordinator.onConfigComplete(); connect/disconnect →coordinator.onConnect()/onDisconnect().v2.7.26-497cd88-SNAPSHOT(RB snapshot, protobufs UI update, enhancements #959) formax_session_seconds(#916),disable/State.DISABLED(chore(deps): update gradle to v8.7 #929), and theTINY_FAST/TINY_SLOWModemPreset additions.🧹 Dependency hygiene
core:modelexcludestakpacket-sdk's transitiveprotobufs-jvm:2.7.25so the app's single pinned protobufs is authoritative on every classpath. Without it, the older transitive pin out-ranked the snapshot on the host-test classpath and broke proto ABI (NoSuchMethodError). Drop oncetakpacket-sdkstops exporting protobufs.Testing Performed
./gradlew assembleFdroidDebug— SUCCESS againstv2.7.26-497cd88-SNAPSHOT.:core:data,:core:takserver(123 tests incl.TAKMeshIntegrationTest/TAKPacket.ADAPTER),:core:service,:core:ui,:feature:settings,:feature:connections— zero protoNoSuchMethodError; takpacket 0.7.0 runs cleanly against v2.7.26.Before merge
v2.7.26-497cd88-SNAPSHOTpin for a tagged protobufs release once one ships with #916/chore(deps): update gradle to v8.7 #929 (reproducible builds), and drop the takpacket exclude oncetakpacket-sdkno longer exports protobufs.🤖 Generated with Claude Code