Skip to content

feat: add indexed listmethod CLI and MCP tool - #4

Merged
MG1937 merged 1 commit into
MG1937:devfrom
TsingShui:feat/listmethod
Oct 20, 2026
Merged

MG1937 merged 1 commit into
MG1937:devfrom
TsingShui:feat/listmethod

Conversation

@TsingShui

Copy link
Copy Markdown
Contributor

Summary

  • Add listmethod to the CLI and MCP, with exact class selection, case-insensitive method-name filtering, worker control, and optional file output.
  • List complete Dalvik signatures for methods defined in class data, including native and abstract methods, without including external reference-only methods. Preserve overloads, duplicate definitions, and multi-DEX / DEX 041 declaration order.
  • Keep method scanning in asc_core/findrefs/scan/method_id_scan.rs. Reuse StringLocator for name-index selection, with aligned fixed-field scans and a dense fallback.
  • Render per-DEX text chunks, transfer DEX buffer ownership instead of copying, borrow UTF-8 names, and compact prototype caches. The shared buffer-ownership improvement also benefits listclass.
  • Simplify listing traversal, count propagation, and output writing while retaining the row-based Rust interface.

Validation

  • cargo test: 69 passed.
  • cargo test --no-default-features: 64 passed.
  • git diff --check: clean.
  • Verified complete output hashes, byte counts, and row counts across 12 real-APK cases covering full class/method listings and class/name filters.

Performance

Local release measurements on an Apple M3 Pro with 12 workers, warm filesystem cache, and stdout redirected to /dev/null:

  • Per-DEX output buffering reduced full method-listing latency by roughly 35–51% versus the initial implementation.
  • A subsequent memory optimization reduced peak method-listing RSS by approximately 14–32%, without slowing the measured workloads.
  • No truncation, pagination, persistent cache, profiling interface, or additional runtime dependency was introduced.

Enumerate defined methods with complete signatures and class/name filters. Reuse StringLocator for name-index selection and keep scanning in method_id_scan.

Render ordered DEX text chunks, transfer DEX buffer ownership, and borrow UTF-8 names to reduce allocations and peak memory. Simplify shared listing traversal and preserve CLI/MCP output semantics.

Verified with cargo test (69 passed) and cargo test --no-default-features (64 passed).
@MG1937
MG1937 merged commit 7b72583 into MG1937:dev Oct 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants