ProGuard

The ProGuard obfuscator ships with the Android SDK and is very easy to enable. Simply uncomment the line in the project.properties file that begins with proguard.config, as shown in Listing 2-3.

In the example that follows in this section, ProGuard is using two configuration files. The first is proguard-android.txt in the tools/proguard directory, which is the shared generic Android configuration file. The second is proguard-project.txt, which is the project configuration file. The latter is often left blank for basic obfuscation.

This only works with the Ant or Eclipse integration. In Android Studio you will need to configure ProGuard in build.gradle as follows:

buildTypes {        release {            runProguard ...

Get Bulletproof Android™: Practical Advice for Building Secure Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.