アラトリ難読化技術の紹介
AllatoriはJava Obfuscatorであり、第2世代のObfuscatorに属するため、あらゆる面で知的財産権を保護できます。アラトリには、次の保護方法があります:義務の命名、流れの難読化、デバッグ情報難読化、弦の難読化、および透かし技術。この難解は、教育的および非営利プロジェクトには無料です。 WARおよびJARファイル形式がサポートされており、コードを難読化する必要があるアプリケーションに有効な日付を追加できます。コードを保護する必要があるプロジェクトがあります。より基本的な解決策は、コードを難読化することです。パッケージ化されたファイルを再コンパイルした後、効果を確認できます。さらに、アラトリで作られたバッグのサイズは少し小さくなります。
プロジェクトの紹介
非常に普通の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.apach/4.0. http://maven.apache.org/xsd/maven-4.0.0.0.xsd "> <modelversion> 4.0.0 </modelversion> <groupid> com.lovnx </groupid> <artifactid> cuspruse </artifactid> <バージョン> 0.0. <groupid> org.springframework.boot </groupid> <artifactid> spring-boot-maven-plugin </artifactid> </plugin> <! - allatoriプラグインStart-> <Plugin> <groupId> org.apache.maven.plugins </groupid> maven-resources-plugin </artifactid> <バージョン> 2.6 </バージョン> <実行> <実行> <id> copy-and-filter-allatori-config </id> <phase>パッケージ</phase> <gogle> copy-resources </goal> </goal> <configuration> <outputdirectory> $ {beadir}/ターゲット</outputory> <リソース> <リソース> <リソース> <リソース> <リソース> <リソース> <Directory> $ {beadir}/allatori </directory> <include> <cludence> allatori.xml </inctruali.xml </cond> </incord> <filtering> true </resources> </resources> </configuration> </execution> </executions> </plugin> <plugin> org.codehaus.mojo </groupid> <artifactid> exec-maven-plugin </artifactid> <bersion> 1.2.1 </version> <executions> <execution> <id> run-allatori </id> <phase>パッケージ</phase> <goal> exec </goal> </goal> </execution> </execution> </実行> < <Argune> -xms128m </argument> <argument> -xmx512m </argument> <astauld> -jar </argure> <astardir} /lib/allationi.jar </argution> <astor> $ {beadir} /target/allatori.xml </argution </plugins> </build> <dependencies> <! - テストBegin-> <依存関係> <groupid> junit </groupId> <artifactid> junit </artifactid> <scope> test </scope> test </scope> </dependency> <! - > < <artifactid> spring-boot-starter-web </artifactid> </dependency> </dependencies> <parent> <parent> <parent> <parent> org.springframework.boot </groupid> <artifactid> spring-boot-boot-boot-starter-parent </artifactid> <バージョン> 1.5.8.release </version Mavenを使用してプラグインをパッケージ化すると、Spring BootはAllatori構成も上記で説明します。 Allatori構成でさらに重要なのは、次のとおりです。
<Athard> $ {beadir} /lib/allatori.jar </argument> <argument> $ {beadir} /target/allatori.xml </argument> AllatoriのAlllati.jarファイルパスを指定します。プロジェクトがPOMプロジェクトである場合、Parent ProjectにLIBディレクトリを配置してから、子プロジェクトにのみ必要です。
<引数> ../ lib/allatori.jar </argument>
やるだけ。
allatori.xmlファイルも非常に重要です。その内容を見てみましょう。
<config> <inupt> <jar in = "cusplain-0.0.1-snapshot.jar" out = "compans-0.0.1-snapshot-obfuscated.jar"/> </input> <keep-names> <class access = "protected+"> <field access = "protected+"/> <メソッド= value = "log.xml"/> </config>
つまり、Allatori Obfuscatorの特定の構成です。ここでは、多くの情報とさまざまな戦略を構成することができます。また、どのクラスが難読化されていないかを指定することもできます。記事の最後にある添付ファイルのドキュメントでは、さまざまな特定の方法を取得できます。
ここで説明する必要があるのは次のとおりです。
<input> <jar in = "cuspry-0.1-snapshot.jar" out = "cuspry-0.0.1-snapshot-obfuscated.jar"/> </input>
混乱-0.0.1-snapshot.jarはパッケージ後の遮るもののないパッケージですが、混乱-0.0.1-Snapshot-obfuscated.jarは難読化されたパッケージであり、これが必要なものです。
パッケージステップ
1.クリーンメイブンプロジェクト。
2. allatori.xmlファイルをターゲットディレクトリにコピーします。
3. Mavenプロジェクトをインストールし、次の情報を確認した後、成功することを意味します。
############################################################################か############################################################################かデモバージョン! ##商業用ではありません! ### ## demoバージョンSystem.outの##を追加し、いくつかのフィールドと方法に「allatori_demo 'name ##」を与えます。 ## ## ## Allatori obfuscator v6.4 DemoによるObfuscation ## ## http://www.allatori.com ## ################################################################################################################ ################################################################################################################ ################################################################################################################ #################################################################################################################
4。成功プロジェクト:
矢印は必要なパッケージを指しており、このパッケージのコードは難読化されています。
効果ビュー
ここでは、逆コンパイルツールを使用して、難読化されたパッケージを表示します。私はJD-GUIソフトウェアを使用しています。これは小さくて実用的です。
testApplication.java難読化の前:
org.springframework.boot.springApplication; Import org.springframework.boot.autoconfigure.springbootapplication; @springbootapplicationpublic class testapplication {public static void main(string [] args){springApplication.run(testapplication.run.class、class); }} testApplication.javaが難読化された後:
java.io.printStreamをインポート; Import org.springframework.boot.springApplication; Import org.springframework.boot.autoconfigure.springbootapplication; @springbootapplicationpublic class testapplication {cublic string ollatorixdemo(int tmp4_3; 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)); }新しい文字列(?); } public static void main(string [] a){ System.out.println("/n####################################################################################################### ############################################################################## ######################################################################## ############################################################################## ######################################################################## ############################################################################## ######################################################################## Allatori Obfuscator V6.4 Demo#/n##/n#http://www.allatori.com#/n# #/n ############################################################################################################################################################################################################################################################################」 SpringApplication.run(testApplication.class、a); }} testController.javaが混乱する前に:
org.springframework.web.bind.annotation.getMapping; import org.springframework.web.bind.annotation.restController; @RestControllerPublic Class TestController {@getMapping( "/test")公開文字列テスト() }} testController.javaが難読化された後:
org.springframework.web.bind.annotation.getMapping; Import org.springframework.web.bind.annotation.restController; @RestControllerPublic Class TestController {@getMapping({{{"/test"})公開文字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)); }新しい文字列(?); }}ハハハ、それはどうですか、わかりませんか?そして、難読化パッケージは、問題なくいつものように実行されます。
-------- GitHubソースコードとドキュメントアドレス "-------
上記はこの記事のすべての内容です。みんなの学習に役立つことを願っています。誰もがwulin.comをもっとサポートすることを願っています。