diff options
Diffstat (limited to 'examples/ant')
-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 | 25 | ||||
-rw-r--r-- | examples/ant/servlets.xml | 15 |
7 files changed, 77 insertions, 29 deletions
diff --git a/examples/ant/applets.xml b/examples/ant/applets.xml index a55b1c3..4d0cb38 100644 --- a/examples/ant/applets.xml +++ b/examples/ant/applets.xml @@ -7,7 +7,9 @@ <taskdef resource="proguard/ant/task.properties" classpath="lib/proguard.jar" /> - <proguard printseeds="on"> + <proguard printseeds="on" + printmapping="out.map" + renamesourcefileattribute="SourceFile"> <!-- Specify the input jars, output jars, and library jars. --> @@ -16,14 +18,19 @@ <libraryjar file="${java.home}/lib/rt.jar" /> - <!-- Preserve all public applets. --> - - <keep access="public" extends="java.applet.Applet" /> + <!-- 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> diff --git a/examples/ant/applications1.xml b/examples/ant/applications1.xml index 7a3d473..6df5789 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 applications.xml --> + Usage: ant -f applications1.xml --> <project name="Applications" default="obfuscate" basedir="../.."> diff --git a/examples/ant/applications2.xml b/examples/ant/applications2.xml index 2e28f01..681a894 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 applications.xml --> + Usage: ant -f applications2.xml --> <project name="Applications" default="obfuscate" basedir="../.."> @@ -21,16 +21,22 @@ <!-- -libraryjars jai_core.jar --> <!-- ... --> - <!-- Preserve all public applications. --> + <!-- Save the obfuscation mapping to a file, and preserve line numbers. --> - -keepclasseswithmembers public class * { - public static void main(java.lang.String[]); - } + -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 * { diff --git a/examples/ant/applications3.xml b/examples/ant/applications3.xml index d5501e0..e42eb39 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 applications.xml --> + Usage: ant -f applications3.xml --> <project name="Applications" default="obfuscate" basedir="../.."> @@ -8,7 +8,9 @@ <taskdef resource="proguard/ant/task.properties" classpath="lib/proguard.jar" /> - <proguard printseeds="on"> + <proguard printseeds="on" + printmapping="out.map" + renamesourcefileattribute="SourceFile"> <!-- Specify the input jars, output jars, and library jars. --> @@ -21,6 +23,14 @@ <!-- 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. --> @@ -31,10 +41,6 @@ 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 b17d036..223d0da 100644 --- a/examples/ant/midlets.xml +++ b/examples/ant/midlets.xml @@ -8,13 +8,15 @@ classpath="lib/proguard.jar" /> <proguard microedition="on" + printseeds="on" + printmapping="out.map" overloadaggressively="on" repackageclasses="" allowaccessmodification="on" - printseeds="on"> + renamesourcefileattribute="SourceFile"> <!-- On Windows, you can't use mixed case class names, - for the sake of the preverify tool. + should you still want to use the preverify tool. usemixedcaseclassnames="false"> --> @@ -23,8 +25,13 @@ <injar file="in.jar" /> <outjar file="out.jar" /> - <libraryjar file="/usr/local/java/wtk2.1/lib/midpapi20.jar" /> - <libraryjar file="/usr/local/java/wtk2.1/lib/cldcapi11.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. --> diff --git a/examples/ant/proguard.xml b/examples/ant/proguard.xml index 315e628..1911a90 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 skipnonpubliclibraryclasses="off" - printmapping="proguard.map" + <proguard printmapping="proguard.map" overloadaggressively="on" - repackageclasses=""> + repackageclasses="" + renamesourcefileattribute="SourceFile"> <!-- Specify the input jars, output jars, and library jars. --> @@ -23,8 +23,12 @@ <outjar file="examples/ant/proguard_out.jar" /> <libraryjar file="${java.home}/lib/rt.jar" /> - <libraryjar file="/usr/local/java/ant1.7.0/lib/ant.jar" /> - <libraryjar file="/usr/local/java/wtk2.1/wtklib/kenv.zip" /> + <libraryjar file="/usr/local/java/ant/lib/ant.jar" /> + <libraryjar file="/usr/local/java/gradle-1.3/lib/plugins/gradle-plugins-1.3.jar" /> + <libraryjar file="/usr/local/java/gradle-1.3/lib/gradle-base-services-1.3.jar" /> + <libraryjar file="/usr/local/java/gradle-1.3/lib/gradle-core-1.3.jar" /> + <libraryjar file="/usr/local/java/gradle-1.3/lib/groovy-all-1.8.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. --> @@ -32,6 +36,11 @@ <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"> @@ -63,6 +72,12 @@ <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" /> diff --git a/examples/ant/servlets.xml b/examples/ant/servlets.xml index 83af0f2..51bcaad 100644 --- a/examples/ant/servlets.xml +++ b/examples/ant/servlets.xml @@ -7,7 +7,9 @@ <taskdef resource="proguard/ant/task.properties" classpath="lib/proguard.jar" /> - <proguard printseeds="on"> + <proguard printseeds="on" + printmapping="proguard.map" + renamesourcefileattribute="SourceFile"> <!-- Specify the input jars, output jars, and library jars. --> @@ -16,14 +18,19 @@ <libraryjar file="${java.home}/lib/rt.jar" /> - <!-- Keep all public servlets. --> - - <keep access="public" implements="javax.servlet.Servlet" /> + <!-- 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> |