-target 1.8 ##Specify the java version number -dontshrink ##Default is enabled, here the shrink is turned off, that is, the unused classes/members are not deleted. -dontoptimize ##Default is enabled, here to turn off bytecode level optimization -useuniqueclassmembernames ## Take a unique strategy for confusing the naming of class members -adaptclassstrings ## After confusing the class name, replace it with a place like Class.forName('className') -ignorewarnings -keepdirectories -keepclasseswithmembers public class * { public static void main(java.lang.String[]);} ##Maintain the class of the main method and its method name -keepclassmembers enum * { *; } ##Reserving enumeration members and methods -keepclassmembers class * { @org.springframework.beans.factory.annotation.Autowired *; @org.springframework.beans.factory.annotation.Qualifier *; @org.springframework.beans.factory.annotation.Value *; @org.springframework.beans.factory.annotation.Required *; @org.springframework.context.annotation.Bean *; @org.springframework.context.annotation.Primary *; @org.springframework.boot.context.properties.ConfigurationProperties *; @org.springframework.boot.context.properties.EnableConfigurationProperties *; @javax.annotation.PostConstruct *; @javax.annotation.PreDestroy *; } -keep @org.springframework.cache.annotation.EnableCaching class * -keep @org.springframework.context.annotation.Configuration class * -keep @org.springframework.boot.context.properties.ConfigurationProperties class * -keep @org.springframework.boot.autoconfigure.SpringBootApplication class * -allowaccessmodification -keepattributes *Annotation* -keepdirectories com.jayk.springboot.proguard.obfuscationdemo -keepdirectories org.springframework.boot.autoconfigure -keepclassmembers class * { *** get*(); void set*(***); } -keepclassmembernames class * { java.lang.Class class$(java.lang.String); java.lang.Class class$(java.lang.String, boolean); } -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); public static ** fromValue(java.lang.String); } -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 ; !private ; !private ; private void writeObject(java.io.ObjectOutputStream); private void readObject(java.io.ObjectInputStream); java.lang.Object writeReplace(); java.lang.Object readResolve(); } -keepclassmembers class * { @org.springframework.beans.factory.annotation.Autowired ; @org.springframework.beans.factory.annotation.Autowired ; @org.springframework.security.access.prepost.PreAuthorize ; }