summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/android.pro4
-rw-r--r--examples/annotations/examples.pro4
-rw-r--r--examples/annotations/examples/Applet.java3
-rw-r--r--examples/annotations/examples/Application.java3
-rw-r--r--examples/annotations/examples/Bean.java3
-rw-r--r--examples/annotations/examples/NativeCallBack.java14
-rw-r--r--examples/annotations/lib/annotations.jarbin6126 -> 6122 bytes
-rw-r--r--examples/ant/applets.xml4
-rw-r--r--examples/ant/applications2.xml2
-rw-r--r--examples/ant/applications3.xml4
-rw-r--r--examples/ant/library.xml4
-rw-r--r--examples/ant/midlets.xml2
-rw-r--r--examples/ant/proguard.xml9
-rw-r--r--examples/ant/servlets.xml4
-rw-r--r--examples/applets.pro4
-rw-r--r--examples/applications.pro4
-rw-r--r--examples/gradle/android.gradle4
-rw-r--r--examples/gradle/applets.gradle4
-rw-r--r--examples/gradle/applications.gradle4
-rw-r--r--examples/gradle/library.gradle4
-rw-r--r--examples/gradle/midlets.gradle2
-rw-r--r--examples/gradle/proguard.gradle9
-rw-r--r--examples/gradle/proguardall.gradle9
-rw-r--r--examples/gradle/scala.gradle4
-rw-r--r--examples/gradle/servlets.gradle4
-rw-r--r--examples/library.pro4
-rw-r--r--examples/midlets.pro2
-rw-r--r--examples/scala.pro4
-rw-r--r--examples/servlets.pro4
29 files changed, 70 insertions, 56 deletions
diff --git a/examples/android.pro b/examples/android.pro
index 234dad4..10aa805 100644
--- a/examples/android.pro
+++ b/examples/android.pro
@@ -128,14 +128,14 @@
# Preserve all native method names and the names of their classes.
--keepclasseswithmembernames class * {
+-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
# Preserve the special static methods that are required in all enumeration
# classes.
--keepclassmembers class * extends java.lang.Enum {
+-keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
diff --git a/examples/annotations/examples.pro b/examples/annotations/examples.pro
index 3a47183..d2b212c 100644
--- a/examples/annotations/examples.pro
+++ b/examples/annotations/examples.pro
@@ -32,14 +32,14 @@
# Preserve all native method names and the names of their classes.
--keepclasseswithmembernames class * {
+-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
# Preserve the special static methods that are required in all enumeration
# classes.
--keepclassmembers class * extends java.lang.Enum {
+-keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
diff --git a/examples/annotations/examples/Applet.java b/examples/annotations/examples/Applet.java
index 8a5874b..e5b7acc 100644
--- a/examples/annotations/examples/Applet.java
+++ b/examples/annotations/examples/Applet.java
@@ -8,7 +8,8 @@ import proguard.annotation.*;
* You can then process it with:
* java -jar ../../../lib/proguard.jar @ ../examples.pro
*
- * The annotation will preserve the class and its essential methods.
+ * 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
diff --git a/examples/annotations/examples/Application.java b/examples/annotations/examples/Application.java
index f8d5060..777d286 100644
--- a/examples/annotations/examples/Application.java
+++ b/examples/annotations/examples/Application.java
@@ -8,7 +8,8 @@ import proguard.annotation.KeepApplication;
* You can then process it with:
* java -jar ../../../lib/proguard.jar @ ../examples.pro
*
- * The annotation will preserve the class and its main method.
+ * The annotation will preserve the class and its main method,
+ * as a result of the specifications in lib/annotations.pro.
*/
@KeepApplication
public class Application
diff --git a/examples/annotations/examples/Bean.java b/examples/annotations/examples/Bean.java
index 0544bf3..aacb501 100644
--- a/examples/annotations/examples/Bean.java
+++ b/examples/annotations/examples/Bean.java
@@ -8,7 +8,8 @@ import proguard.annotation.*;
* 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.
+ * The annotations will preserve the class and its public getters and setters,
+ * as a result of the specifications in lib/annotations.pro.
*/
@Keep
@KeepPublicGettersSetters
diff --git a/examples/annotations/examples/NativeCallBack.java b/examples/annotations/examples/NativeCallBack.java
index 2c72f7b..a4e5583 100644
--- a/examples/annotations/examples/NativeCallBack.java
+++ b/examples/annotations/examples/NativeCallBack.java
@@ -8,7 +8,8 @@ import proguard.annotation.*;
* You can then process it with:
* java -jar ../../../lib/proguard.jar @ ../examples.pro
*
- * The annotation will preserve the class and its main method.
+ * The annotation will preserve the class and its main method,
+ * as a result of the specifications in lib/annotations.pro.
*/
@KeepApplication
public class NativeCallBack
@@ -16,8 +17,9 @@ public class NativeCallBack
/**
* Suppose this is a native method that computes an answer.
*
- * The -keep option regular ProGuard configuration will make sure it is
- * not renamed when processing this code.
+ * 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();
@@ -35,6 +37,12 @@ public class NativeCallBack
}
+ /**
+ * 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();
diff --git a/examples/annotations/lib/annotations.jar b/examples/annotations/lib/annotations.jar
index f43f24e..d931505 100644
--- a/examples/annotations/lib/annotations.jar
+++ b/examples/annotations/lib/annotations.jar
Binary files differ
diff --git a/examples/ant/applets.xml b/examples/ant/applets.xml
index 4d0cb38..5666f96 100644
--- a/examples/ant/applets.xml
+++ b/examples/ant/applets.xml
@@ -33,13 +33,13 @@
<!-- Preserve all native method names and the names of their classes. -->
- <keepclasseswithmembernames>
+ <keepclasseswithmembernames includedescriptorclasses="true">
<method access="native" />
</keepclasseswithmembernames>
<!-- Preserve the methods that are required in all enumeration classes. -->
- <keepclassmembers extends="java.lang.Enum">
+ <keepclassmembers allowoptimization="true" type="enum">
<method access="public static"
type="**[]"
name="values"
diff --git a/examples/ant/applications2.xml b/examples/ant/applications2.xml
index 681a894..664a9ee 100644
--- a/examples/ant/applications2.xml
+++ b/examples/ant/applications2.xml
@@ -45,7 +45,7 @@
<!-- Preserve the methods that are required in all enumeration classes. -->
- -keepclassmembers class * extends java.lang.Enum {
+ -keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
diff --git a/examples/ant/applications3.xml b/examples/ant/applications3.xml
index e42eb39..023c2be 100644
--- a/examples/ant/applications3.xml
+++ b/examples/ant/applications3.xml
@@ -43,13 +43,13 @@
<!-- Preserve all native method names and the names of their classes. -->
- <keepclasseswithmembernames>
+ <keepclasseswithmembernames includedescriptorclasses="true">
<method access="native" />
</keepclasseswithmembernames>
<!-- Preserve the methods that are required in all enumeration classes. -->
- <keepclassmembers extends="java.lang.Enum">
+ <keepclassmembers allowoptimization="true" type="enum">
<method access="public static"
type="**[]"
name="values"
diff --git a/examples/ant/library.xml b/examples/ant/library.xml
index d87bd16..37ceb1a 100644
--- a/examples/ant/library.xml
+++ b/examples/ant/library.xml
@@ -47,13 +47,13 @@
<!-- Preserve all native method names and the names of their classes. -->
- <keepclasseswithmembernames>
+ <keepclasseswithmembernames includedescriptorclasses="true">
<method access="native" />
</keepclasseswithmembernames>
<!-- Preserve the methods that are required in all enumeration classes. -->
- <keepclassmembers extends="java.lang.Enum">
+ <keepclassmembers allowoptimization="true" type="enum">
<method access="public static"
type="**[]"
name="values"
diff --git a/examples/ant/midlets.xml b/examples/ant/midlets.xml
index 223d0da..fe17277 100644
--- a/examples/ant/midlets.xml
+++ b/examples/ant/midlets.xml
@@ -39,7 +39,7 @@
<!-- Preserve all native method names and the names of their classes. -->
- <keepclasseswithmembernames>
+ <keepclasseswithmembernames includedescriptorclasses="true">
<method access="native" />
</keepclasseswithmembernames>
diff --git a/examples/ant/proguard.xml b/examples/ant/proguard.xml
index 1911a90..18b520b 100644
--- a/examples/ant/proguard.xml
+++ b/examples/ant/proguard.xml
@@ -24,10 +24,11 @@
<libraryjar file="${java.home}/lib/rt.jar" />
<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/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
diff --git a/examples/ant/servlets.xml b/examples/ant/servlets.xml
index 51bcaad..33ca6ce 100644
--- a/examples/ant/servlets.xml
+++ b/examples/ant/servlets.xml
@@ -33,13 +33,13 @@
<!-- Preserve all native method names and the names of their classes. -->
- <keepclasseswithmembernames>
+ <keepclasseswithmembernames includedescriptorclasses="true">
<method access="native" />
</keepclasseswithmembernames>
<!-- Preserve the methods that are required in all enumeration classes. -->
- <keepclassmembers extends="java.lang.Enum">
+ <keepclassmembers allowoptimization="true" type="enum">
<method access="public static"
type="**[]"
name="values"
diff --git a/examples/applets.pro b/examples/applets.pro
index c5affc1..75256a0 100644
--- a/examples/applets.pro
+++ b/examples/applets.pro
@@ -34,14 +34,14 @@
# Preserve all native method names and the names of their classes.
--keepclasseswithmembernames class * {
+-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
# Preserve the special static methods that are required in all enumeration
# classes.
--keepclassmembers class * extends java.lang.Enum {
+-keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
diff --git a/examples/applications.pro b/examples/applications.pro
index f718088..5424423 100644
--- a/examples/applications.pro
+++ b/examples/applications.pro
@@ -40,14 +40,14 @@
# Preserve all native method names and the names of their classes.
--keepclasseswithmembernames class * {
+-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
# Preserve the special static methods that are required in all enumeration
# classes.
--keepclassmembers class * extends java.lang.Enum {
+-keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
diff --git a/examples/gradle/android.gradle b/examples/gradle/android.gradle
index 4e950d5..b4fe719 100644
--- a/examples/gradle/android.gradle
+++ b/examples/gradle/android.gradle
@@ -148,14 +148,14 @@ task proguard(type: proguard.gradle.ProGuardTask) {
// Preserve all native method names and the names of their classes.
- keepclasseswithmembernames 'class * { \
+ keepclasseswithmembernames includedescriptorclasses:true, 'class * { \
native <methods>; \
}'
// Preserve the special static methods that are required in all enumeration
// classes.
- keepclassmembers 'class * extends java.lang.Enum { \
+ keepclassmembers allowshrinking:true, 'enum * { \
public static **[] values(); \
public static ** valueOf(java.lang.String); \
}'
diff --git a/examples/gradle/applets.gradle b/examples/gradle/applets.gradle
index 29c8559..aefe651 100644
--- a/examples/gradle/applets.gradle
+++ b/examples/gradle/applets.gradle
@@ -54,14 +54,14 @@ task proguard(type: proguard.gradle.ProGuardTask) {
// Preserve all native method names and the names of their classes.
- keepclasseswithmembernames 'class * { \
+ keepclasseswithmembernames includedescriptorclasses:true, 'class * { \
native <methods>; \
}'
// Preserve the special static methods that are required in all enumeration
// classes.
- keepclassmembers 'class * extends java.lang.Enum { \
+ keepclassmembers allowshrinking:true, 'enum * { \
public static **[] values(); \
public static ** valueOf(java.lang.String); \
}'
diff --git a/examples/gradle/applications.gradle b/examples/gradle/applications.gradle
index 73dfdf0..ffadf91 100644
--- a/examples/gradle/applications.gradle
+++ b/examples/gradle/applications.gradle
@@ -60,14 +60,14 @@ task proguard(type: proguard.gradle.ProGuardTask) {
// Preserve all native method names and the names of their classes.
- keepclasseswithmembernames 'class * { \
+ keepclasseswithmembernames includedescriptorclasses:true, 'class * { \
native <methods>; \
}'
// Preserve the special static methods that are required in all enumeration
// classes.
- keepclassmembers 'class * extends java.lang.Enum { \
+ keepclassmembers allowshrinking:true, 'enum * { \
public static **[] values(); \
public static ** valueOf(java.lang.String); \
}'
diff --git a/examples/gradle/library.gradle b/examples/gradle/library.gradle
index 2f68962..8bd137c 100644
--- a/examples/gradle/library.gradle
+++ b/examples/gradle/library.gradle
@@ -63,14 +63,14 @@ task proguard(type: proguard.gradle.ProGuardTask) {
// Preserve all native method names and the names of their classes.
- keepclasseswithmembernames 'class * { \
+ keepclasseswithmembernames includedescriptorclasses:true, 'class * { \
native <methods>; \
}'
// Preserve the special static methods that are required in all enumeration
// classes.
- keepclassmembers 'class * extends java.lang.Enum { \
+ keepclassmembers allowshrinking:true, 'enum * { \
public static **[] values(); \
public static ** valueOf(java.lang.String); \
}'
diff --git a/examples/gradle/midlets.gradle b/examples/gradle/midlets.gradle
index dffb2c3..1e9fb11 100644
--- a/examples/gradle/midlets.gradle
+++ b/examples/gradle/midlets.gradle
@@ -75,7 +75,7 @@ task proguard(type: proguard.gradle.ProGuardTask) {
// Preserve all native method names and the names of their classes.
- keepclasseswithmembernames 'class * { \
+ keepclasseswithmembernames includedescriptorclasses:true, 'class * { \
native <methods>; \
}'
diff --git a/examples/gradle/proguard.gradle b/examples/gradle/proguard.gradle
index 8974f93..0abb72e 100644
--- a/examples/gradle/proguard.gradle
+++ b/examples/gradle/proguard.gradle
@@ -74,10 +74,11 @@ task proguard(type: proguard.gradle.ProGuardTask) {
// 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'
+ //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 *; \
diff --git a/examples/gradle/proguardall.gradle b/examples/gradle/proguardall.gradle
index 561a455..43c905c 100644
--- a/examples/gradle/proguardall.gradle
+++ b/examples/gradle/proguardall.gradle
@@ -38,10 +38,11 @@ task proguard(type: proguard.gradle.ProGuardTask) {
libraryjars "${System.getProperty('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/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,
diff --git a/examples/gradle/scala.gradle b/examples/gradle/scala.gradle
index 286e5e9..69be1bb 100644
--- a/examples/gradle/scala.gradle
+++ b/examples/gradle/scala.gradle
@@ -116,14 +116,14 @@ task proguard(type: proguard.gradle.ProGuardTask) {
// Preserve all native method names and the names of their classes.
- keepclasseswithmembernames 'class * { \
+ keepclasseswithmembernames includedescriptorclasses:true, 'class * { \
native <methods>; \
}'
// Preserve the special static methods that are required in all enumeration
// classes.
- keepclassmembers 'class * extends java.lang.Enum { \
+ keepclassmembers allowshrinking:true, 'enum * { \
public static **[] values(); \
public static ** valueOf(java.lang.String); \
}'
diff --git a/examples/gradle/servlets.gradle b/examples/gradle/servlets.gradle
index c91ed6a..23062ff 100644
--- a/examples/gradle/servlets.gradle
+++ b/examples/gradle/servlets.gradle
@@ -55,14 +55,14 @@ task proguard(type: proguard.gradle.ProGuardTask) {
// Preserve all native method names and the names of their classes.
- keepclasseswithmembernames 'class * { \
+ keepclasseswithmembernames includedescriptorclasses:true, 'class * { \
native <methods>; \
}'
// Preserve the special static methods that are required in all enumeration
// classes.
- keepclassmembers 'class * extends java.lang.Enum { \
+ keepclassmembers allowshrinking:true, 'enum * { \
public static **[] values(); \
public static ** valueOf(java.lang.String); \
}'
diff --git a/examples/library.pro b/examples/library.pro
index b812082..4669e79 100644
--- a/examples/library.pro
+++ b/examples/library.pro
@@ -44,14 +44,14 @@
# Preserve all native method names and the names of their classes.
--keepclasseswithmembernames class * {
+-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
# Preserve the special static methods that are required in all enumeration
# classes.
--keepclassmembers class * extends java.lang.Enum {
+-keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
diff --git a/examples/midlets.pro b/examples/midlets.pro
index 1383980..f2f5f21 100644
--- a/examples/midlets.pro
+++ b/examples/midlets.pro
@@ -55,7 +55,7 @@
# Preserve all native method names and the names of their classes.
--keepclasseswithmembernames class * {
+-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
diff --git a/examples/scala.pro b/examples/scala.pro
index 658fc77..3b69c3c 100644
--- a/examples/scala.pro
+++ b/examples/scala.pro
@@ -96,14 +96,14 @@
# Preserve all native method names and the names of their classes.
--keepclasseswithmembernames class * {
+-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
# Preserve the special static methods that are required in all enumeration
# classes.
--keepclassmembers class * extends java.lang.Enum {
+-keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
diff --git a/examples/servlets.pro b/examples/servlets.pro
index b42b2e4..a3f7875 100644
--- a/examples/servlets.pro
+++ b/examples/servlets.pro
@@ -35,14 +35,14 @@
# Preserve all native method names and the names of their classes.
--keepclasseswithmembernames class * {
+-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
# Preserve the special static methods that are required in all enumeration
# classes.
--keepclassmembers class * extends java.lang.Enum {
+-keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}