Do You Need To Specify The -injars And -outjars Options In Proguard For Android Builds?
The default android proguard.cfg file doesn't specify any -injars or an -outjars option, and I haven't found any documentation on what -outjars' output should be. On the other hand
Solution 1:
I did a bit of searching, and I found a file, $ANDROID_SDK/tools/proguard/examples/android.pro
, which states:
#
# 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 assume, answers my question.
Solution 2:
No, you shouldn't specify any -injars, -outjars, or -libraryjars options. The plugins for Ant, Eclipse, Grade, or Maven add them for you when you build your project, based on the structure of the project. Your configuration file can be empty, except for any project-specific configuration. See the ProGuard page in the Android documentation.
The example on the ProGuard website is for stand-alone builds.
Post a Comment for "Do You Need To Specify The -injars And -outjars Options In Proguard For Android Builds?"