Skip to content

Commit 2670921

Browse files
committed
Add proguard config
1 parent e4f322e commit 2670921

File tree

2 files changed

+77
-2
lines changed

2 files changed

+77
-2
lines changed

pom.xml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
</execution>
143143
</executions>
144144
<configuration>
145-
<skip>false</skip> <!-- set this to true if fail because of missing credentials -->
145+
<skip>true</skip> <!-- set this to true if fail because of missing credentials -->
146146
<keystore>keystore.jks</keystore>
147147
<alias>pfopensource</alias>
148148
<storepass>${env.OPENSOURCE_PROJECTS_KS_PW}</storepass>
@@ -170,6 +170,40 @@
170170
<quiet>false</quiet>
171171
</configuration>
172172
</plugin>
173+
<plugin>
174+
<groupId>com.github.wvengen</groupId>
175+
<artifactId>proguard-maven-plugin</artifactId>
176+
<version>2.0.11</version>
177+
<executions>
178+
<execution>
179+
<phase>package</phase>
180+
<goals>
181+
<goal>proguard</goal>
182+
</goals>
183+
<configuration>
184+
<includeDependency>false</includeDependency>
185+
<attachArtifactClassifier>proguard</attachArtifactClassifier>
186+
<attach>true</attach>
187+
<proguardVersion>6.0.3</proguardVersion>
188+
<obfuscate>true</obfuscate>
189+
<options>
190+
<option>-include ${project.basedir}/proguard-rules.pro</option>
191+
</options>
192+
<libs>
193+
<lib>${java.home}/lib/rt.jar</lib>
194+
</libs>
195+
</configuration>
196+
</execution>
197+
</executions>
198+
<dependencies>
199+
<dependency>
200+
<groupId>net.sf.proguard</groupId>
201+
<artifactId>proguard-base</artifactId>
202+
<version>6.0.3</version>
203+
<scope>runtime</scope>
204+
</dependency>
205+
</dependencies>
206+
</plugin>
173207
</plugins>
174208
</build>
175209

@@ -222,4 +256,4 @@
222256
<system>Travis</system>
223257
<url>https://travis-ci.org/patrickfav/bytes-java</url>
224258
</ciManagement>
225-
</project>
259+
</project>

proguard-rules.pro

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
2+
-dontusemixedcaseclassnames
3+
-ignorewarnings
4+
-verbose
5+
6+
-keepattributes *Annotation*,EnclosingMethod, InnerClasses, Exceptions, Signature, SourceFile, LineNumberTable
7+
-renamesourcefileattribute SourceFile
8+
-optimizationpasses 5
9+
-overloadaggressively
10+
11+
-keepclasseswithmembernames class * {
12+
native <methods>;
13+
}
14+
15+
-keepclassmembers enum * {
16+
public static **[] values();
17+
public static ** valueOf(java.lang.String);
18+
}
19+
20+
################################################
21+
22+
-dontnote android.**
23+
-dontwarn android.**
24+
25+
-dontnote com.sun.**
26+
-dontwarn com.sun.**
27+
28+
-dontnote sun.**
29+
-dontwarn sun.**
30+
31+
-dontnote java.**
32+
-dontwarn java.**
33+
34+
-dontnote javax.**
35+
-dontwarn javax.**
36+
37+
38+
# keep all public classes in main package
39+
-keep class at.favre.lib.bytes.** { public *; }
40+
41+
-keep class sun.misc.Unsafe { *; }

0 commit comments

Comments
 (0)