国产99久久精品_欧美日本韩国一区二区_激情小说综合网_欧美一级二级视频_午夜av电影_日本久久精品视频

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 科技 - 知識百科 - 正文

SpringBoot怎么使用Allatori讓代碼混淆

來源:懂視網 責編:小采 時間:2020-11-27 19:55:46
文檔

SpringBoot怎么使用Allatori讓代碼混淆

SpringBoot怎么使用Allatori讓代碼混淆:這次給大家帶來Spring Boot怎么使用Allatori讓代碼混淆,Spring Boot使用Allatori讓代碼混淆的注意事項有哪些,下面就是實戰案例,一起來看一下。Allatori混淆技術介紹 Allatori是一個Java 混淆器,它屬于第二代混淆器,因此它能夠全方位地保護你的知識產權。
推薦度:
導讀SpringBoot怎么使用Allatori讓代碼混淆:這次給大家帶來Spring Boot怎么使用Allatori讓代碼混淆,Spring Boot使用Allatori讓代碼混淆的注意事項有哪些,下面就是實戰案例,一起來看一下。Allatori混淆技術介紹 Allatori是一個Java 混淆器,它屬于第二代混淆器,因此它能夠全方位地保護你的知識產權。

這次給大家帶來Spring Boot怎么使用Allatori讓代碼混淆,Spring Boot使用Allatori讓代碼混淆的注意事項有哪些,下面就是實戰案例,一起來看一下。

Allatori混淆技術介紹

Allatori是一個Java 混淆器,它屬于第二代混淆器,因此它能夠全方位地保護你的知識產權。 Allatori具有以下幾種保護方式:命名混淆,流混淆,調試信息混淆,字符串混淆,以及水印技術。對于教育和非商業項目來說這個混淆器是免費的。支持war和jar文件格式,并且允許對需要混淆代碼的應用程序添加有效日期。 有項目需要對代碼進行保護,比較初級的方案就是對代碼進行混淆,打包之后的文件進行反編譯后,就可以看到效果。此外,使用Allatori打的包體積也會小一點。

一個很普通的maven工程,不同的是在根目錄下加入Allatori的jar包。

下面我們來看看pom.xml文件:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.lovnx</groupId>
 <artifactId>confusion</artifactId>
 <version>0.0.1-SNAPSHOT</version>
 <packaging>jar</packaging>
 <build>
 <plugins>
 <plugin>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-maven-plugin</artifactId>
 </plugin>
 <!-- Allatori plugin start -->
 <plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-resources-plugin</artifactId>
 <version>2.6</version>
 <executions>
 <execution>
 <id>copy-and-filter-allatori-config</id>
 <phase>package</phase>
 <goals>
 <goal>copy-resources</goal>
 </goals>
 <configuration>
 <outputDirectory>${basedir}/target</outputDirectory>
 <resources>
 <resource>
 <directory>${basedir}/allatori</directory>
 <includes>
 <include>allatori.xml</include>
 </includes>
 <filtering>true</filtering>
 </resource>
 </resources>
 </configuration>
 </execution>
 </executions>
 </plugin>
 <plugin>
 <groupId>org.codehaus.mojo</groupId>
 <artifactId>exec-maven-plugin</artifactId>
 <version>1.2.1</version>
 <executions>
 <execution>
 <id>run-allatori</id>
 <phase>package</phase>
 <goals>
 <goal>exec</goal>
 </goals>
 </execution>
 </executions>
 <configuration>
 <executable>java</executable>
 <arguments>
 <argument>-Xms128m</argument>
 <argument>-Xmx512m</argument>
 <argument>-jar</argument>
 <argument>${basedir}/lib/allatori.jar</argument>
 <argument>${basedir}/target/allatori.xml</argument>
 </arguments>
 </configuration>
 </plugin>
 <!-- Allatori plugin end -->
 </plugins>
 </build>
 <dependencies>
 <!-- Test Begin -->
 <dependency>
 <groupId>junit</groupId>
 <artifactId>junit</artifactId>
 <scope>test</scope>
 </dependency>
 <!-- Test End -->
 <!-- springboot啟動 -->
 <dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-web</artifactId>
 </dependency>
 </dependencies>
 <parent>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-parent</artifactId>
 <version>1.5.8.RELEASE</version>
 </parent>
