Skip to main content

dex++

Fast static analysis of Android APK / DEX files — a C++23 core with Python bindings, built as a clean, typed replacement for androguard's analysis API.

The current release is 0.2.0 (alpha): the API may still change between 0.x releases. See CHANGELOG.md.

What it does

  • APK metadata — manifest (package, SDK levels, permissions, components and their exported/intent-filter/permission attributes), resource resolution (@string/...), and signing-scheme/certificate inspection (v1/v2/v3).
  • DEX analysis — classes, methods, fields; decoded bytecode with mnemonics; per-method control-flow graphs and try/catch; annotations and static-field initial values.
  • Whole-program — call graph (with class-hierarchy-aware virtual dispatch), class hierarchy, and a cross-reference index (who calls / reads / writes / loads what), both forward and reverse.
  • DEX editing — read a DEX file into an editable model, change it or build one from scratch, and write a valid DEX file (dex::model). From Python (dexpp.Model) and Go, the model works a whole class at a time: copy, move, remove and rename classes, then write.

It inspects APK and DEX files and edits DEX files. It does not decompile or verify signatures.

Install (Python)

dexpp needs Python 3.14 or newer.

pip install dexpp

PyPI has prebuilt wheels for CPython 3.14 on Linux x86_64 (glibc 2.28+ and musl). The same wheels are attached to each GitHub release.

On other platforms and Python versions, pip builds dexpp from the source distribution. That needs a C++23 compiler (GCC ≥ 13 or Clang ≥ 19) and CMake ≥ 3.18. pip install . builds a checkout the same way.

The package ships type stubs, so editors and mypy/pyright get full completion.

import dexpp

apk = dexpp.Apk.open("app.apk")
print(apk.manifest.package, apk.manifest.permissions)
print("signed:", apk.signing.is_signed, [c.sha256_hex for c in apk.signing.certificates])

ctx = apk.analysis()                      # cross into the code
for target, sites in ctx.xrefs.method_refs_by_name("loadUrl"):
    print(target.class_descriptor, len(sites), "call sites")

Build & test (C++)

cmake -S . -B build
cmake --build build -j
ctest --test-dir build --output-on-failure   # run from the project root

./build/main_test tests/data/classes.dex     # demo disassembler

The Python module can also be built in-tree for development:

cmake -S . -B build -DDEXPP_BUILD_PYTHON=ON
cmake --build build -j
PYTHONPATH=build python3 bindings/python/test_dexpp.py

Using it from C++ or Go

The C++ library and the C / Go bindings are source-only for now: there are no install rules or prebuilt binaries.

  • C++: add the checkout to your build with add_subdirectory(dexpp), link the dexpp_core target, and include dex.hpp. DEXPP_VERSION gives the library version.

Editing a DEX file in C++, for example splitting it into one file per class:

#include "dex.hpp"

auto input = dex::model::read_file("classes.dex").value();
for (std::size_t i = 0; i < input.classes.size(); ++i) {
    dex::model::Dex one{input.version, {input.classes[i]}};
    if (auto ok = dex::model::write_file(one, "class" + std::to_string(i) + ".dex"); !ok)
        std::cerr << ok.error().message << '\n';
}

write() builds the file's pools from the references the model holds, so a class can move to another file as it is. See src/model/io.hpp for reading, writing, validate() and rename_types(), and src/model/types.hpp for the model itself.

  • Go: see bindings/go/README.md. The cgo package links the C shim from this repository's build/ directory, so it works from a checkout, not through go get.

Layout

  • src/raw/ — dex::raw: stateless DEX format parser + a minimal ZIP reader, and the format-level pieces a writer needs (opcode table, MUTF-8, digests).
  • src/common/ — vocabulary types shared by the layers (MethodId, FieldId, AccessFlags).
  • src/analysis/ — dex: the handle-based analysis API (the code surface).
  • src/model/ — dex::model: the editable DEX model (read, validate, write, rename).
  • src/apk/ — dex::apk: package metadata (manifest, resources, signing).
  • src/dex.hpp — the single public umbrella header.
  • bindings/python/ — the pybind11 module, stubs, and Python tests.
  • bindings/c/, bindings/go/ — the C ABI shim and the Go package over it.

Metadata

Release files for dexpp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dexpp 0.2.0
File Size Uploaded Provenance Actions
dexpp-0.2.0.tar.gz 211.1 kB With provenance Details for dexpp-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for dexpp 0.2.0
File Interpreter ABI Platform Actions
dexpp-0.2.0-cp314-cp314-musllinux_1_2_x86_64.whl CPython 3.14 CPython 3.14 Linux musl 1.2+ x86-64 Details for dexpp-0.2.0-cp314-cp314-musllinux_1_2_x86_64.whl
dexpp-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for dexpp-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Total release size: 3.3 MB

Release files / dexpp-0.2.0.tar.gz

Download URL dexpp-0.2.0.tar.gz
Size 211.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5fb860e60aeb3149238fb1f36406c436e601ac0a16ab9496e8ebfd0e30b00081
BLAKE2b-256 checksum
How to use checksums
d225f3cdaf0cc1515ffa239f39442c7a74b34ca35aa77cfd431dc446d5668652
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / dexpp-0.2.0-cp314-cp314-musllinux_1_2_x86_64.whl

Download URL dexpp-0.2.0-cp314-cp314-musllinux_1_2_x86_64.whl
Size 2.0 MB
Tags CPython 3.14 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
48f68c3234edf1fc85dc952857eea3a08ade2688ac22fe597a9cb16ff4e5987a
BLAKE2b-256 checksum
How to use checksums
d65e91a2a66698d04162ae1a1e61a468af3c7da72d0ff60b34b34d44127e0e65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / dexpp-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL dexpp-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.1 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9c56fc2275af004df6c50cb28f693147c98dd8d15bbb9b8c3126f750c51d4387
BLAKE2b-256 checksum
How to use checksums
e79fb938bc243942030235c7b148a0386ba0f0a512eca9b1ceea647fba4ef26e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for dexpp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for dexpp-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

3 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page