Search

Wednesday, February 23, 2011

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 /default.properties file:


proguard.config=proguard.cfg

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.

2 comments:

  1. Thank you for your attention in talking about this. Nice review! Also turn your attention that it needs to search for software development companies if you need mobile development software.

    ReplyDelete
  2. For android related doubts and questions check important android questions @ http://skillgun.com

    ReplyDelete