简体   繁体   中英

How to encrypt an android application so the client wont be able to see the source code?

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

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

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.

检查这个了:)然后尝试从自己的apk得到的代码( 只是为了好玩

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.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM