ant
directory to the main directory of your Android project:
dexguard-project.txt custom_rules.xml
local.properties in your Android project. For instance:
dexguard.dir=/usr/local/DexGuard5.0
ant
directory to the main directory of your Android project:
dexguard-project.txt
eclipse directory to
the dropins directory of your Eclipse install:
com.saikoa.dexguard.eclipse.adt_*.jar
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:
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.
android
local.properties, make sure your project is
updated to work with the installed Android SDK. For example:
android update project --path MyAndroidProjectDirectory
cd samples/HelloWorld (edit sdk.dir in the file local.properties) ant debug installBy default, the samples target "android-15", so you should have the target API for Android 4.0.3 installed.
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:
-keep class mypackage.MyClass
-keepclassmembers class mypackage.MyClass {
void myMethod(java.lang.String);
}
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.