Migrating from ProGuard or DexGuard to DashO – Updated!
Published on August 27, 2019 by Nathan Arthur
Over a year ago we wrote instructions for migrating from ProGuard or DexGuard to DashO. Since that time, Google introduced R8, fundamentally changing the Android build process. Now, we have released PreEmptive Protection DashO for Android & Java, version 10.0 with a new Android Mode that is designed to work with R8. With this release, migrating from ProGuard or DexGuard to DashO is so simple that it almost doesn’t need instructions – so we’re posting new instructions to make that clear!
Welcome to our new instructions!
Before we begin, let’s make sure we’re all on the same page. We assume you are currently:
- using Android Gradle Plugin 3.2.0 or above (but 3.4.0 or above makes it easier).
- using ProGuard to minify/obfuscate your Android app or AAR. (We’ll cover DexGuard separately, below.)
- enabling ProGuard via the minifyEnabled setting in your Gradle config.
Now, to update your app (or AAR project) to use DashO (v10.0 or above) and R8:
- Run the DashO GUI
- Open the New Project Wizard, if it didn’t appear automatically.
- Hit Next to get to the Select Application Type page.
- Choose “Android (Most projects)” and hit Next.
- Choose the directory where your app’s (or .aar’s) build.gradle is located, and hit Next.
- Read the Summary of what will be changed in your Gradle build config, and hit Next.
From now on, your (release) builds will be automatically protected by DashO and R8. DashO will automatically apply advanced protections like Control Flow and String Encryption (and you will almost certainly want to add Checks, too), and R8 will perform minification and optimization using the exact same ProGuard config file(s) you were using before.
There are a few things you should do to wrap up:
- If you are using Android Gradle Plugin version 3.2 or 3.3, explicitly enable R8.
- Build and test to be sure everything is working. (And check out our Troubleshooting page, if not.)
- Follow our documentation to Enhance Protection by adding Checks and turning up the protection level in DashO and R8.
We mentioned above that we’d cover DexGuard instructions later. Migrating from DexGuard is the same basic process, but first you have to turn DexGuard off. The instructions in our earlier blog for DexGuard are still relevant for DashO 10; just be sure to come back here and use the Wizard, once you are done removing DexGuard, rather than following the older migration instructions.
And that’s it!
And welcome to DashO!