Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is using Proguard with Android worth the effort?

I am about to finish my first Android application and I am trying to work out how to protect it with ProGuard. My apps minimum API is 7 (Android 2.1). I believe using Proguard would be easy if I set my minimum API to 9 (Android 2.3) but as a lot of devices use 2.1 and 2.2 I don't want to exclude them.

Everything I have read about using Proguard with Android seems confusing and difficult (I dont know anything about Ant scripts) Does anyone know of a step-by-step guide for using Proguard for Android with Eclipse?

Is Proguard even worth bothering with?

like image 442
Mel Avatar asked Sep 20 '11 09:09

Mel


People also ask

Should you use ProGuard?

Android apps are quite easy to reverse engineer, so if you want to prevent this from happening, you should use Proguard for its main function: Obfuscation. The other two important functions of Proguard are Shrinking and Optimization. Shrinking eliminates unused codes and it is highly useful.

Why do we use ProGuard in Android?

ProGuard is a tool to help minify, obfuscate, and optimize your code. It is not only especially useful for reducing the overall size of your Android application as well as removing unused classes and methods that contribute towards the intrinsic 64k method limit of Android applications.

How do you make ProGuard rules pro?

When you create a new project or module using Android Studio, the IDE creates a <module-dir>/proguard-rules.pro file for you to include your own rules. You can also include additional rules from other files by adding them to the proguardFiles property in your module's build.gradle file.


1 Answers

ProGuard has nothing to do with the API level of your app. Newer versions of the Eclipse ADT have it integrated, so using it is just a matter of adding a single line to a configuration file, you don't need to use Ant. You might get some problems if ProGurad removes methods/classes you are actually using, and you will have to work around those by tweaking the ProGurad config file.

If you find it difficult to use, you can always launch your app without obfuscating it, and add ProGuard in a later version. If it is your first app, the chances of someone decompiling it to steal your super-secret code are pretty low :)

like image 108
Nikolay Elenkov Avatar answered Nov 07 '22 21:11

Nikolay Elenkov