Obfuscate your Android app resources using AabResGuard — rename resource identifiers to shorten names, reduce APK size, and add a layer of protection against reverse engineering.
Resource Obfuscation (Res Guard) integrates AabResGuard directly into your IDE workflow. AabResGuard is a tool that obfuscates Android resource names in AAB/APK files, replacing readable resource identifiers (like ic_launcher_background or strings_app_name) with short, meaningless names. This reduces APK size by removing redundant string data in the resource table and adds a layer of protection against reverse engineering.
ADB Pro manages the entire AabResGuard lifecycle: downloading and managing the AabResGuard JAR, configuring whitelist rules and filter options, injecting the Gradle plugin configuration into your build.gradle.kts, and executing the obfuscation task. Everything is controlled from a single tab with three sub-sections: JAR Management, Configuration, and Execution.
Without resource obfuscation, Android apps expose more than most developers realize. Here are the common pain points:
Res Guard automatically downloads and manages the AabResGuard JAR file. The JAR Management tab shows the current version, download status, and file location. If the JAR is missing or outdated, a single click downloads the latest version. The JAR path is persisted as an application-level setting, so it's shared across all projects.
The Configuration tab provides a visual editor for AabResGuard settings. Configure whitelist rules organized by resource type (raw, drawable, mipmap, string, xml), enable or disable file and string filtering toggles, and set up SDK-specific whitelist entries. The configuration is written as a Gradle configuration block that AabResGuard reads during the build process.
When third-party SDKs are configured (via Quick Setup or manually), Res Guard automatically adds the necessary whitelist entries. Firebase Analytics, Firebase Crashlytics, Google Ads, Pangle, Facebook SDK, and notification resources each have predefined whitelist patterns. This prevents the common mistake of obfuscating resources that SDKs reference by name at runtime.
Res Guard can inject the AabResGuard Gradle plugin configuration directly into your build.gradle.kts. The Gradle injector analyzes your existing build file structure, detects the correct insertion point, and writes the classpath dependency and plugin application block. If an existing AabResGuard configuration is detected, the tool updates it rather than creating a duplicate.
The Execution tab runs the AabResGuard obfuscation task and displays real-time execution output. You can see the obfuscation progress, any warnings about resources that were skipped, and the final output size comparison. The execution log is timestamped and persisted for reference.
In addition to automatic download, you can import an AabResGuard JAR from a local path. This is useful when working in environments without internet access, using a custom fork of AabResGuard, or when your organization hosts the JAR on an internal artifact server. Imported JARs are tracked with the same version metadata as downloaded ones, so update detection still works.
Enable the mergeDuplicatedRes toggle to instruct AabResGuard to deduplicate identical resource files before obfuscation. When multiple drawable or raw resources share the same content but have different names, they are merged into a single resource entry. This can significantly reduce the resource table size in projects with duplicated assets across flavor-specific resource directories.
When file filtering is enabled, AabResGuard only obfuscates resources with the specified file extensions. By default, common resource extensions like .png, .webp, and .xml are included. You can customize the filter list to include or exclude specific extensions — for example, excluding .json files that are loaded dynamically at runtime by name.
Enable string filtering to remove unused string resources from the final output. When paired with an unused-string list file, AabResGuard strips string entries that are not referenced by any layout, code, or configuration resource. This is particularly effective for apps with large localization files where many string keys are defined but never used.
When string filtering is active, the language whitelist prevents specific locale string files from being stripped. For example, whitelisting en and zh ensures that English and Chinese string resources are preserved even if they appear unused to the static analyzer. This is important for apps that load localized strings dynamically or use string resources selected at runtime based on user preferences.
AabResGuard obfuscation can target specific build variants. The Gradle analysis step detects all available variants in your project (e.g., release, freeRelease, paidRelease) and presents them for selection. Choose the variant whose AAB output should be obfuscated. The variant selection also controls which Gradle task is invoked — for example, selecting freeRelease runs the AabResGuard task against the bundleFreeRelease output.
| Resource Type | Whitelist Pattern Example | Common SDKs Needing Whitelist |
|---|---|---|
| drawable | */ic_launcher* |
Firebase, Facebook SDK |
| mipmap | */ic_launcher* |
Launcher, Adaptive icons |
| raw | */google_* |
Firebase Analytics, Crashlytics |
| string | */app_name |
Google Ads, Pangle |
| xml | */network_security_config |
Network security configs |
Res Guard is accessible from the ADB Pro side panel. Follow these steps to set up resource obfuscation:
After running AabResGuard, confirm everything works correctly:
ClassNotFoundException or Resources.NotFoundException for whitelisted resources.