Do you need to specify the -injars and -outjars options in ProGuard for Android builds?

In the android proguard.cfg file, the -injars or -outjars option is not specified by default, and I did not find any documentation about what -outjars' output should be. The ProGuard website, on the other hand, provides an android sample that includes -injars and -outjars . Which should I follow?

+4
source share
2 answers

I searched a bit and I found the file $ANDROID_SDK/tools/proguard/examples/android.pro which reads:

 # # This ProGuard configuration file illustrates how to process Android # applications. # Usage: # java -jar proguard.jar @android.pro # # If you're using the Android SDK (version 2.3 or higher), the android tool # already creates a file like this in your project, called proguard.cfg. # It should contain the settings of this file, minus the input and output paths # (-injars, -outjars, -libraryjars, -printmapping, and -printseeds). # The generated Ant build file automatically sets these paths. # Specify the input jars, output jars, and library jars. # Note that ProGuard works with Java bytecode (.class), # before the dex compiler converts it into Dalvik code (.dex). 

Which, I suppose, answers my question.

0
source

No, you should not specify any -injars, -outjars or -libraryjars options. Plugins for Ant, Eclipse, Grade or Maven add them to you when you build your project based on the project structure. Your configuration file may be empty, except for any project-specific configuration. See the ProGuard page in the Android documentation.

The example on the ProGuard website is for standalone builds.

0
source

All Articles