2

My android application requires installing a project template in the client side so once the user click in generate an APK , it modify that template and create an android application, the APK is generated using ANT , my concern is that i don't want the client to be able to browse the project and see the code, i need a way to make that template encrypted at least the SRC folder that has the classes and once the user click to generate the APK it will be decrypted at run time till the APK generated , then it will be encrypted again , is there is a way to achieve this ?

Note :it will be installed in windows OS

mmoghrabi
  • 1,233
  • 1
  • 14
  • 23

5 Answers5

2

Enable ProGuard is release mode

To enable ProGuard so that it runs as part of an Ant or Eclipse build, set the proguard.config property in the /project.properties file. The path can be an absolute path or a path relative to the project's root.

The ProGuard tool shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names. The result is a smaller sized .apk file that is more difficult to reverse engineer. Because ProGuard makes your application harder to reverse engineer, it is important that you use it when your application utilizes features that are sensitive to security like when you are Licensing Your Applications.

Check the link below under the topic Enabling Proguard

http://developer.android.com/tools/help/proguard.html

Some useful links

http://proguard.sourceforge.net/index.html#manual/examples.html

Enabling ProGuard in Eclipse for Android

ANT build for Android Proguard obfuscation

Community
  • 1
  • 1
Raghunandan
  • 132,755
  • 26
  • 225
  • 256
1

You simply should enable proguard: http://developer.android.com/tools/help/proguard.html

Here is an example with ant: ANT build for Android Proguard obfuscation

Here is a good tut: http://www.androidengineer.com/2010/07/optimizing-obfuscating-and-shrinking.html

Hope this helps.

Community
  • 1
  • 1
AMerle
  • 4,354
  • 1
  • 28
  • 43
1

You can't actually encrypt it because it means to change apk file in runtime to decrypt it. And Google can block your application. One thing you can do it obfuscate your code to make it more difficult to reverse.

Timur Samkharadze
  • 1,737
  • 1
  • 17
  • 33
0

check this out :) then try to get the code from your own apk(just for fun)

Community
  • 1
  • 1
Neron T
  • 369
  • 2
  • 8
0

ProGuard cannot encrypt APKs, but DexGuard can.

It also obfuscates APKs more thoroughly. You can find an overview of the differences between ProGuard and DexGuard here: .

(Full disclosure: I am working at GuardSquare, the company that develops ProGuard and DexGuard.)

Farhana Naaz Ansari
  • 7,524
  • 26
  • 65
  • 105
StevenSur
  • 1
  • 1