diff options
Diffstat (limited to 'examples')
54 files changed, 0 insertions, 3516 deletions
diff --git a/examples/android.pro b/examples/android.pro deleted file mode 100644 index 10aa805..0000000 --- a/examples/android.pro +++ /dev/null @@ -1,174 +0,0 @@ -# -# 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/examples/annotations/examples.pro b/examples/annotations/examples.pro deleted file mode 100644 index d2b212c..0000000 --- a/examples/annotations/examples.pro +++ /dev/null @@ -1,60 +0,0 @@ -# -# 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/examples/annotations/examples/Applet.java b/examples/annotations/examples/Applet.java deleted file mode 100644 index e5b7acc..0000000 --- a/examples/annotations/examples/Applet.java +++ /dev/null @@ -1,23 +0,0 @@ -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/examples/annotations/examples/Application.java b/examples/annotations/examples/Application.java deleted file mode 100644 index 777d286..0000000 --- a/examples/annotations/examples/Application.java +++ /dev/null @@ -1,21 +0,0 @@ -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/examples/annotations/examples/Bean.java b/examples/annotations/examples/Bean.java deleted file mode 100644 index aacb501..0000000 --- a/examples/annotations/examples/Bean.java +++ /dev/null @@ -1,57 +0,0 @@ -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/examples/annotations/examples/NativeCallBack.java b/examples/annotations/examples/NativeCallBack.java deleted file mode 100644 index a4e5583..0000000 --- a/examples/annotations/examples/NativeCallBack.java +++ /dev/null @@ -1,52 +0,0 @@ -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/examples/annotations/lib/annotations.jar b/examples/annotations/lib/annotations.jar Binary files differdeleted file mode 100644 index d931505..0000000 --- a/examples/annotations/lib/annotations.jar +++ /dev/null diff --git a/examples/annotations/lib/annotations.pro b/examples/annotations/lib/annotations.pro deleted file mode 100644 index f704af2..0000000 --- a/examples/annotations/lib/annotations.pro +++ /dev/null @@ -1,118 +0,0 @@ -# -# 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/examples/annotations/src/proguard/annotation/Keep.java b/examples/annotations/src/proguard/annotation/Keep.java deleted file mode 100644 index 93a469f..0000000 --- a/examples/annotations/src/proguard/annotation/Keep.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * ProGuard -- shrinking, optimization, obfuscation, and preverification - * of Java bytecode. - * - * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) - */ -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. - */ -@Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR }) -@Retention(RetentionPolicy.CLASS) -@Documented -public @interface Keep {} diff --git a/examples/annotations/src/proguard/annotation/KeepApplication.java b/examples/annotations/src/proguard/annotation/KeepApplication.java deleted file mode 100644 index 181f9b1..0000000 --- a/examples/annotations/src/proguard/annotation/KeepApplication.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * ProGuard -- shrinking, optimization, obfuscation, and preverification - * of Java bytecode. - * - * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) - */ -package proguard.annotation; - -import java.lang.annotation.*; - -/** - * This annotation specifies to keep the annotated class as an application, - * together with its a main method. - */ -@Target({ ElementType.TYPE }) -@Retention(RetentionPolicy.CLASS) -@Documented -public @interface KeepApplication {} diff --git a/examples/annotations/src/proguard/annotation/KeepClassMemberNames.java b/examples/annotations/src/proguard/annotation/KeepClassMemberNames.java deleted file mode 100644 index b2f1df9..0000000 --- a/examples/annotations/src/proguard/annotation/KeepClassMemberNames.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * ProGuard -- shrinking, optimization, obfuscation, and preverification - * of Java bytecode. - * - * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) - */ -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. - */ -@Target({ ElementType.TYPE }) -@Retention(RetentionPolicy.CLASS) -@Documented -public @interface KeepClassMemberNames {} diff --git a/examples/annotations/src/proguard/annotation/KeepClassMembers.java b/examples/annotations/src/proguard/annotation/KeepClassMembers.java deleted file mode 100644 index 7ed755b..0000000 --- a/examples/annotations/src/proguard/annotation/KeepClassMembers.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * ProGuard -- shrinking, optimization, obfuscation, and preverification - * of Java bytecode. - * - * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) - */ -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. - */ -@Target({ ElementType.TYPE }) -@Retention(RetentionPolicy.CLASS) -@Documented -public @interface KeepClassMembers {} diff --git a/examples/annotations/src/proguard/annotation/KeepGettersSetters.java b/examples/annotations/src/proguard/annotation/KeepGettersSetters.java deleted file mode 100644 index 497dcb7..0000000 --- a/examples/annotations/src/proguard/annotation/KeepGettersSetters.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * ProGuard -- shrinking, optimization, obfuscation, and preverification - * of Java bytecode. - * - * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) - */ -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. - */ -@Target({ ElementType.TYPE }) -@Retention(RetentionPolicy.CLASS) -@Documented -public @interface KeepGettersSetters {} diff --git a/examples/annotations/src/proguard/annotation/KeepImplementations.java b/examples/annotations/src/proguard/annotation/KeepImplementations.java deleted file mode 100644 index 47406a3..0000000 --- a/examples/annotations/src/proguard/annotation/KeepImplementations.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * ProGuard -- shrinking, optimization, obfuscation, and preverification - * of Java bytecode. - * - * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) - */ -package proguard.annotation; - -import java.lang.annotation.*; - -/** - * This annotation specifies to keep all implementations or extensions of the - * annotated class as entry points. - */ -@Target({ ElementType.TYPE }) -@Retention(RetentionPolicy.CLASS) -@Documented -public @interface KeepImplementations {} diff --git a/examples/annotations/src/proguard/annotation/KeepName.java b/examples/annotations/src/proguard/annotation/KeepName.java deleted file mode 100644 index 5dd3680..0000000 --- a/examples/annotations/src/proguard/annotation/KeepName.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * ProGuard -- shrinking, optimization, obfuscation, and preverification - * of Java bytecode. - * - * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) - */ -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. - */ -@Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR }) -@Retention(RetentionPolicy.CLASS) -@Documented -public @interface KeepName {} diff --git a/examples/annotations/src/proguard/annotation/KeepPublicClassMemberNames.java b/examples/annotations/src/proguard/annotation/KeepPublicClassMemberNames.java deleted file mode 100644 index f24b126..0000000 --- a/examples/annotations/src/proguard/annotation/KeepPublicClassMemberNames.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * ProGuard -- shrinking, optimization, obfuscation, and preverification - * of Java bytecode. - * - * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) - */ -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. - */ -@Target({ ElementType.TYPE }) -@Retention(RetentionPolicy.CLASS) -@Documented -public @interface KeepPublicClassMemberNames {} diff --git a/examples/annotations/src/proguard/annotation/KeepPublicClassMembers.java b/examples/annotations/src/proguard/annotation/KeepPublicClassMembers.java deleted file mode 100644 index 2be7fa4..0000000 --- a/examples/annotations/src/proguard/annotation/KeepPublicClassMembers.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * ProGuard -- shrinking, optimization, obfuscation, and preverification - * of Java bytecode. - * - * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) - */ -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. - */ -@Target({ ElementType.TYPE }) -@Retention(RetentionPolicy.CLASS) -@Documented -public @interface KeepPublicClassMembers {} diff --git a/examples/annotations/src/proguard/annotation/KeepPublicGettersSetters.java b/examples/annotations/src/proguard/annotation/KeepPublicGettersSetters.java deleted file mode 100644 index 6028ba9..0000000 --- a/examples/annotations/src/proguard/annotation/KeepPublicGettersSetters.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * ProGuard -- shrinking, optimization, obfuscation, and preverification - * of Java bytecode. - * - * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) - */ -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. - */ -@Target({ ElementType.TYPE }) -@Retention(RetentionPolicy.CLASS) -@Documented -public @interface KeepPublicGettersSetters {} diff --git a/examples/annotations/src/proguard/annotation/KeepPublicImplementations.java b/examples/annotations/src/proguard/annotation/KeepPublicImplementations.java deleted file mode 100644 index 52ee5b9..0000000 --- a/examples/annotations/src/proguard/annotation/KeepPublicImplementations.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * ProGuard -- shrinking, optimization, obfuscation, and preverification - * of Java bytecode. - * - * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) - */ -package proguard.annotation; - -import java.lang.annotation.*; - -/** - * This annotation specifies to keep all public implementations or extensions - * of the annotated class as entry points. - */ -@Target({ ElementType.TYPE }) -@Retention(RetentionPolicy.CLASS) -@Documented -public @interface KeepPublicImplementations {} diff --git a/examples/annotations/src/proguard/annotation/KeepPublicProtectedClassMemberNames.java b/examples/annotations/src/proguard/annotation/KeepPublicProtectedClassMemberNames.java deleted file mode 100644 index 59f0004..0000000 --- a/examples/annotations/src/proguard/annotation/KeepPublicProtectedClassMemberNames.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * ProGuard -- shrinking, optimization, obfuscation, and preverification - * of Java bytecode. - * - * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) - */ -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. - */ -@Target({ ElementType.TYPE }) -@Retention(RetentionPolicy.CLASS) -@Documented -public @interface KeepPublicProtectedClassMemberNames {} diff --git a/examples/annotations/src/proguard/annotation/KeepPublicProtectedClassMembers.java b/examples/annotations/src/proguard/annotation/KeepPublicProtectedClassMembers.java deleted file mode 100644 index e918a9b..0000000 --- a/examples/annotations/src/proguard/annotation/KeepPublicProtectedClassMembers.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * ProGuard -- shrinking, optimization, obfuscation, and preverification - * of Java bytecode. - * - * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu) - */ -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. - */ -@Target({ ElementType.TYPE }) -@Retention(RetentionPolicy.CLASS) -@Documented -public @interface KeepPublicProtectedClassMembers {} diff --git a/examples/ant/applets.xml b/examples/ant/applets.xml deleted file mode 100644 index 5666f96..0000000 --- a/examples/ant/applets.xml +++ /dev/null @@ -1,88 +0,0 @@ -<!-- 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/examples/ant/applications1.xml b/examples/ant/applications1.xml deleted file mode 100644 index 6df5789..0000000 --- a/examples/ant/applications1.xml +++ /dev/null @@ -1,15 +0,0 @@ -<!-- 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/examples/ant/applications2.xml b/examples/ant/applications2.xml deleted file mode 100644 index 664a9ee..0000000 --- a/examples/ant/applications2.xml +++ /dev/null @@ -1,74 +0,0 @@ -<!-- 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/examples/ant/applications3.xml b/examples/ant/applications3.xml deleted file mode 100644 index 023c2be..0000000 --- a/examples/ant/applications3.xml +++ /dev/null @@ -1,98 +0,0 @@ -<!-- 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/examples/ant/library.xml b/examples/ant/library.xml deleted file mode 100644 index 37ceb1a..0000000 --- a/examples/ant/library.xml +++ /dev/null @@ -1,102 +0,0 @@ -<!-- 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/examples/ant/midlets.xml b/examples/ant/midlets.xml deleted file mode 100644 index fe17277..0000000 --- a/examples/ant/midlets.xml +++ /dev/null @@ -1,52 +0,0 @@ -<!-- 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/examples/ant/proguard.xml b/examples/ant/proguard.xml deleted file mode 100644 index 18b520b..0000000 --- a/examples/ant/proguard.xml +++ /dev/null @@ -1,89 +0,0 @@ -<!-- 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.1/lib/plugins/gradle-plugins-2.1.jar" /> - <libraryjar file="/usr/local/java/gradle-2.1/lib/gradle-base-services-2.1.jar" /> - <libraryjar file="/usr/local/java/gradle-2.1/lib/gradle-base-services-groovy-2.1.jar" /> - <libraryjar file="/usr/local/java/gradle-2.1/lib/gradle-core-2.1.jar" /> - <libraryjar file="/usr/local/java/gradle-2.1/lib/groovy-all-2.3.6.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/examples/ant/servlets.xml b/examples/ant/servlets.xml deleted file mode 100644 index 33ca6ce..0000000 --- a/examples/ant/servlets.xml +++ /dev/null @@ -1,88 +0,0 @@ -<!-- 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/examples/applets.pro b/examples/applets.pro deleted file mode 100644 index 75256a0..0000000 --- a/examples/applets.pro +++ /dev/null @@ -1,69 +0,0 @@ -# -# 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/examples/applications.pro b/examples/applications.pro deleted file mode 100644 index 5424423..0000000 --- a/examples/applications.pro +++ /dev/null @@ -1,75 +0,0 @@ -# -# 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/examples/dictionaries/compact.txt b/examples/dictionaries/compact.txt deleted file mode 100644 index 5636a3e..0000000 --- a/examples/dictionaries/compact.txt +++ /dev/null @@ -1,18 +0,0 @@ -# -# 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/examples/dictionaries/keywords.txt b/examples/dictionaries/keywords.txt deleted file mode 100644 index 76f5a7b..0000000 --- a/examples/dictionaries/keywords.txt +++ /dev/null @@ -1,58 +0,0 @@ -# -# 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/examples/dictionaries/shakespeare.txt b/examples/dictionaries/shakespeare.txt deleted file mode 100644 index 28b1cd8..0000000 --- a/examples/dictionaries/shakespeare.txt +++ /dev/null @@ -1,23 +0,0 @@ -# -# 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/examples/dictionaries/windows.txt b/examples/dictionaries/windows.txt deleted file mode 100644 index fd65dc9..0000000 --- a/examples/dictionaries/windows.txt +++ /dev/null @@ -1,209 +0,0 @@ -# -# 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/examples/gradle/android.gradle b/examples/gradle/android.gradle deleted file mode 100644 index b4fe719..0000000 --- a/examples/gradle/android.gradle +++ /dev/null @@ -1,195 +0,0 @@ -// -// 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/examples/gradle/applets.gradle b/examples/gradle/applets.gradle deleted file mode 100644 index aefe651..0000000 --- a/examples/gradle/applets.gradle +++ /dev/null @@ -1,90 +0,0 @@ -// -// 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/examples/gradle/applications.gradle b/examples/gradle/applications.gradle deleted file mode 100644 index ffadf91..0000000 --- a/examples/gradle/applications.gradle +++ /dev/null @@ -1,96 +0,0 @@ -// -// 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/examples/gradle/library.gradle b/examples/gradle/library.gradle deleted file mode 100644 index 8bd137c..0000000 --- a/examples/gradle/library.gradle +++ /dev/null @@ -1,99 +0,0 @@ -// -// 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/examples/gradle/midlets.gradle b/examples/gradle/midlets.gradle deleted file mode 100644 index 1e9fb11..0000000 --- a/examples/gradle/midlets.gradle +++ /dev/null @@ -1,88 +0,0 @@ -// -// 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/examples/gradle/proguard.gradle b/examples/gradle/proguard.gradle deleted file mode 100644 index 0abb72e..0000000 --- a/examples/gradle/proguard.gradle +++ /dev/null @@ -1,92 +0,0 @@ -// -// 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/examples/gradle/proguardall.gradle b/examples/gradle/proguardall.gradle deleted file mode 100644 index 43c905c..0000000 --- a/examples/gradle/proguardall.gradle +++ /dev/null @@ -1,94 +0,0 @@ -// -// 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/examples/gradle/proguardgui.gradle b/examples/gradle/proguardgui.gradle deleted file mode 100644 index 7bfebd9..0000000 --- a/examples/gradle/proguardgui.gradle +++ /dev/null @@ -1,72 +0,0 @@ -// -// 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/examples/gradle/retrace.gradle b/examples/gradle/retrace.gradle deleted file mode 100644 index 7fe2c7e..0000000 --- a/examples/gradle/retrace.gradle +++ /dev/null @@ -1,64 +0,0 @@ -// -// 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/examples/gradle/scala.gradle b/examples/gradle/scala.gradle deleted file mode 100644 index 69be1bb..0000000 --- a/examples/gradle/scala.gradle +++ /dev/null @@ -1,153 +0,0 @@ -// -// 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/examples/gradle/servlets.gradle b/examples/gradle/servlets.gradle deleted file mode 100644 index 23062ff..0000000 --- a/examples/gradle/servlets.gradle +++ /dev/null @@ -1,91 +0,0 @@ -// -// 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/examples/library.pro b/examples/library.pro deleted file mode 100644 index 4669e79..0000000 --- a/examples/library.pro +++ /dev/null @@ -1,79 +0,0 @@ -# -# 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/examples/midlets.pro b/examples/midlets.pro deleted file mode 100644 index f2f5f21..0000000 --- a/examples/midlets.pro +++ /dev/null @@ -1,67 +0,0 @@ -# -# 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/examples/proguard.pro b/examples/proguard.pro deleted file mode 100644 index 9cdd0a9..0000000 --- a/examples/proguard.pro +++ /dev/null @@ -1,70 +0,0 @@ -# -# 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-1.3/lib/plugins/gradle-plugins-1.3.jar -#-libraryjars /usr/local/java/gradle-1.3/lib/gradle-base-services-1.3.jar -#-libraryjars /usr/local/java/gradle-1.3/lib/gradle-core-1.3.jar -#-libraryjars /usr/local/java/gradle-1.3/lib/groovy-all-1.8.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/examples/proguardall.pro b/examples/proguardall.pro deleted file mode 100644 index b96da6c..0000000 --- a/examples/proguardall.pro +++ /dev/null @@ -1,72 +0,0 @@ -# -# 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-1.3/lib/plugins/gradle-plugins-1.3.jar --libraryjars /usr/local/java/gradle-1.3/lib/gradle-base-services-1.3.jar --libraryjars /usr/local/java/gradle-1.3/lib/gradle-core-1.3.jar --libraryjars /usr/local/java/gradle-1.3/lib/groovy-all-1.8.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 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/examples/proguardgui.pro b/examples/proguardgui.pro deleted file mode 100644 index 78f67db..0000000 --- a/examples/proguardgui.pro +++ /dev/null @@ -1,51 +0,0 @@ -# -# 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/examples/retrace.pro b/examples/retrace.pro deleted file mode 100644 index 39f5a95..0000000 --- a/examples/retrace.pro +++ /dev/null @@ -1,43 +0,0 @@ -# -# 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/examples/scala.pro b/examples/scala.pro deleted file mode 100644 index 3b69c3c..0000000 --- a/examples/scala.pro +++ /dev/null @@ -1,132 +0,0 @@ -# -# 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/examples/servlets.pro b/examples/servlets.pro deleted file mode 100644 index a3f7875..0000000 --- a/examples/servlets.pro +++ /dev/null @@ -1,70 +0,0 @@ -# -# 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 |