Friday, November 9, 2012

Protect your code

A short tip to finish the day. Do you know that when you publish your Android Application it's so easy to download and decompile it?. So everyone can use your code or even modify it to break your copy protection or any thing else.
So it is very recommended to compress and obfuscate your code. It is very easy, simply add the following line in your / file:


And if you use the Eclipse option Export Signed Application Package create by hand the /proguard directory.
The only precaution is to add the following line in proguard.cfg for every class you don't want to be obfuscate:

-keep public class 

Why don't obfuscate? Very easy, if the class must be accessed dynamically in runtime you cannot obfuscate it, otherwise you'll get an Classnofound error.
I hope this trick will be useful for you.

No comments:

Post a Comment