I'm working on an app in Android Studio 3.6 and I've just realised that I seem to be missing the proguard-android.txt
or proguard-android-optimize.txt
and proguard-rules.pro
files.
They are defined in my build.gradle (app) file:
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
but I do not have these files shwoing anywhere in my project tree or in the project folders.
I am using gradle 3.6.3 according to my build.gradle (ProjectName)
file so I know that R8
will actually be used rather than ProGuard, but I understand (from https://developer.android.com/studio/build/shrink-code#keep-code) that R8 still uses the same files to define what should be optimized and what should be kept etc.
I want to make sure that my app is optimized and obfuscated but I also need to protect some code with -keep
clauses which I believe need to go into the proguard-rules.pro
file.
So, a couple of questions:
- Why do I not have these files?
- How do I get hold of the latest official defaul files as a starting point?