deepadb 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +53 -19
  2. package/build/bridge/local-bridge.d.ts +40 -1
  3. package/build/bridge/local-bridge.d.ts.map +1 -1
  4. package/build/bridge/local-bridge.js +155 -5
  5. package/build/bridge/local-bridge.js.map +1 -1
  6. package/build/index.js +2 -1
  7. package/build/index.js.map +1 -1
  8. package/build/middleware/auth.d.ts +10 -0
  9. package/build/middleware/auth.d.ts.map +1 -1
  10. package/build/middleware/auth.js +48 -0
  11. package/build/middleware/auth.js.map +1 -1
  12. package/build/middleware/ui-dump.d.ts +21 -0
  13. package/build/middleware/ui-dump.d.ts.map +1 -1
  14. package/build/middleware/ui-dump.js +38 -0
  15. package/build/middleware/ui-dump.js.map +1 -1
  16. package/build/server.d.ts.map +1 -1
  17. package/build/server.js +6 -2
  18. package/build/server.js.map +1 -1
  19. package/build/tools/at-commands.d.ts.map +1 -1
  20. package/build/tools/at-commands.js +192 -0
  21. package/build/tools/at-commands.js.map +1 -1
  22. package/build/tools/diagnostics.d.ts +2 -2
  23. package/build/tools/diagnostics.d.ts.map +1 -1
  24. package/build/tools/diagnostics.js +86 -3
  25. package/build/tools/diagnostics.js.map +1 -1
  26. package/build/tools/firmware-analysis.d.ts.map +1 -1
  27. package/build/tools/firmware-analysis.js +24 -0
  28. package/build/tools/firmware-analysis.js.map +1 -1
  29. package/build/tools/input-gestures.d.ts +11 -0
  30. package/build/tools/input-gestures.d.ts.map +1 -0
  31. package/build/tools/input-gestures.js +766 -0
  32. package/build/tools/input-gestures.js.map +1 -0
  33. package/build/tools/multi-device.d.ts.map +1 -1
  34. package/build/tools/multi-device.js +186 -0
  35. package/build/tools/multi-device.js.map +1 -1
  36. package/build/tools/qemu.d.ts.map +1 -1
  37. package/build/tools/qemu.js +246 -2
  38. package/build/tools/qemu.js.map +1 -1
  39. package/build/tools/ui.js +2 -48
  40. package/build/tools/ui.js.map +1 -1
  41. package/build/tools/wireless-firmware.d.ts +16 -0
  42. package/build/tools/wireless-firmware.d.ts.map +1 -0
  43. package/build/tools/wireless-firmware.js +566 -0
  44. package/build/tools/wireless-firmware.js.map +1 -0
  45. package/package.json +3 -3
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  MCP (Model Context Protocol) server providing full Android Debug Bridge (ADB) integration with Claude. Enables Claude to directly interact with connected Android devices — inspecting state, running commands, managing apps, capturing logs, controlling device settings, analyzing UI hierarchies, recording screens, managing emulators, running structured test sessions, orchestrating multi-device operations, capturing network traffic, running CI pipelines, auditing accessibility, detecting performance regressions, executing cloud device farm tests, debugging over WiFi, building projects, and managing community plugins.
4
4
 
5
- **147 tools, 4 resources, and 4 prompts across 41 modules** — the most comprehensive ADB MCP server available, with triple transport (stdio + HTTP/SSE + WebSocket), optional GraphQL API, defense-in-depth security, modem firmware analysis, workflow marketplace, AT command interface with multi-chipset support, RIL message interception, device profiling, baseband/modem integration, automated test generation, OTA update monitoring, SELinux auditing, thermal/power profiling, network device discovery, visual regression detection, workflow orchestration, accessibility auditing, and contextual truncation.
5
+ **174 tools, 4 resources, and 4 prompts across 43 modules** — the most comprehensive ADB MCP server available, with triple transport (stdio + HTTP/SSE + WebSocket), optional GraphQL API, defense-in-depth security, modem firmware analysis, workflow marketplace, AT command interface with multi-chipset support, RIL message interception, device profiling, baseband/modem integration, automated test generation, OTA update monitoring, SELinux auditing, thermal/power profiling, network device discovery, visual regression detection, workflow orchestration, accessibility auditing, and contextual truncation.
6
6
 
7
7
  ## Architecture
8
8
 
@@ -78,15 +78,15 @@ DeepADB operates in two modes, auto-detected at startup:
78
78
  ```
79
79
  AI Agent (PC) ←→ MCP ←→ DeepADB (PC) ←→ ADB (USB) ←→ Android Device
80
80
  ```
81
- Standard mode: DeepADB runs on a PC/Mac/Linux host and communicates with the device over USB via ADB. All 147 tools work through the ADB bridge with automatic retry on transient failures.
81
+ Standard mode: DeepADB runs on a PC/Mac/Linux host and communicates with the device over USB via ADB. All 174 tools work through the ADB bridge with automatic retry on transient failures.
82
82
 
83
83
  ### On-Device Mode — direct local execution
84
84
  ```
85
85
  AI Agent (Termux) ←→ MCP (stdio/HTTP) ←→ DeepADB (Termux) ←→ sh/su (local)
86
86
  ```
87
- When DeepADB runs directly on the Android device (e.g., inside Termux), it auto-detects the environment and switches to `LocalBridge`. Commands execute directly via `sh`/`su` — no ADB server, no USB, no serialization overhead. All 147 tools work identically, with significantly lower latency.
87
+ When DeepADB runs directly on the Android device (e.g., inside Termux), it auto-detects the environment and switches to `LocalBridge`. Commands execute directly via `sh`/`su` — no ADB server, no USB, no serialization overhead. All 174 tools work identically, with significantly lower latency.
88
88
 
