Skip to content

[DEV] v2 rewrite#8

Merged
MatrixEditor merged 47 commits intomasterfrom
dev/v2-rewrite
Apr 6, 2026
Merged

[DEV] v2 rewrite#8
MatrixEditor merged 47 commits intomasterfrom
dev/v2-rewrite

Conversation

@MatrixEditor
Copy link
Copy Markdown
Owner

No description provided.

---

+ THIS CODE IS NOT STABLE AND WILL CHANGE!
+ Next todo will be to adjust the parsing and add fuzzer targets
---

+ Result type should be used accross the library
---

+ Header
+ various items
---

+ 2nd approach to instructions ported from ART
---

+ Added new error: OperandAccessError
+ A,B,C,H and VarArgs can be extracted using vreg module
---

+ Instruction iterator and IntoIter support CodeItemAccessor
+ DexFile now implements methods for describing fields, methods, types and strings
---

+ Changed leb128 parsing to return a Result
+ Removed unused DexFile field in Method, ClassDataAccessor and Field structs
+ ClassDataAccessor can be used on all DexFile variants
---

+ updated verification flags in DExVerfier
---

+ EncodedValue implementation with fuzzing tests
+ DexFIle is now able to return an UTF8 String without validating the mUTF8
---

+ added support to get index  from item in dex file
…east for now)

---

+ string_ids renamed to get_string_ids()
+ removed unnecessary import in container.rs
+ mutf8  withstands at least #33554432 fuzzing runs
---

Changes:
+ decode_leb128p1 will always return i32 from now on
+ Made file::header::Header cloneable

Additions:
+ Python Extension using pyo3 (feature: "python")
+ Support is limited to parsing one file and fetching the header for now
---

Changed:
+ Splitted decode_leb128_off into decode_leb128_adv and decode_leb128_off with slightly different behaviour
+ DexFile::get<type>_opt applied boundry check using <idx_ty>::MAX instead of u32::MAX
+ Most structs in dexrs::file::structs are now cloneable
+ PyDexFileImpl can be created bypassing dex container instances only

Additions:
+ DebugInfo parser (parameter names and positions)
---

+ updated initialization of python package to automatically include all types
---

Changes:
+ Added iterator implementation over parameter names in debug info
+ Added TypeId interface for Python API
---

Changes:
+ Added python stubs for each module currently available
+ Renamed all rust python bindings to begin with py_

Additions:
+ Added Python API to encode and decode MUTF8 data (currently limited to null-terminated strings)
---

+ Removed Field::is_static method from class_accessor
+ Added DexFile::pretty_type to always return a non-empty string without the need of a result
+ Instruction::relative_at is now bound to a one-byte extra boundary
+ ClassAccessor Python API
+ README updated to reflect API changes
---

+ Python API will be generated if cfg(feature = python)
+ Moved existing Python api into Rust source code base
+ Python stubs are WIP and don't include constant code flags
---

+ vreg module is still missing, but all classes have been added to the Python API
+ stubs added
+ Instruction::next now returns an Option<> instead of Result<>
---

+ Fixed parsing parameter names in debug info
---

+ Fuzzing tests for complex instructions
+ Two new errors regarding complex instructions
+ Rename Python API candidate of Instruction to [Py|Rs]DexInstruction
+ Fix lifetime issue with CodeItemAccessor and Python API
+ Added Python stubs for vreg sunmodule and added struct definitions
---

+ This should close #3

Fixes #3
---

+ Removed unnecessary import from dex_basic_ops.rs
+ Added new fuzzing test for code items
+ Added CatchHandlerData parser to Rust and Python API
+ New Error to reflect changes in dependencies (+leb128fmt) for signed variable integers
+ Added leb128 Python API
@MatrixEditor MatrixEditor linked an issue Apr 6, 2026 that may be closed by this pull request
@MatrixEditor MatrixEditor merged commit 55d4bc4 into master Apr 6, 2026
@MatrixEditor MatrixEditor deleted the dev/v2-rewrite branch April 6, 2026 08:38
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.

[Issue-Tracker] Stable DEX file Rust API

1 participant