AndyN
AndyN

Reputation: 1754

How to encrypt jar file of android application

I want to encrypt .jar file of my android application so that it can't be decoded by any one to view the source code. How can I achieve this?

Upvotes: 0

Views: 890

Answers (2)

Saran Makam
Saran Makam

Reputation: 126

Firstly - you can exclude source code from jar files. It is not required at runtime. Class files are sufficient.

Encrypting will not help you, if you encrypt the files JVM will not be able to understand it.

As responded in the earlier answer, there will always be tools to decompile the byte codes, you can make it harder for the attacker to read so that it is not worth his time

Upvotes: 0

MrSmith42
MrSmith42

Reputation: 10161

It will always be possible to decompile it.

You can only obfuscate your code to make it harder to understand for humans. If your project insists of more than a few classes the effort to understand it will be higher than any one is willing to invest.

One tool to achieve this, which also reduces the size of your class-files is
ProGuard: http://proguard.sourceforge.net/

But there are quite some similar tools out there.

Upvotes: 1

Related Questions