89
- **Validated on hardware:** 203/203 tests pass on-device (Pixel 6a, Android 16, Termux + Magisk + QEMU 10.2.1). Includes 20 QEMU/KVM virtualization tests covering setup detection, disk image lifecycle, resource budget reporting, Alpine Linux VM boot with KVM acceleration, big.LITTLE CPU topology detection, and clean VM shutdown. QEMU tests auto-skip in ADB mode (183 passed, 4 skipped).
89
+ **Validated on hardware:** 235/235 tests pass on-device (Pixel 6a, Android 16, Termux + Magisk + QEMU 10.2.1). Includes 27 QEMU/KVM virtualization tests covering setup detection, disk image lifecycle, resource budget reporting, Alpine Linux VM boot with KVM acceleration, big.LITTLE CPU topology detection, guest ADB connectivity error handling, and clean VM shutdown. QEMU tests auto-skip in ADB mode (207 passed, 5 skipped).
90
90
 
91
91
  **Privilege escalation:** In ADB mode, all shell commands run as uid=2000 (the `shell` user) which has system-level permissions. In Termux, commands run as a regular app user. LocalBridge automatically elevates privileged commands through `su` when root (Magisk) is available:
92
92
  - **Command allowlist:** 16 system commands (`settings`, `dumpsys`, `am`, `input`, `screencap`, `screenrecord`, `uiautomator`, `app_process`, `getenforce`, `setenforce`, `cmd`, `pm`, `wm`, `svc`, `ip`, `ifconfig`) are routed through `su -c` to match ADB-mode behavior.
@@ -136,7 +136,7 @@ DA_GRAPHQL_PORT=4000 npm start
136
136
  }
