Quick Start

DexGuard is a specialized optimizer and obfuscator for Android applications. It is easy to integrate in your Android build process. Once installed, it works transparently, producing code that is optimized and more difficult to crack.

Setting Up the Ant Build

If you develop your applications with the Ant build process of the Android SDK Tools (revision 21.0.0 or higher), you can enable DexGuard as follows:
  1. Copy the two configuration files from DexGuard's ant directory to the main directory of your Android project:
    dexguard-project.txt
    custom_rules.xml
    
  2. Specify the main DexGuard directory on your system in the configuration file local.properties in your Android project. For instance:
    dexguard.dir=/usr/local/DexGuard5.0
    
The standard Ant build process will now automatically use DexGuard for your Android project.

Setting Up the Eclipse Plugin

If you develop your applications in Eclipse (version 3.7 or higher) with the plugin of the Android Developer Tools (version 23.0.1.1256982 or higher), you can enable DexGuard as follows:
  1. Optionally copy the configuration file from DexGuard's ant directory to the main directory of your Android project:
    dexguard-project.txt
    
  2. Copy the plugin from DexGuard's eclipse directory to the dropins directory of your Eclipse install:
    com.saikoa.dexguard.eclipse.adt_*.jar
    
You're set! The standard Eclipse build process will automatically use DexGuard for all Android builds.

Getting the Most Out of DexGuard

DexGuard has been configured to work out of the box for most projects. It transparently combines the functionality of ProGuard, dx, apkbuilder, signjar, and zipalign in a single, seamless process. Instead of creating a whole series of intermediary and final .apk files in the bin directory, it just produces the final .apk file.

When building in debug mode, DexGuard only converts and packages your code. When building in release mode, it additionally optimizes and obfuscates the code.

Once your basic setup works, you should have a look at DexGuard's specialized optimizations and advanced obfuscation. For optimally protecting your application, consider the following options:

You can specify custom configurations in the following optional files:
dexguard-project.txt         (for all targets)
dexguard-project-debug.txt   (for target 'debug')
dexguard-project-release.txt (for target 'release')
proguard-project.txt         (for backward compatibility with ProGuard)
All options are all illustrated in the sample projects in the directory samples. Our best practices can serve as a guideline.

Quick Troubleshooting

If you have problems setting up your project:

If the obfuscated application doesn't work, you may have to add some custom configuration to dexguard-project.txt. The most common issues on the Android platform:

You can look at the generated files bin/proguard/seeds.txt and bin/proguard/usage.txt to check which classes and class members DexGuard has explicitly kept (due to the configuration), or removed (because they appeared unused).

Please consult the extensive troubleshooting section if you encounter other issues.


Copyright © 2002-2014 Saikoa BVBA.