I want to prevent my application from being reverse engineered and decompiled by someone else. How do I activate proguard in my project to assist me in achieving this?
-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
Should I be writing this into my application?
Progaurd obfuscates the code and makes it tough to reverse engineer. The mapping files generated by proguard needs to be preserved, in case you may want to re-engineer the code. I would say, it is pretty much handy to use it for any market build.
EDIT
progaurd.cfg would have been automatically created when you are creating an Android project via eclipse.
You may now want to enable progaurd for your project. There may be a file say default.properties which includes the target of your application. You may want to add the below line
to enable progaurd for your application. You are now all set for progaurd enabled application. If progaurd is successfully configured, on export of your apk you may see a folder progaurd generated with a list of files in it. (Refer Enabling Progaurd in the link provided). Hope it helps