0

I have an app that I migrated from Eclipse to Android-Studio. I want to make sure I'm using Proguard for my release version. I see in my build.gradle file this:

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

However, I don't have a proguard-android.txt or proguard-rules.txt in my project's folder. Is my code being obfuscated?

Barodapride
  • 3,475
  • 4
  • 25
  • 36

2 Answers2

5

No, your code is not being obfuscated. You are not running proguard. minifyEnabled controls whether to run proguard, and you have it set to false, need to change that to true to turn on proguard. getDefaultProguardFile('proguard-android.txt') gets the default proguard rules from the SDK. See proguardFiles docs.

To check that your code is being obfuscated, you can look in your build/outputs/mapping/release directory. Those files should have modification times from during your build. Looking at the mapping.txt will give the obfuscation details (which names were mapped to what).

iagreen
  • 31,470
  • 8
  • 76
  • 90
1

proguard-android.txt is system file .u need not to care.enter image description here

'proguard-rules.txt is here . if u havent ,u can add a empty file. u can use ur custom name . But when minifyEnabled is true ,u need to add some line in it.

tiny sunlight
  • 6,231
  • 3
  • 21
  • 42