Utilities

Recover Java stack frames from an R8 mapping

Translate an obfuscated Java stack trace using the mapping from its build.

Agent

overview

What retrace-stacktrace does

Supply two local files: the R8 mapping from the relevant build and its Java stack trace. The adapter runs pinned R8 Retrace 9.5.26 and saves its native text output. It does not fetch mappings, record crashes or connect to a device.

A zero exit does not establish that the supplied mapping matches the build. Unmatched frames may remain obfuscated, and an empty trace produces a valid empty file. Recoverable names and line information depend on the mapping and trace you supplied.

The mapping must be a nonempty regular UTF-8 file of at most 20 MiB; the trace must be a regular UTF-8 file of at most 1 MiB and may be empty. NUL bytes are rejected. The native Java subprocess has a 90-second timeout and a 256 MiB maximum Java heap. Each output/log is checked against 4 MiB after the process exits; these checks do not bound peak process memory or disk use.

source hub.docker.com/r/nenadzaric/skills-android-retrace-stacktrace

use cases

Where retrace-stacktrace fits

Recover a known obfuscated frame

Use the mapping retained with a build to translate its Java trace. The owned fixture recovers com.trickest.Fixture.crash(Fixture.java:42).

Keep unresolved frames visible

Save native Retrace text for later review. An unmatched mapping can leave a.b.c(SourceFile:1) unchanged while the process exits successfully.

Process crash text without a device connection

Pass existing mapping and trace files between workflow nodes. This job exposes no crash collection, remote URL, symbol download or device operation.

reference

retrace-stacktrace inputs and flags

2 inputs
NameTypeFlagDescription
mappingFILE--mappingMatching-build UTF-8 R8 mapping FILE, nonempty and at most 20 MiB.
traceFILE--traceUTF-8 Java stack-trace FILE, at most 1 MiB; empty is valid.

Showing key inputs. retrace-stacktrace exposes 2 inputs in total.

example

Run retrace-stacktrace

retrace-stacktrace · command
retrace-stacktrace --mapping mapping.txt --trace trace.txt -o recovered.txt
sample output
java.lang.RuntimeException: owned fixture
    at com.trickest.Fixture.crash(Fixture.java:42)

guidance

Choosing retrace-stacktrace

Choose this job when you already have a Java stack trace and its matching R8 mapping. Use jadx-decompile to inspect APK/DEX source or dex2jar-convert for a JVM JAR; those jobs do not replace the build mapping needed here.

jadx-decompile

Inspect APK/DEX code as generated Java source; a different input and output from retracing existing Java crash text.

dex2jar-convert

Convert DEX bytecode to a JVM JAR rather than translate stack frames with a supplied mapping.

faq

retrace-stacktrace questions

No. The unmatched owned fixture exits successfully and preserves its obfuscated frame. Use the mapping from the relevant build and inspect the native output; the node does not certify the mapping or guarantee every frame is recovered.

No. The empty owned trace produces a zero-byte output with a successful exit. The mapping itself must be nonempty.

No. Its inputs are a supplied R8 mapping and Java stack-trace text. Native tombstone symbolization, log collection and device actions are outside this contract.

The mapping must be a nonempty regular UTF-8 file of at most 20 MiB; the trace must be a regular UTF-8 file of at most 1 MiB and may be empty. NUL bytes are rejected. The native Java subprocess has a 90-second timeout and a 256 MiB maximum Java heap. Each output/log is checked against 4 MiB after the process exits; these checks do not bound peak process memory or disk use. Malformed or missing mappings, oversized or non-UTF-8 inputs and refusal to overwrite nonempty output returned adapter exit 2 in the saved tests. Output must be absent or an empty regular file and must differ from both inputs.

The notices1 image passed eight native cases: recovered frame, empty trace, unmatched mapping, malformed mapping, missing mapping, oversized input, non-UTF-8 input and preservation of existing nonempty output. A four-node platform workflow also passed using two owned fixture files, with downloaded native output and verifier checks. Public image and source/notices downloads have been verified anonymously. The original tool ID is public in the Library.

The source link provides immutable ORAS download directions and the bundle SHA-256 for the actual adapter, build files, fixtures, official R8 source, release dependency source records, original notices and matching Java runtime source. R8 9.5.26 uses source commit e3b702721f5dfe78fc536316df4741ff6f32916a, with BSD-3-Clause core and component terms. The release dependency list includes build dependencies; it is not an exhaustive inventory of the minimized runtime.

Run retrace-stacktrace yourself

Complete downloaded native text from the owned matching-build platform fixture. Retrace recovers Fixture.java:42 from the supplied mapping and obfuscated trace; this example does not guarantee recovery for other mappings.

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