Allatori是第二代Java混淆器,它为您的知识产权提供全方位的保护。
虽然大多数第二代混淆器都能提供值得信赖的保护,但我们在Allatori中开发了一些额外的功能,使代码的反向工程几乎不可能。
Allatori不仅仅是混淆,它还能最大限度地减少应用程序的大小,提高速度,同时除了你和你的团队,任何人都无法读懂你的代码。Allatori和所有现代的Java混淆器一样,具有完整的水印功能,可以为您的软件提供适当的许可!
如果你有必要保护你的软件,如果你想减少它的大小和处理时间,Allatori混淆器是为你准备的。
官网 https://allatori.com/
上代码
在根目录下创建allatori文件夹,放入配置文件allatori.xml,创建lib文件夹,导入allatori.jar和allatori-annotations.jar。
<config>
<input>
<jar in="${project.build.finalName}.jar" out="${project.build.finalName}-obfuscated.jar"/>
</input>
<keep-names>
<class access="protected+">
<field access="protected+"/>
<method access="protected+"/>
</class>
</keep-names>
<property name="log-file" value="log.xml"/>
<ignore-classes>
<!-- 注意:spring的框架相关的文件需要排除,避免启动报错 -->
<class template="class *springframework*"/>
<class template="class org**"/>
</ignore-classes>
</config>
pom文件
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.smardec.mousegestures</groupId>
<artifactId>mouse-gestures</artifactId>
<packaging>jar</packaging>
<version>1.2</version>
<name>mouse-gestures</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Copying Allatori configuration file to 'target' directory.
The destination file will be filtered (Maven properties used in configuration file will be resolved). -->
<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>
<!-- Running Allatori -->
<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>
<!-- Copy allatori.jar to 'allatori' directory to use the commented line -->
<argument>${basedir}/allatori/lib/allatori.jar</argument>
<!-- <argument>${basedir}/allatori/allatori.jar</argument> -->
<argument>${basedir}/target/allatori.xml</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</project>
执行打包命令
mvn clean package -U -Dmaven.test.skip=true