做挖机配件销售的网站,住房和城乡建设厅官网查询,北京高端品牌网站建设,wordpress企业建站教程文章目录一、集成1. 官方介绍地址2. 添加仓库和插件3. 编译打包二、安装go环境和编译2.1. 安装go2.2. 编译三、运行3.1. 正常运行3.2. 二次加密运行3.3. 测试结果四、IntelliJ IDE 反编译测试4.1. 将加密的jar进行解压4.2. 打开解压后的文件夹4.3. class文件查看4.4. 配置文件反…
文章目录一、集成1. 官方介绍地址2. 添加仓库和插件3. 编译打包二、安装go环境和编译2.1. 安装go2.2. 编译三、运行3.1. 正常运行3.2. 二次加密运行3.3. 测试结果四、IntelliJ IDE 反编译测试4.1. 将加密的jar进行解压4.2. 打开解压后的文件夹4.3. class文件查看4.4. 配置文件反编译4.5. xml文件反编译五、jd-gui 反编译测试5.1. 没加密的jar效果5.2. 加密jar的效果六、XJad反编译测试6.1. 没加密的jar效果6.2. 加密的jar效果七、XJad反编译测试7.1. 没加密的jar效果7.2. 加密的jar效果八、Recaf 反编译8.1. 没加密的jar8.2. 加密的jar九、反编译工具集合分享一、集成
1. 官方介绍地址
手动加密https://github.com/core-lib/xjar maven插件集成https://github.com/core-lib/xjar-maven-plugin
2. 添加仓库和插件
第一种不推荐使用
project!-- 设置 jitpack.io 插件仓库 --pluginRepositoriespluginRepositoryidjitpack.io/idurlhttps://jitpack.io/url/pluginRepository/pluginRepositories!-- 添加 XJar Maven 插件 --buildpluginsplugingroupIdcom.github.core-lib/groupIdartifactIdxjar-maven-plugin/artifactIdversion4.0.2/versionexecutionsexecutiongoalsgoalbuild/goal/goals!--可以改成 install--phasepackage/phaseconfigurationpasswordxxxx/password!-- 需要加密的资源路径表达式 --includes includecom/zsplat/**/includeincludemapper/*Mapper.xml/includeincludeconfig/**/include/includes!-- 无需加密的资源路径表达式 --excludesexcludestatic/**/excludeexcludeMETA-INF/**/exclude/excludes!-- 目标jar存放目录 --targetDir${project.build.directory}\xJarDir\/targetDir!-- 目标jar名称,也可以用表达式参考官网 --targetJarzsplat.jar/targetJar/configuration/execution/executions/plugin/plugins/build
/project
第二种推荐使用就是把密码配置删除采用编译打包添加密码会安全些 https://jitpack.io Maven仓库 !-- 设置 jitpack.io 插件仓库 --pluginRepositoriespluginRepositoryidjitpack.io/idurlhttps://jitpack.io/url/pluginRepository/pluginRepositoriesbuildpluginsplugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactId/plugin!--开源官网https://github.com/core-lib/xjar-maven-plugin--plugingroupIdcom.github.core-lib/groupIdartifactIdxjar-maven-plugin/artifactIdversion4.0.2/versionexecutionsexecutiongoalsgoalbuild/goal/goalsphasepackage/phase!-- 或使用phaseinstall/phase--configurationexcludesexcludestatic/**/excludeexcludetemplates/**/excludeexcluderesources/**/excludeexcludeMETA-INF/resources/**/exclude/excludes!-- 目标jar存放目录 --targetDir${project.build.directory}\xJarDir\/targetDir!-- 目标jar名称,也可以用表达式参考官网 --targetJarunified-access-center-passwd.jar/targetJar/configuration/execution/executions/plugin/plugins/build
3. 编译打包
上面xJar插件绑定到指定的 package 因此每次执行 mvn clean package -Dxjar.passwordio.xjar即可自动构建出加密的包
mvn clean install -Dxjar.passwordio.xjar如下图
根目录中 unified-access-center-0.0.1-SNAPSHOT.jar 是未加密的而 xJarDir 文件夹下的 unified-access-center-passwd.jar 就是加密后的。 注释 jar包名称可以一样前提是不在同一个目录中即可这里jar名称不一样只是为了让大家看得清楚些而已 二、安装go环境和编译 在对应的 xJarDir 文件夹目录编译脚本go build xjar.go。在不同的平台进行编译即可得到不同平台的启动器可执行文件其中Windows下文件名为 xjar.exe 而Linux下为 xjar 2.1. 安装go windows 环境: win10安装go开发环境 linux环境: 用于编译的机器需要安装 Go 环境用于运行的机器则可不必安装 Go 环境 linux 安装Go环境
2.2. 编译
演示编译windows 环境
cd xJarDir
go build xjar.go执行成功后会生成xjar.exe文件
演示编译环境linux 上传linux
go build xjar.go三、运行
3.1. 正常运行
windows环境
xjar.exe java -Dfile.encodingutf-8 --add-opens java.base/jdk.internal.loaderALL-UNNAMED --add-opens jdk.zipfs/jdk.nio.zipfsALL-UNNAMED -jar unified-access-center-passwd.jarlinux环境
./xjar java -Dfile.encodingutf-8 --add-opens java.base/jdk.internal.loaderALL-UNNAMED --add-opens jdk.zipfs/jdk.nio.zipfsALL-UNNAMED -jar unified-access-center-passwd.jar3.2. 二次加密运行 声明如果小伙伴们不需要二次加密请跳过3.2. 步骤 我的运行方式是这样的因为我单独对yml文件中的敏感信息进行了二次加密因此需要添加-Djasypt.encryptor.passwordgblfy.com这一段特别注意点建议按照我的命令的前后顺序
./xjar java -Dfile.encodingutf-8 -Djasypt.encryptor.passwordgblfy.com -jar unified-access-center-passwd.jar如果小伙伴们也想和我一样对敏感信息二次加密请移步 Spring Boot2 集成 jasypt 3.0.4 配置文件敏感信息加密
3.3. 测试结果
目的这里是先运行保证正常功能无影响下面会对jar进行反编译测试
四、IntelliJ IDE 反编译测试
4.1. 将加密的jar进行解压 4.2. 打开解压后的文件夹 4.3. class文件查看 4.4. 配置文件反编译 4.5. xml文件反编译 五、jd-gui 反编译测试
5.1. 没加密的jar效果
没加密的jar效果
5.2. 加密jar的效果
加密jar的效果 说明一下这里不是我没把文件打开这是我选中文件双击打开后的效果小伙伴们可以试试
六、XJad反编译测试
6.1. 没加密的jar效果 6.2. 加密的jar效果 七、XJad反编译测试
7.1. 没加密的jar效果 7.2. 加密的jar效果 八、Recaf 反编译 这里我换了另外一个项目测试看效果 8.1. 没加密的jar 8.2. 加密的jar
java文件效果 配置文件效果
九、反编译工具集合分享
java 反编译工具