Utilities
Compile a class-file JAR to one DEX
Compile supplied Java class files into one binary DEX artifact.
overview
What d8-compile-dex does
Supply one local class-file JAR. The adapter validates it and stages the bytes under a .jar filename before running pinned R8 D8 9.5.26 in release mode with minimum API 28 and desugaring disabled. It saves generated classes.dex as the output FILE.
This node does not expose android.jar, a library resolver or caller-selected compiler options. It does not package an APK, sign an app or run bytecode on a device. A successful compile alone does not establish runtime compatibility.
The supplied JAR must be a nonempty regular file of at most 20 MiB, with at most 5,000 ZIP entries, at most 20 MiB declared size per entry and at most 64 MiB declared total expansion. The native Java process has a 90-second timeout and a 256 MiB maximum Java heap. Native logs and the one DEX artifact are checked against 4 MiB after the process exits; these are not peak process-memory or disk containment guarantees.
source hub.docker.com/r/nenadzaric/skills-android-d8-compile-dex
use cases
Where d8-compile-dex fits
Produce DEX from a supplied class-file fixture
Compile existing JVM class files to a DEX artifact for downstream inspection. The owned fixture produces a DEX whose answer() method returns 42 under independent baksmali inspection.
Keep compilation separate from app packaging
Pass the binary DEX output to a compatible downstream node. APK construction, resource processing, signing and device execution are separate jobs.
Reject an archive without class files
The adapter checks for a .class entry before invoking D8. The native no-class probe exits zero without a DEX; adapter preflight rejects that input instead of treating missing output as a successful artifact.
reference
d8-compile-dex inputs and flags
| Name | Type | Flag | Description |
|---|---|---|---|
| jar | FILE | --jar | Local class-file JAR, nonempty and at most 20 MiB; contains at least one .class entry. |
Showing key inputs. d8-compile-dex exposes 1 inputs in total.
example
Run d8-compile-dex
d8-compile-dex --jar owned-answer42.jar -o classes.dex.method public static answer()I
.registers 1
const/16 v0, 0x2a
return v0
.end methodguidance
Choosing d8-compile-dex
Choose this node when your input is a class-file JAR and your next step needs a single DEX. Choose smali-assemble for smali source or dex2jar-convert for the opposite DEX-to-JAR direction. These jobs are not a guarantee of lossless round trips.
smali-assemble
Assemble a smali source folder into DEX rather than compile JVM class files from a JAR.
dex2jar-convert
Convert DEX to a JVM JAR. D8 here accepts class-file JAR input and produces DEX.
faq
d8-compile-dex questions
related
More Utilities tools
browser-fetch
Headless Chromium render: requested URL, final URL, status, and title next to the page.
cewl
Spider a URL and return a wordlist for password crackers.
csvkit
SQL on one CSV. The table name is the file stem.
dnsgen
Wordlist and mined-word subdomain permutation.
duckdb
In-process SQL on CSV, JSON, and Parquet. No server.
edge-tts
Microsoft Edge neural speech from text or a script file. No API key.
Run d8-compile-dex yourself
Saved independent baksmali inspection excerpt from the DEX also downloaded and verified in the owned platform run. The delivered artifact is binary DEX, not this smali text. Its native SHA-256 is 6f56c40237b9185b946878d5d16d8a202041c6627a0c66cce0a87e7a373b8ee7.
Facts on this page come from the live Trickest tool library.