The questions you point out are for obfuscating NetBeans modules. This is a pretty complicated precedent, so I assume that this is not an ordinary application that interests you.
In short: the obfuscation process changes the names of classes, methods, and fields to make it difficult to reverse engineer your application.
This causes some problems:
- The JVM requires that your application have an open static void main (String args []) in the public class, so you must tell proguard not to change this name
- If you use any kind of introspection, you need to protect the corresponding names from changes.
- other cases as described in the manual
In addition, proguard deletes unused code. If you have any classes that are used but not specified directly, you also need -keepthem.
proguard example, . , ( ):
-injars application.jar
-outjars obfuscated.jar
-libraryjars <java.home>/lib/rt.jar
-printmapping obfuscation.map
-keep public class com.mycompany.Application {
public static void main(java.lang.String[]);
}
-dontshrink, proguard , . , , () , .
Proguard Ant, NetBeans. , Ant, . NetBeans, ( ). , . , proguard, Ant NetBeans.