E4 Android 双通道:BLE + 网络中继并行(BR-1.1/1.3,队伍码不上网) - #12
Merged
Merged
Conversation
Android now runs the network relay alongside BLE, closing the convoy distance gap on the Android side. Design keeps the team code off the wire entirely: - MeshBus.send() computes the ciphertext once, then sends the full [kind|teamLen|team|cipher] frame over BLE AND relays just roomId(team)+kind+base64(cipher) over the network — team plaintext never leaves the device (BR-1.2) - Receive path is shared: dispatchSealed() decrypts with the local team and drops on MAC failure, so a wrong-room hash collision from the network is discarded exactly like a wrong-team BLE frame - NetTransport.kt (OkHttp WebSocket): relay-join with roomId+token, exponential-backoff reconnect, silent degradation — relayUrl empty means bluetooth-only, behaviourally identical to today (BR-1.4). Now uses the previously-dead INTERNET permission (resolves KI-10) - BR-1.3 dedup is free: business layer is already idempotent (chat/ voice by mid, position overwrites by device, acks are a Set), so a frame arriving via both channels is harmless — documented, no extra dedup layer - cloudCount tracked separately from BLE peerCount (BR-1.5 data; visible UI wiring is the remaining Android piece) MeshCrypto.roomId added for parity with meshcrypto.mjs. Fixture at 57 assertions: adds Android roomId salt drift check and a NetTransport 'ciphertext-only' shape check. iOS network channel deferred pending decision D-2 (long-poll HTTPS vs hand-rolled WebSocket — iOS 12 has no URLSessionWebSocketTask). ③ G-NET-1 marked in-progress.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
E4 客户端 Android 侧——跟车"超 BLE 距离即失效"(G-NET-1)在 Android 上闭环。
内容
MeshBus.send()只算一次密文,BLE 发完整信封帧、网络只发roomId(team)+kind+base64(密文)——队伍码明文绝不出设备(BR-1.2)dispatchSealed():用本机队伍码解密、MAC 不过即丢,网络侧房间哈希碰撞被自然丢弃NetTransport.kt(OkHttp WebSocket):relay-join 带 roomId+token、指数退避重连、静默降级;relayUrl空 = 纯蓝牙(BR-1.4,等同今日行为)。用上了此前从未使用的INTERNET权限(解决 KI-10)cloudCount与 BLEpeerCount分开跟踪(BR-1.5 数据层)MeshCrypto.roomId与 meshcrypto.mjs 对齐验证
mesh-fixture#16:57 项断言全绿(新增 Android roomId 域分离防漂移、NetTransport 只上传密文形状检查)android-native-build#19:含 OkHttp 依赖编译通过并出 APK未完(诚实边界)
🤖 Generated with Claude Code
https://claude.ai/code/session_01YSg1v3QaS7AYLHz4pfS3zh
Generated by Claude Code