Build with
ProGuard in production
ProGuard
in productionIn accordance with industry guidelines, after your
app is fully
tested and ready to deploy,
you
should use an obfuscation tool as part of your formal build and release
process.
Multiple obfuscation tools are currently available. To ensure correct
BlackBerry
Dynamics
operation and
performance, however, they need to be configured so as not to obfuscate key parts of the BlackBerry Dynamics SDK
library. Below is a
configuration that can be used as the basis for any application. Using ProGuard
is recommended because
it is the default obfuscation tool for Android. If you are using an alternative tool, the
rules in the appendix should be adapted for that tool.The
BlackBerry Dynamics SDK
uses
Platform APIs, some of which rely on versions of above the minimum supported API Level. A
target SDK below the latest API level might throw warnings about the newer APIs, because
</li> cannot find them in the underlying Platform JAR. The BlackBerry Dynamics SDK
now ensures the
appropriate runtime checks are made before it attempts to use any such API. You can
ignore warnings about APIs that aren't found in BlackBerry Dynamics SDK
classes with
-dontwarn com.good.gd
as shown on the final line in
the example below.The snippet below is an
</li>.cfg
file
that works for any BlackBerry Dynamics SDK
app.... #### General -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* -keepattributes Exceptions -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } ## Rules forBlackBerry Dynamicsand its included library components -keep class com.good.gd.** { <methods>; <fields>; } -keep class com.good.gt.** { <methods>; <fields>; } -keep class org.apache.http.** { <methods>; <fields>; } -dontwarn com.good.gd.** -dontwarn com.good.gt.** ...