Obfuscating Android Code with Proguard


First enable minifyEnabled in your build.gradle file, like

minifyEnabled true

After this, add below lines in progurad-rules.txt file

-keep class yourpackage.** { *; }

For checking that its working fine go to:

http://www.javadecompilers.com/apktool website so that you can verify after decompilation.

It will work and your classes will be hidden completely.

Copyfrom: https://stackoverflow.com/questions/17290023/obfuscation-in-android-studio