</project>

使用maven打包插件,Spring Boot構建的工程,Allatori的配置在上面也有說明,Allatori配置里面比較重要的是:

<argument>${basedir}/lib/allatori.jar</argument>
<argument>${basedir}/target/allatori.xml</argument>

指定Allatori的allatori.jar文件路徑,如果你的工程是一個pom工程,可以在父工程中放lib目錄,然后子工程只需要:

<argument>../lib/allatori.jar</argument>

即可。

allatori.xml這個文件也很重要,看看其中的內容:

<config>
 <input>
 <jar in="confusion-0.0.1-SNAPSHOT.jar" out="confusion-0.0.1-SNAPSHOT-obfuscated.jar"/>
 </input>
 <keep-names>
 <class access="protected+">
 <field access="protected+"/>
 <method access="protected+"/>
 </class>
 </keep-names>
 <property name="log-file" value="log.xml"/>
</config>

即是對Allatori混淆器的具體配置,這里可以配置很多信息,很多種策略,也可以指定哪些類不被混淆,具體的各種方式可以在在文末附件里面的文檔得到。
這里需要說明的是:

 <input>
 <jar in="confusion-0.0.1-SNAPSHOT.jar" out="confusion-0.0.1-SNAPSHOT-obfuscated.jar"/>
 </input>

confusion-0.0.1-SNAPSHOT.jar這個是打包后的未被混淆的包,而confusion-0.0.1-SNAPSHOT-obfuscated.jar是混淆后的包,這個是我們需要的。

打包步驟
1、clean maven工程。
2、將resources下面的allatori.xml文件復制到target目錄下面。
3、install maven工程,看到如下信息后表示成功:

################################################
# #
# ## # # ## ### ### ## ### #
# # # # # # # # # # # # # #
# ### # # ### # # # ## # #
# # # ### ### # # # ### # # ### #
# #
# DEMO VERSION! #
# NOT FOR COMMERCIAL USE! #
# #
# Demo version adds System.out's #
# and gives 'ALLATORI_DEMO' name #
# to some fields and methods. #
# #
# #
# Obfuscation by Allatori Obfuscator v6.4 DEMO #
# #
# http://www.allatori.com #
# #
################################################

4、成功后的工程:

Spring Boot使用Allatori代碼混淆的方法

箭頭所指處即是我們需要的包,此包代碼已被混淆。

效果查看

這里使用反編譯工具對混淆后的包進行查看,我用的是jd-gui這個軟件,小巧實用。

TestApplication.java混淆前:

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class TestApplication {
 
 public static void main(String[] args) {
 SpringApplication.run(TestApplication.class, args);
 }
}

TestApplication.java混淆后:

import java.io.PrintStream;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class TestApplication
{
 public static String ALLATORIxDEMO(String a)
 {
 int tmp4_3 = 4;
 int tmp7_6 = 1;
 int tmp21_18 = a.length();
 int tmp25_24 = 1;
 tmp25_24;
 int j;
 int ? = tmp25_24;
 int k = tmp21_18;
 int tmp35_31 = (j = new char[tmp21_18] - 1);
 tmp35_31;
 int i = 5 << 4 ^ (0x2 ^ 0x5);
 (tmp4_3 << tmp4_3 ^ tmp7_6 << tmp7_6);
 if (tmp35_31 >= 0)
 {
 int tmp45_44 = j;
 j--;
 ?[tmp45_44] = ((char)(a.charAt(tmp45_44) ^ i));
 int tmp66_63 = (j--);
 ?[tmp66_63] = ((char)(a.charAt(tmp66_63) ^ k));
 }
 return new String(?);
 }
 public static void main(String[] a)
 {
 System.out.println("\n################################################\n# #\n# ## # # ## ### ### ## ### #\n# # # # # # # # # # # # # #\n# ### # # ### # # # ## # #\n# # # ### ### # # # ### # # ### #\n# #\n# Obfuscation by Allatori Obfuscator v6.4 DEMO #\n# #\n# http://www.allatori.com #\n# #\n################################################\n"); SpringApplication.run(TestApplication.class, a);
 }
}

