Commit 25532764 by 李晓钟

添加代码加密机制。

parent c65e681d
......@@ -52,6 +52,43 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.wecloud</groupId>
<artifactId>classencrypt-maven-plugin</artifactId>
<version>${maven-classencrypt-plugin.version}</version>
<configuration>
<!-- 参数说明-->
<!-- -packages 加密的包名(可为空,多个用","分割)-->
<!-- -libjars jar/war包lib下要加密jar文件名(可为空,多个用","分割)-->
<!-- -cfgfiles 需要加密的配置文件,一般是classes目录下的yml或properties文件(可为空,多个用","分割)-->
<!-- -excludes 排除的类名(可为空,多个用","分割)-->
<!-- -classpath 外部依赖的jar目录,例如/tomcat/lib(可为空,多个用","分割)-->
<!-- -password 加密密码,如果是#号,则使用无密码模式加密-->
<!-- -code 机器码,在绑定的机器生成,加密后只可在此机器上运行-->
<password>wecloud#0-0</password><!--加密打包之后pom.xml会被删除,不用担心在jar包里找到此密码-->
<packages>com.wecloud,io.geekidea</packages>
<!-- <cfgfiles>application.yml</cfgfiles>-->
<!-- <excludes>io.geekidea</excludes>-->
<!-- <libjars>a.jar,b.jar</libjars> 多个之间用,分割-->
<!-- 机器绑定-->
<!-- 机器绑定只允许加密的项目在特定的机器上运行;-->
<!-- 在需要绑定的机器上执行以下命令,生成机器码-->
<!-- 在cmd目录下,执行 java -jar classencrypt-fatjar.jar -C-->
<!-- 例如我本机是: 4B1ABEBA8423DEE07469C1E38B3CF7881BBAC2F6C072365DF2297D84370991CC97E8330B0E5FB4ADFF0F87A038F4773A-->
<!-- <code>4B1ABEBA8423DEE07469C1E38B3CF7881BBAC2F6C072365DF2297D84370991CC97E8330B0E5FB4ADFF0F87A038F4773A</code>-->
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>classEncrypt</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
......
#! /bin/sh
java -jar classencrypt.jar -C
#! /bin/sh
cd ..
java -javaagent:bootstrap-2.0-encrypted.jar='-pwd wecloud#0-0' -jar bootstrap-2.0-encrypted.jar
......@@ -44,7 +44,7 @@ public class ChannelManager {
AttributeKey<String> LANGUAGE = AttributeKey.valueOf("la");
/**
* APP_VERSION
* APP_VERSIONn
*/
AttributeKey<String> APP_VERSION = AttributeKey.valueOf("av");
AttributeKey<String> TOKEN = AttributeKey.valueOf("to");
......
......@@ -59,6 +59,7 @@
<maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
<maven-versions-plugin.version>2.2</maven-versions-plugin.version>
<maven-assembly-plugin.version>3.2.0</maven-assembly-plugin.version>
<maven-classencrypt-plugin.version>1.0.0</maven-classencrypt-plugin.version>
</properties>
<modules>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment