Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy protect PhoneGap Android app ? Is Android Market Copy protect feature useful?

I have PhoneGap app in Android. Now I am ready to publish it, but I would like to protect the app from eyes of script-kiddies. I first thought that it is impossible, than I have discovered "Copy protection" feature when publishing the app on the market. So I was excited, but when I turned it ON, it didn't actually does nothing.

I can install the app on the rooted phone with no problem, I can copy it on SD card and see all the sources. I thought that this "Copy protection" feature will not allow people with rooted phones to install the app. Or am I missing something ?

Is there ANY way how to make it at least difficult, if not disable it at all, for people to see all my HTML and JS sources in my app ?

like image 693
Frodik Avatar asked May 27 '11 19:05

Frodik


2 Answers

The copy protection feature has been deprecated by Google. Do not use it.

  1. Use ProGuard to obfuscate your code.

  2. Encrypt your assets and decrypt them as you read them.

  3. Use the Licensing mechanism if you have a paid app.

like image 83
EboMike Avatar answered Oct 17 '22 19:10

EboMike


The best combination I've found is the DojoToolkit and the Closure Compiler in Advanced Mode.

Closure in Advanced Mode makes JavaScript code almost impossible to reverse-engineer, even after passing through a beautifier. Once your JavaScript code is obfuscated beyond any recognition and any possibility to reverse-engineer, your HTML won't disclose much of your secrets.

This link for using the Dojo Toolkit with the Closure Compiler in Advanced Mode for mobile applications:

http://dojo-toolkit.33424.n3.nabble.com/file/n2636749/Using_the_Dojo_Toolkit_with_the_Closure_Compiler.pdf?by-user=t

like image 43
Stephen Chung Avatar answered Oct 17 '22 20:10

Stephen Chung