Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to extract merged proguard rules

I need to extract final proguard rules file, with all rules for a project. I've greped it in the project directory but no luck

like image 891
Anatolii Kokuliuk Avatar asked Jun 08 '17 08:06

Anatolii Kokuliuk


People also ask

Where is ProGuard rules file?

Android Gradle Plugin provides us two different ProGuard rules config files which are located under build/intermediates/proguard-files .

What is R8 ProGuard?

R8 is another tool that will convert your java byte code into an optimized format of dex code. It will check the whole application and will remove the unused classes and methods. It helps us to reduce the size of our APK and to make our app more secure. R8 uses similar proguard rules to modify its default behavior.

What does minifyEnabled do?

So minifyEnabled removes dead code but does not obfuscate or optimize.

What is consumerProguardFiles?

consumerProguardFiles 'consumer-rules.pro'} A consumer proguard rules file is like any other proguard rules files with the caveat that the rules inside it are automatically applied to the consuming application when the application is being built in a proguard enabled mode.


1 Answers

Add this line to your proguard-rules.pro to get a file with the merged proguard configuration of your project.

    -printconfiguration "build/outputs/mapping/configuration.txt"
like image 112
mobo Avatar answered Oct 17 '22 03:10

mobo