Skip to main content
# Dex2Call

[![PyPI version](https://badge.fury.io/py/dex2call.svg)](https://badge.fury.io/py/dex2call)

A simple script that takes an APK or a DEX files and returns the method calls made by the developer's code to the android.jar classes.

Tested on Python 2.7 and 3.7 but should be a polyglot script.

## Installation

pip install dex2call

## Usage

$ dex2call --help
Usage: dex2call [OPTIONS] <dex or apk>

This script reads the bytecode of a dex file or an apk file and yields the
API calls made by the developer code. By default only shows the API calls
made to android.jar.

The script by default looks for ./classes.dex.

Options:
-o, --output <file> Location where to dump the results. Default
stdout (-)
--android-only / --all-methods Set to true to remove any method call that
doesn't point to an android method
--help Show this message and exit.

## Example:

As command line tool:

$ dex2call classes.dex
(android.location.Location getLatitude () None)
(android.location.Location getLongitude () None)
(android.app.Activity <init> () None)
(android.app.Activity onCreate (android.os.Bundle) None)
(android.location.LocationManager requestLocationUpdates (java.lang.String android.location.LocationListener) None)
(android.app.Activity onResume () None)
(android.util.Log d (java.lang.String java.lang.String) None)
(android.util.Log d (java.lang.String java.lang.String) None)
(android.widget.Toast makeText (android.content.Context java.lang.CharSequence) android.widget.Toast)
(android.widget.Toast show () None)
(android.widget.Toast makeText (android.content.Context java.lang.CharSequence) android.widget.Toast)
(android.widget.Toast show () None)

If an APK is passed to the tool, it will extract each dex file and also will infer the package name.

An example can be found in `example.py` of how to use dex2call as a python module.

Metadata

Release files for dex2call 0.6.1

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

Source distribution (sdist)

Source distribution for dex2call 0.6.1
File Size Uploaded Provenance Actions
dex2call-0.6.1.tar.gz 3.4 kB Without provenance Details for dex2call-0.6.1.tar.gz

Release files / dex2call-0.6.1.tar.gz

Download URL dex2call-0.6.1.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1ec6bc48d125321ba2f8a4d7decfb366d940f60f08d5423010152336b64eb799
BLAKE2b-256 checksum
How to use checksums
e16905c03b2dbcd3e876a1e43cea61e9a2f4ec51a2390c5a0abf11349743172d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Security for dex2call 0.6.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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