ProGuard on AndroidStudio: how to get obfuscated library of .aar files from a multi-module version of a project release?

I have the following situation: I have a project in Android Studio 1.4 that has 3 modules. The main module is the application for the application, the remaining 2 are library modules / subprojects. Therefore, when I build the whole project (using gradle), I get the application as .apk with all the dependencies (2 library modules), and everything works as intended. I can also enable the minify parameter for ProGuard in the build.gradle file of the application module, which compresses the application.

Two library modules additionally create .aar files that I can use in other application projects (when starting the release build for the entire project). Now I want to distribute libraries, and I want them to be confused (not compressed) through ProGuard.

I want them to be automatically confused during the build release of my application (while preserving the public APIs, of course), without breaking the build process of my application due to missing classes, etc. I tried to get this work to use the 'consumerProguardFiles' entries inside the build.gradle library files, but without success.

So how can I achieve this?

+5
source share

Source: https://habr.com/ru/post/1234373/


All Articles