Repository navigation
dev-0.1.2-post3
Summary
This update improves Python ASC's smali disassembly quality, fixes missing method parameters in code-less methods, and reduces class lookup latency through prefix-only DEX inflation.
Python and Rust implementations will continue to be maintained in parallel so users can choose the integration style that fits their workflow.
Key Changes
Smali disassembly
- Added complete smali rendering for:
.class,.super,.implements- fields and annotations
- methods and
.locals - branch labels
- try/catch blocks
- optional
.lineand local-variable debug directives
- Added
--debuginfoto enable DEX debug metadata output. - Added
--method 'run(I)V'to render one exact method by full signature. - Fixed smali syntax:
- field references now use
->field:Type - invoke instructions now use
{v0, v1} - range invokes now use
{v0 .. v3} - method descriptors no longer contain invalid spaces
- field references now use
- Fixed abstract/native methods whose parameter list was incorrectly rendered as empty when no
code_itemexisted.
DEX rebuild correctness
- Fixed rebuilt
code_item.debug_info_offso debug metadata remains addressable after DEX reconstruction. - Added fallback handling for stored entries, malformed prefixes, and DEX 041 containers.
Prefix-only DEX inflation
Class lookup now:
- Inflates only the DEX prefix needed to inspect
string_ids,type_ids,class_defs, and the target descriptor. - Rejects unrelated DEX files without full inflation.
- Fully inflates only the candidate DEX that contains the requested class.
- Falls back to the original full-inflate path when prefix parsing is unsafe.
Performance
Measured on:
- Same command and workload before/after the prefix-inflate change
| Metric | Before | After | Improvement |
|---|---|---|---|
| APK class lookup median | 727 ms | 307 ms | -57.8% |
| Internal total median | 769 ms | 342 ms | -55.6% |
| Wall-clock median | 1007 ms | 523 ms | -48.0% |
The previous cli_getclass regression was also traced to method descriptor normalization in the decompiler hot path. Descriptor normalization is now performed only by the smali formatter, avoiding repeated string processing during decompilation.
Validation
- Full test suite:
139tests passed. - Prefix inflate tests cover:
- deflated DEX entries
- stored DEX entries
- partial prefix parsing
- full-inflate fallback
- Disassembly tests cover:
- annotations
- debug info
- fields
- invoke/range invoke syntax
- exact method filtering
- try/catch and branch labels
Release
- Python package version:
0.1.2-post3 - Target branch:
dev-0.1.0 - Latest commit:
b9cba55