TestController.java混淆前:

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class TestController {
 @GetMapping("/test")
 public String test(){
 return "88888888888888888";
 }
}

TestController.java混淆后:

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class TestController
{
 @GetMapping({"/test"})
 public String test()
 {
 return ALLATORIxDEMO("*]*]*]*]*]*]*]*]*");
 }
 public static String ALLATORIxDEMO(String a)
 {
 int tmp27_24 = a.length();
 int tmp31_30 = 1;
 tmp31_30;
 int j;
 int ? = tmp31_30;
 int k = tmp27_24;
 int tmp41_37 = (j = new char[tmp27_24] - 1);
 tmp41_37;
 int i = (0x3 ^ 0x5) << 4 ^ 0x5;
 (2 << 3 ^ 0x2);
 if (tmp41_37 >= 0)
 {
 int tmp51_50 = j;
 j--;
 ?[tmp51_50] = ((char)(a.charAt(tmp51_50) ^ i));
 int tmp72_69 = (j--);
 ?[tmp72_69] = ((char)(a.charAt(tmp72_69) ^ k));
 }
 return new String(?);
 }
}

相信看了本文案例你已經掌握了方法,更多精彩請關注Gxl網其它相關文章!

推薦閱讀:

實現文件上傳的AjaxUpLoad.js

js操作二進制數據方法總結

聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

SpringBoot怎么使用Allatori讓代碼混淆

SpringBoot怎么使用Allatori讓代碼混淆:這次給大家帶來Spring Boot怎么使用Allatori讓代碼混淆,Spring Boot使用Allatori讓代碼混淆的注意事項有哪些,下面就是實戰案例,一起來看一下。Allatori混淆技術介紹 Allatori是一個Java 混淆器,它屬于第二代混淆器,因此它能夠全方位地保護你的知識產權。
推薦度:
  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 久久精品一区二区三区四区 | 亚洲国产精品一区 | 国产精品一区二区三区四区五区 | 久操视频在线免费观看 | 国产欧美日韩中文字幕 | 国产香蕉视频在线 | 欧美黄色网页 | 精品亚洲一区二区三区 | 日韩 国产 欧美 精品 在线 | 欧美大陆日韩 | 一区二区三区视频在线 | 久久久影院亚洲精品 | 欧美在线视频一区二区三区 | 久久久国产这里有的是精品 | 亚洲综合精品一区二区三区中文 | 久久中文字幕久久久久91 | 福利二区 | 女人18毛片a级毛片一区②区 | 国产va精品免费观看 | 97精品国产97久久久久久 | 久久无码精品一区二区三区 | 亚洲最新在线 | 成人国产精品一级毛片视频 | www.欧美色图 | 日韩精品不卡 | 精品国产日韩一区三区 | 热re91久久精品国产91热 | 国产成人久久精品亚洲小说 | 中文字幕亚洲天堂 | 一级毛片黄 | 日韩欧美综合 | 久久久久成人精品一区二区 | 亚州一区二区 | 亚洲综合图片小说区热久久 | 伊人久久成人成综合网222 | 亚洲欧美中文日韩综合 | 国产精品视频一区二区三区经 | 欧美一区二区视频 | 国产一区二区三区亚洲欧美 | 日皮影院 | 国产综合亚洲欧美日韩一区二区 |