Where can I find documentation for Android build options related to proguard

I worked a lot with the android build system, and I came across a situation where proguard removed the required classes that raised NoClassDefFoundError. I could tell that the class was not found, however, it took me a while to realize that proguard ruined the classes that were built with my code.

Finally, I found that I can prevent proguard from starting by adding LOCAL_PROGUARD_ENABLED := disabled to the Android.mk file.

I was able to do this because something happened by chance that looked like an Android.mk file that did the same.

I could not find the documentation for the following

 LOCAL_PROGUARD_FLAGS LOCAL_PROGUARD_ENABLED LOCAL_PROGUARD_FLAG_FILES 

As far as I can tell, a typical use of LOCAL_PROGUARD_FLAGS is to locate the proguard configuration file used as follows:

 LOCAL_PROGUARD_FLAGS := -include $(LOCAL_PATH)/proguard.flags 

The problem is that I cannot understand how it differs from LOCAL_PROGUARD_FLAG_FILES as follows:

 LOCAL_PROGUARD_FLAG_FILES := proguard.flags 

LOCAL_PROGUARD_ENABLED can be used to disable proguard, but apart from the disabled parameter, I do not know what else can be used with this option.

 LOCAL_PROGUARD_ENABLED := disabled 

Does anyone know where I can find the documentation (official or unofficial) for these build options? Google doesn't seem to return anything useful for my searches.

+4
source share
1 answer

I also searched for this information and came across this patch:

  Now the meaning of the LOCAL_PROGUARD_ENABLED options:

     * full:
         Use the build system default configurations:
         with shrink but no obfuscation or optimization,
         global proguard flags in build / core / proguard.flags
         are applied.
     * custom:
         The same as "full" except no aapt-generated resource-related
         proguard flags.
     * nosystem:
         Don't use any build system default configurations;  but
         aapt-generated proguard flags are still applied.  You are
         responsible for any other flags.
     * disabled:
         Disable proguard.
     * obfuscation:
         The same as "full" but with obfuscation enabled.
     * optimization:
         The same as "full" but with optimization enabled.
     * no value (the default):
         The build system chooses the proper value: "full" if it an
         app;  "disabled" if it a library.

Here is the link: https://android.googlesource.com/platform/build/+/7311a34%5E!/

+5
source

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


All Articles