The DashO™ Gradle Plugin for Android is a Gradle plugin that allows you to integrate PreEmptive Protection™ DashO into your Android Gradle build quickly and easily. The plugin allows DashO to work alongside R8 to protect your Android application or library. Specifically, the integration relies on DashO to protect Control Flow Obfuscation, StringThe DashO Gradle Plugin for Android integrates PreEmptive Protection DashO into the Gradle build for an Android application or library. The plugin works with the Android Gradle Plugin and R8 so protection is applied as part of the Android build process.
How the integration protects your Android project
DashO and R8 perform different parts of the protection process:
| Tool | Protection responsibilities |
| DashO | Control Flow Obfuscation, String Encryption, Resource Encryption, and Checks |
| R8 | Renaming, Removal, and Optimization |
For complete protection, enable shrinking with R8 for each build type that the DashO plugin protects.
Android Mode
The DashO Gradle Plugin for Android uses an Android Mode DashO configuration. In Android Mode:
- The plugin manages the build inputs, dependencies, and outputs.
- DashO disables the transformations delegated to R8.
- You configure the applicable DashO protection features in the Android Mode project file.
Android Mode project files are designed for this integration and are different from the Standard Mode project files used for JVM-based Java projects and some post-processing workflows.
Integration workflow
To integrate DashO into an Android Gradle project:
- Review DashO Gradle Plugin for Android Version Compatibility and select a compatible combination of DashO, Gradle, the Android Gradle Plugin, Kotlin, and Java.
- Follow the Android getting started instructions to create the Android Mode project and integrate the plugin.
- Configure the DashO Gradle Plugin for Android for the build variants and protection behavior required by your project.
- Enable R8 for the DashO Android integration.
- If the plugin cannot automatically locate a compatible DashO installation, configure DashO Home for the Android Gradle Plugin.
- Build the protected variant and verify that the build output shows that DashO ran successfully.
If you are migrating from an older Android Gradle integration, review the DashO upgrading instructions before changing your build.
Related articles