O'Reilly logo

Bulletproof Android™: Practical Advice for Building Secure Apps by Godfrey Nolan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required