RUScan

Glossary / APK, AAB and XAPK formats

DEX file

DEX (Dalvik Executable) is the file format that holds the compiled code of an Android app. Java or Kotlin sources are compiled into DEX bytecode, and the result ships inside the APK as one or more .dex files, starting with classes.dex.

Updated: 2026-11-24·2 min read

Why it matters for security

All the code of the app is in DEX: network calls, security checks and string constants such as API keys, tokens and server addresses. DEX keeps strings in a table of its own. They can be read straight from the binary, without decompiling anything.

What is inside

A DEX file starts with a header that carries an Adler-32 checksum and a SHA-1 signature of the rest of the file. What follows are tables of strings, types, fields and methods, then the code itself. Dalvik bytecode is register-based, unlike the stack machine of Java bytecode.

The 65,536 method limit

A single DEX file can reference at most 65,536 methods. When an app with its libraries exceeds that number, the build splits the code into several DEX files. Android 5.0 and higher supports such multidex APKs natively. An app with minSdk of 20 or lower needs the multidex support library for the same result.

How to look inside

The string table is readable with any tool that prints binary strings. On a demo APK this line prints the Google API key embedded in the build:

unzip app.apk classes.dex
grep -a -o "AIza[A-Za-z0-9_-]\{35\}" classes.dex

To get back readable Java, run the file through jadx. The same command accepts a whole APK:

jadx -d out classes.dex

What the scan reports

APKSonar walks every classes*.dex of the package, looks for keys and tokens and checks how the code uses crypto, TLS and WebView APIs. A bare .dex file can be uploaded on its own. The report then has no manifest section, because the manifest lives outside DEX.

Sources

Guides on this topic

Related terms

← All terms →