Clavem

Code obfuscation

Code obfuscation is the practice of transforming a program, usually by renaming classes and functions to meaningless names and scrambling its structure, so that it still runs the same way but is harder for a person to read or reverse engineer.

How it works

An obfuscator takes your compiled program or source and rewrites it without changing what it does. Common moves are renaming symbols, flattening control flow so the logic is harder to follow, and encoding strings so they do not appear in plain text. The result runs the same, and reads much worse.

Android’s R8 tool is a documented example. Its documentation describes shortening the names of classes, fields and methods to reduce the size of the DEX file, so that com.example.MyActivity could become a.b.a. There the renaming is part of making the app smaller, and the side effect is that it also becomes harder to read.

What it protects and what it does not

Obfuscation helps against It does not help against
Reading the code to understand an algorithm Running the program in a debugger and watching what it does
Finding a function by its name, such as isLicensed Finding the check by its behavior or by the library it calls
A casual look at a decompiler A person who is patient, or willing to automate the search

The program must still run on the customer’s machine, so the real logic exists at run time. Strings that were encoded have to be decoded before they are used. Calls into a standard crypto library, such as an Ed25519 verify function, tend to stay recognizable even when your own names are scrambled.

What it costs you

Obfuscation changes your build, and the costs show up later.

  • Crash reports. Android’s documentation notes that enabling app optimization makes stack traces difficult to understand, especially if R8 renames class or method names. You then have to translate each report back to the original source. Keep the mapping the tool produces for every release you ship, or old crash reports become unreadable.
  • Debugging. Support questions that quote an obfuscated name are harder to trace.
  • Breakage. Code that finds classes or members by name at run time, through reflection, can stop working when names change. You need rules that keep those names.
  • Build time and testing. Every release build needs a test pass on the obfuscated output, not only the debug build.

Obfuscation versus a license check

A license check answers whether this customer paid. Obfuscation only makes the check harder to find. The two do different jobs, and one is not a replacement for the other. An obfuscated app may cost a crack author more hours, and a determined one will still finish. Many sellers add obfuscation late, after cheaper measures such as device limits and server-side checks are in place. See software piracy for which defences cost honest customers the least.

How Clavem handles it

Clavem does not obfuscate anything and does not ship tooling for it. It gives you random server-checked keys and Ed25519-signed tokens, which stop keygens and forged server answers. It does not make your own binary harder to patch. If you obfuscate your app, test the license verification path on a release build, because renaming can break code that looks things up by name. For the full list of ways license checks go wrong, read license key security mistakes.

Questions

Does obfuscation make a license check secure?

No. It slows down someone reading the code, but the program still has to run the check, so a determined person can find it with a debugger. Treat it as a delay, not a lock.

Is obfuscation the same as encryption?

No. Encrypted code cannot run until it is decrypted, and obfuscated code runs as it is. Obfuscation hides intent, not data.

Sources

  1. Android Developers, Enable app optimization with R8 (checked November 2026)