混淆配置,所有的包增加classifier为xj,只对biz包混淆,混淆后classifier为obf,profile配置写好,混淆打包时勾选biz-obf+default打包,不混淆时只勾选default

This commit is contained in:
SkyJourney
2025-07-11 22:05:57 +08:00
parent df2b136b3e
commit 1380c846f5
30 changed files with 471 additions and 22 deletions
+20 -1
View File
@@ -20,10 +20,12 @@
<dependency>
<groupId>com.renkang</groupId>
<artifactId>health-consultation-api</artifactId>
<classifier>xj</classifier>
</dependency>
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-system-local-api</artifactId>
<classifier>xj</classifier>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
@@ -79,8 +81,25 @@
<dependency>
<groupId>com.renkang</groupId>
<artifactId>health-watch-api</artifactId>
<classifier>xj</classifier>
</dependency>
</dependencies>
<profiles>
<profile>
<id>biz-obf</id>
<build>
<plugins>
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
@@ -0,0 +1,35 @@
-keepattributes *Annotation*, Signature, InnerClasses, EnclosingMethod, Exceptions
-keep @org.springframework.stereotype.Service class *
-keep @org.springframework.web.bind.annotation.RestController class *
-keep @org.springframework.context.annotation.Configuration class *
-keep @org.springframework.stereotype.Component class *
-keepclassmembers enum * { # 保留枚举结构
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class * implements java.io.Serializable { *; }
-keepclassmembers class * {
@org.springframework.web.bind.annotation.*Mapping *;
}
-keepclassmembers class * {
private static synthetic java.lang.Object $deserializeLambda$(java.lang.invoke.SerializedLambda);
}
-keep class lombok.** { *; }
-keepclassmembers class * {
@lombok.Getter *;
@lombok.Setter *;
}
# MyBatis 专用保留规则
-keep interface org.jeecg.**.mapper.** { *; }
-keepclassmembers class org.jeecg.**.entity.** { *; }
-dontwarn org.jeecg.**.entity.**
# 关闭优化和压缩(避免框架兼容性问题)
-dontshrink # 不删除未使用代码
-dontoptimize # 不优化字节码[5,6](@ref)
-keepdirectories
-dontusemixedcaseclassnames
-adaptclassstrings
# 混淆选项
-useuniqueclassmembernames # 成员名称唯一化
-ignorewarnings