SReverseby Simpa Labs

Shrinking and keep rules

How ProGuard affects APK API analysis

The effect ProGuard has on an analysis comes down to its keep rules. They decide which classes, methods and fields still have usable names in the shipped dex.

Where ProGuard sits in the build

ProGuard processes Java class files before Android DEX conversion in builds that use it. Shrinking, optimization and name obfuscation are distinct steps; Java class-file preverification is not ART verification. The output is a smaller program with short names. R8 reads ProGuard configuration syntax and performs the same broad classes of work, so a ProGuard configuration file recovered from a repository is often the most informative single artifact an analysis can find.

Keep rules decide what survives

Shrinking starts from configured entry points and follows code references. Keep rules describe uses the tool cannot discover, such as reflection. The standard Android configuration preserves classes the platform resolves by name, and an app adds its own rules for anything it looks up dynamically. Read the exact rule and its modifiers. The ProGuard manual separates keeping classes, members and names, and permits modifiers that allow renaming or optimization. One kept class does not preserve every reachable name.

Lookups preserved by rules can provide useful names. Check the shipped DEX rather than assuming a reflection-heavy section stayed readable.

Debug attributes and annotations

ProGuard can strip attributes that carry debugging metadata. When source file names and line numbers are removed, stack traces stop pointing at the original source, which can make a stack trace harder to resolve. Use a matching mapping file and the attributes the build retained. When those attributes are kept, an exception from a crash report can point straight at the method that produced it, and that is often the quickest entry into a flow.

Annotations are a separate attribute. Frameworks that inspect them at run time need them preserved, so an app built on such a framework usually keeps them, and the annotations then survive with their string values intact. Inspect retained annotations for route data, then verify the request path and any values added at runtime.

What an API analysis can still use

  • Retrofit annotations on interface methods, which carry the HTTP method and path as string values even when the method name is a single letter.
  • URLs, host names, header names and content types stored as constants.
  • JSON wire names in fields, annotations, adapters or generated serializer code.
  • Manifest components and their intent filters, which describe entry points into the flow.
  • Resource files and layout names, which still link screens to the code that inflates them.
  • Native method declarations and their runtime binding. Name-based lookup and explicit registration use different mappings; read both sides before assigning a native address.

Distinguishing ProGuard from R8 output

Short names alone do not identify the tool that produced them. Several signals help. Both tools optimize structure. Use build records and matching mapping metadata to identify the tool; neither short names nor a merged class proves its identity. A mapping header is useful when present, but does not always list every build option.

The distinction matters less than it appears. The reading strategy is the same either way: find the network layer, trace values, and use behavior to name the code.

Reconstructing the request path

Begin with the client. Find the code that creates it, since that is where base URLs, interceptors and converters are configured. The interfaces attached to that client carry the endpoint definitions, and from each definition you can follow the call into the repository or service class that prepares its arguments. Renamed or not, the argument list tells you what the endpoint needs.

Then confirm the path with one live call. A successful request checks that case. Also test fresh sessions, required request sequences and expected failures. Where a prediction is wrong, compare the sent bytes against your notes and look for a step you missed, such as an interceptor that rewrites a header or a converter that changes the body encoding.

Serialization is worth checking early, because it decides how much of the payload you can read statically. A reflective JSON library resolves field names by string, so the names on the wire usually match something present in the dex. A generated serializer compiles the same mapping into code, which means the field names appear as constants in generated classes rather than in the model. Finding which of the two the app uses tells you where the payload shape is defined.

Reviewed 19 October 2026 · SReverse research desk

Start your full APK reconstruction

Send the full APK

Projects start at $70. Choose WhatsApp or email, then attach the APK in the app that opens. We reply within one hour with the next step and send the fixed quote after review.

Want us to contact you?