diff options
author | Ying Wang <wangying@google.com> | 2012-02-27 18:34:24 -0800 |
---|---|---|
committer | Ying Wang <wangying@google.com> | 2012-02-27 18:34:24 -0800 |
commit | 9f606f95f03a75961498803e24bee6799a7c0885 (patch) | |
tree | a45f4d74feda9b76277a0c9ced55ad15d82248a1 /examples | |
parent | cfead78069f3dc32998dc118ee08cab3867acea2 (diff) | |
download | android_external_proguard-9f606f95f03a75961498803e24bee6799a7c0885.tar.gz android_external_proguard-9f606f95f03a75961498803e24bee6799a7c0885.tar.bz2 android_external_proguard-9f606f95f03a75961498803e24bee6799a7c0885.zip |
Revert "Upgrade from Progaurd 4.4 to 4.7."cm-10.1.3-RC2cm-10.1.3-RC1cm-10.1.3cm-10.1.2cm-10.1.1cm-10.1.0-RC5cm-10.1.0-RC4cm-10.1.0-RC3cm-10.1.0-RC2cm-10.1.0-RC1cm-10.1.0cm-10.1-M3cm-10.1-M2cm-10.1-M1mr1.1-stagingjellybean-stablejellybeancm-10.1
This reverts commit cfead78069f3dc32998dc118ee08cab3867acea2.
Bug: 6079915
Diffstat (limited to 'examples')
-rw-r--r-- | examples/android.pro | 149 | ||||
-rw-r--r-- | examples/annotations/examples.pro | 3 | ||||
-rw-r--r-- | examples/annotations/lib/annotations.jar | bin | 6123 -> 6123 bytes | |||
-rw-r--r-- | examples/ant/android-8.xml | 177 | ||||
-rw-r--r-- | examples/ant/applets.xml | 15 | ||||
-rw-r--r-- | examples/ant/applications1.xml | 2 | ||||
-rw-r--r-- | examples/ant/applications2.xml | 16 | ||||
-rw-r--r-- | examples/ant/applications3.xml | 18 | ||||
-rw-r--r-- | examples/ant/midlets.xml | 15 | ||||
-rw-r--r-- | examples/ant/proguard.xml | 15 | ||||
-rw-r--r-- | examples/ant/servlets.xml | 15 | ||||
-rw-r--r-- | examples/applets.pro | 21 | ||||
-rw-r--r-- | examples/applications.pro | 25 | ||||
-rwxr-xr-x[-rw-r--r--] | examples/dictionaries/shakespeare.txt | 0 | ||||
-rw-r--r-- | examples/library.pro | 3 | ||||
-rw-r--r-- | examples/midlets.pro | 23 | ||||
-rw-r--r-- | examples/proguard.pro | 2 | ||||
-rw-r--r-- | examples/proguardall.pro | 4 | ||||
-rw-r--r-- | examples/proguardgui.pro | 5 | ||||
-rw-r--r-- | examples/scala.pro | 132 | ||||
-rw-r--r-- | examples/servlets.pro | 21 |
21 files changed, 66 insertions, 595 deletions
diff --git a/examples/android.pro b/examples/android.pro deleted file mode 100644 index a502a2b..0000000 --- a/examples/android.pro +++ /dev/null @@ -1,149 +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 (version 2.3 or higher), the android tool -# already creates a file like this in your project, called proguard.cfg. -# It should contain the settings of this file, minus the input and output paths -# (-injars, -outjars, -libraryjars, -printmapping, and -printseeds). -# The generated Ant build file automatically sets these paths. - -# 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 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 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 class * { - native <methods>; -} - -# Preserve the special static methods that are required in all enumeration -# classes. - --keepclassmembers class * extends java.lang.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/annotations/examples.pro b/examples/annotations/examples.pro index 3a47183..270092a 100644 --- a/examples/annotations/examples.pro +++ b/examples/annotations/examples.pro @@ -8,7 +8,8 @@ # Specify the input, output, and library jars. # This is assuming the code has been compiled in the examples directory. --injars examples(*.class) +#-injars examples(*.class) +-injars classes(*.class) -outjars out -libraryjars <java.home>/lib/rt.jar diff --git a/examples/annotations/lib/annotations.jar b/examples/annotations/lib/annotations.jar Binary files differindex 36f6356..967d604 100644 --- a/examples/annotations/lib/annotations.jar +++ b/examples/annotations/lib/annotations.jar diff --git a/examples/ant/android-8.xml b/examples/ant/android-8.xml deleted file mode 100644 index 3a4316b..0000000 --- a/examples/ant/android-8.xml +++ /dev/null @@ -1,177 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project name="MyAndroidApp" default="help"> - -<!-- The local.properties file is created and updated by the 'android' - tool. - It contains the path to the SDK. It should *NOT* be checked into - Version Control Systems. --> - <property file="local.properties" /> - - <!-- The build.properties file can be created by you and is never touched - by the 'android' tool. This is the place to change some of the - default property values used by the Ant rules. - Here are some properties you may want to change/update: - - source.dir - The name of the source directory. Default is 'src'. - out.dir - The name of the output directory. Default is 'bin'. - - Properties related to the SDK location or the project target should - be updated using the 'android' tool with the 'update' action. - - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. - - --> - <property file="build.properties" /> - - <!-- The default.properties file is created and updated by the 'android' - tool, as well as ADT. - This file is an integral part of the build system for your - application and should be checked into Version Control Systems. --> - <property file="default.properties" /> - - <!-- Custom Android task to deal with the project target, and import the - proper rules. - This requires ant 1.6.0 or above. --> - <path id="android.antlibs"> - <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" /> - <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" /> - <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" /> - </path> - - <taskdef name="setup" - classname="com.android.ant.SetupTask" - classpathref="android.antlibs" /> - -<!-- extension targets. Uncomment the ones where you want to do custom work - in between standard targets --> -<!-- - <target name="-pre-build"> - </target> - <target name="-pre-compile"> - </target> - - [This is typically used for code obfuscation. - Compiled code location: ${out.classes.absolute.dir} - If this is not done in place, override ${out.dex.input.absolute.dir}] - <target name="-post-compile"> - </target> ---> - - - <!-- Execute the Android Setup task that will setup some properties - specific to the target, and import the build rules files. - - The rules file is imported from - <SDK>/platforms/<target_platform>/ant/ant_rules_r#.xml - - To customize existing targets, there are two options: - - Customize only one target: - - copy/paste the target into this file, *before* the - <setup> task. - - customize it to your needs. - - Customize the whole script. - - copy/paste the content of the rules files (minus the top node) - into this file, *after* the <setup> task - - disable the import of the rules by changing the setup task - below to <setup import="false" />. - - customize to your needs. - --> - - <setup /> - - <!-- Define a place for the optimized classes. --> - <property name="out.proguard.absolute.jar" - location="${out.absolute.dir}/classes-processed.jar" /> - - <!-- Define a obfuscation mapping file. --> - <property name="out.proguard.absolute.map" - location="${out.absolute.dir}/classes-processed.map" /> - - <!-- Redefine the dex help macro, so it converts the optimized classes.. --> - <macrodef name="dex-helper"> - <element name="external-libs" optional="yes" /> - <element name="extra-parameters" optional="yes" /> - <sequential> - <echo>Converting optimized files into ${intermediate.dex.file}...</echo> - <apply executable="${dx}" failonerror="true" parallel="true"> - <arg value="--dex" /> - <arg value="--output=${intermediate.dex.file}" /> - <extra-parameters /> - <arg line="${verbose.option}" /> - <fileset file="${out.proguard.absolute.jar}" /> - <external-libs /> - </apply> - </sequential> - </macrodef> - - <!-- Define the optimization target. --> - <taskdef resource="proguard/ant/task.properties" - classpath="/home/eric/ProGuard/releases/proguard4.5.1/lib/proguard.jar" /> - - <target name="-post-compile"> - <echo>Optimizing compiled files and libraries into ${out.proguard.absolute.jar}...</echo> - <proguard printmapping="${out.proguard.absolute.map}"> - <injar path="${out.classes.absolute.dir}" /> - <injar path="${external.libs.absolute.dir}" /> - <outjar path="${out.proguard.absolute.jar}" /> - <libraryjar refid="android.target.classpath" /> - - -dontpreverify - -repackageclasses '' - -allowaccessmodification - -optimizations !code/simplification/arithmetic - - <!-- - -renamesourcefileattribute SourceFile - -keepattributes SourceFile,LineNumberTable - --> - - -keepattributes *Annotation* - - -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 - - -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*(...); - } - - -keepclasseswithmembers class * { - public <init>(android.content.Context, android.util.AttributeSet); - } - - -keepclasseswithmembers class * { - public <init>(android.content.Context, android.util.AttributeSet, int); - } - - -keepclassmembers class * implements android.os.Parcelable { - static android.os.Parcelable$Creator CREATOR; - } - - -keepclassmembers class **.R$* { - public static <fields>; - } - - -keep public interface com.android.vending.licensing.ILicensingService - -dontnote com.android.vending.licensing.ILicensingService - - -keepclasseswithmembernames class * { - native <methods>; - } - - -keepclassmembers class * extends java.lang.Enum { - public static **[] values(); - public static ** valueOf(java.lang.String); - } - </proguard> - </target> - -</project> diff --git a/examples/ant/applets.xml b/examples/ant/applets.xml index 4d0cb38..a55b1c3 100644 --- a/examples/ant/applets.xml +++ b/examples/ant/applets.xml @@ -7,9 +7,7 @@ <taskdef resource="proguard/ant/task.properties" classpath="lib/proguard.jar" /> - <proguard printseeds="on" - printmapping="out.map" - renamesourcefileattribute="SourceFile"> + <proguard printseeds="on"> <!-- Specify the input jars, output jars, and library jars. --> @@ -18,19 +16,14 @@ <libraryjar file="${java.home}/lib/rt.jar" /> - <!-- Optionally preserve line numbers in the obfuscated stack traces. - <keepattribute name="LineNumberTable"> - <keepattribute name="SourceFile"> - --> + <!-- Preserve all public applets. --> + + <keep access="public" extends="java.applet.Applet" /> <!-- 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> diff --git a/examples/ant/applications1.xml b/examples/ant/applications1.xml index 6df5789..7a3d473 100644 --- a/examples/ant/applications1.xml +++ b/examples/ant/applications1.xml @@ -1,6 +1,6 @@ <!-- This Ant build file illustrates how to process applications, by including a ProGuard-style configuration file. - Usage: ant -f applications1.xml --> + Usage: ant -f applications.xml --> <project name="Applications" default="obfuscate" basedir="../.."> diff --git a/examples/ant/applications2.xml b/examples/ant/applications2.xml index 681a894..2e28f01 100644 --- a/examples/ant/applications2.xml +++ b/examples/ant/applications2.xml @@ -1,6 +1,6 @@ <!-- This Ant build file illustrates how to process applications, by including ProGuard-style configuration options. - Usage: ant -f applications2.xml --> + Usage: ant -f applications.xml --> <project name="Applications" default="obfuscate" basedir="../.."> @@ -21,22 +21,16 @@ <!-- -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 annotations. --> + + -keepattributes *Annotation* + <!-- Preserve all native method names and the names of their classes. --> -keepclasseswithmembernames class * { diff --git a/examples/ant/applications3.xml b/examples/ant/applications3.xml index e42eb39..d5501e0 100644 --- a/examples/ant/applications3.xml +++ b/examples/ant/applications3.xml @@ -1,6 +1,6 @@ <!-- This Ant build file illustrates how to process applications, using a full-blown XML configuration. - Usage: ant -f applications3.xml --> + Usage: ant -f applications.xml --> <project name="Applications" default="obfuscate" basedir="../.."> @@ -8,9 +8,7 @@ <taskdef resource="proguard/ant/task.properties" classpath="lib/proguard.jar" /> - <proguard printseeds="on" - printmapping="out.map" - renamesourcefileattribute="SourceFile"> + <proguard printseeds="on"> <!-- Specify the input jars, output jars, and library jars. --> @@ -23,14 +21,6 @@ <!-- 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. --> @@ -41,6 +31,10 @@ parameters="java.lang.String[]" /> </keepclasseswithmembers> + <!-- Preserve all annotations. --> + + <keepattribute name="*Annotation*" /> + <!-- Preserve all native method names and the names of their classes. --> <keepclasseswithmembernames> diff --git a/examples/ant/midlets.xml b/examples/ant/midlets.xml index 223d0da..b17d036 100644 --- a/examples/ant/midlets.xml +++ b/examples/ant/midlets.xml @@ -8,15 +8,13 @@ classpath="lib/proguard.jar" /> <proguard microedition="on" - printseeds="on" - printmapping="out.map" overloadaggressively="on" repackageclasses="" allowaccessmodification="on" - renamesourcefileattribute="SourceFile"> + printseeds="on"> <!-- On Windows, you can't use mixed case class names, - should you still want to use the preverify tool. + for the sake of the preverify tool. usemixedcaseclassnames="false"> --> @@ -25,13 +23,8 @@ <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"> - --> + <libraryjar file="/usr/local/java/wtk2.1/lib/midpapi20.jar" /> + <libraryjar file="/usr/local/java/wtk2.1/lib/cldcapi11.jar" /> <!-- Preserve all public midlets. --> diff --git a/examples/ant/proguard.xml b/examples/ant/proguard.xml index f10764d..315e628 100644 --- a/examples/ant/proguard.xml +++ b/examples/ant/proguard.xml @@ -9,10 +9,10 @@ <taskdef resource="proguard/ant/task.properties" classpath="lib/proguard.jar" /> - <proguard printmapping="proguard.map" + <proguard skipnonpubliclibraryclasses="off" + printmapping="proguard.map" overloadaggressively="on" - repackageclasses="" - renamesourcefileattribute="SourceFile"> + repackageclasses=""> <!-- Specify the input jars, output jars, and library jars. --> @@ -23,8 +23,8 @@ <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/wtk2.5.2/wtklib/kenv.zip" /> + <libraryjar file="/usr/local/java/ant1.7.0/lib/ant.jar" /> + <libraryjar file="/usr/local/java/wtk2.1/wtklib/kenv.zip" /> <!-- Adapt the resource file names, based on the corresponding obfuscated class names. --> @@ -32,11 +32,6 @@ <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"> diff --git a/examples/ant/servlets.xml b/examples/ant/servlets.xml index 51bcaad..83af0f2 100644 --- a/examples/ant/servlets.xml +++ b/examples/ant/servlets.xml @@ -7,9 +7,7 @@ <taskdef resource="proguard/ant/task.properties" classpath="lib/proguard.jar" /> - <proguard printseeds="on" - printmapping="proguard.map" - renamesourcefileattribute="SourceFile"> + <proguard printseeds="on"> <!-- Specify the input jars, output jars, and library jars. --> @@ -18,19 +16,14 @@ <libraryjar file="${java.home}/lib/rt.jar" /> - <!-- Optionally preserve line numbers in the obfuscated stack traces. - <keepattribute name="LineNumberTable"> - <keepattribute name="SourceFile"> - --> + <!-- Keep all public servlets. --> + + <keep access="public" implements="javax.servlet.Servlet" /> <!-- 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> diff --git a/examples/applets.pro b/examples/applets.pro index c5affc1..ee90db0 100644 --- a/examples/applets.pro +++ b/examples/applets.pro @@ -11,26 +11,17 @@ -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. +# Preserve all public applets. --keepattributes *Annotation* +-keep public class * extends java.applet.Applet -# You can print out the seeds that are matching the keep options below. +# Print out a list of what we're preserving. -#-printseeds out.seeds +-printseeds -# Preserve all public applets. +# Preserve all annotations. --keep public class * extends java.applet.Applet +-keepattributes *Annotation* # Preserve all native method names and the names of their classes. diff --git a/examples/applications.pro b/examples/applications.pro index f718088..29d8e43 100644 --- a/examples/applications.pro +++ b/examples/applications.pro @@ -15,29 +15,20 @@ #-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[]); } +# Print out a list of what we're preserving. + +-printseeds + +# Preserve all annotations. + +-keepattributes *Annotation* + # Preserve all native method names and the names of their classes. -keepclasseswithmembernames class * { diff --git a/examples/dictionaries/shakespeare.txt b/examples/dictionaries/shakespeare.txt index 28b1cd8..28b1cd8 100644..100755 --- a/examples/dictionaries/shakespeare.txt +++ b/examples/dictionaries/shakespeare.txt diff --git a/examples/library.pro b/examples/library.pro index b812082..37be47e 100644 --- a/examples/library.pro +++ b/examples/library.pro @@ -15,11 +15,10 @@ # 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. +# tables to actually get these 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 diff --git a/examples/midlets.pro b/examples/midlets.pro index 1383980..bffc38e 100644 --- a/examples/midlets.pro +++ b/examples/midlets.pro @@ -9,8 +9,8 @@ -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 +-libraryjars /usr/local/java/wtk2.1/lib/midpapi20.jar +-libraryjars /usr/local/java/wtk2.1/lib/cldcapi11.jar # Preverify the code suitably for Java Micro Edition. @@ -34,25 +34,14 @@ # # -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 +# Print out a list of what we're preserving. + +-printseeds + # Preserve all native method names and the names of their classes. -keepclasseswithmembernames class * { diff --git a/examples/proguard.pro b/examples/proguard.pro index 3b0a926..c48b87e 100644 --- a/examples/proguard.pro +++ b/examples/proguard.pro @@ -53,5 +53,5 @@ # 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 +#-libraryjars /usr/local/java/wtk2.1/wtklib/kenv.zip #-keep public class proguard.wtk.ProGuardObfuscator diff --git a/examples/proguardall.pro b/examples/proguardall.pro index da9c2b3..8dc042e 100644 --- a/examples/proguardall.pro +++ b/examples/proguardall.pro @@ -17,8 +17,8 @@ # 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/wtk2.5.2/wtklib/kenv.zip +-libraryjars /usr/local/java/ant1.5.0/lib/ant.jar +-libraryjars /usr/local/java/wtk2.1/wtklib/kenv.zip # Allow methods with the same signature, except for the return type, # to get the same obfuscation name. diff --git a/examples/proguardgui.pro b/examples/proguardgui.pro index f14ce14..2cb83ed 100644 --- a/examples/proguardgui.pro +++ b/examples/proguardgui.pro @@ -16,6 +16,11 @@ -libraryjars <java.home>/lib/rt.jar +# In recent JREs, some public Swing classes depend on package visible classes, +# so don't skip these package visible classes while parsing the library jar. + +-dontskipnonpubliclibraryclasses + # 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. diff --git a/examples/scala.pro b/examples/scala.pro deleted file mode 100644 index 658fc77..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 class * { - native <methods>; -} - -# Preserve the special static methods that are required in all enumeration -# classes. - --keepclassmembers class * extends java.lang.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 index b42b2e4..fdc36b0 100644 --- a/examples/servlets.pro +++ b/examples/servlets.pro @@ -12,26 +12,17 @@ -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. +# Preserve all public servlets. --keepattributes *Annotation* +-keep public class * implements javax.servlet.Servlet -# You can print out the seeds that are matching the keep options below. +# Print out a list of what we're preserving. -#-printseeds out.seeds +-printseeds -# Preserve all public servlets. +# Preserve all annotations. --keep public class * implements javax.servlet.Servlet +-keepattributes *Annotation* # Preserve all native method names and the names of their classes. |