-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathproguard.conf
168 lines (140 loc) · 5.47 KB
/
proguard.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html
# JVM 8
# List external jars your application depends on (that not listed in maven dependencies).
#-libraryjars <java.home>/lib/(**.jar;!**.properties;!**.data;!**.dat!**.lib;!**.zip;!**.src;!**.txt)
# JVM 9 and higher
# Ignore unwanted files from the runtime library module: .jar and module-info.class files
-libraryjars <java.home>/jmods(!**.jar;!module-info.class)
# To avoid processing a library that may have been preprocessed, simply add the following:
#-libraryjars <path/to/lib> -keep class com.crashlytics.** { *; }
# Comment next options if you want to get more info
-dontnote **
-dontwarn **
-dontshrink
-dontoptimize
-dontobfuscate
# Specifies to repackage all class files that are renamed, by moving them into the single given package
#-repackageclasses
# Ignore warnings such as duplicate class definitions and classes in incorrectly named files
-ignorewarnings
# Keep classes with main methods
-keepclasseswithmembers public class * { public static void main(java.lang.String[]); }
# Keep all original class files
#-keep class org.fabri1983.signaling.* { *; }
# Replace all strings in reflections method invocations with new class names. For example, invokes Class.forName('className')
-adaptclassstrings
# Keep all original annotations and etc. Otherwise all we be removed from files.
-keepattributes
Exception,
InnerClasses,
Signature,
*Annotation*,
Synthetic,
EnclosingMethod
# Keep debug info
-keepattributes
Deprecated,
SourceFile,
LineNumberTable,
LocalVariable*Table
# Renames properties files and image files in the processed output, based on the obfuscated names of their corresponding class files (if any)
-adaptresourcefilenames **.properties,**.jks,**.xml,**.key
# Looks for class names in properties files and in the manifest file, and replaces these names by the obfuscated names (if any)
-adaptresourcefilecontents **.properties,**.xml,META-INF/MANIFEST.MF
# Keep all original names in interfaces (without obfuscate).
-keepnames interface **
# Keep all original methods parameters in files defined in -keep sections, otherwise all parameter names will be obfuscate.
-keepparameternames
# Keep all original interfaces files in all packages.
#-keep interface * extends * { *; }
# Processing dependency injection
-keepclassmembers class * {
@javax.annotation.* *;
}
# Keep all original defined annotations in all class in all packages.
-keepclassmembers class * {
@org.springframework.beans.factory.annotation.* *;
}
# All possible servlets in the input jars
-keep public class * implements javax.servlet.Servlet
# Processing Gson code.
# Fields should be explicitly annotated with @SerializedName, so we keep it
-keepclasseswithmembers,allowobfuscation,includedescriptorclasses class * {
@com.google.gson.annotations.SerializedName <fields>;
}
-keepclassmembers enum * {
@com.google.gson.annotations.SerializedName <fields>;
}
# Processing native methods
-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
# Processing enumeration classes
-keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
#Processing serializable classes
-keepnames class * implements java.io.Serializable
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
!static !transient <fields>;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
# Processing RMI code
-keep interface * extends java.rmi.Remote {
<methods>;
}
-keep class * implements java.rmi.Remote {
<init>(java.rmi.activation.ActivationID, java.rmi.MarshalledObject);
}
# Processing Bean classes
-keep class * {
void set*(***);
void set*(int,***);
boolean is*();
boolean is*(int);
*** get*();
*** get*(int);
}
# do not process next classes (and fields and methods) as they are libraries
-keep class * extends java.beans.BeanInfo
-keep class cglib.** { *; }
-keep class commons-codec.** { *; }
-keep class commons-collections.** { *; }
-keep class commons-dbcp.** { *; }
-keep class commons-io.** { *; }
-keep class commons-validator.** { *; }
-keep class com.auth0.** { *; }
-keep class com.fasterxml.jackson.** { *; }
-keep class com.google.** { *; }
-keep class com.hazelcast.** { *; }
-keep class com.sun.** { *; }
-keep class dagger.** { *; }
-keep class java.** { *; }
-keep class javax.** { *; }
-keep class jdk.** { *; }
-keep class org.apache.** { *; }
-keep class org.eclipse.** { *; }
-keep class org.glassfish.** { *; }
-keep class org.graalvm.** { *; }
-keep class org.hibernate.** { *; }
-keep class org.springframework.** { *; }
-keep class postgresql.** { *; }
-keep class sun.** { *; }
-assumenosideeffects public class java.lang.System {
public static long currentTimeMillis();
static java.lang.Class getCallerClass();
public static int identityHashCode(java.lang.Object);
public static java.lang.SecurityManager getSecurityManager();
public static java.util.Properties getProperties();
public static java.lang.String getProperty(java.lang.String);
public static java.lang.String getenv(java.lang.String);
public static java.lang.String mapLibraryName(java.lang.String);
public static java.lang.String getProperty(java.lang.String,java.lang.String);
}