137
137
  ```
138
138
 
139
- ## Available Tools (147)
139
+ ## Available Tools (174)
140
140
 
141
141
  ### Health (1 tool)
142
142
  - `adb_health_check` — Comprehensive toolchain validation: ADB binary, server, device connection, authorization, root access, and storage writability
@@ -179,7 +179,7 @@ DA_GRAPHQL_PORT=4000 npm start
179
179
  - `adb_logcat_stop` — Stop a watcher session (or all sessions)
180
180
  - `adb_logcat_sessions` — List all active watcher sessions with stats
181
181
 
182
- ### Diagnostics (7 tools)
182
+ ### Diagnostics (9 tools)
183
183
  - `adb_dumpsys` — Run dumpsys for any service (or list all services)
184
184
  - `adb_telephony` — Cell info, signal strength, and network registration (parallel query)
185
185
  - `adb_battery` — Battery status, level, temperature, and charging info
@@ -187,6 +187,8 @@ DA_GRAPHQL_PORT=4000 npm start
187
187
  - `adb_top` — CPU and memory usage snapshot
188
188
  - `adb_perf_snapshot` — Parallel memory, frame stats, and CPU profiling for a package
189
189
  - `adb_bugreport` — Full bug report zip capture (device state, logs, system info)
190
+ - `adb_crash_logs` — ANR traces and tombstone crash dumps from /data/anr/ and /data/tombstones/
191
+ - `adb_heap_dump` — Capture heap dump (.hprof) from a running process for memory analysis
190
192
 
191
193
  ### UI (8 tools)
192
194
  - `adb_screencap` — Take screenshot with filename sanitization, saves locally
@@ -225,22 +227,46 @@ DA_GRAPHQL_PORT=4000 npm start
225
227
  - `adb_emulator_start` — Launch an AVD with headless, cold boot, and GPU options (PC mode) or report QEMU alternative (on-device mode)
226
228
  - `adb_emulator_stop` — Gracefully shut down a running emulator
227
229
 
228
- ### QEMU/KVM Virtualization (5 tools)
230
+ ### QEMU/KVM Virtualization (8 tools)
229
231
  - `adb_qemu_setup` — Check and install QEMU for on-device virtualization. Verifies KVM, reports host CPU/RAM, installs via Termux pkg
230
232
  - `adb_qemu_images` — Manage VM disk images: list, create (qcow2/raw), delete. Path containment verification prevents traversal
231
233
  - `adb_qemu_start` — Boot a KVM-accelerated VM with dynamic resource allocation. Auto-detects optimal CPUs (total minus 1, reserving one for host) and memory (65% of physical RAM). Supports kernel/initrd/append for Android boot, ADB port forwarding
232
- - `adb_qemu_stop` — Stop a running VM (graceful SIGTERM or force SIGKILL). Reports running VMs if no name given
233
- - `adb_qemu_status` — Full status: KVM/QEMU availability, host resource budget, running VMs with PID/resources/uptime/ports, image inventory
234
+ - `adb_qemu_stop` — Stop a running VM (graceful SIGTERM or force SIGKILL). Auto-disconnects guest ADB before killing. Reports running VMs if no name given
235
+ - `adb_qemu_status` — Full status: KVM/QEMU availability, host resource budget, running VMs with PID/resources/uptime/ports/ADB connection state, image inventory
236
+ - `adb_qemu_connect` — Connect to a running VM's guest ADB service. Restricted to localhost only — port derived from running VM state, never user input. Enables multi-device tools to operate on guest VMs
237
+ - `adb_qemu_disconnect` — Disconnect from a guest VM's ADB service. Clears connection state and removes guest from device list
238
+ - `adb_qemu_guest_shell` — Execute shell commands on a guest VM via ADB. Subject to security middleware. Guest serial derived internally — no user-supplied host/IP reaches the ADB binary
234
239
 
235
240
  ### Test Sessions (3 tools)
236
241
  - `adb_test_session_start` — Start a named test session with organized output directory
237
242
  - `adb_test_step` — Capture a numbered step with screenshot and logcat into the session
238
243
  - `adb_test_session_end` — End session, write summary manifest, return directory path
239
244
 
240
- ### Multi-Device Orchestration (3 tools)
245
+ ### Multi-Device Orchestration (4 tools)
241
246
  - `adb_multi_shell` — Execute a command on all/selected devices in parallel (security-checked)
242
247
  - `adb_multi_install` — Install an APK across multiple devices simultaneously
243
248
  - `adb_multi_compare` — Run a command on all devices and highlight output differences
249
+ - `adb_multi_test` — Comparative test workflow: run predefined diagnostic profiles (firmware/security/network/identity/full) or custom command lists across all devices including QEMU guests, compare per-check, report matches and differences
250
+
251
+ ### Input Gestures & UI Automation (13 tools)
252
+ - `adb_input_drag` — Drag from point A to point B (uses `draganddrop` with swipe fallback for older Android)
253
+ - `adb_input_long_press` — Long press at coordinates with configurable hold duration
254
+ - `adb_input_double_tap` — Double tap with configurable interval between taps
255
+ - `adb_input_text` — Dedicated text input with space/special character handling
256
+ - `adb_open_url` — Open a URL on the device via VIEW intent
257
+ - `adb_orientation` — Get or set screen orientation (auto/portrait/landscape/reverse)
258
+ - `adb_clipboard` — Read or write device clipboard
259
+ - `adb_tap_element` — Find element by text/resource-id/content-description and tap its center
260
+ - `adb_wait_element` — Poll UI hierarchy until an element appears or disappears (configurable timeout/poll interval)
261
+ - `adb_wait_stable` — Poll until consecutive UI dumps match (screen stabilization after transitions)
262
+ - `adb_scroll_until` — Scroll repeatedly until a target element is found, with optional auto-tap
263
+ - `adb_screenshot_compressed` — Capture screenshot with size/quality metadata for token-efficient workflows
264
+ - `adb_batch_actions` — Execute multiple input actions (tap/swipe/long_press/double_tap/keyevent/text/drag/back/home/sleep) in a single tool call with security validation
265
+
266
+ ### Device Awareness (3 tools)
267
+ - `adb_screen_size` — Screen resolution, display density (DPI), aspect ratio, and DP width in one call
268
+ - `adb_device_state` — Combined snapshot: battery level/status/temp, network type, WiFi state, screen on/off, orientation, foreground activity
269
+ - `adb_notifications` — Parse active notifications with package, title, text, importance, channel, flags, and timestamp (filterable by package)
244
270
 
245
271
  ### Snapshot/Restore (3 tools)
246
272
  - `adb_snapshot_capture` — Save comprehensive device state (packages, settings, properties) to JSON
@@ -293,11 +319,12 @@ DA_GRAPHQL_PORT=4000 npm start
293
319
  - `adb_gradle` — Run any Gradle task in a project directory
294
320
  - `adb_build_and_install` — Build debug APK and install via ANDROID_SERIAL targeting
295
321
 
296
- ### AT Commands (4 tools)
322
+ ### AT Commands (5 tools)
297
323
  - `adb_at_detect` — Auto-detect modem AT command device node by chipset family (Shannon, Qualcomm, MediaTek, Unisoc, generic). Probes known paths and returns the first responding node
298
324
  - `adb_at_send` — Send a single AT command to the modem with response capture. Auto-detects port or accepts manual override. Dangerous command blocklist with force override
299
325
  - `adb_at_batch` — Send multiple AT commands sequentially with per-command results. Configurable inter-command delay
300
326
  - `adb_at_probe` — Run a standard diagnostic probe: modem ID, signal quality, network registration, SIM status, operator, functionality mode
327
+ - `adb_at_cross_validate` — Cross-validate baseband firmware by comparing AT command responses (ATI, AT+CGMR, AT+CGMM) against system properties. Flags discrepancies as potential firmware tampering, incomplete OTA, or property spoofing. Shannon-specific AT+DEVCONINFO support. Requires root
301
328
 
302
329
  ### Screenshot Diffing (3 tools)
303
330
  - `adb_screenshot_baseline` — Capture and save a named screenshot baseline with metadata (dimensions, SHA-256, timestamp)
@@ -345,6 +372,12 @@ DA_GRAPHQL_PORT=4000 npm start
345
372
  - `adb_firmware_diff` — Compare all firmware components (baseband, bootloader, kernel, security patch, build ID, Android version, RIL) between saved fingerprints or live device. Deep parsed diffs for baseband and bootloader when changes detected
346
373
  - `adb_firmware_history` — Track firmware progression across all saved OTA fingerprints with multi-component change detection (baseband, bootloader, kernel, security patch, build ID, Android version) and parsed baseband diffs
347
374
 
375
+ ### Wireless Firmware (4 tools)
376
+ - `adb_wifi_firmware` — WiFi chipset and firmware identification: driver version, firmware version, supported bands (2.4/5/6 GHz), WiFi standard detection (5/6/6E/7), current connection info. MAC address opt-in only
377
+ - `adb_bluetooth_firmware` — Bluetooth firmware and chipset identification: firmware version, BT version (4.0–5.4 from LMP), adapter state, LE capabilities (2M PHY, Coded PHY, extended advertising), active profiles (A2DP/HFP/HID/LE Audio), bonded device count. MAC/name opt-in only
378
+ - `adb_nfc_firmware` — NFC controller firmware: controller type (NXP/Broadcom/Samsung/ST), firmware version, supported technologies (NFC-A/B/F/V, MIFARE), secure element (eSE/UICC), HCE support
379
+ - `adb_gps_firmware` — GNSS/GPS chipset and firmware identification: hardware model (manufacturer, chip, firmware), supported constellations (GPS/GLONASS/Galileo/BeiDou/QZSS/NavIC/SBAS), signal types with frequencies, dual-frequency (L1+L5) detection, raw GNSS measurement capabilities, A-GPS modes (MSB/MSA), SUPL server configuration, carrier phase measurements
380
+
348
381
  ### Workflow Marketplace (3 tools)
349
382
  - `adb_market_search` — Search the workflow marketplace for community-shared workflow definitions with keyword and tag filtering. Shows install status
350
383
  - `adb_market_install` — Download, validate (JSON structure + SHA-256 integrity), and install a marketplace workflow for immediate use with adb_workflow_run
@@ -401,10 +434,10 @@ Background logcat watchers run as spawned processes with ring buffer accumulatio
401
434
  Full view tree capture via `uiautomator dump` with parsed XML extraction. Returns structured element data including text, resource-id, content-description, class names, bounds coordinates with tap-ready center points, and interaction flags. Pre-compiled regex attribute extraction for efficient parsing.
402
435
 
403
436
  ### Security Middleware
404
- Multi-layered security activated via `DA_SECURITY=true`. Provides command blocklist/allowlist filtering, rate limiting (commands per minute), and audit logging with automatic credential redaction. Security checks are integrated into `adb_shell`, `adb_root_shell`, `adb_multi_shell`, `adb_multi_compare`, `adb_input`, and `adb_start_activity`. Configurable via environment variables for different deployment scenarios.
437
+ Multi-layered security activated via `DA_SECURITY=true`. Provides command blocklist/allowlist filtering, rate limiting (commands per minute), and audit logging with automatic credential redaction. Security checks are integrated into `adb_shell`, `adb_root_shell`, `adb_multi_shell`, `adb_multi_compare`, `adb_input`, `adb_batch_actions`, and `adb_start_activity`. Configurable via environment variables for different deployment scenarios.
405
438
 
406
439
  ### Input Sanitization
407
- All tools that interpolate user-supplied parameters into shell command strings validate inputs against shell metacharacters before execution. Package names, property keys, service names, setting keys, test identifiers, network interface names, and tcpdump filters are all validated through a centralized `validateShellArg()` function that rejects `;`, `|`, `&`, `$`, backticks, parentheses, and other injection vectors. File paths use single-quoted shell escaping to prevent `$()` command substitution. The `adb_input` tool applies type-specific validation: `tap`/`swipe` accept only numeric coordinates, `keyevent` accepts only alphanumeric keycodes, and `text` is shell-escaped for literal delivery. Deserialized JSON from snapshot files is validated before shell interpolation. Every `z.number()` parameter across all 147 tools has explicit `.min()/.max()` Zod bounds to prevent resource exhaustion from extreme values. The LocalBridge has explicit handlers for every ADB subcommand used by tool modules, preventing unquoted fallthrough to the default shell handler. In on-device mode, privilege escalation uses a frozen 16-command allowlist and restricted-path regex — the elevation set is `ReadonlySet` + `Object.freeze`, not configurable at runtime. The HTTP/SSE transport denies cross-origin requests by default (configurable via `DA_HTTP_CORS_ORIGIN`), the plugin registry verifies SHA-256 integrity hashes and prevents path traversal via directory containment checks, and the workflow engine enforces step count (200), sleep duration (5 min), and repeat iteration (100) limits. Fetch helpers enforce a 5 MB response body limit. Getprop output parsing handles Windows `\r\n` line endings via `.trim()` before regex matching, and dual SIM slot counts are capped at 4 to prevent resource exhaustion from corrupted device properties.
440
+ All tools that interpolate user-supplied parameters into shell command strings validate inputs against shell metacharacters before execution. Package names, property keys, service names, setting keys, test identifiers, network interface names, and tcpdump filters are all validated through a centralized `validateShellArg()` function that rejects `;`, `|`, `&`, `$`, backticks, parentheses, and other injection vectors. File paths use single-quoted shell escaping to prevent `$()` command substitution. The `adb_input` tool applies type-specific validation: `tap`/`swipe` accept only numeric coordinates, `keyevent` accepts only alphanumeric keycodes, and `text` is shell-escaped for literal delivery. The `adb_batch_actions` tool enforces the same per-action-type validation (digits-only for coordinates, alphanumeric for keycodes, shell-escape for text) and routes every assembled command through the security middleware. Deserialized JSON from snapshot files is validated before shell interpolation. Every `z.number()` parameter across all 174 tools has explicit `.min()/.max()` Zod bounds to prevent resource exhaustion from extreme values. The LocalBridge has explicit handlers for every ADB subcommand used by tool modules, preventing unquoted fallthrough to the default shell handler. In on-device mode, privilege escalation uses a frozen 16-command allowlist and restricted-path regex — the elevation set is `ReadonlySet` + `Object.freeze`, not configurable at runtime. The HTTP/SSE transport denies cross-origin requests by default (configurable via `DA_HTTP_CORS_ORIGIN`), the plugin registry verifies SHA-256 integrity hashes and prevents path traversal via directory containment checks, and the workflow engine enforces step count (200), sleep duration (5 min), and repeat iteration (100) limits. Fetch helpers enforce a 5 MB response body limit. Getprop output parsing handles Windows `\r\n` line endings via `.trim()` before regex matching, and dual SIM slot counts are capped at 4 to prevent resource exhaustion from corrupted device properties.
408
441
 
409
442
  ### Multi-Device Orchestration
410
443
  Run commands, install APKs, and compare outputs across multiple connected devices in parallel. Essential for comparative testing across Android versions and device models.
@@ -551,7 +584,7 @@ DeepADB/
551
584
  │ │ ├── files.ts # Push, pull, ls, cat (4 tools)
552
585
  │ │ ├── logs.ts # Logcat snapshots — filtered (3 tools)
553
586
  │ │ ├── logcat-watch.ts # Persistent logcat with ring buffer and poll (4 tools)
554
- │ │ ├── diagnostics.ts # dumpsys, telephony, battery, network, perf, bugreport (7 tools)
587
+ │ │ ├── diagnostics.ts # dumpsys, telephony, battery, network, perf, bugreport, crash logs, heap dump (9 tools)
555
588
  │ │ ├── ui.ts # Screenshots, input, activity, UI hierarchy (6 tools)
556
589
  │ │ ├── screen-record.ts # Screen video recording start/stop (2 tools)
557
590
  │ │ ├── control.ts # Airplane, WiFi, data, location, screen, settings, reboot (9 tools)
@@ -584,6 +617,7 @@ DeepADB/
584
617
  │ │ ├── selinux-audit.ts # SELinux status, AVC denials, permission auditing (3 tools)
585
618
  │ │ ├── thermal-power.ts # Thermal zones, CPU frequency, battery drain (3 tools)
586
619
  │ │ ├── network-discovery.ts # ADB-over-network scanning and auto-connect (3 tools)
620
+ │ │ └── wireless-firmware.ts # WiFi, Bluetooth, NFC, GPS firmware identification (4 tools)
587
621
  │ │ ├── build.ts # Gradle build and install (2 tools)
588
622
  │ │ ├── resources.ts # MCP Resources — device state surfaces (4 resources)
589
623
  │ │ └── prompts.ts # MCP Prompts — workflow templates (4 prompts)
@@ -608,16 +642,16 @@ DeepADB/
608
642
  ├── LICENSE # MIT license
609
643
  ├── tests/
610
644
  │ ├── run-all.mjs # Run all test suites sequentially with summary (tracks skipped counts)
611
- │ ├── test-hw.mjs # Hardware core: health, identity, baseband, thermal, profiles (26 tests)
645
+ │ ├── test-hw.mjs # Hardware core: health, identity, baseband, thermal, profiles, wireless firmware (33 tests)
612
646
  │ ├── test-shell-files.mjs # Shell, filesystem, packages, diagnostics (24 tests)
613
- │ ├── test-ui-control.mjs # UI hierarchy, screenshots, settings, accessibility (15 tests)
647
+ │ ├── test-ui-control.mjs # UI hierarchy, screenshots, settings, input gestures, UI automation, device awareness, accessibility (31 tests)
614
648
  │ ├── test-monitoring.mjs # Logcat watchers, snapshots, OTA, regression, workflows (25 tests)
615
649
  │ ├── test-security.mjs # Input sanitization, shell injection, AT command safety (25 tests)
616
650
  │ ├── test-lifecycle.mjs # App lifecycle, file push/pull, input, port forwarding, screen recording, test sessions (22 tests)
617
- │ ├── test-analysis.mjs # Thermal/snapshot/regression comparison, firmware diff, screenshot diff, test gen, RIL intercept (18 tests)
651
+ │ ├── test-analysis.mjs # Thermal/snapshot/regression comparison, firmware diff, screenshot diff, test gen, RIL intercept, AT cross-validation (19 tests)
618
652
  │ ├── test-boundaries.mjs # Zod bounds enforcement, input injection, error paths, sensitive data protection (28 tests)
619
- │ ├── test-qemu.mjs # QEMU/KVM setup, image management, VM status (10 on-device tests)
620
- │ ├── test-qemu-boot.mjs # QEMU Alpine VM boot, KVM acceleration, topology detection (10 on-device tests)
653
+ │ ├── test-qemu.mjs # QEMU/KVM setup, image management, VM status, guest connectivity errors (13 on-device tests)
654
+ │ ├── test-qemu-boot.mjs # QEMU Alpine VM boot, KVM acceleration, topology detection, guest ADB connectivity (14 on-device tests)
621
655
  │ └── lib/
622
656
  │ └── harness.mjs # Shared test harness (stdio JSON-RPC transport, 6 assertion types)
623
657
  └── docs/
@@ -22,6 +22,24 @@ export declare class LocalBridge extends AdbBridge {
22
22
  * Probed lazily on first command that needs elevation.
23
23
  */
24
24
  private rootAvailable;
25
+ /**
26
+ * Guest devices connected via ADB (e.g., QEMU VMs).
27
+ * When a command targets one of these serials, LocalBridge routes it through
28
+ * the real `adb` binary instead of executing locally.
29
+ *
30
+ * SECURITY: Only populated by qemu.ts connect/disconnect flow, which validates
31
+ * that serials are strictly `localhost:<port>` from running VMs.
32
+ * No external host connections are ever registered.
33
+ */
34
+ private static guestDevices;
35
+ /** Cached ADB binary path. undefined = not yet checked, null = not found. */
36
+ private adbBinaryPath;
37
+ /** Register a guest device serial for ADB routing. Called by qemu.ts on connect. */
38
+ static registerGuestDevice(serial: string): void;
39
+ /** Unregister a guest device serial. Called by qemu.ts on disconnect/stop. */
40
+ static unregisterGuestDevice(serial: string): void;
41
+ /** Check if a serial belongs to a registered guest device. */
42
+ static isGuestDevice(serial: string | undefined): boolean;
25
43
  /**
26
44
  * Android system commands that require shell-user (uid=2000) or root privileges.
27
45
  * In ADB mode, all shell commands run as uid=2000 automatically.
@@ -46,6 +64,26 @@ export declare class LocalBridge extends AdbBridge {
46
64
  * This is the same escaping path used by AdbBridge.rootShell().
47
65
  */
48
66
  private elevate;
67
+ /**
68
+ * Find the `adb` binary for guest device communication.
69
+ * Result is cached after first probe.
70
+ *
71
+ * SECURITY: Path is discovered from the system, never user-supplied.
72
+ */
73
+ private findAdbBinaryPath;
74
+ /**
75
+ * Execute a command on a guest device via the real ADB binary.
76
+ * Called when the target device serial matches a registered guest.
77
+ *
78
+ * Reconstructs the full ADB command: `adb -s <serial> <subcommand> <args...>`
79
+ * This is the same execution path as AdbBridge.exec(), but using the
80
+ * locally-installed adb binary instead of the host's ADB.
81
+ *
82
+ * SECURITY: The serial comes from the guest device registry (populated only
83
+ * by qemu.ts with validated localhost:<port> values). Args are passed as
84
+ * an array to execFile (no shell expansion).
85
+ */
86
+ private execViaAdb;
49
87
  /**
50
88
  * Android filesystem paths that require elevated access in on-device mode.
51
89
  * Commands referencing these paths need su to bypass scoped storage restrictions.
@@ -73,7 +111,8 @@ export declare class LocalBridge extends AdbBridge {
73
111
  private execLocal;
74
112
  /**
75
113
  * Synthesize an `adb devices -l` response for DeviceManager.
76
- * Reads device properties once and caches them.
114
+ * Reads device properties once and caches the local device line.
115
+ * When guest VMs are connected via ADB, merges their status into the list.
77
116
  */
78
117
  private syntheticDeviceList;
79
118
  /** Create a successful AdbResult from a string. */
@@ -1 +1 @@
1
- {"version":3,"file":"local-bridge.d.ts","sourceRoot":"","sources":["../../src/bridge/local-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAoC,YAAY,EAAE,MAAM,eAAe,CA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IAkDjC,mDAAmD;IACnD,OAAO,CAAC,UAAU;IAWlB,4CAA4C;IAC7B,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAIvC,iCAAiC;IAClB,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IASzC;;;;OAIG;IACM,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY;CA0BxE"}
@@ -11,7 +11,8 @@
11
11
  *
12
12
  * Environment detection: see config.ts isOnDevice().
13
13
  */
14
- import { execFile, spawn } from "child_process";
14
+ import { execFile, spawn, spawnSync } from "child_process";
15
+ import { existsSync } from "fs";
15
16
  import { AdbBridge, AdbError } from "./adb-bridge.js";
16
17
  import { config } from "../config/config.js";
17
18
  import { shellEscape } from "../middleware/sanitize.js";
@@ -23,6 +24,30 @@ export class LocalBridge extends AdbBridge {
23
24
  * Probed lazily on first command that needs elevation.
24
25
  */
25
26
  rootAvailable = null;
27
+ /**
28
+ * Guest devices connected via ADB (e.g., QEMU VMs).
29
+ * When a command targets one of these serials, LocalBridge routes it through
30
+ * the real `adb` binary instead of executing locally.
31
+ *
32
+ * SECURITY: Only populated by qemu.ts connect/disconnect flow, which validates
33
+ * that serials are strictly `localhost:<port>` from running VMs.
34
+ * No external host connections are ever registered.
35
+ */
36
+ static guestDevices = new Set();
37
+ /** Cached ADB binary path. undefined = not yet checked, null = not found. */
38
+ adbBinaryPath = undefined;
39
+ /** Register a guest device serial for ADB routing. Called by qemu.ts on connect. */
40
+ static registerGuestDevice(serial) {
41
+ LocalBridge.guestDevices.add(serial);
42
+ }
43
+ /** Unregister a guest device serial. Called by qemu.ts on disconnect/stop. */
44
+ static unregisterGuestDevice(serial) {
45
+ LocalBridge.guestDevices.delete(serial);
46
+ }
47
+ /** Check if a serial belongs to a registered guest device. */
48
+ static isGuestDevice(serial) {
49
+ return serial !== undefined && LocalBridge.guestDevices.has(serial);
50
+ }
26
51
  /**
27
52
  * Android system commands that require shell-user (uid=2000) or root privileges.
28
53
  * In ADB mode, all shell commands run as uid=2000 automatically.
@@ -89,6 +114,95 @@ export class LocalBridge extends AdbBridge {
89
114
  elevate(command) {
90
115
  return `su -c '${shellEscape(command)}'`;
91
116
  }
117
+ /**
118
+ * Find the `adb` binary for guest device communication.
119
+ * Result is cached after first probe.
120
+ *
121
+ * SECURITY: Path is discovered from the system, never user-supplied.
122
+ */
123
+ findAdbBinaryPath() {
124
+ if (this.adbBinaryPath !== undefined)
125
+ return this.adbBinaryPath;
126
+ try {
127
+ const result = spawnSync("which", ["adb"], { timeout: 3000 });
128
+ if (result.status === 0 && result.stdout) {
129
+ const path = result.stdout.toString().trim();
130
+ if (path.length > 0) {
131
+ this.adbBinaryPath = path;
132
+ return path;
133
+ }
134
+ }
135
+ }
136
+ catch { /* which not available */ }
137
+ // Fallback: standard Termux location
138
+ const termuxAdb = "/data/data/com.termux/files/usr/bin/adb";
139
+ if (existsSync(termuxAdb)) {
140
+ this.adbBinaryPath = termuxAdb;
141
+ return termuxAdb;
142
+ }
143
+ this.adbBinaryPath = null;
144
+ return null;
145
+ }
146
+ /**
147
+ * Execute a command on a guest device via the real ADB binary.
148
+ * Called when the target device serial matches a registered guest.
149
+ *
150
+ * Reconstructs the full ADB command: `adb -s <serial> <subcommand> <args...>`
151
+ * This is the same execution path as AdbBridge.exec(), but using the
152
+ * locally-installed adb binary instead of the host's ADB.
153
+ *
154
+ * SECURITY: The serial comes from the guest device registry (populated only
155
+ * by qemu.ts with validated localhost:<port> values). Args are passed as
156
+ * an array to execFile (no shell expansion).
157
+ */
158
+ execViaAdb(args, options) {
159
+ const adbPath = this.findAdbBinaryPath();
160
+ if (!adbPath) {
161
+ return Promise.reject(new AdbError("ADB binary not found — required for guest device communication. Install with: pkg install android-tools", { stdout: "", stderr: "", exitCode: 1, timedOut: false, bufferExceeded: false, device: options.device ?? "guest" }));
162
+ }
163
+ const timeout = options.timeout || config.commandTimeout;
164
+ const fullArgs = [];
165
+ if (options.device) {
166
+ fullArgs.push("-s", options.device);
167
+ }
168
+ fullArgs.push(...args);
169
+ this.localLogger.debug(`adb guest: ${adbPath} ${fullArgs.join(" ").substring(0, 200)}`);
170
+ return new Promise((resolve, reject) => {
171
+ const execOptions = {
172
+ timeout,
173
+ maxBuffer: config.maxOutputSize * 2,
174
+ };
175
+ execFile(adbPath, fullArgs, execOptions, (error, stdout, stderr) => {
176
+ const bufferExceeded = error?.code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER"
177
+ || error?.message?.includes("maxBuffer") === true;
178
+ const timedOut = error?.killed === true && !bufferExceeded;
179
+ const exitCode = error?.code != null
180
+ ? (typeof error.code === "number" ? error.code : 1)
181
+ : 0;
182
+ const result = {
183
+ stdout: stdout?.toString() ?? "",
184
+ stderr: stderr?.toString() ?? "",
185
+ exitCode,
186
+ timedOut,
187
+ bufferExceeded,
188
+ device: options.device ?? "guest",
189
+ };
190
+ if (timedOut) {
191
+ reject(new AdbError(`Guest command timed out after ${timeout}ms`, result));
192
+ return;
193
+ }
194
+ if (bufferExceeded) {
195
+ resolve(result);
196
+ return;
197
+ }
198
+ if (exitCode !== 0 && !options.ignoreExitCode) {
199
+ reject(new AdbError(`Guest command failed (exit ${exitCode}): ${result.stderr || result.stdout}`.trim(), result));
200
+ return;
201
+ }
202
+ resolve(result);
203
+ });
204
+ });
205
+ }
92
206
  /**
93
207
  * Android filesystem paths that require elevated access in on-device mode.
94
208
  * Commands referencing these paths need su to bypass scoped storage restrictions.
@@ -123,6 +237,13 @@ export class LocalBridge extends AdbBridge {
123
237
  * tool calls to exec() flow through here.
124
238
  */
125
239
  async exec(args, options = {}) {
240
+ // Guest device routing: if the target device is a registered QEMU guest,
241
+ // route through the real ADB binary instead of local execution.
242
+ // This enables multi-device tools to transparently operate on both
243
+ // the host device (local) and guest VMs (via ADB).
244
+ if (options.device && LocalBridge.isGuestDevice(options.device)) {
245
+ return this.execViaAdb(args, options);
246
+ }
126
247
  const subcommand = args[0];
127
248
  const hasRoot = await this.checkRootAvailable();
128
249
  switch (subcommand) {
@@ -269,9 +390,11 @@ export class LocalBridge extends AdbBridge {
269
390
  }
270
391
  /**
271
392
  * Synthesize an `adb devices -l` response for DeviceManager.
272
- * Reads device properties once and caches them.
393
+ * Reads device properties once and caches the local device line.
394
+ * When guest VMs are connected via ADB, merges their status into the list.
273
395
  */
274
396
  async syntheticDeviceList() {
397
+ // Build local device line (cached — host device props don't change)
275
398
  if (!this.deviceInfoCache) {
276
399
  try {
277
400
  const [modelRes, productRes] = await Promise.allSettled([
@@ -280,13 +403,40 @@ export class LocalBridge extends AdbBridge {
280
403
  ]);
281
404
  const model = modelRes.status === "fulfilled" ? modelRes.value.stdout.trim().replace(/\s+/g, "_") : "Android";
282
405
  const product = productRes.status === "fulfilled" ? productRes.value.stdout.trim() : "unknown";
283
- this.deviceInfoCache = `List of devices attached\nlocal device product:${product} model:${model} transport_id:0\n`;
406
+ this.deviceInfoCache = `local device product:${product} model:${model} transport_id:0`;
284
407
  }
285
408
  catch {
286
- this.deviceInfoCache = "List of devices attached\nlocal device product:unknown model:Android transport_id:0\n";
409
+ this.deviceInfoCache = "local device product:unknown model:Android transport_id:0";
410
+ }
411
+ }
412
+ let deviceLines = this.deviceInfoCache;
413
+ // If guest VMs are connected, query ADB for their device lines
414
+ if (LocalBridge.guestDevices.size > 0) {
415
+ const adbPath = this.findAdbBinaryPath();
416
+ if (adbPath) {
417
+ try {
418
+ const result = spawnSync(adbPath, ["devices", "-l"], { timeout: 5000 });
419
+ if (result.status === 0 && result.stdout) {
420
+ const adbOutput = result.stdout.toString();
421
+ const adbLines = adbOutput.split("\n").slice(1) // Skip "List of devices attached" header
422
+ .map(l => l.trim())
423
+ .filter(l => l.length > 0);
424
+ // Only include lines matching registered guest serials
425
+ for (const line of adbLines) {
426
+ const serial = line.split(/\s+/)[0];
427
+ if (serial && LocalBridge.guestDevices.has(serial)) {
428
+ deviceLines += "\n" + line;
429
+ }
430
+ }
431
+ }
432
+ }
433
+ catch {
434
+ // ADB query failed — still return local device
435
+ this.localLogger.debug("syntheticDeviceList: ADB query for guest devices failed");
436
+ }
287
437
  }
288
438
  }
289
- return this.makeResult(this.deviceInfoCache);
439
+ return this.makeResult(`List of devices attached\n${deviceLines}\n`);
290
440
  }
291
441
  /** Create a successful AdbResult from a string. */
292
442
  makeResult(stdout) {
@@ -1 +1 @@
1
- {"version":3,"file":"local-bridge.js","sourceRoot":"","sources":["../../src/bridge/local-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAmB,KAAK,EAAgB,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,SAAS,EAA6B,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,OAAO,WAAY,SAAQ,SAAS;IAChC,WAAW,CAAS;IACpB,eAAe,GAAkB,IAAI,CAAC;IAE9C;;;OAGG;IACK,aAAa,GAAmB,IAAI,CAAC;IAE7C;;;;;;;;OAQG;IACK,MAAM,CAAU,iBAAiB,GAAwB,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC;QACrF,UAAU,EAAO,4CAA4C;QAC7D,SAAS,EAAQ,2BAA2B;QAC5C,IAAI,EAAa,gEAAgE;QACjF,OAAO,EAAU,oCAAoC;QACrD,WAAW,EAAM,oEAAoE;QACrF,cAAc,EAAG,sDAAsD;QACvE,aAAa,EAAI,8DAA8D;QAC/E,aAAa,EAAI,uDAAuD;QACxE,YAAY,EAAK,sCAAsC;QACvD,YAAY,EAAK,uCAAuC;QACxD,KAAK,EAAY,4DAA4D;QAC7E,IAAI,EAAa,iEAAiE;QAClF,IAAI,EAAa,wDAAwD;QACzE,KAAK,EAAY,sDAAsD;QACvE,IAAI,EAAa,2DAA2D;QAC5E,UAAU,EAAO,2DAA2D;KAC7E,CAAC,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AC,CAAC;QAEnE,OAAO,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE;YACzB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;YACjC,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,0BAA0B,EAAE;SAC7E,CAAC,CAAC;IACL,CAAC"}
package/build/index.js CHANGED
@@ -16,7 +16,7 @@ import { startHttpTransport } from "./http-transport.js";
16
16
  import { startWsTransport } from "./ws-transport.js";
17
17
  import { startGraphQLApi } from "./graphql-api.js";
18
18
  import { VERSION } from "./config/config.js";
19
- import { isAuthEnabled } from "./middleware/auth.js";
19
+ import { isAuthEnabled, validateTokenStrength } from "./middleware/auth.js";
20
20
  async function main() {
21
21
  const { server, logger, bridge, deviceManager } = await createServer();
22
22
  /** Parse a port env var safely — returns null if unset, NaN, out of range, or negative. */
@@ -61,6 +61,7 @@ async function main() {
61
61
  if (httpPort || wsPort || graphqlPort) {
62
62
  if (isAuthEnabled()) {
63
63
  console.error("[DeepADB] Bearer token authentication enabled (DA_AUTH_TOKEN set)");
64
+ validateTokenStrength();
64
65
  }
65
66
  else if (!isLoopback) {
66
67
  console.error("[DeepADB] ⚠ No authentication configured. Set DA_AUTH_TOKEN for bearer token auth.");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAA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K,CAAC,iDAAiD,QAAQ,IAAI,MAAM,KAAK,CAAC,CAAC;IAC1F,CAAC;SAAM,CAAC;QACN,sBAAsB;QACtB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAChC,OAAO,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;IACvF,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -20,6 +20,16 @@
20
20
  import { IncomingMessage, ServerResponse } from "http";
21
21
  /** Whether token auth is enabled. */
22
22
  export declare function isAuthEnabled(): boolean;
23
+ /**
24
+ * Validate token strength at startup. Logs warnings for weak tokens.
25
+ * Called once from index.ts when network transports are enabled.
26
+ *
27
+ * Checks:
28
+ * 1. Minimum length (32 chars = 128+ bits for hex, 192+ bits for base64)
29
+ * 2. Entropy estimation — reject tokens with very low character diversity
30
+ * 3. Common weak patterns (all same character, sequential digits, dictionary-like)
31
+ */
32
+ export declare function validateTokenStrength(): void;
23
33
  /**
24
34
  * Check bearer token authentication on an incoming HTTP request.
25
35
  *
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/middleware/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AASvD,qCAAqC;AACrC,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAY5E;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAc3D"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/middleware/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAYvD,qCAAqC;AACrC,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAuC5C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAY5E;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAc3D"}