2

I tried to proguard my app. It successfully obfuscated the apk. However, when i try to view the java code of my apk using Apk_oneclick, I am able to. I have created a release version of my apk. Still the problem persist. Any help would be much appreciated.

Thanks in advance.

build.gradle:

enter image description here

Proguard Rules:

enter image description here

Java code from the release-apk:

enter image description here

Vyshakh
  • 632
  • 1
  • 11
  • 29
  • If screenshot of proguard rules file is not changed - you haven't any rule - they all are comented – Beyka Aug 11 '17 at 13:18
  • Thanks for the comment. I fixed the issue. Added some proguard rules and cleaned the project. Its working fine now. :) – Vyshakh Aug 11 '17 at 13:19

3 Answers3

1

For enabling ProGuard configurations for your application you need to enable it in your module level gradle file. you need to set the value of minifyEnabled true.

buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

You can also enable shrinkResources true which will remove resources that ProGuard flaggs as unused.

buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
0

You need to set following property
and add some rules in proguard-android

  buildTypes {
        release {
            debuggable false
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    } 
Ganesh Gudghe
  • 1,327
  • 1
  • 17
  • 41
0

Got it working. Cleaned the project and ran the same with some changes in the Proguard rules.

Vyshakh
  • 632
  • 1
  • 11
  • 29