-
Notifications
You must be signed in to change notification settings - Fork 8
Dadb Integration Boundary
Last updated: 2026-07-22
Screen Remote uses the local dadb 2.0.0 included build through includeBuild("../external/dadb") in Screen-Remote/settings.gradle.kts. Dependency substitution maps:
-
dev.mobile:dadbtoexternal/dadb/dadb -
dev.mobile:dadb-androidtoexternal/dadb/dadb-android
external/dadb is a separate Git worktree and upstream capability boundary, not a general directory for app-specific ADB utilities.
| Subproject | Ownership |
|---|---|
dadb |
General JVM ADB protocol, messages, streams, shell/sync, install/uninstall, forward/reverse, and transport abstractions. |
dadb-android |
Android runtime wrapper, USB Host transport, STLS/TLS, Wireless Debugging pairing, mDNS discovery, certificates/storage, and Android-specific error mapping. |
dadb-helper |
Device-side helper; its JAR is built and synchronized into app assets by the main build. |
-
ScreenRemoteAppchooses the app-private runtime root and initializesAdbRuntimeProviderat startup. -
AdbRuntimeProviderowns one initializedAdbRuntimeand does not expose new global connection policy to UI. -
infrastructure/adbconnects dadb transport, pairing, USB, and mDNS primitives to the app's session and connection lifecycle. -
featurecalls scenario-level app APIs and does not reimplement ADB protocol or transports inside Compose pages.
- Ordinary TCP ADB transport.
- Android USB Host transport and ADB connection after USB permission.
- STLS/TLS transport upgrade and Wireless Debugging pairing-code flow.
-
_adb-tls-pairing._tcpand_adb-tls-connect._tcpmDNS discovery with continuousStateFlowstate. - ADB identity, TLS storage, and runtime files under an app-private root.
-
DadbSessionrouting: a logical network session owns a compatibility-first primary connection plus one shared/retryable delayed-ACK streaming connection; exclusive USB maps both routes to one transport. - Explicit operation results such as
SyncResult,InstallResult, andUninstallResult; the app must not treat failure as success.
These capabilities have current implementation evidence in both the library and app. One-off upstream commit-comparison records from the old page are intentionally not retained.
The app uses ConnectionCandidate to distinguish transports and generate ADB transport serials:
| Transport | Identity form |
|---|---|
| USB | usb:<serial> |
| TCP |
tcp:<host>:<port>, with normalized IPv6 host/port representation. |
| mDNS | mdns:<service-name> |
A transport serial identifies a connection entry, not a merged physical device. USB, TCP, and mDNS remain different candidate routes even when they reach the same device. mDNS retains the service name and does not replace persistent identity with the resolved ip:port.
- dadb maps transport failures to explicit ADB/TLS/USB error types or operation results.
- The app owns session policy, connection candidates, reconnection, runtime state, and UI feedback.
- dadb provides transports and protocol primitives; it does not replace the Screen Remote session state machine.
- Changes at the dadb/app boundary must review cancellation, socket/stream cleanup,
delayed_ack, TLS upgrade, and error classification together.
A dadb upgrade is more than a version-number change. At minimum:
- Review API and protocol changes across
dadb,dadb-android, and the helper. - Verify every main-app consumer of
SyncResult, install, and uninstall results. - Run dadb JVM/Android tests, including
DadbSessionTest, plus focused app tests for ADB, USB, mDNS, connections, and scrcpy socket order. - Run the app's
testDebugUnitTestandassembleDebug. - Validate connection, cancellation, and reconnection on real devices for affected transports.
The app and external/dadb continue to manage status, commits, and pushes independently.
- Overview / 总览
- Quick Start / 快速开始
- Connection & Pairing / 连接设备与配对
- Session Management / 会话管理
- Remote Control / 远程控制
- Settings / 设置
- Management Features / 管理功能
- FAQ / 常见问题
- Overview / 总览
- Technical Index / 技术文档索引
- Audit Checklist / 初始化与更新清单
- Conventions / 文档维护约定
- Architecture / 架构
- Module Map / 模块地图与边界
- Runtime Path / 运行时主链路
- Session State / 会话状态与事件
- Session Lifecycle / 会话配置与连接生命周期
- ADB, USB & Wireless / ADB、USB 与无线
- ADB Lifecycle / ADB 连接生命周期
- Pairing / 设备配对与无线调试
- Codecs / 编码与解码
- Remote Interaction / 远程交互性能与悬浮菜单
- Clipboard / 剪贴板同步
- Management / 管理功能
- Events & Shell / 事件、监控与 Shell
- Logging / 日志系统与维护
- Troubleshooting / 分层排障方法
- UI Design / UI 设计系统
- Bilingual Copy / 双语与文案
- Remote UI Analysis / 远程 UI 布局分析
- Engineering Rules / 工程与验证规则
- External Research / 外部研究与取舍
Technical topics appear here only after their page-level audit is complete. / 技术主题仅在完成逐页审核后加入侧边栏。