Home | History | Annotate | Download | only in examples
      1 #
      2 # This ProGuard configuration file illustrates how to process applets.
      3 # Usage:
      4 #     java -jar proguard.jar @applets.pro
      5 #
      6 
      7 # Specify the input jars, output jars, and library jars.
      8 
      9 -injars  in.jar
     10 -outjars out.jar
     11 
     12 -libraryjars <java.home>/lib/rt.jar
     13 
     14 # Save the obfuscation mapping to a file, so you can de-obfuscate any stack
     15 # traces later on. Keep a fixed source file attribute and all line number
     16 # tables to get line numbers in the stack traces.
     17 # You can comment this out if you're not interested in stack traces.
     18 
     19 -printmapping out.map
     20 -renamesourcefileattribute SourceFile
     21 -keepattributes SourceFile,LineNumberTable
     22 
     23 # Preserve all annotations.
     24 
     25 -keepattributes *Annotation*
     26 
     27 # You can print out the seeds that are matching the keep options below.
     28 
     29 #-printseeds out.seeds
     30 
     31 # Preserve all public applets.
     32 
     33 -keep public class * extends java.applet.Applet
     34 
     35 # Preserve all native method names and the names of their classes.
     36 
     37 -keepclasseswithmembernames class * {
     38     native <methods>;
     39 }
     40 
     41 # Preserve the special static methods that are required in all enumeration
     42 # classes.
     43 
     44 -keepclassmembers class * extends java.lang.Enum {
     45     public static **[] values();
     46     public static ** valueOf(java.lang.String);
     47 }
     48 
     49 # Explicitly preserve all serialization members. The Serializable interface
     50 # is only a marker interface, so it wouldn't save them.
     51 # You can comment this out if your library doesn't use serialization.
     52 # If your code contains serializable classes that have to be backward
     53 # compatible, please refer to the manual.
     54 
     55 -keepclassmembers class * implements java.io.Serializable {
     56     static final long serialVersionUID;
     57     static final java.io.ObjectStreamField[] serialPersistentFields;
     58     private void writeObject(java.io.ObjectOutputStream);
     59     private void readObject(java.io.ObjectInputStream);
     60     java.lang.Object writeReplace();
     61     java.lang.Object readResolve();
     62 }
     63 
     64 # Your application may contain more items that need to be preserved;
     65 # typically classes that are dynamically created using Class.forName:
     66 
     67 # -keep public class mypackage.MyClass
     68 # -keep public interface mypackage.MyInterface
     69 # -keep public class * implements mypackage.MyInterface
     70