Abstract
Software obfuscation is widely used by Android developers to protect the source code of their applications against adversarial reverse-engineering efforts. A specific type of obfuscation, string obfuscation, transforms the content of all string literals in the source code to non-interpretable text and inserts logic to deobfuscate these string literals at runtime. In this work, we demonstrate that string obfuscation is easily reversible. We present ASTANA, a practical tool for Android applications to recover the human-readable content from obfuscated string literals. ASTANA makes minimal assumptions about the obfuscation logic or application structure. The key idea is to execute the deobfuscation logic for a specific (obfuscated) string literal, which yields the original string value. To obtain the relevant deobfuscation logic, we present a lightweight and optimistic algorithm, based on program slicing techniques. By an experimental evaluation with 100 popular real-world financial applications, we demonstrate the practicality of ASTANA. We verify the correctness of our deobfuscation tool and provide insights into the behavior of string obfuscators applied by the developers of the evaluated Android applications.
Introduction
To protect Android applications from reverse engineering, developers often apply code obfuscation. One specific technique is string obfuscation, which encrypts or scrambles human-readable string literals—such as API keys, URLs, or SQL queries—in the source code and inserts logic to decrypt them at runtime. While benign apps use this to protect intellectual property, malware authors heavily rely on it to hide malicious payloads from automated antivirus scanners.
Existing tools to reverse string obfuscation are often brittle, relying on rigid pattern matching or lacking context-awareness. They frequently fail when developers combine string obfuscation with control flow obfuscation. ASTANA was designed as a generic, context-aware deobfuscator that makes minimal assumptions about the underlying obfuscator and scales to analyze massive, complex codebases without the overhead of computationally heavy traditional analysis.
Methodology
ASTANA operates in three main phases to extract and run hidden strings, as illustrated in the system workflow below.
1. String Literal Analysis
ASTANA unpacks the Android APK, converting Dalvik bytecode into both Java bytecode (.jar) and human-readable Smali code (.smali). It scans the Smali code for string declarations and uses heuristics to identify "deobfuscation candidates," such as strings passed to specific constructors or static methods that return a String object.
2. Optimistic Backwards Program Slicing
To isolate the decryption logic, ASTANA uses backwards program slicing. Traditional slicing relies on a Program Dependency Graph (PDG), which can grow exponentially in complexity. Instead, ASTANA employs a lightweight, "optimistic" approach by building a Register Dependency Graph (RDG).
This RDG focuses only on the specific execution paths between a string's declaration and its suspected decryption point. By extracting only the necessary statements to recreate the string, ASTANA avoids the performance bottlenecks of full-app modeling.
3. Slice Execution
The extracted "slice" is compiled into a standalone Java class and executed in a standard Java Virtual Machine (JVM). ASTANA provides a 5-second timeout for the slice to run the decryption logic and output the plaintext string.
Experimental Evaluation
The tool was evaluated against the Top 100 UK Financial Android Applications from the Google Play Store. These apps were selected because they handle sensitive user data and are highly likely to employ commercial-grade obfuscation.
Key Results
- High Success Rate: ASTANA successfully analyzed 97 out of 100 apps, identifying 79,272 obfuscated string candidates.
- Execution Yield: 71,409 (90%) of the generated program slices executed successfully, returning non-empty plaintext strings.
- Qualitative Validation: Character distribution analysis confirmed that recovered strings matched standard English text, whereas the obfuscated inputs appeared as random noise.
- Security Insights: The recovered strings revealed sensitive logic, including hardcoded "root" checks and certificate pinning configurations.
Discussion and Insights
The evaluation provided several key takeaways regarding the current state of Android security:
- Simplicity of Obfuscation: Despite commercial tools, actual decryption mechanisms rely on a very small set of techniques (approximately five distinct methods were observed).
- Efficiency of Lightweight Analysis: Heavyweight analysis is often unnecessary; localized, optimistic slicing is faster and highly effective for defeating string obfuscation.
- Logic Size: Deobfuscation logic is typically very compact; over 59% of generated slices contained 10 or fewer statements.
- Selective Protection: Developers often leave third-party libraries (like networking frameworks) unobfuscated to maintain performance, focusing protection only on core application logic.
Limitations and Future Work
ASTANA may fail if obfuscators use reflection across separated definitions or if they insert Android-specific runtime environment checks (e.g., checking OS versions) that fail in a standard desktop JVM. Future improvements could involve converting slices back to Dalvik bytecode for execution on physical Android devices to bypass environment-specific checks.
Summary updated