rea/scripts/lib
Quentin Limo fef6f73064
feat(adb): complete ADB device support for Android reverse engineering (#1552)
* feat(adb): acquire installed APK sets from connected Android devices

Add a read-only ADB device-acquisition family over the caller's adb binary:
inspect_adb_client, list_adb_devices, inspect_adb_device, list_adb_packages,
and pull_adb_package, exposed through the CLI and MCP with shared admission,
Evidence provenance (binary, version, serial, transport), and fixed argv
vectors that never reach a shell.

pull_adb_package acquires the complete split set reported by pm path into a
package-named directory that must not exist, digesting every file with
SHA-256 and keeping per-file failure reasons and partial coverage. Device
kind is reported as an inference with its basis; getprop whitelisting keeps
build identity bounded. REA installs nothing and never manages devices or
emulators; the first device query may start the caller's local adb server,
recorded when observed.

Verified against adb 34.0.5 on Linux with an Android 14 (API 34) x86_64
emulator: full 224-package inventory, a real two-APK split set pulled with
byte-exact digests, and a 73.9 MB system-package pull. npm run verify:adb
records the lane; parser goldens come from the same device. READMEs carry
the new row in every supported language.

* feat(adb): complete the adb surface with observation, transfer, and lifecycle tools

Extend the ADB family from five to twenty-four operations, all through
fixed adb argument vectors with no shell exposure:

Observation: read_adb_logcat (bounded dump, count/buffer/pid), inspect_adb_package
(dumpsys package projection), list_adb_processes (ps -A), list_adb_directory
(ls -la with kinds and symlink targets), list_adb_features (hex GL versions),
list_adb_services (AIDL slash-suffixed names), inspect_adb_display (wm size and
density), inspect_adb_window (focus declarations), read_adb_setting (device-side
nulls reported as such), capture_adb_screen (exec-out screencap with PNG
dimensions), collect_adb_bugreport (digested device archive).

Transfer and search: pull_adb_file and push_adb_file (device-side sha256sum
verification, explicit overwrite authority), resolve_adb_packages (substring
package search with exact-match flag — the find step of an easy get).

Lifecycle for dynamic analysis, each declaring mutatesTarget:
install_adb_package and uninstall_adb_package preserving the device's
Success/Failure verdict, start_adb_app (resolve-activity then am start -W),
start_adb_activity (typed extras as --es/--ez/--ei/--el/--ef), and stop_adb_app
(am force-stop).

Verified end-to-end against adb 34.0.5 on Linux with an Android 14 (API 34)
x86_64 emulator: 287 services, 92 features, split-set pulls with byte-exact
digests, verified push/pull roundtrip, sized screen capture, and the full
install → resolve → start → observe-in-ps → force-stop → uninstall lifecycle.
Fixed a v-mode regex incompatibility in the settings key pattern and added
argument descriptions required by the CLI catalog audit.

* fix(adb): quote remote shell operands and protect captured output

* test(adb): cover bugreport destinations containing spaces

---------

Co-authored-by: REA Contributor <contributor@rea.tools>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-10-10 23:01:24 +08:00
..
artifact-e2e.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
browser-capture-metadata-budget-e2e.mjs fix(browser): bound script metadata and preserve omissions 2026-10-09 06:32:10 +08:00
browser-dom-destinations-e2e.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
browser-module-e2e.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
browser-nested-source-map-e2e.mjs fix(browser): compose nested source-map column offsets (#1109) 2026-10-09 02:01:29 +08:00
browser-network-assertions.mjs feat(browser): capture correlated network content and lifecycle evidence (#797) 2026-10-07 04:35:49 +08:00
browser-network-e2e.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
browser-popup-e2e.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
browser-runtime-e2e.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
browser-runtime-fixture-lifecycle.mjs feat(browser): attribute native execution and listener sources (#917) 2026-10-07 21:45:07 +08:00
browser-runtime-selector-e2e.mjs feat(browser): attribute native execution and listener sources (#917) 2026-10-07 21:45:07 +08:00
browser-runtime-termination-e2e.mjs feat(browser): attribute native execution and listener sources (#917) 2026-10-07 21:45:07 +08:00
browser-runtime-world-e2e.mjs feat(browser): attribute native execution and listener sources (#917) 2026-10-07 21:45:07 +08:00
browser-scenario-environment-e2e.mjs fix(browser): release attached viewport overrides without resizing the external page 2026-10-10 02:33:56 +08:00
browser-scenario-verifier.mjs fix(browser): retain scenario observations across failures 2026-10-09 22:46:08 +08:00
browser-screenshot-e2e.mjs fix(mcp): deliver typed errors without invalid structured output (#1277) 2026-10-09 13:54:32 +00:00
browser-script-export-assertions.mjs refactor(javascript): group domain semantics and contracts (#907) 2026-10-07 17:16:58 +08:00
browser-script-export-e2e.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
browser-source-map-e2e.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
browser-verifier-assertions.mjs fix(browser)!: preserve payload shapes and WebMCP declarations 2026-10-10 06:20:28 +08:00
catalog-builders.mjs feat(adb): complete ADB device support for Android reverse engineering (#1552) 2026-10-10 23:01:24 +08:00
catalog-cli.d.mts refactor(catalog): import CLI metadata from its owner 2026-10-10 00:49:14 +08:00
catalog-cli.mjs refactor(adapters): split oversized provider workflows 2026-07-18 05:49:14 +00:00
catalog-core.mjs feat(adb): complete ADB device support for Android reverse engineering (#1552) 2026-10-10 23:01:24 +08:00
conformance-fixtures.d.mts test(conformance): remove fixture generator test option 2026-09-29 18:00:47 +08:00
conformance-fixtures.mjs test(conformance): remove fixture generator test option 2026-09-29 18:00:47 +08:00
development-tests.d.mts build: separate runtime artifacts and supervise command ownership 2026-10-09 20:11:17 +08:00
development-tests.mjs build: separate runtime artifacts and supervise command ownership 2026-10-09 20:11:17 +08:00
docs-facts.d.mts docs: clarify onboarding and align provider guidance (#745) 2026-10-06 22:57:36 +08:00
docs-facts.mjs docs: add ten README translations and expand language navigation 2026-10-09 05:33:36 +08:00
elf-section-name-fixtures.mjs feat(native): inspect offline ELF layout through pwntools (#1037) 2026-10-08 14:22:08 +08:00
format-generated-file.mjs chore: migrate formatting to Oxfmt (#615) 2026-10-06 01:59:19 +08:00
generated-file.d.mts build: add canonical product catalog and docs drift checks 2026-07-15 17:43:52 +08:00
generated-file.mjs fix(build): clarify generated-file check hint and drop redundant catalog step (#998) 2026-10-08 00:21:39 +08:00
ghidra-reference-snapshot-e2e.mjs fix(targets): cancel resolution before provider admission 2026-10-10 00:35:17 +08:00
large-result-mcp.mjs fix(mcp): retain complete application results across response limits 2026-10-08 23:46:02 +08:00
mcp-startup-probe.d.mts perf(mcp): reduce cold-start work 2026-07-26 15:02:58 +00:00
mcp-startup-probe.mjs perf(mcp): reduce cold-start work 2026-07-26 15:02:58 +00:00
mcp-verifier-results.mjs fix(mcp): deliver typed errors without invalid structured output (#1277) 2026-10-09 13:54:32 +00:00
module-boundaries.d.mts refactor(process): separate capture implementation from analyst workflows (#988) 2026-10-08 00:46:21 +08:00
module-boundaries.mjs build: separate runtime artifacts and supervise command ownership 2026-10-09 20:11:17 +08:00
native-value-e2e.mjs test(ghidra): preserve Node heap options in adapter verification (#1550) 2026-10-10 20:27:45 +08:00
product-catalog.d.mts refactor(catalog): import CLI metadata from its owner 2026-10-10 00:49:14 +08:00
product-catalog.mjs refactor(catalog): import CLI metadata from its owner 2026-10-10 00:49:14 +08:00
real-ghidra-address-boundaries.mjs fix(ghidra): stop dereferencing the removed error payload in address verification 2026-10-09 14:04:35 +00:00
real-ghidra-batch-identity.mjs fix(native): distinguish batch selectors from resolved entries 2026-10-09 19:09:30 +08:00
real-ghidra-boundaries.mjs fix: reuse validators for identical output schemas 2026-10-10 19:29:16 +08:00
real-ghidra-compact-references.mjs fix(native): preserve compact reference provenance (#1438) 2026-10-10 21:39:28 +08:00
real-ghidra-entry-aliases.mjs fix(cli): resolve xrefs symbol selectors after address validation (#1209) 2026-10-09 13:28:48 +08:00
real-ghidra-instruction-flow.mjs fix(ghidra): preserve decoded return flow evidence 2026-10-09 18:53:28 +08:00
real-ghidra-large-results.mjs Merge pull request #1297 from morluto/fix/ghidra-session-root-stability 2026-10-09 07:59:06 -07:00
real-ghidra-namespace-annotations.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
real-ghidra-snapshot-lifecycle.mjs fix(mcp): deliver typed errors without invalid structured output (#1277) 2026-10-09 13:54:32 +00:00
real-ghidra-target-admission.mjs fix(ghidra): preserve source failures and snapshot ownership 2026-10-09 05:10:36 +08:00
real-hopper-boundaries.mjs fix: reuse validators for identical output schemas 2026-10-10 19:29:16 +08:00
real-hopper-cleanup.d.mts fix(hopper): verify lease cleanup and repair the macOS test lane (#1111) 2026-10-09 02:41:34 +08:00
real-hopper-cleanup.mjs fix(hopper): verify lease cleanup and repair the macOS test lane (#1111) 2026-10-09 02:41:34 +08:00
real-hopper-cli-selectors.mjs fix(cli): accept exact native names through explicit selectors 2026-10-09 05:46:16 +08:00
real-hopper-exhaustive-search.d.mts refactor: return complete tool results inline 2026-09-29 07:08:46 +08:00
real-hopper-exhaustive-search.mjs refactor: return complete tool results inline 2026-09-29 07:08:46 +08:00
real-hopper-fixture.d.mts test(hopper): add semantic runtime conformance 2026-07-18 04:50:23 +00:00
real-hopper-fixture.mjs fix(hopper): preserve typed string values and verify real searches 2026-10-09 05:12:36 +08:00
real-hopper-function-basics.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
real-hopper-inventory.mjs refactor: remove forwarding exports and redundant aliases 2026-10-09 22:46:09 +08:00
real-hopper-navigation.mjs fix(hopper): probe interior navigation from multi-byte instructions (#1285) 2026-10-10 06:07:01 +08:00
real-hopper-search.mjs fix(hopper)!: isolate regex matching from the native API thread 2026-10-09 05:12:36 +08:00
real-hopper-selection.mjs refactor: remove forwarding exports and redundant aliases 2026-10-09 22:46:09 +08:00
real-hopper-semantic.d.mts test(hopper): add semantic runtime conformance 2026-07-18 04:50:23 +00:00
real-hopper-semantic.mjs fix(contracts)!: require observed provider output metadata 2026-10-10 03:52:13 +08:00
real-hopper-session-isolation.mjs fix(hopper): reserve Linux demo application before launch (#1158) 2026-10-09 10:14:25 +08:00
real-hopper-source-binding.mjs fix(hopper): bind file mappings to verified source bytes 2026-10-09 06:13:41 +08:00
real-hopper-workflows.mjs test(hopper): cover real boundary failures and CLI parity 2026-10-09 02:44:28 +08:00
recorded-core-fixtures.py feat(native): inspect recorded crashes through pwntools and pwndbg (#1054) 2026-10-08 16:50:31 +08:00
release-checkpoint.mjs fix(release): publish reviewed release PR merges 2026-10-09 08:44:47 +08:00
test-discovery.d.mts refactor: add incremental capability migration safeguards (#819) 2026-10-07 10:56:06 +08:00
test-discovery.mjs refactor: add incremental capability migration safeguards (#819) 2026-10-07 10:56:06 +08:00
unrelated-hopper-sentinel.mjs fix(process): protect unrelated Hopper during cleanup 2026-07-22 14:04:00 +00:00
verifier-run.d.mts refactor: return complete analysis results inline 2026-09-29 08:07:24 +08:00
verifier-run.mjs feat(ghidra): enable Windows x64 read-only analysis (#699) 2026-10-06 16:53:33 +08:00
verify-package-core.mjs test(package): share validated native dossier fixtures 2026-10-10 04:02:40 +08:00
windows-protocol-input.mjs fix(android): support owned JADX stdio on Windows (#1276) 2026-10-09 20:34:42 +08:00