diff options
Diffstat (limited to 'third_party/java/proguard/proguard5.3.3/examples')
54 files changed, 3516 insertions, 0 deletions
diff --git a/third_party/java/proguard/proguard5.3.3/examples/android.pro b/third_party/java/proguard/proguard5.3.3/examples/android.pro new file mode 100644 index 0000000000..10aa8053f8 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/android.pro @@ -0,0 +1,174 @@ +# +# This ProGuard configuration file illustrates how to process Android +# applications. +# Usage: +# java -jar proguard.jar @android.pro +# +# If you're using the Android SDK, the Ant release build and Eclipse export +# already take care of the proper settings. You only need to enable ProGuard +# by commenting in the corresponding line in project.properties. You can still +# add project-specific configuration in proguard-project.txt. +# +# This configuration file is for custom, stand-alone builds. + +# 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). + +-injars bin/classes +-injars libs +-outjars bin/classes-processed.jar + +-libraryjars /usr/local/android-sdk/platforms/android-9/android.jar +#-libraryjars /usr/local/android-sdk/add-ons/google_apis-7_r01/libs/maps.jar +# ... + +# Save the obfuscation mapping to a file, so you can de-obfuscate any stack +# traces later on. + +-printmapping bin/classes-processed.map + +# You can print out the seeds that are matching the keep options below. + +#-printseeds bin/classes-processed.seeds + +# Preverification is irrelevant for the dex compiler and the Dalvik VM. + +-dontpreverify + +# Reduce the size of the output some more. + +-repackageclasses '' +-allowaccessmodification + +# Switch off some optimizations that trip older versions of the Dalvik VM. + +-optimizations !code/simplification/arithmetic + +# Keep a fixed source file attribute and all line number tables to get line +# numbers in the stack traces. +# You can comment this out if you're not interested in stack traces. + +-renamesourcefileattribute SourceFile +-keepattributes SourceFile,LineNumberTable + +# RemoteViews might need annotations. + +-keepattributes *Annotation* + +# Preserve all fundamental application classes. + +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider + +# Preserve all View implementations, their special context constructors, and +# their setters. + +-keep public class * extends android.view.View { + public <init>(android.content.Context); + public <init>(android.content.Context, android.util.AttributeSet); + public <init>(android.content.Context, android.util.AttributeSet, int); + public void set*(...); +} + +# Preserve all classes that have special context constructors, and the +# constructors themselves. + +-keepclasseswithmembers class * { + public <init>(android.content.Context, android.util.AttributeSet); +} + +# Preserve all classes that have special context constructors, and the +# constructors themselves. + +-keepclasseswithmembers class * { + public <init>(android.content.Context, android.util.AttributeSet, int); +} + +# Preserve all possible onClick handlers. + +-keepclassmembers class * extends android.content.Context { + public void *(android.view.View); + public void *(android.view.MenuItem); +} + +# Preserve the special fields of all Parcelable implementations. + +-keepclassmembers class * implements android.os.Parcelable { + static android.os.Parcelable$Creator CREATOR; +} + +# Preserve static fields of inner classes of R classes that might be accessed +# through introspection. + +-keepclassmembers class **.R$* { + public static <fields>; +} + +# Preserve annotated Javascript interface methods. + +-keepclassmembers class * { + @android.webkit.JavascriptInterface <methods>; +} + +# Preserve the required interface from the License Verification Library +# (but don't nag the developer if the library is not used at all). + +-keep public interface com.android.vending.licensing.ILicensingService + +-dontnote com.android.vending.licensing.ILicensingService + +# The Android Compatibility library references some classes that may not be +# present in all versions of the API, but we know that's ok. + +-dontwarn android.support.** + +# Preserve all native method names and the names of their classes. + +-keepclasseswithmembernames,includedescriptorclasses class * { + native <methods>; +} + +# Preserve the special static methods that are required in all enumeration +# classes. + +-keepclassmembers,allowoptimization enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# Explicitly preserve all serialization members. The Serializable interface +# is only a marker interface, so it wouldn't save them. +# You can comment this out if your application doesn't use serialization. +# If your code contains serializable classes that have to be backward +# compatible, please refer to the manual. + +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# Your application may contain more items that need to be preserved; +# typically classes that are dynamically created using Class.forName: + +# -keep public class mypackage.MyClass +# -keep public interface mypackage.MyInterface +# -keep public class * implements mypackage.MyInterface + +# If you wish, you can let the optimization step remove Android logging calls. + +#-assumenosideeffects class android.util.Log { +# public static boolean isLoggable(java.lang.String, int); +# public static int v(...); +# public static int i(...); +# public static int w(...); +# public static int d(...); +# public static int e(...); +#} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/examples.pro b/third_party/java/proguard/proguard5.3.3/examples/annotations/examples.pro new file mode 100644 index 0000000000..d2b212c733 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/examples.pro @@ -0,0 +1,60 @@ +# +# This ProGuard configuration file illustrates how to use annotations for +# specifying which classes and class members should be kept. +# Usage: +# java -jar proguard.jar @examples.pro +# + +# Specify the input, output, and library jars. +# This is assuming the code has been compiled in the examples directory. + +-injars examples(*.class) +-outjars out + +-libraryjars <java.home>/lib/rt.jar + +# Some important configuration is based on the annotations in the code. +# We have to specify what the annotations mean to ProGuard. + +-include lib/annotations.pro + +# +# We can then still add any other options that might be useful. +# + +# Print out a list of what we're preserving. + +-printseeds + +# Preserve all annotations themselves. + +-keepattributes *Annotation* + +# Preserve all native method names and the names of their classes. + +-keepclasseswithmembernames,includedescriptorclasses class * { + native <methods>; +} + +# Preserve the special static methods that are required in all enumeration +# classes. + +-keepclassmembers,allowoptimization enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# Explicitly preserve all serialization members. The Serializable interface +# is only a marker interface, so it wouldn't save them. +# You can comment this out if your application doesn't use serialization. +# If your code contains serializable classes that have to be backward +# compatible, please refer to the manual. + +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/examples/Applet.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/examples/Applet.java new file mode 100644 index 0000000000..e5b7accac4 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/examples/Applet.java @@ -0,0 +1,23 @@ +import proguard.annotation.*; + +/** + * This applet illustrates the use of annotations for configuring ProGuard. + * + * You can compile it with: + * javac -classpath ../lib/annotations.jar Applet.java + * You can then process it with: + * java -jar ../../../lib/proguard.jar @ ../examples.pro + * + * The annotation will preserve the class and its essential methods, + * as a result of the specifications in lib/annotations.pro. + */ +@Keep +public class Applet extends java.applet.Applet +{ + // Implementations for Applet. + + public void init() + { + // ... + } +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/examples/Application.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/examples/Application.java new file mode 100644 index 0000000000..777d2865a7 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/examples/Application.java @@ -0,0 +1,21 @@ +import proguard.annotation.KeepApplication; + +/** + * This application illustrates the use of annotations for configuring ProGuard. + * + * You can compile it with: + * javac -classpath ../lib/annotations.jar Application.java + * You can then process it with: + * java -jar ../../../lib/proguard.jar @ ../examples.pro + * + * The annotation will preserve the class and its main method, + * as a result of the specifications in lib/annotations.pro. + */ +@KeepApplication +public class Application +{ + public static void main(String[] args) + { + System.out.println("The answer is 42"); + } +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/examples/Bean.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/examples/Bean.java new file mode 100644 index 0000000000..aacb501671 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/examples/Bean.java @@ -0,0 +1,57 @@ +import proguard.annotation.*; + +/** + * This bean illustrates the use of annotations for configuring ProGuard. + * + * You can compile it with: + * javac -classpath ../lib/annotations.jar Bean.java + * You can then process it with: + * java -jar ../../../lib/proguard.jar @ ../examples.pro + * + * The annotations will preserve the class and its public getters and setters, + * as a result of the specifications in lib/annotations.pro. + */ +@Keep +@KeepPublicGettersSetters +public class Bean +{ + public boolean booleanProperty; + public int intProperty; + public String stringProperty; + + + public boolean isBooleanProperty() + { + return booleanProperty; + } + + + public void setBooleanProperty(boolean booleanProperty) + { + this.booleanProperty = booleanProperty; + } + + + public int getIntProperty() + { + return intProperty; + } + + + public void setIntProperty(int intProperty) + { + this.intProperty = intProperty; + } + + + public String getStringProperty() + { + return stringProperty; + } + + + public void setStringProperty(String stringProperty) + { + this.stringProperty = stringProperty; + } +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/examples/NativeCallBack.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/examples/NativeCallBack.java new file mode 100644 index 0000000000..a4e5583e18 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/examples/NativeCallBack.java @@ -0,0 +1,52 @@ +import proguard.annotation.*; + +/** + * This application illustrates the use of annotations for configuring ProGuard. + * + * You can compile it with: + * javac -classpath ../lib/annotations.jar NativeCallBack.java + * You can then process it with: + * java -jar ../../../lib/proguard.jar @ ../examples.pro + * + * The annotation will preserve the class and its main method, + * as a result of the specifications in lib/annotations.pro. + */ +@KeepApplication +public class NativeCallBack +{ + /** + * Suppose this is a native method that computes an answer. + * + * The -keep option for native methods in the regular ProGuard + * configuration will make sure it is not removed or renamed when + * processing this code. + */ + public native int computeAnswer(); + + + /** + * Suppose this method is called back from the above native method. + * + * ProGuard would remove it, because it is not referenced from java. + * The annotation will make sure it is preserved anyhow. + */ + @Keep + public int getAnswer() + { + return 42; + } + + + /** + * The main entry point of the application. + * + * The @KeepApplication annotation of this class will make sure it is not + * removed or renamed when processing this code. + */ + public static void main(String[] args) + { + int answer = new NativeCallBack().computeAnswer(); + + System.out.println("The answer is " + answer); + } +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/lib/annotations.jar b/third_party/java/proguard/proguard5.3.3/examples/annotations/lib/annotations.jar Binary files differnew file mode 100644 index 0000000000..671c57c324 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/lib/annotations.jar diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/lib/annotations.pro b/third_party/java/proguard/proguard5.3.3/examples/annotations/lib/annotations.pro new file mode 100644 index 0000000000..f704af2dd4 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/lib/annotations.pro @@ -0,0 +1,118 @@ +# +# This ProGuard configuration file specifies how annotations can be used +# to configure the processing of other code. +# Usage: +# java -jar proguard.jar @annotations.pro -libraryjars annotations.jar ... +# +# Note that the other input/output options still have to be specified. +# If you specify them in a separate file, you can simply include this file: +# -include annotations.pro +# +# You can add any other options that are required. For instance, if you are +# processing a library, you can still include the options from library.pro. + + +# The annotations are defined in the accompanying jar. For now, we'll start +# with these. You can always define your own annotations, if necessary. +-libraryjars annotations.jar + + +# The following annotations can be specified with classes and with class +# members. + +# @Keep specifies not to shrink, optimize, or obfuscate the annotated class +# or class member as an entry point. + +-keep @proguard.annotation.Keep class * + +-keepclassmembers class * { + @proguard.annotation.Keep *; +} + + +# @KeepName specifies not to optimize or obfuscate the annotated class or +# class member as an entry point. + +-keepnames @proguard.annotation.KeepName class * + +-keepclassmembernames class * { + @proguard.annotation.KeepName *; +} + + +# The following annotations can only be specified with classes. + +# @KeepImplementations and @KeepPublicImplementations specify to keep all, +# resp. all public, implementations or extensions of the annotated class as +# entry points. Note the extension of the java-like syntax, adding annotations +# before the (wild-carded) interface name. + +-keep class * implements @proguard.annotation.KeepImplementations * +-keep public class * implements @proguard.annotation.KeepPublicImplementations * + +# @KeepApplication specifies to keep the annotated class as an application, +# together with its main method. + +-keepclasseswithmembers @proguard.annotation.KeepApplication public class * { + public static void main(java.lang.String[]); +} + +# @KeepClassMembers, @KeepPublicClassMembers, and +# @KeepPublicProtectedClassMembers specify to keep all, all public, resp. +# all public or protected, class members of the annotated class from being +# shrunk, optimized, or obfuscated as entry points. + +-keepclassmembers @proguard.annotation.KeepClassMembers class * { + *; +} + +-keepclassmembers @proguard.annotation.KeepPublicClassMembers class * { + public *; +} + +-keepclassmembers @proguard.annotation.KeepPublicProtectedClassMembers class * { + public protected *; +} + +# @KeepClassMemberNames, @KeepPublicClassMemberNames, and +# @KeepPublicProtectedClassMemberNames specify to keep all, all public, resp. +# all public or protected, class members of the annotated class from being +# optimized or obfuscated as entry points. + +-keepclassmembernames @proguard.annotation.KeepClassMemberNames class * { + *; +} + +-keepclassmembernames @proguard.annotation.KeepPublicClassMemberNames class * { + public *; +} + +-keepclassmembernames @proguard.annotation.KeepPublicProtectedClassMemberNames class * { + public protected *; +} + +# @KeepGettersSetters and @KeepPublicGettersSetters specify to keep all, resp. +# all public, getters and setters of the annotated class from being shrunk, +# optimized, or obfuscated as entry points. + +-keepclassmembers @proguard.annotation.KeepGettersSetters class * { + void set*(***); + void set*(int, ***); + + boolean is*(); + boolean is*(int); + + *** get*(); + *** get*(int); +} + +-keepclassmembers @proguard.annotation.KeepPublicGettersSetters class * { + public void set*(***); + public void set*(int, ***); + + public boolean is*(); + public boolean is*(int); + + public *** get*(); + public *** get*(int); +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/Keep.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/Keep.java new file mode 100644 index 0000000000..2e5ad04984 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/Keep.java @@ -0,0 +1,18 @@ +/* + * ProGuard -- shrinking, optimization, obfuscation, and preverification + * of Java bytecode. + */ +package proguard.annotation; + +import java.lang.annotation.*; + +/** + * This annotation specifies not to optimize or obfuscate the annotated class or + * class member as an entry point. + * + * @author Eric Lafortune + */ +@Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR }) +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface Keep {} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepApplication.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepApplication.java new file mode 100644 index 0000000000..072a80db5b --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepApplication.java @@ -0,0 +1,18 @@ +/* + * ProGuard -- shrinking, optimization, obfuscation, and preverification + * of Java bytecode. + */ +package proguard.annotation; + +import java.lang.annotation.*; + +/** + * This annotation specifies to keep the annotated class as an application, + * together with its a main method. + * + * @author Eric Lafortune + */ +@Target({ ElementType.TYPE }) +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface KeepApplication {} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepClassMemberNames.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepClassMemberNames.java new file mode 100644 index 0000000000..4adb5ec35e --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepClassMemberNames.java @@ -0,0 +1,18 @@ +/* + * ProGuard -- shrinking, optimization, obfuscation, and preverification + * of Java bytecode. + */ +package proguard.annotation; + +import java.lang.annotation.*; + +/** + * This annotation specifies to keep all class members of the annotated class + * from being optimized or obfuscated as entry points. + * + * @author Eric Lafortune + */ +@Target({ ElementType.TYPE }) +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface KeepClassMemberNames {} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepClassMembers.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepClassMembers.java new file mode 100644 index 0000000000..9cdfc6798b --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepClassMembers.java @@ -0,0 +1,18 @@ +/* + * ProGuard -- shrinking, optimization, obfuscation, and preverification + * of Java bytecode. + */ +package proguard.annotation; + +import java.lang.annotation.*; + +/** + * This annotation specifies to keep all class members of the annotated class + * from being shrunk, optimized, or obfuscated as entry points. + * + * @author Eric Lafortune + */ +@Target({ ElementType.TYPE }) +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface KeepClassMembers {} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepGettersSetters.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepGettersSetters.java new file mode 100644 index 0000000000..37d7cc7756 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepGettersSetters.java @@ -0,0 +1,18 @@ +/* + * ProGuard -- shrinking, optimization, obfuscation, and preverification + * of Java bytecode. + */ +package proguard.annotation; + +import java.lang.annotation.*; + +/** + * This annotation specifies to keep all getters and setters of the annotated + * class from being shrunk, optimized, or obfuscated as entry points. + * + * @author Eric Lafortune + */ +@Target({ ElementType.TYPE }) +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface KeepGettersSetters {} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepImplementations.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepImplementations.java new file mode 100644 index 0000000000..b2bce128e8 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepImplementations.java @@ -0,0 +1,18 @@ +/* + * ProGuard -- shrinking, optimization, obfuscation, and preverification + * of Java bytecode. + */ +package proguard.annotation; + +import java.lang.annotation.*; + +/** + * This annotation specifies to keep all implementations or extensions of the + * annotated class as entry points. + * + * @author Eric Lafortune + */ +@Target({ ElementType.TYPE }) +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface KeepImplementations {} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepName.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepName.java new file mode 100644 index 0000000000..ec1574bb21 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepName.java @@ -0,0 +1,18 @@ +/* + * ProGuard -- shrinking, optimization, obfuscation, and preverification + * of Java bytecode. + */ +package proguard.annotation; + +import java.lang.annotation.*; + +/** + * This annotation specifies not to optimize or obfuscate the annotated class or + * class member as an entry point. + * + * @author Eric Lafortune + */ +@Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR }) +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface KeepName {} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicClassMemberNames.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicClassMemberNames.java new file mode 100644 index 0000000000..e951f19750 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicClassMemberNames.java @@ -0,0 +1,18 @@ +/* + * ProGuard -- shrinking, optimization, obfuscation, and preverification + * of Java bytecode. + */ +package proguard.annotation; + +import java.lang.annotation.*; + +/** + * This annotation specifies to keep all public class members of the annotated + * class from being optimized or obfuscated as entry points. + * + * @author Eric Lafortune + */ +@Target({ ElementType.TYPE }) +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface KeepPublicClassMemberNames {} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicClassMembers.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicClassMembers.java new file mode 100644 index 0000000000..480c03641f --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicClassMembers.java @@ -0,0 +1,18 @@ +/* + * ProGuard -- shrinking, optimization, obfuscation, and preverification + * of Java bytecode. + */ +package proguard.annotation; + +import java.lang.annotation.*; + +/** + * This annotation specifies to keep all public class members of the annotated + * class from being shrunk, optimized, or obfuscated as entry points. + * + * @author Eric Lafortune + */ +@Target({ ElementType.TYPE }) +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface KeepPublicClassMembers {} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicGettersSetters.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicGettersSetters.java new file mode 100644 index 0000000000..3b6f8e6aed --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicGettersSetters.java @@ -0,0 +1,18 @@ +/* + * ProGuard -- shrinking, optimization, obfuscation, and preverification + * of Java bytecode. + */ +package proguard.annotation; + +import java.lang.annotation.*; + +/** + * This annotation specifies to keep all public getters and setters of the + * annotated class from being shrunk, optimized, or obfuscated as entry points. + * + * @author Eric Lafortune + */ +@Target({ ElementType.TYPE }) +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface KeepPublicGettersSetters {} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicImplementations.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicImplementations.java new file mode 100644 index 0000000000..c777d9be27 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicImplementations.java @@ -0,0 +1,18 @@ +/* + * ProGuard -- shrinking, optimization, obfuscation, and preverification + * of Java bytecode. + */ +package proguard.annotation; + +import java.lang.annotation.*; + +/** + * This annotation specifies to keep all public implementations or extensions + * of the annotated class as entry points. + * + * @author Eric Lafortune + */ +@Target({ ElementType.TYPE }) +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface KeepPublicImplementations {} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicProtectedClassMemberNames.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicProtectedClassMemberNames.java new file mode 100644 index 0000000000..f4511ea037 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicProtectedClassMemberNames.java @@ -0,0 +1,18 @@ +/* + * ProGuard -- shrinking, optimization, obfuscation, and preverification + * of Java bytecode. + */ +package proguard.annotation; + +import java.lang.annotation.*; + +/** + * This annotation specifies to keep all public or protected class members of + * the annotated class from being optimized or obfuscated as entry points. + * + * @author Eric Lafortune + */ +@Target({ ElementType.TYPE }) +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface KeepPublicProtectedClassMemberNames {} diff --git a/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicProtectedClassMembers.java b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicProtectedClassMembers.java new file mode 100644 index 0000000000..5b195bbfc8 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/annotations/src/proguard/annotation/KeepPublicProtectedClassMembers.java @@ -0,0 +1,19 @@ +/* + * ProGuard -- shrinking, optimization, obfuscation, and preverification + * of Java bytecode. + */ +package proguard.annotation; + +import java.lang.annotation.*; + +/** + * This annotation specifies to keep all public or protected class members of + * the annotated class from being shrunk, optimized, or obfuscated as entry + * points. + * + * @author Eric Lafortune + */ +@Target({ ElementType.TYPE }) +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface KeepPublicProtectedClassMembers {} diff --git a/third_party/java/proguard/proguard5.3.3/examples/ant/applets.xml b/third_party/java/proguard/proguard5.3.3/examples/ant/applets.xml new file mode 100644 index 0000000000..5666f965b2 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/ant/applets.xml @@ -0,0 +1,88 @@ +<!-- This Ant build file illustrates how to process applets. + Usage: ant -f applets.xml --> + +<project name="Applets" default="obfuscate" basedir="../.."> + +<target name="obfuscate"> + <taskdef resource="proguard/ant/task.properties" + classpath="lib/proguard.jar" /> + + <proguard printseeds="on" + printmapping="out.map" + renamesourcefileattribute="SourceFile"> + + <!-- Specify the input jars, output jars, and library jars. --> + + <injar file="in.jar" /> + <outjar file="out.jar" /> + + <libraryjar file="${java.home}/lib/rt.jar" /> + + <!-- Optionally preserve line numbers in the obfuscated stack traces. + <keepattribute name="LineNumberTable"> + <keepattribute name="SourceFile"> + --> + + <!-- Preserve all annotations. --> + + <keepattribute name="*Annotation*" /> + + <!-- Preserve all public applets. --> + + <keep access="public" extends="java.applet.Applet" /> + + <!-- Preserve all native method names and the names of their classes. --> + + <keepclasseswithmembernames includedescriptorclasses="true"> + <method access="native" /> + </keepclasseswithmembernames> + + <!-- Preserve the methods that are required in all enumeration classes. --> + + <keepclassmembers allowoptimization="true" type="enum"> + <method access="public static" + type="**[]" + name="values" + parameters="" /> + <method access="public static" + type="**" + name="valueOf" + parameters="java.lang.String" /> + </keepclassmembers> + + <!-- Explicitly preserve all serialization members. The Serializable + interface is only a marker interface, so it wouldn't save them. + You can comment this out if your library doesn't use serialization. + If your code contains serializable classes that have to be backward + compatible, please refer to the manual. --> + + <keepclassmembers implements="java.io.Serializable"> + <field access ="static final" + type ="long" + name ="serialVersionUID" /> + <field access ="static final" + type ="java.io.ObjectStreamField[]" + name ="serialPersistentFields" /> + <method access ="private" + type ="void" + name ="writeObject" + parameters="java.io.ObjectOutputStream" /> + <method access ="private" + type ="void" + name ="readObject" + parameters="java.io.ObjectInputStream" /> + <method type ="java.lang.Object" + name ="writeReplace" + parameters="" /> + <method type ="java.lang.Object" + name ="readResolve" + parameters="" /> + </keepclassmembers> + + <!-- Your application may contain more items that need to be preserved; + typically classes that are dynamically created using Class.forName --> + + </proguard> +</target> + +</project> diff --git a/third_party/java/proguard/proguard5.3.3/examples/ant/applications1.xml b/third_party/java/proguard/proguard5.3.3/examples/ant/applications1.xml new file mode 100644 index 0000000000..6df5789eb0 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/ant/applications1.xml @@ -0,0 +1,15 @@ +<!-- This Ant build file illustrates how to process applications, + by including a ProGuard-style configuration file. + Usage: ant -f applications1.xml --> + +<project name="Applications" default="obfuscate" basedir="../.."> + +<target name="obfuscate"> + <taskdef resource="proguard/ant/task.properties" + classpath="lib/proguard.jar" /> + + <proguard configuration="examples/applications.pro" /> + +</target> + +</project> diff --git a/third_party/java/proguard/proguard5.3.3/examples/ant/applications2.xml b/third_party/java/proguard/proguard5.3.3/examples/ant/applications2.xml new file mode 100644 index 0000000000..664a9ee86f --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/ant/applications2.xml @@ -0,0 +1,74 @@ +<!-- This Ant build file illustrates how to process applications, + by including ProGuard-style configuration options. + Usage: ant -f applications2.xml --> + +<project name="Applications" default="obfuscate" basedir="../.."> + +<target name="obfuscate"> + <taskdef resource="proguard/ant/task.properties" + classpath="lib/proguard.jar" /> + + <proguard> + + <!-- Specify the input jars, output jars, and library jars. --> + + -injars in.jar + -outjars out.jar + + -libraryjars ${java.home}/lib/rt.jar + <!-- -libraryjars junit.jar --> + <!-- -libraryjars servlet.jar --> + <!-- -libraryjars jai_core.jar --> + <!-- ... --> + + <!-- Save the obfuscation mapping to a file, and preserve line numbers. --> + + -printmapping out.map + -renamesourcefileattribute SourceFile + -keepattributes SourceFile,LineNumberTable + + <!-- Preserve all annotations. --> + + -keepattributes *Annotation* + + <!-- Preserve all public applications. --> + + -keepclasseswithmembers public class * { + public static void main(java.lang.String[]); + } + + <!-- Preserve all native method names and the names of their classes. --> + + -keepclasseswithmembernames class * { + native <methods>; + } + + <!-- Preserve the methods that are required in all enumeration classes. --> + + -keepclassmembers,allowoptimization enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); + } + + <!-- Explicitly preserve all serialization members. The Serializable + interface is only a marker interface, so it wouldn't save them. + You can comment this out if your library doesn't use serialization. + If your code contains serializable classes that have to be backward + compatible, please refer to the manual. --> + + -keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); + } + + <!-- Your application may contain more items that need to be preserved; + typically classes that are dynamically created using Class.forName --> + + </proguard> +</target> + +</project> diff --git a/third_party/java/proguard/proguard5.3.3/examples/ant/applications3.xml b/third_party/java/proguard/proguard5.3.3/examples/ant/applications3.xml new file mode 100644 index 0000000000..023c2bef9a --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/ant/applications3.xml @@ -0,0 +1,98 @@ +<!-- This Ant build file illustrates how to process applications, + using a full-blown XML configuration. + Usage: ant -f applications3.xml --> + +<project name="Applications" default="obfuscate" basedir="../.."> + +<target name="obfuscate"> + <taskdef resource="proguard/ant/task.properties" + classpath="lib/proguard.jar" /> + + <proguard printseeds="on" + printmapping="out.map" + renamesourcefileattribute="SourceFile"> + + <!-- Specify the input jars, output jars, and library jars. --> + + <injar file="in.jar" /> + <outjar file="out.jar" /> + + <libraryjar file="${java.home}/lib/rt.jar" /> + <!-- libraryjar file="junit.jar" / --> + <!-- libraryjar file="servlet.jar" / --> + <!-- libraryjar file="jai_core.jar" / --> + <!-- ... / --> + + <!-- Preserve line numbers in the obfuscated stack traces. --> + + <keepattribute name="LineNumberTable" /> + <keepattribute name="SourceFile" /> + + <!-- Preserve all annotations. --> + + <keepattribute name="*Annotation*" /> + + <!-- Preserve all public applications. --> + + <keepclasseswithmembers access="public"> + <method access ="public static" + type ="void" + name ="main" + parameters="java.lang.String[]" /> + </keepclasseswithmembers> + + <!-- Preserve all native method names and the names of their classes. --> + + <keepclasseswithmembernames includedescriptorclasses="true"> + <method access="native" /> + </keepclasseswithmembernames> + + <!-- Preserve the methods that are required in all enumeration classes. --> + + <keepclassmembers allowoptimization="true" type="enum"> + <method access="public static" + type="**[]" + name="values" + parameters="" /> + <method access="public static" + type="**" + name="valueOf" + parameters="java.lang.String" /> + </keepclassmembers> + + <!-- Explicitly preserve all serialization members. The Serializable + interface is only a marker interface, so it wouldn't save them. + You can comment this out if your library doesn't use serialization. + If your code contains serializable classes that have to be backward + compatible, please refer to the manual. --> + + <keepclassmembers implements="java.io.Serializable"> + <field access ="static final" + type ="long" + name ="serialVersionUID" /> + <field access ="static final" + type ="java.io.ObjectStreamField[]" + name ="serialPersistentFields" /> + <method access ="private" + type ="void" + name ="writeObject" + parameters="java.io.ObjectOutputStream" /> + <method access ="private" + type ="void" + name ="readObject" + parameters="java.io.ObjectInputStream" /> + <method type ="java.lang.Object" + name ="writeReplace" + parameters="" /> + <method type ="java.lang.Object" + name ="readResolve" + parameters="" /> + </keepclassmembers> + + <!-- Your application may contain more items that need to be preserved; + typically classes that are dynamically created using Class.forName --> + + </proguard> +</target> + +</project> diff --git a/third_party/java/proguard/proguard5.3.3/examples/ant/library.xml b/third_party/java/proguard/proguard5.3.3/examples/ant/library.xml new file mode 100644 index 0000000000..37ceb1a8da --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/ant/library.xml @@ -0,0 +1,102 @@ +<!-- This Ant build file illustrates how to process a program library, + such that it remains usable as a library. + Usage: ant -f library.xml --> + +<project name="Library" default="obfuscate" basedir="../.."> + +<target name="obfuscate"> + <taskdef resource="proguard/ant/task.properties" + classpath="lib/proguard.jar" /> + + <proguard printmapping="out.map" + renamesourcefileattribute="SourceFile"> + + <!-- Specify the input jars, output jars, and library jars. --> + + <injar file="library.jar" /> + <outjar file="library_out.jar" /> + + <libraryjar file="${java.home}/lib/rt.jar" /> + + <!-- Keep some useful attributes. --> + + <keepattribute name="InnerClasses" /> + <keepattribute name="SourceFile" /> + <keepattribute name="LineNumberTable" /> + <keepattribute name="Deprecated" /> + <keepattribute name="*Annotation*" /> + + <!-- Preserve all public classes, and their public and protected fields + and methods. --> + + <keep access="public"> + <field access="public protected" /> + <method access="public protected" /> + </keep> + + <!-- Preserve all .class method names. --> + + <keepclassmembernames access="public"> + <method type ="java.lang.Class" + name ="class$" + parameters="java.lang.String" /> + <method type ="java.lang.Class" + name ="class$" + parameters="java.lang.String,boolean" /> + </keepclassmembernames> + + <!-- Preserve all native method names and the names of their classes. --> + + <keepclasseswithmembernames includedescriptorclasses="true"> + <method access="native" /> + </keepclasseswithmembernames> + + <!-- Preserve the methods that are required in all enumeration classes. --> + + <keepclassmembers allowoptimization="true" type="enum"> + <method access="public static" + type="**[]" + name="values" + parameters="" /> + <method access="public static" + type="**" + name="valueOf" + parameters="java.lang.String" /> + </keepclassmembers> + + <!-- Explicitly preserve all serialization members. The Serializable + interface is only a marker interface, so it wouldn't save them. + You can comment this out if your library doesn't use serialization. + If your code contains serializable classes that have to be backward + compatible, please refer to the manual. --> + + <keepclassmembers implements="java.io.Serializable"> + <field access ="final" + type ="long" + name ="serialVersionUID" /> + <field access ="static final" + type ="java.io.ObjectStreamField[]" + name ="serialPersistentFields" /> + <method access ="private" + type ="void" + name ="writeObject" + parameters="java.io.ObjectOutputStream" /> + <method access ="private" + type ="void" + name ="readObject" + parameters="java.io.ObjectInputStream" /> + <method type ="java.lang.Object" + name ="writeReplace" + parameters="" /> + <method type ="java.lang.Object" + name ="readResolve" + parameters="" /> + </keepclassmembers> + + <!-- Your application may contain more items that need to be preserved; + typically classes that are dynamically created using Class.forName --> + + </proguard> +</target> + +</project> diff --git a/third_party/java/proguard/proguard5.3.3/examples/ant/midlets.xml b/third_party/java/proguard/proguard5.3.3/examples/ant/midlets.xml new file mode 100644 index 0000000000..fe17277a37 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/ant/midlets.xml @@ -0,0 +1,52 @@ +<!-- This Ant build file illustrates how to process J2ME midlets. + Usage: ant -f midlets.xml --> + +<project name="Midlets" default="obfuscate" basedir="../.."> + +<target name="obfuscate"> + <taskdef resource="proguard/ant/task.properties" + classpath="lib/proguard.jar" /> + + <proguard microedition="on" + printseeds="on" + printmapping="out.map" + overloadaggressively="on" + repackageclasses="" + allowaccessmodification="on" + renamesourcefileattribute="SourceFile"> + + <!-- On Windows, you can't use mixed case class names, + should you still want to use the preverify tool. + usemixedcaseclassnames="false"> + --> + + <!-- Specify the input jars, output jars, and library jars. --> + + <injar file="in.jar" /> + <outjar file="out.jar" /> + + <libraryjar file="/usr/local/java/wtk2.5.2/lib/midpapi20.jar" /> + <libraryjar file="/usr/local/java/wtk2.5.2/lib/cldcapi11.jar" /> + + <!-- Optionally preserve line numbers in the obfuscated stack traces. + <keepattribute name="LineNumberTable"> + <keepattribute name="SourceFile"> + --> + + <!-- Preserve all public midlets. --> + + <keep access="public" extends="javax.microedition.midlet.MIDlet" /> + + <!-- Preserve all native method names and the names of their classes. --> + + <keepclasseswithmembernames includedescriptorclasses="true"> + <method access="native" /> + </keepclasseswithmembernames> + + <!-- Your application may contain more items that need to be preserved; + typically classes that are dynamically created using Class.forName --> + + </proguard> +</target> + +</project> diff --git a/third_party/java/proguard/proguard5.3.3/examples/ant/proguard.xml b/third_party/java/proguard/proguard5.3.3/examples/ant/proguard.xml new file mode 100644 index 0000000000..f37c266aa0 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/ant/proguard.xml @@ -0,0 +1,89 @@ +<!-- This Ant build file illustrates how to process ProGuard (including its + main application, its GUI, its Ant task, and its WTK plugin), and the + ReTrace tool, all in one go. + Usage: ant -f proguard.xml --> + +<project name="ProGuard" default="obfuscate" basedir="../.."> + +<target name="obfuscate"> + <taskdef resource="proguard/ant/task.properties" + classpath="lib/proguard.jar" /> + + <proguard printmapping="proguard.map" + overloadaggressively="on" + repackageclasses="" + renamesourcefileattribute="SourceFile"> + + <!-- Specify the input jars, output jars, and library jars. --> + + <injar file="lib/proguard.jar" /> + <injar file="lib/proguardgui.jar" filter="!META-INF/**" /> + <injar file="lib/retrace.jar" filter="!META-INF/**" /> + + <outjar file="examples/ant/proguard_out.jar" /> + + <libraryjar file="${java.home}/lib/rt.jar" /> + <libraryjar file="/usr/local/java/ant/lib/ant.jar" /> + <libraryjar file="/usr/local/java/gradle-2.12/lib/plugins/gradle-plugins-2.12.jar" /> + <libraryjar file="/usr/local/java/gradle-2.12/lib/gradle-base-services-2.12.jar" /> + <libraryjar file="/usr/local/java/gradle-2.12/lib/gradle-base-services-groovy-2.12.jar" /> + <libraryjar file="/usr/local/java/gradle-2.12/lib/gradle-core-2.12.jar" /> + <libraryjar file="/usr/local/java/gradle-2.12/lib/groovy-all-2.4.4.jar" /> + <libraryjar file="/usr/local/java/wtk2.5.2/wtklib/kenv.zip" /> + + <!-- Adapt the resource file names, based on the corresponding obfuscated + class names. --> + + <adaptresourcefilenames filter="**.properties,**.gif,**.jpg" /> + <adaptresourcefilecontents filter="proguard/ant/task.properties" /> + + <!-- Optionally preserve line numbers in the obfuscated stack traces. + <keepattribute name="LineNumberTable"> + <keepattribute name="SourceFile"> + --> + + <!-- The main seeds: ProGuard and its companion tool ReTrace. --> + + <keep access="public" name="proguard.ProGuard"> + <method access ="public static" + type ="void" + name ="main" + parameters="java.lang.String[]" /> + </keep> + <keep access="public" name="proguard.gui.ProGuardGUI"> + <method access ="public static" + type ="void" + name ="main" + parameters="java.lang.String[]" /> + </keep> + <keep access="public" name="proguard.retrace.ReTrace"> + <method access ="public static" + type ="void" + name ="main" + parameters="java.lang.String[]" /> + </keep> + + <!-- If we have ant.jar, we can properly process the Ant task. --> + + <keeppackagename name="proguard.ant" /> + <keep name="proguard.ant.*" allowobfuscation="true" /> + <keepclassmembers access="public" name="proguard.ant.*"> + <constructor parameters="org.apache.tools.ant.Project" /> + <method access="public" type="void" name="set*" parameters="***" /> + <method access="public" type="void" name="add*" parameters="***" /> + </keepclassmembers> + + <!-- If we have the Gradle jars, we can properly process the Gradle task. --> + + <keep access="public" name="proguard.gradle.*"> + <method access="public" /> + </keep> + + <!-- If we have kenv.zip, we can process the J2ME WTK plugin. --> + + <keep access="public" name="proguard.wtk.ProGuardObfuscator" /> + + </proguard> +</target> + +</project> diff --git a/third_party/java/proguard/proguard5.3.3/examples/ant/servlets.xml b/third_party/java/proguard/proguard5.3.3/examples/ant/servlets.xml new file mode 100644 index 0000000000..33ca6cec9a --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/ant/servlets.xml @@ -0,0 +1,88 @@ +<!-- This Ant build file illustrates how to process servlets. + Usage: ant -f servlets.xml --> + +<project name="Servlets" default="obfuscate" basedir="../.."> + +<target name="obfuscate"> + <taskdef resource="proguard/ant/task.properties" + classpath="lib/proguard.jar" /> + + <proguard printseeds="on" + printmapping="proguard.map" + renamesourcefileattribute="SourceFile"> + + <!-- Specify the input jars, output jars, and library jars. --> + + <injar file="in.jar" /> + <outjar file="out.jar" /> + + <libraryjar file="${java.home}/lib/rt.jar" /> + + <!-- Optionally preserve line numbers in the obfuscated stack traces. + <keepattribute name="LineNumberTable"> + <keepattribute name="SourceFile"> + --> + + <!-- Preserve all annotations. --> + + <keepattribute name="*Annotation*" /> + + <!-- Keep all public servlets. --> + + <keep access="public" implements="javax.servlet.Servlet" /> + + <!-- Preserve all native method names and the names of their classes. --> + + <keepclasseswithmembernames includedescriptorclasses="true"> + <method access="native" /> + </keepclasseswithmembernames> + + <!-- Preserve the methods that are required in all enumeration classes. --> + + <keepclassmembers allowoptimization="true" type="enum"> + <method access="public static" + type="**[]" + name="values" + parameters="" /> + <method access="public static" + type="**" + name="valueOf" + parameters="java.lang.String" /> + </keepclassmembers> + + <!-- Explicitly preserve all serialization members. The Serializable + interface is only a marker interface, so it wouldn't save them. + You can comment this out if your library doesn't use serialization. + If your code contains serializable classes that have to be backward + compatible, please refer to the manual. --> + + <keepclassmembers implements="java.io.Serializable"> + <field access ="static final" + type ="long" + name ="serialVersionUID" /> + <field access ="static final" + type ="java.io.ObjectStreamField[]" + name ="serialPersistentFields" /> + <method access ="private" + type ="void" + name ="writeObject" + parameters="java.io.ObjectOutputStream" /> + <method access ="private" + type ="void" + name ="readObject" + parameters="java.io.ObjectInputStream" /> + <method type ="java.lang.Object" + name ="writeReplace" + parameters="" /> + <method type ="java.lang.Object" + name ="readResolve" + parameters="" /> + </keepclassmembers> + + <!-- Your application may contain more items that need to be preserved; + typically classes that are dynamically created using Class.forName --> + + </proguard> +</target> + +</project> diff --git a/third_party/java/proguard/proguard5.3.3/examples/applets.pro b/third_party/java/proguard/proguard5.3.3/examples/applets.pro new file mode 100644 index 0000000000..75256a0456 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/applets.pro @@ -0,0 +1,69 @@ +# +# This ProGuard configuration file illustrates how to process applets. +# Usage: +# java -jar proguard.jar @applets.pro +# + +# Specify the input jars, output jars, and library jars. + +-injars in.jar +-outjars out.jar + +-libraryjars <java.home>/lib/rt.jar + +# Save the obfuscation mapping to a file, so you can de-obfuscate any stack +# traces later on. Keep a fixed source file attribute and all line number +# tables to get line numbers in the stack traces. +# You can comment this out if you're not interested in stack traces. + +-printmapping out.map +-renamesourcefileattribute SourceFile +-keepattributes SourceFile,LineNumberTable + +# Preserve all annotations. + +-keepattributes *Annotation* + +# You can print out the seeds that are matching the keep options below. + +#-printseeds out.seeds + +# Preserve all public applets. + +-keep public class * extends java.applet.Applet + +# Preserve all native method names and the names of their classes. + +-keepclasseswithmembernames,includedescriptorclasses class * { + native <methods>; +} + +# Preserve the special static methods that are required in all enumeration +# classes. + +-keepclassmembers,allowoptimization enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# Explicitly preserve all serialization members. The Serializable interface +# is only a marker interface, so it wouldn't save them. +# You can comment this out if your library doesn't use serialization. +# If your code contains serializable classes that have to be backward +# compatible, please refer to the manual. + +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# Your application may contain more items that need to be preserved; +# typically classes that are dynamically created using Class.forName: + +# -keep public class mypackage.MyClass +# -keep public interface mypackage.MyInterface +# -keep public class * implements mypackage.MyInterface diff --git a/third_party/java/proguard/proguard5.3.3/examples/applications.pro b/third_party/java/proguard/proguard5.3.3/examples/applications.pro new file mode 100644 index 0000000000..5424423e61 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/applications.pro @@ -0,0 +1,75 @@ +# +# This ProGuard configuration file illustrates how to process applications. +# Usage: +# java -jar proguard.jar @applications.pro +# + +# Specify the input jars, output jars, and library jars. + +-injars in.jar +-outjars out.jar + +-libraryjars <java.home>/lib/rt.jar +#-libraryjars junit.jar +#-libraryjars servlet.jar +#-libraryjars jai_core.jar +#... + +# Save the obfuscation mapping to a file, so you can de-obfuscate any stack +# traces later on. Keep a fixed source file attribute and all line number +# tables to get line numbers in the stack traces. +# You can comment this out if you're not interested in stack traces. + +-printmapping out.map +-renamesourcefileattribute SourceFile +-keepattributes SourceFile,LineNumberTable + +# Preserve all annotations. + +-keepattributes *Annotation* + +# You can print out the seeds that are matching the keep options below. + +#-printseeds out.seeds + +# Preserve all public applications. + +-keepclasseswithmembers public class * { + public static void main(java.lang.String[]); +} + +# Preserve all native method names and the names of their classes. + +-keepclasseswithmembernames,includedescriptorclasses class * { + native <methods>; +} + +# Preserve the special static methods that are required in all enumeration +# classes. + +-keepclassmembers,allowoptimization enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# Explicitly preserve all serialization members. The Serializable interface +# is only a marker interface, so it wouldn't save them. +# You can comment this out if your application doesn't use serialization. +# If your code contains serializable classes that have to be backward +# compatible, please refer to the manual. + +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# Your application may contain more items that need to be preserved; +# typically classes that are dynamically created using Class.forName: + +# -keep public class mypackage.MyClass +# -keep public interface mypackage.MyInterface +# -keep public class * implements mypackage.MyInterface diff --git a/third_party/java/proguard/proguard5.3.3/examples/dictionaries/compact.txt b/third_party/java/proguard/proguard5.3.3/examples/dictionaries/compact.txt new file mode 100644 index 0000000000..5636a3eede --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/dictionaries/compact.txt @@ -0,0 +1,18 @@ +# +# This obfuscation dictionary contains strings that are already present +# in many class files. Since these strings can be shared, the resulting +# obfuscated class files will generally be a little bit more compact. +# Usage: +# java -jar proguard.jar ..... -obfuscationdictionary compact.txt +# + +Code +V +I +Z +B +C +S +F +D +L diff --git a/third_party/java/proguard/proguard5.3.3/examples/dictionaries/keywords.txt b/third_party/java/proguard/proguard5.3.3/examples/dictionaries/keywords.txt new file mode 100644 index 0000000000..76f5a7b0ab --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/dictionaries/keywords.txt @@ -0,0 +1,58 @@ +# +# This obfuscation dictionary contains reserved Java keywords. They can't +# be used in Java source files, but they can be used in compiled class files. +# Note that this hardly improves the obfuscation. Decent decompilers can +# automatically replace reserved keywords, and the effect can fairly simply be +# undone by obfuscating again with simpler names. +# Usage: +# java -jar proguard.jar ..... -obfuscationdictionary keywords.txt +# + +do +if +for +int +new +try +byte +case +char +else +goto +long +this +void +break +catch +class +const +final +float +short +super +throw +while +double +import +native +public +return +static +switch +throws +boolean +default +extends +finally +package +private +abstract +continue +strictfp +volatile +interface +protected +transient +implements +instanceof +synchronized diff --git a/third_party/java/proguard/proguard5.3.3/examples/dictionaries/shakespeare.txt b/third_party/java/proguard/proguard5.3.3/examples/dictionaries/shakespeare.txt new file mode 100644 index 0000000000..28b1cd8d55 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/dictionaries/shakespeare.txt @@ -0,0 +1,23 @@ +# +# This obfuscation dictionary contains quotes from plays by Shakespeare. +# It illustrates that any text can be used, for whatever flippant reasons +# one may have. +# Usage: +# java -jar proguard.jar ..... -obfuscationdictionary shakespeare.txt +# + + +"This thing of darkness I acknowledge mine." + + --From The Tempest (V, i, 275-276) + + +"Though this be madness, yet there is method in 't." + + --From Hamlet (II, ii, 206) + + +"What's in a name? That which we call a rose + By any other word would smell as sweet." + + --From Romeo and Juliet (II, ii, 1-2) diff --git a/third_party/java/proguard/proguard5.3.3/examples/dictionaries/windows.txt b/third_party/java/proguard/proguard5.3.3/examples/dictionaries/windows.txt new file mode 100644 index 0000000000..fd65dc977d --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/dictionaries/windows.txt @@ -0,0 +1,209 @@ +# +# This obfuscation dictionary contains names that are not allowed as file names +# in Windows, not even with extensions like .class or .java. They can however +# be used without problems in jar archives, which just begs to apply them as +# obfuscated class names. Trying to unpack the obfuscated archives in Windows +# will probably generate some sparks. +# Usage: +# java -jar proguard.jar ..... -classobfuscationdictionary windows.txt +# -packageobfuscationdictionary windows.txt +# + +aux +Aux +aUx +AUx +auX +AuX +aUX +AUX +AUX +con +Con +cOn +COn +coN +CoN +cON +CON +CON +nul +Nul +nUl +NUl +nuL +NuL +nUL +NUL +NUL +prn +Prn +pRn +PRn +prN +PrN +pRN +PRN +PRN +com1 +Com1 +cOm1 +COm1 +coM1 +CoM1 +cOM1 +COM1 +COM1 +com2 +Com2 +cOm2 +COm2 +coM2 +CoM2 +cOM2 +COM2 +COM2 +com3 +Com3 +cOm3 +COm3 +coM3 +CoM3 +cOM3 +COM3 +COM3 +com4 +Com4 +cOm4 +COm4 +coM4 +CoM4 +cOM4 +COM4 +COM4 +com5 +Com5 +cOm5 +COm5 +coM5 +CoM5 +cOM5 +COM5 +COM5 +com6 +Com6 +cOm6 +COm6 +coM6 +CoM6 +cOM6 +COM6 +COM6 +com7 +Com7 +cOm7 +COm7 +coM7 +CoM7 +cOM7 +COM7 +COM7 +com8 +Com8 +cOm8 +COm8 +coM8 +CoM8 +cOM8 +COM8 +COM8 +com9 +Com9 +cOm9 +COm9 +coM9 +CoM9 +cOM9 +COM9 +COM9 +lpt1 +Lpt1 +lPt1 +LPt1 +lpT1 +LpT1 +lPT1 +LPT1 +LPT1 +lpt2 +Lpt2 +lPt2 +LPt2 +lpT2 +LpT2 +lPT2 +LPT2 +LPT2 +lpt3 +Lpt3 +lPt3 +LPt3 +lpT3 +LpT3 +lPT3 +LPT3 +LPT3 +lpt4 +Lpt4 +lPt4 +LPt4 +lpT4 +LpT4 +lPT4 +LPT4 +LPT4 +lpt5 +Lpt5 +lPt5 +LPt5 +lpT5 +LpT5 +lPT5 +LPT5 +LPT5 +lpt6 +Lpt6 +lPt6 +LPt6 +lpT6 +LpT6 +lPT6 +LPT6 +LPT6 +lpt7 +Lpt7 +lPt7 +LPt7 +lpT7 +LpT7 +lPT7 +LPT7 +LPT7 +lpt8 +Lpt8 +lPt8 +LPt8 +lpT8 +LpT8 +lPT8 +LPT8 +LPT8 +lpt9 +Lpt9 +lPt9 +LPt9 +lpT9 +LpT9 +lPT9 +LPT9 +LPT9 diff --git a/third_party/java/proguard/proguard5.3.3/examples/gradle/android.gradle b/third_party/java/proguard/proguard5.3.3/examples/gradle/android.gradle new file mode 100644 index 0000000000..b4fe7191c0 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/gradle/android.gradle @@ -0,0 +1,195 @@ +// +// This Gradle build file illustrates how to process Android +// applications. +// Usage: +// gradle -b android.gradle proguard +// +// If you're using the Android SDK, the Ant release build and Eclipse export +// already take care of the proper settings. You only need to enable ProGuard +// by commenting in the corresponding line in project.properties. You can still +// add project-specific configuration in proguard-project.txt. +// +// This configuration file is for custom, stand-alone builds. + +// Tell Gradle where to find the ProGuard task. + +buildscript { + repositories { + flatDir dirs: '../../lib' + } + dependencies { + classpath ':proguard' + } +} + +// Define a ProGuard task. + +task proguard(type: proguard.gradle.ProGuardTask) { + + // You should probably import a more compact ProGuard-style configuration + // file for all static settings, but we're specifying them all here, for + // the sake of the example. + //configuration 'configuration.pro' + + // 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). + + injars 'bin/classes' + injars 'libs' + outjars 'bin/classes-processed.jar' + + libraryjars '/usr/local/android-sdk/platforms/android-9/android.jar' + //libraryjars '/usr/local/android-sdk/add-ons/google_apis-7_r01/libs/maps.jar' + // ... + + // Save the obfuscation mapping to a file, so you can de-obfuscate any stack + // traces later on. + + printmapping 'bin/classes-processed.map' + + // You can print out the seeds that are matching the keep options below. + + //printseeds 'bin/classes-processed.seeds' + + // Preverification is irrelevant for the dex compiler and the Dalvik VM. + + dontpreverify + + // Reduce the size of the output some more. + + repackageclasses '' + allowaccessmodification + + // Switch off some optimizations that trip older versions of the Dalvik VM. + + optimizations '!code/simplification/arithmetic' + + // Keep a fixed source file attribute and all line number tables to get line + // numbers in the stack traces. + // You can comment this out if you're not interested in stack traces. + + renamesourcefileattribute 'SourceFile' + keepattributes 'SourceFile,LineNumberTable' + + // RemoteViews might need annotations. + + keepattributes '*Annotation*' + + // Preserve all fundamental application classes. + + keep 'public class * extends android.app.Activity' + keep 'public class * extends android.app.Application' + keep 'public class * extends android.app.Service' + keep 'public class * extends android.content.BroadcastReceiver' + keep 'public class * extends android.content.ContentProvider' + + // Preserve all View implementations, their special context constructors, and + // their setters. + + keep 'public class * extends android.view.View { \ + public <init>(android.content.Context); \ + public <init>(android.content.Context, android.util.AttributeSet); \ + public <init>(android.content.Context, android.util.AttributeSet, int); \ + public void set*(...); \ + }' + + // Preserve all classes that have special context constructors, and the + // constructors themselves. + + keepclasseswithmembers 'class * { \ + public <init>(android.content.Context, android.util.AttributeSet); \ + }' + + // Preserve all classes that have special context constructors, and the + // constructors themselves. + + keepclasseswithmembers 'class * { \ + public <init>(android.content.Context, android.util.AttributeSet, int); \ + }' + + // Preserve all possible onClick handlers. + + keepclassmembers 'class * extends android.content.Context { \ + public void *(android.view.View); \ + public void *(android.view.MenuItem); \ + }' + + // Preserve the special fields of all Parcelable implementations. + + keepclassmembers 'class * implements android.os.Parcelable { \ + static android.os.Parcelable$Creator CREATOR; \ + }' + + // Preserve static fields of inner classes of R classes that might be accessed + // through introspection. + + keepclassmembers 'class **.R$* { \ + public static <fields>; \ + }' + + // Preserve annotated Javascript interface methods. + + keepclassmembers 'class * { \ + @android.webkit.JavascriptInterface <methods>; \ + }' + + // Preserve the required interface from the License Verification Library + // (but don't nag the developer if the library is not used at all). + + keep 'public interface com.android.vending.licensing.ILicensingService' + + dontnote 'com.android.vending.licensing.ILicensingService' + + // The Android Compatibility library references some classes that may not be + // present in all versions of the API, but we know that's ok. + + dontwarn 'android.support.**' + + // Preserve all native method names and the names of their classes. + + keepclasseswithmembernames includedescriptorclasses:true, 'class * { \ + native <methods>; \ + }' + + // Preserve the special static methods that are required in all enumeration + // classes. + + keepclassmembers allowshrinking:true, 'enum * { \ + public static **[] values(); \ + public static ** valueOf(java.lang.String); \ + }' + + // Explicitly preserve all serialization members. The Serializable interface + // is only a marker interface, so it wouldn't save them. + // You can comment this out if your application doesn't use serialization. + // If your code contains serializable classes that have to be backward + // compatible, please refer to the manual. + + keepclassmembers 'class * implements java.io.Serializable { \ + static final long serialVersionUID; \ + static final java.io.ObjectStreamField[] serialPersistentFields; \ + private void writeObject(java.io.ObjectOutputStream); \ + private void readObject(java.io.ObjectInputStream); \ + java.lang.Object writeReplace(); \ + java.lang.Object readResolve(); \ + }' + + // Your application may contain more items that need to be preserved; + // typically classes that are dynamically created using Class.forName: + + //keep 'public class mypackage.MyClass' + //keep 'public interface mypackage.MyInterface' + //keep 'public class * implements mypackage.MyInterface' + + // If you wish, you can let the optimization step remove Android logging + // calls. + //assumenosideeffects class android.util.Log { + // public static boolean isLoggable(java.lang.String, int); + // public static int v(...); + // public static int i(...); + // public static int w(...); + // public static int d(...); + // public static int e(...); + //} +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/gradle/applets.gradle b/third_party/java/proguard/proguard5.3.3/examples/gradle/applets.gradle new file mode 100644 index 0000000000..aefe651408 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/gradle/applets.gradle @@ -0,0 +1,90 @@ +// +// This Gradle build file illustrates how to process applets. +// Usage: +// gradle -b applets.gradle proguard +// + +// Tell Gradle where to find the ProGuard task. + +buildscript { + repositories { + flatDir dirs: '../../lib' + } + dependencies { + classpath ':proguard' + } +} + +// Define a ProGuard task. + +task proguard(type: proguard.gradle.ProGuardTask) { + + // You should probably import a more compact ProGuard-style configuration + // file for all static settings, but we're specifying them all here, for + // the sake of the example. + //configuration 'configuration.pro' + + // Specify the input jars, output jars, and library jars. + + injars 'in.jar' + outjars 'out.jar' + + libraryjars "${System.getProperty('java.home')}/lib/rt.jar" + + // Save the obfuscation mapping to a file, so you can de-obfuscate any stack + // traces later on. Keep a fixed source file attribute and all line number + // tables to get line numbers in the stack traces. + // You can comment this out if you're not interested in stack traces. + + printmapping 'out.map' + renamesourcefileattribute 'SourceFile' + keepattributes 'SourceFile,LineNumberTable' + + // Preserve all annotations. + + keepattributes '*Annotation*' + + // You can print out the seeds that are matching the keep options below. + + //printseeds 'out.seeds' + + // Preserve all public applets. + + keep 'public class * extends java.applet.Applet' + + // Preserve all native method names and the names of their classes. + + keepclasseswithmembernames includedescriptorclasses:true, 'class * { \ + native <methods>; \ + }' + + // Preserve the special static methods that are required in all enumeration + // classes. + + keepclassmembers allowshrinking:true, 'enum * { \ + public static **[] values(); \ + public static ** valueOf(java.lang.String); \ + }' + + // Explicitly preserve all serialization members. The Serializable interface + // is only a marker interface, so it wouldn't save them. + // You can comment this out if your library doesn't use serialization. + // If your code contains serializable classes that have to be backward + // compatible, please refer to the manual. + + keepclassmembers 'class * implements java.io.Serializable { \ + static final long serialVersionUID; \ + static final java.io.ObjectStreamField[] serialPersistentFields; \ + private void writeObject(java.io.ObjectOutputStream); \ + private void readObject(java.io.ObjectInputStream); \ + java.lang.Object writeReplace(); \ + java.lang.Object readResolve(); \ + }' + + // Your application may contain more items that need to be preserved; + // typically classes that are dynamically created using Class.forName: + + // keep 'public class mypackage.MyClass' + // keep 'public interface mypackage.MyInterface' + // keep 'public class * implements mypackage.MyInterface' +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/gradle/applications.gradle b/third_party/java/proguard/proguard5.3.3/examples/gradle/applications.gradle new file mode 100644 index 0000000000..ffadf91654 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/gradle/applications.gradle @@ -0,0 +1,96 @@ +// +// This Gradle build file illustrates how to process applications. +// Usage: +// gradle -b applications.gradle proguard +// + +// Tell Gradle where to find the ProGuard task. + +buildscript { + repositories { + flatDir dirs: '../../lib' + } + dependencies { + classpath ':proguard' + } +} + +// Define a ProGuard task. + +task proguard(type: proguard.gradle.ProGuardTask) { + + // You should probably import a more compact ProGuard-style configuration + // file for all static settings, but we're specifying them all here, for + // the sake of the example. + //configuration 'configuration.pro' + + // Specify the input jars, output jars, and library jars. + + injars 'in.jar' + outjars 'out.jar' + + libraryjars "${System.getProperty('java.home')}/lib/rt.jar" + //libraryjars 'junit.jar' + //libraryjars 'servlet.jar' + //libraryjars 'jai_core.jar' + //... + + // Save the obfuscation mapping to a file, so you can de-obfuscate any stack + // traces later on. Keep a fixed source file attribute and all line number + // tables to get line numbers in the stack traces. + // You can comment this out if you're not interested in stack traces. + + printmapping 'out.map' + renamesourcefileattribute 'SourceFile' + keepattributes 'SourceFile,LineNumberTable' + + // Preserve all annotations. + + keepattributes '*Annotation*' + + // You can print out the seeds that are matching the keep options below. + + //printseeds 'out.seeds' + + // Preserve all public applications. + + keepclasseswithmembers 'public class * { \ + public static void main(java.lang.String[]); \ + }' + + // Preserve all native method names and the names of their classes. + + keepclasseswithmembernames includedescriptorclasses:true, 'class * { \ + native <methods>; \ + }' + + // Preserve the special static methods that are required in all enumeration + // classes. + + keepclassmembers allowshrinking:true, 'enum * { \ + public static **[] values(); \ + public static ** valueOf(java.lang.String); \ + }' + + // Explicitly preserve all serialization members. The Serializable interface + // is only a marker interface, so it wouldn't save them. + // You can comment this out if your application doesn't use serialization. + // If your code contains serializable classes that have to be backward + // compatible, please refer to the manual. + + keepclassmembers 'class * implements java.io.Serializable { \ + static final long serialVersionUID; \ + static final java.io.ObjectStreamField[] serialPersistentFields; \ + private void writeObject(java.io.ObjectOutputStream); \ + private void readObject(java.io.ObjectInputStream); \ + java.lang.Object writeReplace(); \ + java.lang.Object readResolve(); \ + }' + + // Your application may contain more items that need to be preserved; + // typically classes that are dynamically created using Class.forName: + + // keep 'public class mypackage.MyClass' + // keep 'public interface mypackage.MyInterface' + // keep 'public class * implements mypackage.MyInterface' +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/gradle/library.gradle b/third_party/java/proguard/proguard5.3.3/examples/gradle/library.gradle new file mode 100644 index 0000000000..8bd137cd2c --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/gradle/library.gradle @@ -0,0 +1,99 @@ +// +// This Gradle build file illustrates how to process a program +// library, such that it remains usable as a library. +// Usage: +// gradle -b library.gradle proguard +// + +// Tell Gradle where to find the ProGuard task. + +buildscript { + repositories { + flatDir dirs: '../../lib' + } + dependencies { + classpath ':proguard' + } +} + +// Define a ProGuard task. + +task proguard(type: proguard.gradle.ProGuardTask) { + + // You should probably import a more compact ProGuard-style configuration + // file for all static settings, but we're specifying them all here, for + // the sake of the example. + //configuration 'configuration.pro' + + // Specify the input jars, output jars, and library jars. + // In this case, the input jar is the program library that we want to process. + + injars 'in.jar' + outjars 'out.jar' + + libraryjars "${System.getProperty('java.home')}/lib/rt.jar" + + // Save the obfuscation mapping to a file, so we can de-obfuscate any stack + // traces later on. Keep a fixed source file attribute and all line number + // tables to get line numbers in the stack traces. + // You can comment this out if you're not interested in stack traces. + + printmapping 'out.map' + keepparameternames + renamesourcefileattribute 'SourceFile' + keepattributes 'Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,EnclosingMethod' + + // Preserve all annotations. + + keepattributes '*Annotation*' + + // Preserve all public classes, and their public and protected fields and + // methods. + + keep 'public class * { \ + public protected *; \ + }' + + // Preserve all .class method names. + + keepclassmembernames 'class * { \ + java.lang.Class class$(java.lang.String); \ + java.lang.Class class$(java.lang.String, boolean); \ + }' + + // Preserve all native method names and the names of their classes. + + keepclasseswithmembernames includedescriptorclasses:true, 'class * { \ + native <methods>; \ + }' + + // Preserve the special static methods that are required in all enumeration + // classes. + + keepclassmembers allowshrinking:true, 'enum * { \ + public static **[] values(); \ + public static ** valueOf(java.lang.String); \ + }' + + // Explicitly preserve all serialization members. The Serializable interface + // is only a marker interface, so it wouldn't save them. + // You can comment this out if your library doesn't use serialization. + // If your code contains serializable classes that have to be backward + // compatible, please refer to the manual. + + keepclassmembers 'class * implements java.io.Serializable { \ + static final long serialVersionUID; \ + static final java.io.ObjectStreamField[] serialPersistentFields; \ + private void writeObject(java.io.ObjectOutputStream); \ + private void readObject(java.io.ObjectInputStream); \ + java.lang.Object writeReplace(); \ + java.lang.Object readResolve(); \ + }' + + // Your library may contain more items that need to be preserved; + // typically classes that are dynamically created using Class.forName: + + // keep 'public class mypackage.MyClass' + // keep 'public interface mypackage.MyInterface' + // keep 'public class * implements mypackage.MyInterface' +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/gradle/midlets.gradle b/third_party/java/proguard/proguard5.3.3/examples/gradle/midlets.gradle new file mode 100644 index 0000000000..1e9fb116af --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/gradle/midlets.gradle @@ -0,0 +1,88 @@ +// +// This Gradle build file illustrates how to process J2ME midlets. +// Usage: +// gradle -b midlets.gradle proguard +// + +// Tell Gradle where to find the ProGuard task. + +buildscript { + repositories { + flatDir dirs: '../../lib' + } + dependencies { + classpath ':proguard' + } +} + +// Define a ProGuard task. + +task proguard(type: proguard.gradle.ProGuardTask) { + + // You should probably import a more compact ProGuard-style configuration + // file for all static settings, but we're specifying them all here, for + // the sake of the example. + //configuration 'configuration.pro' + + // Specify the input jars, output jars, and library jars. + + injars 'in.jar' + outjars 'out.jar' + + libraryjars '/usr/local/java/wtk2.5.2/lib/midpapi20.jar' + libraryjars '/usr/local/java/wtk2.5.2/lib/cldcapi11.jar' + + // Preverify the code suitably for Java Micro Edition. + + microedition + + // Allow methods with the same signature, except for the return type, + // to get the same obfuscation name. + + overloadaggressively + + // Put all obfuscated classes into the nameless root package. + + repackageclasses '' + + // Allow classes and class members to be made public. + + allowaccessmodification + + // On Windows, you can't use mixed case class names, + // should you still want to use the preverify tool. + // + // dontusemixedcaseclassnames + + // Save the obfuscation mapping to a file, so you can de-obfuscate any stack + // traces later on. + + printmapping 'out.map' + + // You can keep a fixed source file attribute and all line number tables to + // get stack traces with line numbers. + + //renamesourcefileattribute 'SourceFile' + //keepattributes 'SourceFile,LineNumberTable' + + // You can print out the seeds that are matching the keep options below. + + //printseeds 'out.seeds' + + // Preserve all public midlets. + + keep 'public class * extends javax.microedition.midlet.MIDlet' + + // Preserve all native method names and the names of their classes. + + keepclasseswithmembernames includedescriptorclasses:true, 'class * { \ + native <methods>; \ + }' + + // Your midlet may contain more items that need to be preserved; + // typically classes that are dynamically created using Class.forName: + + // keep 'public class mypackage.MyClass' + // keep 'public interface mypackage.MyInterface' + // keep 'public class * implements mypackage.MyInterface' +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/gradle/proguard.gradle b/third_party/java/proguard/proguard5.3.3/examples/gradle/proguard.gradle new file mode 100644 index 0000000000..0abb72e89d --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/gradle/proguard.gradle @@ -0,0 +1,92 @@ +// +// This Gradle build file illustrates how to process ProGuard itself. +// Configuration files for typical applications will be very similar. +// Usage: +// gradle -b proguard.gradle proguard +// + +// Tell Gradle where to find the ProGuard task. + +buildscript { + repositories { + flatDir dirs: '../../lib' + } + dependencies { + classpath ':proguard' + } +} + +// Define a ProGuard task. + +task proguard(type: proguard.gradle.ProGuardTask) { + + // You should probably import a more compact ProGuard-style configuration + // file for all static settings, but we're specifying them all here, for + // the sake of the example. + //configuration 'configuration.pro' + + // Specify the input jars, output jars, and library jars. + // We'll filter out the Ant classes, Gradle classes, and WTK classes, keeping + // everything else. + + injars '../../lib/proguard.jar', filter: '!proguard/ant/**,!proguard/gradle/**,!proguard/wtk/**' + outjars 'proguard_out.jar' + + libraryjars "${System.getProperty('java.home')}/lib/rt.jar" + + // Write out an obfuscation mapping file, for de-obfuscating any stack traces + // later on, or for incremental obfuscation of extensions. + + printmapping 'proguard.map' + + // Allow methods with the same signature, except for the return type, + // to get the same obfuscation name. + + overloadaggressively + + // Put all obfuscated classes into the nameless root package. + + repackageclasses '' + + // Allow classes and class members to be made public. + + allowaccessmodification + + // The entry point: ProGuard and its main method. + + keep 'public class proguard.ProGuard { \ + public static void main(java.lang.String[]); \ + }' + + // If you want to preserve the Ant task as well, you'll have to specify the + // main ant.jar. + + //libraryjars '/usr/local/java/ant/lib/ant.jar' + //adaptresourcefilecontents 'proguard/ant/task.properties' + // + //keep allowobfuscation: true, 'class proguard.ant.*' + //keepclassmembers 'public class proguard.ant.* { \ + // <init>(org.apache.tools.ant.Project); \ + // public void set*(***); \ + // public void add*(***); \ + //}' + + // If you want to preserve the Gradle task, you'll have to specify the Gradle + // jars. + + //libraryjars '/usr/local/java/gradle-2.1/lib/plugins/gradle-plugins-2.1.jar' + //libraryjars '/usr/local/java/gradle-2.1/lib/gradle-base-services-2.1.jar' + //libraryjars '/usr/local/java/gradle-2.1/lib/gradle-base-services-groovy-2.1.jar' + //libraryjars '/usr/local/java/gradle-2.1/lib/gradle-core-2.1.jar' + //libraryjars '/usr/local/java/gradle-2.1/lib/groovy-all-2.3.6.jar' + + //keep 'public class proguard.gradle.* { \ + // public *; \ + //}' + + // If you want to preserve the WTK obfuscation plug-in, you'll have to specify + // the kenv.zip file. + + //libraryjars '/usr/local/java/wtk2.5.2/wtklib/kenv.zip' + //keep 'public class proguard.wtk.ProGuardObfuscator' +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/gradle/proguardall.gradle b/third_party/java/proguard/proguard5.3.3/examples/gradle/proguardall.gradle new file mode 100644 index 0000000000..43c905cdaf --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/gradle/proguardall.gradle @@ -0,0 +1,94 @@ +// +// This Gradle build file illustrates how to process ProGuard +// (including its main application, its GUI, its Ant task, and its WTK plugin), +// and the ReTrace tool, all in one go. +// Configuration files for typical applications will be very similar. +// Usage: +// gradle -b proguardall.gradle proguard +// + +// Tell Gradle where to find the ProGuard task. + +buildscript { + repositories { + flatDir dirs: '../../lib' + } + dependencies { + classpath ':proguard' + } +} + +// Define a ProGuard task. + +task proguard(type: proguard.gradle.ProGuardTask) { + + // You should probably import a more compact ProGuard-style configuration + // file for all static settings, but we're specifying them all here, for + // the sake of the example. + //configuration 'configuration.pro' + + // Specify the input jars, output jars, and library jars. + // We'll read all jars from the lib directory, process them, and write the + // processed jars to a new out directory. + + injars '../../lib' + outjars 'out' + + // You may have to adapt the paths below. + + libraryjars "${System.getProperty('java.home')}/lib/rt.jar" + libraryjars '/usr/local/java/ant/lib/ant.jar' + libraryjars '/usr/local/java/gradle-2.1/lib/plugins/gradle-plugins-2.1.jar' + libraryjars '/usr/local/java/gradle-2.1/lib/gradle-base-services-2.1.jar' + libraryjars '/usr/local/java/gradle-2.1/lib/gradle-base-services-groovy-2.1.jar' + libraryjars '/usr/local/java/gradle-2.1/lib/gradle-core-2.1.jar' + libraryjars '/usr/local/java/gradle-2.1/lib/groovy-all-2.3.6.jar' + libraryjars '/usr/local/java/wtk2.5.2/wtklib/kenv.zip' + + // Allow methods with the same signature, except for the return type, + // to get the same obfuscation name. + + overloadaggressively + + // Put all obfuscated classes into the nameless root package. + + repackageclasses '' + + // Adapt the names and contents of the resource files. + + adaptresourcefilenames '**.properties,**.gif,**.jpg' + adaptresourcefilecontents 'proguard/ant/task.properties' + + // The main entry points. + + keep 'public class proguard.ProGuard { \ + public static void main(java.lang.String[]); \ + }' + + keep 'public class proguard.gui.ProGuardGUI { \ + public static void main(java.lang.String[]); \ + }' + + keep 'public class proguard.retrace.ReTrace { \ + public static void main(java.lang.String[]); \ + }' + + // If we have ant.jar, we can properly process the Ant task. + + keep allowobfuscation: true, 'class proguard.ant.*' + keepclassmembers 'public class proguard.ant.* { \ + <init>(org.apache.tools.ant.Project); \ + public void set*(***); \ + public void add*(***); \ + }' + + // If we have the Gradle jars, we can properly process the Gradle task. + + keep 'public class proguard.gradle.* { \ + public *; \ + }' + + // If we have kenv.zip, we can process the J2ME WTK plugin. + + keep 'public class proguard.wtk.ProGuardObfuscator' +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/gradle/proguardgui.gradle b/third_party/java/proguard/proguard5.3.3/examples/gradle/proguardgui.gradle new file mode 100644 index 0000000000..7bfebd9db6 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/gradle/proguardgui.gradle @@ -0,0 +1,72 @@ +// +// This Gradle build file illustrates how to process the ProGuard GUI. +// Configuration files for typical applications will be very similar. +// Usage: +// gradle -b proguardgui.gradle proguard +// + +// Tell Gradle where to find the ProGuard task. + +buildscript { + repositories { + flatDir dirs: '../../lib' + } + dependencies { + classpath ':proguard' + } +} + +// Define a ProGuard task. + +task proguard(type: proguard.gradle.ProGuardTask) { + + // You should probably import a more compact ProGuard-style configuration + // file for all static settings, but we're specifying them all here, for + // the sake of the example. + //configuration 'configuration.pro' + + // Specify the input jars, output jars, and library jars. + // The input jars will be merged in a single output jar. + // We'll filter out the Ant classes, Gradle classes, and WTK classes, keeping + // everything else. + + injars '../../lib/proguardgui.jar' + injars '../../lib/proguard.jar', filter: '!META-INF/**,!proguard/ant/**,!proguard/gradle/**,!proguard/wtk/**' + injars '../../lib/retrace.jar', filter: '!META-INF/**' + outjars 'proguardgui_out.jar' + + libraryjars "${System.getProperty('java.home')}/lib/rt.jar" + + // If we wanted to reuse the previously obfuscated proguard_out.jar, we could + // perform incremental obfuscation based on its mapping file, and only keep the + // additional GUI files instead of all files. + + //applymapping 'proguard.map' + //injars '../../lib/proguardgui.jar' + //outjars 'proguardgui_out.jar' + //libraryjars '../../lib/proguard.jar', filter: '!proguard/ant/**,!proguard/wtk/**' + //libraryjars '../../lib/retrace.jar' + //libraryjars "${System.getProperty('java.home')}/lib/rt.jar" + + + // Allow methods with the same signature, except for the return type, + // to get the same obfuscation name. + + overloadaggressively + + // Put all obfuscated classes into the nameless root package. + + repackageclasses '' + + // Adapt the names of resource files, based on the corresponding obfuscated + // class names. Notably, in this case, the GUI resource properties file will + // have to be renamed. + + adaptresourcefilenames '**.properties,**.gif,**.jpg' + + // The entry point: ProGuardGUI and its main method. + + keep 'public class proguard.gui.ProGuardGUI { \ + public static void main(java.lang.String[]); \ + }' +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/gradle/retrace.gradle b/third_party/java/proguard/proguard5.3.3/examples/gradle/retrace.gradle new file mode 100644 index 0000000000..7fe2c7e259 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/gradle/retrace.gradle @@ -0,0 +1,64 @@ +// +// This Gradle build file illustrates how to process the ReTrace tool. +// Configuration files for typical applications will be very similar. +// Usage: +// gradle -b retrace.gradle proguard +// + +// Tell Gradle where to find the ProGuard task. + +buildscript { + repositories { + flatDir dirs: '../../lib' + } + dependencies { + classpath ':proguard' + } +} + +// Define a ProGuard task. + +task proguard(type: proguard.gradle.ProGuardTask) { + + // You should probably import a more compact ProGuard-style configuration + // file for all static settings, but we're specifying them all here, for + // the sake of the example. + //configuration 'configuration.pro' + + // Specify the input jars, output jars, and library jars. + // The input jars will be merged in a single output jar. + // We'll filter out the Ant and WTK classes. + + injars '../../lib/retrace.jar' + injars '../../lib/proguard.jar(!META-INF/MANIFEST.MF,' + !proguard/ant/**,!proguard/wtk/**) + outjars 'retrace_out.jar' + + libraryjars "${System.getProperty('java.home')}/lib/rt.jar" + + // If we wanted to reuse the previously obfuscated proguard_out.jar, we could + // perform incremental obfuscation based on its mapping file, and only keep the + // additional ReTrace files instead of all files. + + //applymapping 'proguard.map' + //outjars 'retrace_out.jar', filter: 'proguard/retrace/**' + + // Allow methods with the same signature, except for the return type, + // to get the same obfuscation name. + + overloadaggressively + + // Put all obfuscated classes into the nameless root package. + + repackageclasses '' + + // Allow classes and class members to be made public. + + allowaccessmodification + + // The entry point: ReTrace and its main method. + + keep 'public class proguard.retrace.ReTrace { \ + public static void main(java.lang.String[]); \ + }' +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/gradle/scala.gradle b/third_party/java/proguard/proguard5.3.3/examples/gradle/scala.gradle new file mode 100644 index 0000000000..69be1bb931 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/gradle/scala.gradle @@ -0,0 +1,153 @@ +// +// This Gradle build file illustrates how to process Scala +// applications, including the Scala runtime. +// Usage: +// gradle -b scala.gradle proguard +// + +// Tell Gradle where to find the ProGuard task. + +buildscript { + repositories { + flatDir dirs: '../../lib' + } + dependencies { + classpath ':proguard' + } +} + +// Define a ProGuard task. + +task proguard(type: proguard.gradle.ProGuardTask) { + + // You should probably import a more compact ProGuard-style configuration + // file for all static settings, but we're specifying them all here, for + // the sake of the example. + //configuration 'configuration.pro' + + // Specify the input jars, output jars, and library jars. + + injars 'in.jar' + injars '/usr/local/java/scala-2.9.1/lib/scala-library.jar' + //injars '/usr/local/java/scala-2.9.1/lib/scala-compiler.jar', filter: '!META-INF/MANIFEST.MF' + //injars '/usr/local/java/scala-2.9.1/lib/jline.jar', filter: '!META-INF/MANIFEST.MF' + outjars 'out.jar' + + libraryjars "${System.getProperty('java.home')}/lib/rt.jar" + //libraryjars '/usr/local/java/ant/lib/ant.jar' + //... + + // Ignore some compiler artefacts. + + dontwarn 'scala.**' + + // Save the obfuscation mapping to a file, so you can de-obfuscate any stack + // traces later on. Keep a fixed source file attribute and all line number + // tables to get line numbers in the stack traces. + // You can comment this out if you're not interested in stack traces. + + printmapping 'out.map' + renamesourcefileattribute 'SourceFile' + keepattributes 'SourceFile,LineNumberTable' + + // Preserve all annotations. + + keepattributes '*Annotation*' + + // You can print out the seeds that are matching the keep options below. + + //printseeds 'out.seeds' + + // Preserve all public applications. + + keepclasseswithmembers 'public class * { \ + public static void main(java.lang.String[]); \ + }' + + // Preserve some classes and class members that are accessed by means of + // introspection. + + keep 'class * implements org.xml.sax.EntityResolver' + + keepclassmembers 'class * { \ + ** MODULE$; \ + }' + + keepclassmembernames 'class scala.concurrent.forkjoin.ForkJoinPool { \ + long eventCount; \ + int workerCounts; \ + int runControl; \ + scala.concurrent.forkjoin.ForkJoinPool$WaitQueueNode syncStack; \ + scala.concurrent.forkjoin.ForkJoinPool$WaitQueueNode spareStack; \ + }' + + keepclassmembernames 'class scala.concurrent.forkjoin.ForkJoinWorkerThread { \ + int base; \ + int sp; \ + int runState; \ + }' + + keepclassmembernames 'class scala.concurrent.forkjoin.ForkJoinTask { \ + int status; \ + }' + + keepclassmembernames 'class scala.concurrent.forkjoin.LinkedTransferQueue { \ + scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference head; \ + scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference tail; \ + scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference cleanMe; \ + }' + + // Preserve some classes and class members that are accessed by means of + // introspection in the Scala compiler library, if it is processed as well. + + //keep 'class * implements jline.Completor' + //keep 'class * implements jline.Terminal' + + //keep 'class scala.tools.nsc.Global' + + //keepclasseswithmembers 'class * { \ + // <init>(scala.tools.nsc.Global); \ + //}' + + //keepclassmembers 'class * { \ + // *** scala_repl_value(); \ + // *** scala_repl_result(); \ + //}' + + // Preserve all native method names and the names of their classes. + + keepclasseswithmembernames includedescriptorclasses:true, 'class * { \ + native <methods>; \ + }' + + // Preserve the special static methods that are required in all enumeration + // classes. + + keepclassmembers allowshrinking:true, 'enum * { \ + public static **[] values(); \ + public static ** valueOf(java.lang.String); \ + }' + + // Explicitly preserve all serialization members. The Serializable interface + // is only a marker interface, so it wouldn't save them. + // You can comment this out if your application doesn't use serialization. + // If your code contains serializable classes that have to be backward + // compatible, please refer to the manual. + + keepclassmembers 'class * implements java.io.Serializable { \ + static final long serialVersionUID; \ + static final java.io.ObjectStreamField[] serialPersistentFields; \ + private void writeObject(java.io.ObjectOutputStream); \ + private void readObject(java.io.ObjectInputStream); \ + java.lang.Object writeReplace(); \ + java.lang.Object readResolve(); \ + }' + + // Your application may contain more items that need to be preserved; + // typically classes that are dynamically created using Class.forName: + + // keep 'public class mypackage.MyClass' + // keep 'public interface mypackage.MyInterface' + // keep 'public class * implements mypackage.MyInterface' + +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/gradle/servlets.gradle b/third_party/java/proguard/proguard5.3.3/examples/gradle/servlets.gradle new file mode 100644 index 0000000000..23062ff041 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/gradle/servlets.gradle @@ -0,0 +1,91 @@ +// +// This Gradle build file illustrates how to process servlets. +// Usage: +// gradle -b servlets.gradle proguard +// + +// Tell Gradle where to find the ProGuard task. + +buildscript { + repositories { + flatDir dirs: '../../lib' + } + dependencies { + classpath ':proguard' + } +} + +// Define a ProGuard task. + +task proguard(type: proguard.gradle.ProGuardTask) { + + // You should probably import a more compact ProGuard-style configuration + // file for all static settings, but we're specifying them all here, for + // the sake of the example. + //configuration 'configuration.pro' + + // Specify the input jars, output jars, and library jars. + + injars 'in.jar' + outjars 'out.jar' + + libraryjars "${System.getProperty('java.home')}/lib/rt.jar" + libraryjars '/usr/local/java/servlet/servlet.jar' + + // Save the obfuscation mapping to a file, so you can de-obfuscate any stack + // traces later on. Keep a fixed source file attribute and all line number + // tables to get line numbers in the stack traces. + // You can comment this out if you're not interested in stack traces. + + printmapping 'out.map' + renamesourcefileattribute 'SourceFile' + keepattributes 'SourceFile,LineNumberTable' + + // Preserve all annotations. + + keepattributes '*Annotation*' + + // You can print out the seeds that are matching the keep options below. + + //printseeds 'out.seeds' + + // Preserve all public servlets. + + keep 'public class * implements javax.servlet.Servlet' + + // Preserve all native method names and the names of their classes. + + keepclasseswithmembernames includedescriptorclasses:true, 'class * { \ + native <methods>; \ + }' + + // Preserve the special static methods that are required in all enumeration + // classes. + + keepclassmembers allowshrinking:true, 'enum * { \ + public static **[] values(); \ + public static ** valueOf(java.lang.String); \ + }' + + // Explicitly preserve all serialization members. The Serializable interface + // is only a marker interface, so it wouldn't save them. + // You can comment this out if your library doesn't use serialization. + // If your code contains serializable classes that have to be backward + // compatible, please refer to the manual. + + keepclassmembers 'class * implements java.io.Serializable { \ + static final long serialVersionUID; \ + static final java.io.ObjectStreamField[] serialPersistentFields; \ + private void writeObject(java.io.ObjectOutputStream); \ + private void readObject(java.io.ObjectInputStream); \ + java.lang.Object writeReplace(); \ + java.lang.Object readResolve(); \ + }' + + // Your application may contain more items that need to be preserved; + // typically classes that are dynamically created using Class.forName: + + // keep 'public class mypackage.MyClass' + // keep 'public interface mypackage.MyInterface' + // keep 'public class * implements mypackage.MyInterface' +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/library.pro b/third_party/java/proguard/proguard5.3.3/examples/library.pro new file mode 100644 index 0000000000..4669e79c21 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/library.pro @@ -0,0 +1,79 @@ +# +# This ProGuard configuration file illustrates how to process a program +# library, such that it remains usable as a library. +# Usage: +# java -jar proguard.jar @library.pro +# + +# Specify the input jars, output jars, and library jars. +# In this case, the input jar is the program library that we want to process. + +-injars in.jar +-outjars out.jar + +-libraryjars <java.home>/lib/rt.jar + +# Save the obfuscation mapping to a file, so we can de-obfuscate any stack +# traces later on. Keep a fixed source file attribute and all line number +# tables to get line numbers in the stack traces. +# You can comment this out if you're not interested in stack traces. + +-printmapping out.map +-keepparameternames +-renamesourcefileattribute SourceFile +-keepattributes Exceptions,InnerClasses,Signature,Deprecated, + SourceFile,LineNumberTable,EnclosingMethod + +# Preserve all annotations. + +-keepattributes *Annotation* + +# Preserve all public classes, and their public and protected fields and +# methods. + +-keep public class * { + public protected *; +} + +# Preserve all .class method names. + +-keepclassmembernames class * { + java.lang.Class class$(java.lang.String); + java.lang.Class class$(java.lang.String, boolean); +} + +# Preserve all native method names and the names of their classes. + +-keepclasseswithmembernames,includedescriptorclasses class * { + native <methods>; +} + +# Preserve the special static methods that are required in all enumeration +# classes. + +-keepclassmembers,allowoptimization enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# Explicitly preserve all serialization members. The Serializable interface +# is only a marker interface, so it wouldn't save them. +# You can comment this out if your library doesn't use serialization. +# If your code contains serializable classes that have to be backward +# compatible, please refer to the manual. + +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# Your library may contain more items that need to be preserved; +# typically classes that are dynamically created using Class.forName: + +# -keep public class mypackage.MyClass +# -keep public interface mypackage.MyInterface +# -keep public class * implements mypackage.MyInterface diff --git a/third_party/java/proguard/proguard5.3.3/examples/midlets.pro b/third_party/java/proguard/proguard5.3.3/examples/midlets.pro new file mode 100644 index 0000000000..f2f5f21569 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/midlets.pro @@ -0,0 +1,67 @@ +# +# This ProGuard configuration file illustrates how to process J2ME midlets. +# Usage: +# java -jar proguard.jar @midlets.pro +# + +# Specify the input jars, output jars, and library jars. + +-injars in.jar +-outjars out.jar + +-libraryjars /usr/local/java/wtk2.5.2/lib/midpapi20.jar +-libraryjars /usr/local/java/wtk2.5.2/lib/cldcapi11.jar + +# Preverify the code suitably for Java Micro Edition. + +-microedition + +# Allow methods with the same signature, except for the return type, +# to get the same obfuscation name. + +-overloadaggressively + +# Put all obfuscated classes into the nameless root package. + +-repackageclasses '' + +# Allow classes and class members to be made public. + +-allowaccessmodification + +# On Windows, you can't use mixed case class names, +# should you still want to use the preverify tool. +# +# -dontusemixedcaseclassnames + +# Save the obfuscation mapping to a file, so you can de-obfuscate any stack +# traces later on. + +-printmapping out.map + +# You can keep a fixed source file attribute and all line number tables to +# get stack traces with line numbers. + +#-renamesourcefileattribute SourceFile +#-keepattributes SourceFile,LineNumberTable + +# You can print out the seeds that are matching the keep options below. + +#-printseeds out.seeds + +# Preserve all public midlets. + +-keep public class * extends javax.microedition.midlet.MIDlet + +# Preserve all native method names and the names of their classes. + +-keepclasseswithmembernames,includedescriptorclasses class * { + native <methods>; +} + +# Your midlet may contain more items that need to be preserved; +# typically classes that are dynamically created using Class.forName: + +# -keep public class mypackage.MyClass +# -keep public interface mypackage.MyInterface +# -keep public class * implements mypackage.MyInterface diff --git a/third_party/java/proguard/proguard5.3.3/examples/proguard.pro b/third_party/java/proguard/proguard5.3.3/examples/proguard.pro new file mode 100644 index 0000000000..a077df41af --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/proguard.pro @@ -0,0 +1,70 @@ +# +# This ProGuard configuration file illustrates how to process ProGuard itself. +# Configuration files for typical applications will be very similar. +# Usage: +# java -jar proguard.jar @proguard.pro +# + +# Specify the input jars, output jars, and library jars. +# We'll filter out the Ant classes, Gradle classes, and WTK classes, keeping +# everything else. + +-injars ../lib/proguard.jar(!proguard/ant/**,!proguard/gradle/**,!proguard/wtk/**) +-outjars proguard_out.jar + +-libraryjars <java.home>/lib/rt.jar + +# Write out an obfuscation mapping file, for de-obfuscating any stack traces +# later on, or for incremental obfuscation of extensions. + +-printmapping proguard.map + +# Allow methods with the same signature, except for the return type, +# to get the same obfuscation name. + +-overloadaggressively + +# Put all obfuscated classes into the nameless root package. + +-repackageclasses '' + +# Allow classes and class members to be made public. + +-allowaccessmodification + +# The entry point: ProGuard and its main method. + +-keep public class proguard.ProGuard { + public static void main(java.lang.String[]); +} + +# If you want to preserve the Ant task as well, you'll have to specify the +# main ant.jar. + +#-libraryjars /usr/local/java/ant/lib/ant.jar +#-adaptresourcefilecontents proguard/ant/task.properties +# +#-keep,allowobfuscation class proguard.ant.* +#-keepclassmembers public class proguard.ant.* { +# <init>(org.apache.tools.ant.Project); +# public void set*(***); +# public void add*(***); +#} + +# If you want to preserve the Gradle task, you'll have to specify the Gradle +# jars. + +#-libraryjars /usr/local/java/gradle-2.12/lib/plugins/gradle-plugins-2.12.jar +#-libraryjars /usr/local/java/gradle-2.12/lib/gradle-base-services-2.12.jar +#-libraryjars /usr/local/java/gradle-2.12/lib/gradle-core-2.12.jar +#-libraryjars /usr/local/java/gradle-2.12/lib/groovy-all-2.4.4.jar + +#-keep public class proguard.gradle.* { +# public *; +#} + +# If you want to preserve the WTK obfuscation plug-in, you'll have to specify +# the kenv.zip file. + +#-libraryjars /usr/local/java/wtk2.5.2/wtklib/kenv.zip +#-keep public class proguard.wtk.ProGuardObfuscator diff --git a/third_party/java/proguard/proguard5.3.3/examples/proguardall.pro b/third_party/java/proguard/proguard5.3.3/examples/proguardall.pro new file mode 100644 index 0000000000..c3106f70f6 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/proguardall.pro @@ -0,0 +1,72 @@ +# +# This ProGuard configuration file illustrates how to process ProGuard +# (including its main application, its GUI, its Ant task, and its WTK plugin), +# and the ReTrace tool, all in one go. +# Configuration files for typical applications will be very similar. +# Usage: +# java -jar proguard.jar @proguardall.pro +# + +# Specify the input jars, output jars, and library jars. +# We'll read all jars from the lib directory, process them, and write the +# processed jars to a new out directory. + +-injars ../lib +-outjars out + +# You may have to adapt the paths below. + +-libraryjars <java.home>/lib/rt.jar +-libraryjars /usr/local/java/ant/lib/ant.jar +-libraryjars /usr/local/java/gradle-2.12/lib/plugins/gradle-plugins-2.12.jar +-libraryjars /usr/local/java/gradle-2.12/lib/gradle-base-services-2.12.jar +-libraryjars /usr/local/java/gradle-2.12/lib/gradle-core-2.12.jar +-libraryjars /usr/local/java/gradle-2.12/lib/groovy-all-2.4.4.jar +-libraryjars /usr/local/java/wtk2.5.2/wtklib/kenv.zip + +# Allow methods with the same signature, except for the return type, +# to get the same obfuscation name. + +-overloadaggressively + +# Put all obfuscated classes into the nameless root package. + +-repackageclasses '' + +# Adapt the names and contents of the resource files. + +-adaptresourcefilenames **.properties,**.gif,**.jpg +-adaptresourcefilecontents proguard/ant/task.properties + +# The main entry points. + +-keep public class proguard.ProGuard { + public static void main(java.lang.String[]); +} + +-keep public class proguard.gui.ProGuardGUI { + public static void main(java.lang.String[]); +} + +-keep public class proguard.retrace.ReTrace { + public static void main(java.lang.String[]); +} + +# If we have ant.jar, we can properly process the Ant task. + +-keep,allowobfuscation class proguard.ant.* +-keepclassmembers public class proguard.ant.* { + <init>(org.apache.tools.ant.Project); + public void set*(***); + public void add*(***); +} + +# If we have the Gradle jars, we can properly process the Gradle task. + +-keep public class proguard.gradle.* { + public *; +} + +# If we have kenv.zip, we can process the J2ME WTK plugin. + +-keep public class proguard.wtk.ProGuardObfuscator diff --git a/third_party/java/proguard/proguard5.3.3/examples/proguardgui.pro b/third_party/java/proguard/proguard5.3.3/examples/proguardgui.pro new file mode 100644 index 0000000000..78f67dbf60 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/proguardgui.pro @@ -0,0 +1,51 @@ +# +# This ProGuard configuration file illustrates how to process the ProGuard GUI. +# Configuration files for typical applications will be very similar. +# Usage: +# java -jar proguard.jar @proguardgui.pro +# + +# Specify the input jars, output jars, and library jars. +# The input jars will be merged in a single output jar. +# We'll filter out the Ant classes, Gradle classes, and WTK classes, keeping +# everything else. + +-injars ../lib/proguardgui.jar +-injars ../lib/proguard.jar(!META-INF/**,!proguard/ant/**,!proguard/gradle/**,!proguard/wtk/**) +-injars ../lib/retrace.jar (!META-INF/**) +-outjars proguardgui_out.jar + +-libraryjars <java.home>/lib/rt.jar + +# If we wanted to reuse the previously obfuscated proguard_out.jar, we could +# perform incremental obfuscation based on its mapping file, and only keep the +# additional GUI files instead of all files. + +#-applymapping proguard.map +#-injars ../lib/proguardgui.jar +#-outjars proguardgui_out.jar +#-libraryjars ../lib/proguard.jar(!proguard/ant/**,!proguard/wtk/**) +#-libraryjars ../lib/retrace.jar +#-libraryjars <java.home>/lib/rt.jar + + +# Allow methods with the same signature, except for the return type, +# to get the same obfuscation name. + +-overloadaggressively + +# Put all obfuscated classes into the nameless root package. + +-repackageclasses '' + +# Adapt the names of resource files, based on the corresponding obfuscated +# class names. Notably, in this case, the GUI resource properties file will +# have to be renamed. + +-adaptresourcefilenames **.properties,**.gif,**.jpg + +# The entry point: ProGuardGUI and its main method. + +-keep public class proguard.gui.ProGuardGUI { + public static void main(java.lang.String[]); +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/retrace.pro b/third_party/java/proguard/proguard5.3.3/examples/retrace.pro new file mode 100644 index 0000000000..39f5a95c59 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/retrace.pro @@ -0,0 +1,43 @@ +# +# This ProGuard configuration file illustrates how to process the ReTrace tool. +# Configuration files for typical applications will be very similar. +# Usage: +# java -jar proguard.jar @retrace.pro +# + +# Specify the input jars, output jars, and library jars. +# The input jars will be merged in a single output jar. +# We'll filter out the Ant and WTK classes. + +-injars ../lib/retrace.jar +-injars ../lib/proguard.jar(!META-INF/MANIFEST.MF, + !proguard/ant/**,!proguard/wtk/**) +-outjars retrace_out.jar + +-libraryjars <java.home>/lib/rt.jar + +# If we wanted to reuse the previously obfuscated proguard_out.jar, we could +# perform incremental obfuscation based on its mapping file, and only keep the +# additional ReTrace files instead of all files. + +#-applymapping proguard.map +#-outjars retrace_out.jar(proguard/retrace/**) + +# Allow methods with the same signature, except for the return type, +# to get the same obfuscation name. + +-overloadaggressively + +# Put all obfuscated classes into the nameless root package. + +-repackageclasses '' + +# Allow classes and class members to be made public. + +-allowaccessmodification + +# The entry point: ReTrace and its main method. + +-keep public class proguard.retrace.ReTrace { + public static void main(java.lang.String[]); +} diff --git a/third_party/java/proguard/proguard5.3.3/examples/scala.pro b/third_party/java/proguard/proguard5.3.3/examples/scala.pro new file mode 100644 index 0000000000..3b69c3c8b4 --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/scala.pro @@ -0,0 +1,132 @@ +# +# This ProGuard configuration file illustrates how to process Scala +# applications, including the Scala runtime. +# Usage: +# java -jar proguard.jar @scala.pro +# + +# Specify the input jars, output jars, and library jars. + +-injars in.jar +-injars /usr/local/java/scala-2.9.1/lib/scala-library.jar +#-injars /usr/local/java/scala-2.9.1/lib/scala-compiler.jar(!META-INF/MANIFEST.MF) +#-injars /usr/local/java/scala-2.9.1/lib/jline.jar(!META-INF/MANIFEST.MF) +-outjars out.jar + +-libraryjars <java.home>/lib/rt.jar +#-libraryjars /usr/local/java/ant/lib/ant.jar +#... + +# Ignore some compiler artefacts. + +-dontwarn scala.** + +# Save the obfuscation mapping to a file, so you can de-obfuscate any stack +# traces later on. Keep a fixed source file attribute and all line number +# tables to get line numbers in the stack traces. +# You can comment this out if you're not interested in stack traces. + +-printmapping out.map +-renamesourcefileattribute SourceFile +-keepattributes SourceFile,LineNumberTable + +# Preserve all annotations. + +-keepattributes *Annotation* + +# You can print out the seeds that are matching the keep options below. + +#-printseeds out.seeds + +# Preserve all public applications. + +-keepclasseswithmembers public class * { + public static void main(java.lang.String[]); +} + +# Preserve some classes and class members that are accessed by means of +# introspection. + +-keep class * implements org.xml.sax.EntityResolver + +-keepclassmembers class * { + ** MODULE$; +} + +-keepclassmembernames class scala.concurrent.forkjoin.ForkJoinPool { + long eventCount; + int workerCounts; + int runControl; + scala.concurrent.forkjoin.ForkJoinPool$WaitQueueNode syncStack; + scala.concurrent.forkjoin.ForkJoinPool$WaitQueueNode spareStack; +} + +-keepclassmembernames class scala.concurrent.forkjoin.ForkJoinWorkerThread { + int base; + int sp; + int runState; +} + +-keepclassmembernames class scala.concurrent.forkjoin.ForkJoinTask { + int status; +} + +-keepclassmembernames class scala.concurrent.forkjoin.LinkedTransferQueue { + scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference head; + scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference tail; + scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference cleanMe; +} + +# Preserve some classes and class members that are accessed by means of +# introspection in the Scala compiler library, if it is processed as well. + +#-keep class * implements jline.Completor +#-keep class * implements jline.Terminal + +#-keep class scala.tools.nsc.Global + +#-keepclasseswithmembers class * { +# <init>(scala.tools.nsc.Global); +#} + +#-keepclassmembers class * { +# *** scala_repl_value(); +# *** scala_repl_result(); +#} + +# Preserve all native method names and the names of their classes. + +-keepclasseswithmembernames,includedescriptorclasses class * { + native <methods>; +} + +# Preserve the special static methods that are required in all enumeration +# classes. + +-keepclassmembers,allowoptimization enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# Explicitly preserve all serialization members. The Serializable interface +# is only a marker interface, so it wouldn't save them. +# You can comment this out if your application doesn't use serialization. +# If your code contains serializable classes that have to be backward +# compatible, please refer to the manual. + +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# Your application may contain more items that need to be preserved; +# typically classes that are dynamically created using Class.forName: + +# -keep public class mypackage.MyClass +# -keep public interface mypackage.MyInterface +# -keep public class * implements mypackage.MyInterface + diff --git a/third_party/java/proguard/proguard5.3.3/examples/servlets.pro b/third_party/java/proguard/proguard5.3.3/examples/servlets.pro new file mode 100644 index 0000000000..a3f7875b5e --- /dev/null +++ b/third_party/java/proguard/proguard5.3.3/examples/servlets.pro @@ -0,0 +1,70 @@ +# +# This ProGuard configuration file illustrates how to process servlets. +# Usage: +# java -jar proguard.jar @servlets.pro +# + +# Specify the input jars, output jars, and library jars. + +-injars in.jar +-outjars out.jar + +-libraryjars <java.home>/lib/rt.jar +-libraryjars /usr/local/java/servlet/servlet.jar + +# Save the obfuscation mapping to a file, so you can de-obfuscate any stack +# traces later on. Keep a fixed source file attribute and all line number +# tables to get line numbers in the stack traces. +# You can comment this out if you're not interested in stack traces. + +-printmapping out.map +-renamesourcefileattribute SourceFile +-keepattributes SourceFile,LineNumberTable + +# Preserve all annotations. + +-keepattributes *Annotation* + +# You can print out the seeds that are matching the keep options below. + +#-printseeds out.seeds + +# Preserve all public servlets. + +-keep public class * implements javax.servlet.Servlet + +# Preserve all native method names and the names of their classes. + +-keepclasseswithmembernames,includedescriptorclasses class * { + native <methods>; +} + +# Preserve the special static methods that are required in all enumeration +# classes. + +-keepclassmembers,allowoptimization enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# Explicitly preserve all serialization members. The Serializable interface +# is only a marker interface, so it wouldn't save them. +# You can comment this out if your library doesn't use serialization. +# If your code contains serializable classes that have to be backward +# compatible, please refer to the manual. + +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# Your application may contain more items that need to be preserved; +# typically classes that are dynamically created using Class.forName: + +# -keep public class mypackage.MyClass +# -keep public interface mypackage.MyInterface +# -keep public class * implements mypackage.MyInterface |