I need to pass a parameter to my proguard configuration. In this case the parameter represents the version of the program to be obfuscated. This is my configuration file:
-injars 'C:UsersjmurrayDesktopOBFMyProgramMyProgram-1.0.0-RELEASEMyProgram-1.0.0-RELEASE.jar'
-outjars 'C:UsersjmurrayDesktopOBFMyProgramMyProgram-1.0.0-RELEASEMyProgram-1.0.0-RELEASE-OBF.jar'
-libraryjars 'C:Program FilesJavajdk-11jmodsjava.base.jmod'
-libraryjars 'C:Program FilesJavajdk-11jmodsjava.desktop.jmod'
-libraryjars 'C:Program FilesJavajdk-11jmodsjava.datatransfer.jmod'
-libraryjars 'C:UsersjmurrayDesktopOBFMyProgramMyProgram-1.0.0-RELEASElib'
-dontusemixedcaseclassnames
-dontnote
-dontwarn
##---------------Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature
# For using GSON @Expose annotation
-keepattributes *Annotation*
# Gson specific classes
-keep class sun.misc.Unsafe { *; }
#-keep class com.google.gson.stream.** { *; }
# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { *; }
##---------------End: proguard configuration for Gson ----------
-keep public class com.jmurray.MyProgram.main.* {
public <fields>;
public <methods>;
}
As you can see the version (1.0.0-RELEASE) is hardcoded into the configuration file. I need to pass it from outside