ken
ken

Reputation: 131

How To Protect Source Code While Android Development

I decompiled an android apk with dex2jar just now. The package name and class name has been shorten like the screenshot.

Screenshot

I want to konw how to do that.

PS: I use Android Studio IDE.

Upvotes: 1

Views: 3052

Answers (1)

Antonio E.
Antonio E.

Reputation: 4391

The only point in code obfuscation at development time is to check that the obfuscation doesn't break anything. Beside this, the component that manage the obfuscation is the ProGuard:

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.

To enable it in android studio:

Note: When using Android Studio, you must add Proguard to your gradle.build file's build types. For more information, see the Gradle Plugin User Guide.

To know more about the ProGuard tool just read the android's documentation :)

Upvotes: 4

Related Questions