|
@@ -64,7 +64,7 @@
|
|
|
<plugin>
|
|
<plugin>
|
|
|
<groupId>com.idea-aedi</groupId>
|
|
<groupId>com.idea-aedi</groupId>
|
|
|
<artifactId>class-winter-maven-plugin</artifactId>
|
|
<artifactId>class-winter-maven-plugin</artifactId>
|
|
|
- <version>2.9.3</version>
|
|
|
|
|
|
|
+ <version>2.9.4</version>
|
|
|
<!-- 相关配置 -->
|
|
<!-- 相关配置 -->
|
|
|
<configuration>
|
|
<configuration>
|
|
|
<!-- <finalName></finalName>-->
|
|
<!-- <finalName></finalName>-->
|
|
@@ -95,15 +95,15 @@
|
|
|
```
|
|
```
|
|
|
注:不必担心信息泄漏问题,使用此方式生成混淆的jar包时,会擦除pom.xml中关于class-winter-plugin的信息。
|
|
注:不必担心信息泄漏问题,使用此方式生成混淆的jar包时,会擦除pom.xml中关于class-winter-plugin的信息。
|
|
|
|
|
|
|
|
-- #### <font face="幼圆" ><font face="幼圆" color = "#86CA5E">**方式二**</font>:通过 [**class-winter-core.jar**](https://gitee.com/JustryDeng/class-winter/raw/master/class-winter-core/src/test/resources/class-winter-core-2.9.3.jar) 主动加密</font>
|
|
|
|
|
|
|
+- #### <font face="幼圆" ><font face="幼圆" color = "#86CA5E">**方式二**</font>:通过 [**class-winter-core.jar**](https://gitee.com/JustryDeng/class-winter/raw/master/class-winter-core/src/test/resources/class-winter-core-2.9.4.jar) 主动加密</font>
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
- java -jar class-winter-core-2.9.3.jar originJarOrWar=${要加密的项目.jar或.war包} includePrefix=${加密范围} [k3=v3 k4=v4 ...]
|
|
|
|
|
|
|
+ java -jar class-winter-core-2.9.4.jar originJarOrWar=${要加密的项目.jar或.war包} includePrefix=${加密范围} [k3=v3 k4=v4 ...]
|
|
|
# 对于复杂的参数值,可以使用引号引起来
|
|
# 对于复杂的参数值,可以使用引号引起来
|
|
|
# linux
|
|
# linux
|
|
|
- java -jar class-winter-core-2.9.3.jar k1='v1' k2='v2'
|
|
|
|
|
|
|
+ java -jar class-winter-core-2.9.4.jar k1='v1' k2='v2'
|
|
|
# windows
|
|
# windows
|
|
|
- java -jar class-winter-core-2.9.3.jar k1="v1" k2="v2"
|
|
|
|
|
|
|
+ java -jar class-winter-core-2.9.4.jar k1="v1" k2="v2"
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
## <font face="幼圆" color = "#3399EA" >加密参数</font>
|
|
## <font face="幼圆" color = "#3399EA" >加密参数</font>
|
|
@@ -328,8 +328,8 @@ linux示例:tips='请不要直接使用混淆后的jar/war'</td>
|
|
|
```bash
|
|
```bash
|
|
|
# 假设your-project-encrypted.jar是由class-winter加密后的包,那么你可以这么启动
|
|
# 假设your-project-encrypted.jar是由class-winter加密后的包,那么你可以这么启动
|
|
|
java -javaagent:/your-project-encrypted.jar -jar /your-project-encrypted.jar
|
|
java -javaagent:/your-project-encrypted.jar -jar /your-project-encrypted.jar
|
|
|
- # 也可以用class-winter-core-2.9.3.jar
|
|
|
|
|
- # java -javaagent:/class-winter-core-2.9.3.jar -jar /your-project-encrypted.jar
|
|
|
|
|
|
|
+ # 也可以用class-winter-core-2.9.4.jar
|
|
|
|
|
+ # java -javaagent:/class-winter-core-2.9.4.jar -jar /your-project-encrypted.jar
|
|
|
# 或者指定参数
|
|
# 或者指定参数
|
|
|
# java -javaagent:/your-project-encrypted.jar=debug=true,password=pwd12345 -jar /your-project-encrypted.jar
|
|
# java -javaagent:/your-project-encrypted.jar=debug=true,password=pwd12345 -jar /your-project-encrypted.jar
|
|
|
# 参数可以引起来(linux)
|
|
# 参数可以引起来(linux)
|
|
@@ -345,9 +345,9 @@ linux示例:tips='请不要直接使用混淆后的jar/war'</td>
|
|
|
编辑tomcat/bin/catalina.sh文件,在最上面加上
|
|
编辑tomcat/bin/catalina.sh文件,在最上面加上
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
- # 如果你有参数, 那么 -javaagent:/class-winter-core-2.9.3.jar=k1=v1,k2=v2
|
|
|
|
|
|
|
+ # 如果你有参数, 那么 -javaagent:/class-winter-core-2.9.4.jar=k1=v1,k2=v2
|
|
|
# tomcat启动往往需要通过decryptProjectPathPrefix指定要解密的路径
|
|
# tomcat启动往往需要通过decryptProjectPathPrefix指定要解密的路径
|
|
|
- CATALINA_OPTS="$CATALINA_OPTS -javaagent:/class-winter-core-2.9.3.jar=debug=true,decryptProjectPathPrefix=/usr/local/xxx/";
|
|
|
|
|
|
|
+ CATALINA_OPTS="$CATALINA_OPTS -javaagent:/class-winter-core-2.9.4.jar=debug=true,decryptProjectPathPrefix=/usr/local/xxx/";
|
|
|
export CATALINA_OPTS;
|
|
export CATALINA_OPTS;
|
|
|
```
|
|
```
|
|
|
|
|
|
|
@@ -356,9 +356,9 @@ linux示例:tips='请不要直接使用混淆后的jar/war'</td>
|
|
|
在tomcat/bin目录下创建setenv.sh文件,并写上
|
|
在tomcat/bin目录下创建setenv.sh文件,并写上
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
- # 如果你有参数, 那么 -javaagent:/class-winter-core-2.9.3.jar=k1=v1,k2=v2
|
|
|
|
|
|
|
+ # 如果你有参数, 那么 -javaagent:/class-winter-core-2.9.4.jar=k1=v1,k2=v2
|
|
|
# tomcat启动往往需要通过decryptProjectPathPrefix指定要解密的路径
|
|
# tomcat启动往往需要通过decryptProjectPathPrefix指定要解密的路径
|
|
|
- JAVA_OPTS="$JAVA_OPTS -javaagent:/class-winter-core-2.9.3.jar=debug=true,decryptProjectPathPrefix=/usr/local/xxx/";
|
|
|
|
|
|
|
+ JAVA_OPTS="$JAVA_OPTS -javaagent:/class-winter-core-2.9.4.jar=debug=true,decryptProjectPathPrefix=/usr/local/xxx/";
|
|
|
export JAVA_OPTS;
|
|
export JAVA_OPTS;
|
|
|
```
|
|
```
|
|
|
|
|
|
|
@@ -367,9 +367,9 @@ linux示例:tips='请不要直接使用混淆后的jar/war'</td>
|
|
|
编辑tomcat/bin/catalina.bat文件,在@echo off后加上catalina参数
|
|
编辑tomcat/bin/catalina.bat文件,在@echo off后加上catalina参数
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
- rem 如果你有参数, 那么 -javaagent:D:/class-winter-core-2.9.3.jar=k1=v1,k2=v2
|
|
|
|
|
|
|
+ rem 如果你有参数, 那么 -javaagent:D:/class-winter-core-2.9.4.jar=k1=v1,k2=v2
|
|
|
rem tomcat启动往往需要通过decryptProjectPathPrefix指定要解密的路径
|
|
rem tomcat启动往往需要通过decryptProjectPathPrefix指定要解密的路径
|
|
|
- set CATALINA_OPTS="-javaagent:D:/class-winter-core-2.9.3.jar=decryptProjectPathPrefix=/D:/tmp/"
|
|
|
|
|
|
|
+ set CATALINA_OPTS="-javaagent:D:/class-winter-core-2.9.4.jar=decryptProjectPathPrefix=/D:/tmp/"
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
- windows方式二
|
|
- windows方式二
|
|
@@ -377,9 +377,9 @@ linux示例:tips='请不要直接使用混淆后的jar/war'</td>
|
|
|
在tomcat/bin目录下创建setenv.bat文件,并写上
|
|
在tomcat/bin目录下创建setenv.bat文件,并写上
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
- rem 如果你有参数, 那么 -javaagent:D:/class-winter-core-2.9.3.jar=k1=v1,k2=v2
|
|
|
|
|
|
|
+ rem 如果你有参数, 那么 -javaagent:D:/class-winter-core-2.9.4.jar=k1=v1,k2=v2
|
|
|
rem tomcat启动往往需要通过decryptProjectPathPrefix指定要解密的路径
|
|
rem tomcat启动往往需要通过decryptProjectPathPrefix指定要解密的路径
|
|
|
- set JAVA_OPTS="-javaagent:D:/class-winter-core-2.9.3.jar=decryptProjectPathPrefix=/D:/tmp/"
|
|
|
|
|
|
|
+ set JAVA_OPTS="-javaagent:D:/class-winter-core-2.9.4.jar=decryptProjectPathPrefix=/D:/tmp/"
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
- #### <font face="幼圆" color = "#86CA5E" >IDE解密(启动)</font>
|
|
- #### <font face="幼圆" color = "#86CA5E" >IDE解密(启动)</font>
|
|
@@ -490,7 +490,7 @@ linux示例:tips='请不要直接使用混淆后的jar/war'</td>
|
|
|
<parent>
|
|
<parent>
|
|
|
<groupId>org.springframework.boot</groupId>
|
|
<groupId>org.springframework.boot</groupId>
|
|
|
<artifactId>spring-boot-starter-parent</artifactId>
|
|
<artifactId>spring-boot-starter-parent</artifactId>
|
|
|
- <version>2.9.3</version>
|
|
|
|
|
|
|
+ <version>2.6.4</version>
|
|
|
<relativePath/> <!-- lookup parent from repository -->
|
|
<relativePath/> <!-- lookup parent from repository -->
|
|
|
</parent>
|
|
</parent>
|
|
|
<groupId>com.example</groupId>
|
|
<groupId>com.example</groupId>
|
|
@@ -611,23 +611,33 @@ linux示例:tips='请不要直接使用混淆后的jar/war'</td>
|
|
|
|
|
|
|
|
> class-winter初始能力设计理念是,只做通用能力支持,如果没法做到通用,那就干脆不做,需要的话使用者自行扩展
|
|
> class-winter初始能力设计理念是,只做通用能力支持,如果没法做到通用,那就干脆不做,需要的话使用者自行扩展
|
|
|
|
|
|
|
|
-- <font face="幼圆" color = "#F53B45">**1. 是否支持yml等配置文件加密?**</font>
|
|
|
|
|
|
|
+- <font face="幼圆" color = "#F53B45">**1. 加密失败并伴有` Ignore clear-method-body for className [xxx], Cannot find 'yyy'`提示**</font>
|
|
|
|
|
+
|
|
|
|
|
+ - 原因:类`xxx`中使用到了类`yyy`,但是被加密包中不存在`yyy`类
|
|
|
|
|
+
|
|
|
|
|
+ - 解决方案1:在`xxx`中引入`yyy类`(或引入`yyy所在包`)
|
|
|
|
|
+
|
|
|
|
|
+ - 解决方案2:通过加密参数supportFile指定`yyy`所在包为加密辅助包
|
|
|
|
|
+
|
|
|
|
|
+ 注:使用supportFile时,尽量控制指定范围,如果指定的范围太大(如无脑指定整个依赖仓库),引入的相关包太多,可能导致一些意料外的加密问题。如:[issues I9VTG9](https://gitee.com/JustryDeng/class-winter/issues/I9VTG9)
|
|
|
|
|
+
|
|
|
|
|
+- <font face="幼圆" color = "#F53B45">**2. 是否支持yml等配置文件加密?**</font>
|
|
|
|
|
|
|
|
<font face="幼圆" color = "#3CAA3C">**不支持。**</font>
|
|
<font face="幼圆" color = "#3CAA3C">**不支持。**</font>
|
|
|
|
|
|
|
|
不同的框架加载配置文件的方式不一样,没法写一个通用的加密逻辑,需要的话自行根据所用技术框架自行实现
|
|
不同的框架加载配置文件的方式不一样,没法写一个通用的加密逻辑,需要的话自行根据所用技术框架自行实现
|
|
|
|
|
|
|
|
-- <font face="幼圆" color = "#F53B45">**2. 是否支持对lib包里的xml加密?**</font>
|
|
|
|
|
|
|
+- <font face="幼圆" color = "#F53B45">**3. 是否支持对lib包里的xml加密?**</font>
|
|
|
|
|
|
|
|
<font face="幼圆" color = "#3CAA3C">**不支持。**</font>
|
|
<font face="幼圆" color = "#3CAA3C">**不支持。**</font>
|
|
|
|
|
|
|
|
首先实现起来相对麻烦,其次即便是(通用)加密也是伪加密。除非自己根据框架进行扩展进行定制加密
|
|
首先实现起来相对麻烦,其次即便是(通用)加密也是伪加密。除非自己根据框架进行扩展进行定制加密
|
|
|
|
|
|
|
|
-- <font face="幼圆" color = "#F53B45">**3. 部分版本spring-boot为啥加密后,启动时读取配置文件内容失败?**</font>
|
|
|
|
|
|
|
+- <font face="幼圆" color = "#F53B45">**4. 部分版本spring-boot为啥加密后,启动时读取配置文件内容失败?**</font>
|
|
|
|
|
|
|
|
<font face="幼圆" color = "#3CAA3C">**配置文件使用.yaml或.properties无此问题;部分版本的spring-boot使用.yml配置文件可能出现部分配置读取失败。**</font>
|
|
<font face="幼圆" color = "#3CAA3C">**配置文件使用.yaml或.properties无此问题;部分版本的spring-boot使用.yml配置文件可能出现部分配置读取失败。**</font>
|
|
|
|
|
|
|
|
-- <font face="幼圆" color = "#F53B45">**4. 启动时明明按要求指定了JVM参数,为啥还是提示Miss jvm arg?**</font>
|
|
|
|
|
|
|
+- <font face="幼圆" color = "#F53B45">**5. 启动时明明按要求指定了JVM参数,为啥还是提示Miss jvm arg?**</font>
|
|
|
|
|
|
|
|
<font face="幼圆" color = "#3CAA3C">**JVM参数位置不对,要放在-jar xxx.jar之前**</font>
|
|
<font face="幼圆" color = "#3CAA3C">**JVM参数位置不对,要放在-jar xxx.jar之前**</font>
|
|
|
|
|
|
|
@@ -638,13 +648,13 @@ linux示例:tips='请不要直接使用混淆后的jar/war'</td>
|
|
|
java -javaagent:cc-encrypted.jar -XX:+DisableAttachMechanism -jar cc-encrypted.jar
|
|
java -javaagent:cc-encrypted.jar -XX:+DisableAttachMechanism -jar cc-encrypted.jar
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-- <font face="幼圆" color = "#F53B45">**5. class-winter是否支持对类名、字段名、方法名等进行混淆?**</font>
|
|
|
|
|
|
|
+- <font face="幼圆" color = "#F53B45">**6. class-winter是否支持对类名、字段名、方法名等进行混淆?**</font>
|
|
|
|
|
|
|
|
<font face="幼圆" color = "#3CAA3C">**不支持。**</font>
|
|
<font face="幼圆" color = "#3CAA3C">**不支持。**</font>
|
|
|
|
|
|
|
|
需要的话,可结合其它混淆工具(如:allatori等)一起加密,可参考enhance分支
|
|
需要的话,可结合其它混淆工具(如:allatori等)一起加密,可参考enhance分支
|
|
|
|
|
|
|
|
-- <font face="幼圆" color = "#F53B45">**6. includeLibs指定了要加密的lib包,为啥没生效?**</font>
|
|
|
|
|
|
|
+- <font face="幼圆" color = "#F53B45">**7. includeLibs指定了要加密的lib包,为啥没生效?**</font>
|
|
|
|
|
|
|
|
<font face="幼圆" color = "#3CAA3C">**首先检查是否正确配置了includeLibs,然后检查includePrefix匹配范围是否包含lib中的class**</font>
|
|
<font face="幼圆" color = "#3CAA3C">**首先检查是否正确配置了includeLibs,然后检查includePrefix匹配范围是否包含lib中的class**</font>
|
|
|
|
|
|