Updated Oct 19, 2026

Utilities

Assemble smali files into DEX bytecode

smali-assemble is an offline adapter for a selected google/smali operation.

Agent

overview

What smali-assemble does

Supply a folder containing only .smali files to assemble a classes.dex artifact. The adapter selects API level 28 and one native worker.

A FILE containing native DEX bytecode. The adapter checks DEX header length, SHA1 signature and Adler32 checksum. These structural checks do not prove that the code is safe or behaves correctly.

Native execution has a 120-second timeout and JVM -Xmx256m. The adapter checks a 4 MiB artifact limit after execution; this is not peak process-memory or temporary-disk containment. The source is limited to 200 files and 10 MiB, with only .smali files and no symlink entries.

Pinned native source 3.0.7 at 878d37fe960945e1b2eec430f1649d43910a4fd0. Final-image native positive and negative fixtures passed. The private platform fixture-tool-verifier run passed. The exact image and source/notices bundle are publicly downloadable; the exact public Library identity was verified. This is a source-built fatJAR; native version output has an upstream -dev suffix and the image uses tag 3.0.7-source1. It is not claimed to be an official release binary.

source github.com/google/smali/tree/878d37fe960945e1b2eec430f1649d43910a4fd0

use cases

Where smali-assemble fits

Assemble smali files into DEX bytecode

Supply a folder containing only .smali files to assemble a classes.dex artifact. The adapter selects API level 28 and one native worker.

Retain the native artifact

A FILE containing native DEX bytecode. The adapter checks DEX header length, SHA1 signature and Adler32 checksum. These structural checks do not prove that the code is safe or behaves correctly.

reference

smali-assemble inputs and flags

1 inputs
NameTypeFlagDescription
sourceFOLDER--sourceFolder containing only .smali source files.

Showing key inputs. smali-assemble exposes 1 inputs in total.

example

Run smali-assemble

smali-assemble · command
python3 /app/run.py --source ./smali-source ./output
sample output
[{"class": "Lorg/trickest/fixture/Fixture;", "methods": [{"name": "answer", "descriptor": "()I", "instructions": [["const/16", "v0, 42"], ["return", "v0"]]}, {"name": "endpoint", "descriptor": "()Ljava/lang/String;", "instructions": [["const-string", "v0, \"https://fixture.invalid/api/v1\""], ["return-object", "v0"]]}]}]

guidance

Choosing smali-assemble

Use this job for smali-to-DEX assembly. Apktool rebuilds broader package resources, while baksmali disassembles DEX in the reverse direction. The tool does not generate a signed APK.

faq

smali-assemble questions

source: Folder containing only .smali source files.

A FILE containing native DEX bytecode. The adapter checks DEX header length, SHA1 signature and Adler32 checksum. These structural checks do not prove that the code is safe or behaves correctly. The registered contract also exposes a FOLDER output; the primary native artifact is the FILE described here. The downloaded primary FILE and its fixture semantics were verified in the platform run.

Native execution has a 120-second timeout and JVM -Xmx256m. The adapter checks a 4 MiB artifact limit after execution; this is not peak process-memory or temporary-disk containment. The source is limited to 200 files and 10 MiB, with only .smali files and no symlink entries.

Use this job for smali-to-DEX assembly. Apktool rebuilds broader package resources, while baksmali disassembles DEX in the reverse direction. The tool does not generate a signed APK.

Yes. This Library tool uses the tested image and supplied-file contract. Native fixtures and the private platform fixture-tool-verifier run passed; the exact image, adapter source and notices are publicly downloadable through the repository directions below.

The public repository overview provides immutable image and ORAS source/notices download commands, the exact bundle SHA256 and pinned native source directions. The bundle retains the adapter, build recipes, owned fixtures, portable native/verifier harnesses, installed and embedded notices, dependency source/POMs and matching Debian OpenJDK source payloads. First-party adapter licensing is separate from native/component licenses. Use its IMAGE override with the immutable public image to reproduce the native fixture without a GHCR account. Source provenance qualifications are retained; this is not a reproducible-build or exhaustive-SBOM claim. Image, source and license notice downloads.

Run smali-assemble yourself

Retained Androguard inspection of the actual assembled DEX from a self-owned smali fixture. This JSON is independent inspection output, not the binary DEX format returned by the node. It confirms the answer() method returns 42. Invalid source syntax and an empty source folder were rejected separately.

Facts on this page come from the live Trickest tool library.