• Allatori工具混淆jar包class


    方式一

    1. 下载demo版的:官方版本

     2. 把jar拷贝到项目中并创建xml如图:

    3. 配置xml 

    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <config>
    3. <input>
    4. <!-- 这里的in表示需要混淆的jar(springboot打包后的jar),out表示输出混淆后的jar(混淆器修改springboot打包后的jar) -->
    5. <jar in="nacea-polling-1.0-SNAPSHOT.jar" out="nacea-polling-1.0-SNAPSHOT-obfuscated.jar" />
    6. </input>
    7. <keep-names>
    8. <class access="protected+">
    9. <field access="protected+" />
    10. <method access="protected+" />
    11. </class>
    12. </keep-names>
    13. <!-- 忽略springBoot的启动项(防止启动报错) -->
    14. <ignore-classes>
    15. <class template="class *springframework*" />
    16. <class template="class com.cxy.nacea.polling.entity.*" />
    17. <class template="class com.cxy.nacea.polling.entity.task.*" />
    18. </ignore-classes>
    19. <property name="log-file" value="log.xml" />
    20. <!-- 添加水印密匙,主要用来保护版权 -->
    21. <!-- <watermark key="secure-key-to-extract-watermark" value="Customer: John Smith; Date: xx.yy.zzzz"/> -->
    22. <!-- 配置过期时间 -->
    23. <!-- <expiry date="2000/01/01" string="EXPIRED!"/> -->
    24. </config>

    4. 配置pom 

    1. <!-- Allatori plugin start -->
    2. <plugin>
    3. <groupId>org.apache.maven.plugins</groupId>
    4. <artifactId>maven-resources-plugin</artifactId>
    5. <version>2.6</version>
    6. <executions>
    7. <execution>
    8. <id>copy-and-filter-allatori-config</id>
    9. <phase>package</phase>
    10. <goals>
    11. <goal>copy-resources</goal>
    12. </goals>
    13. <configuration>
    14. <outputDirectory>${basedir}/target</outputDirectory>
    15. <resources>
    16. <resource>
    17. <directory>${basedir}/allatori</directory>
    18. <includes>
    19. <include>allatori.xml</include>
    20. </includes>
    21. <filtering>true</filtering>
    22. </resource>
    23. </resources>
    24. </configuration>
    25. </execution>
    26. </executions>
    27. </plugin>
    28. <plugin>
    29. <groupId>org.codehaus.mojo</groupId>
    30. <artifactId>exec-maven-plugin</artifactId>
    31. <version>1.2.1</version>
    32. <executions>
    33. <execution>
    34. <id>run-allatori</id>
    35. <phase>package</phase>
    36. <goals>
    37. <goal>exec</goal>
    38. </goals>
    39. </execution>
    40. </executions>
    41. <configuration>
    42. <executable>java</executable>
    43. <arguments>
    44. <argument>-Xms128m</argument>
    45. <argument>-Xmx512m</argument>
    46. <argument>-jar</argument>
    47. <argument>${basedir}/lib/allatori.jar</argument>
    48. <argument>${basedir}/target/allatori.xml</argument>
    49. </arguments>
    50. </configuration>
    51. </plugin>

    5.打包即可

     方式二

    配置Allatori-8.2-Demo\tutorial\step01\files\config.xml。双击RunAllatori.bat。

  • 相关阅读:
    基于Python实现椭圆拟合
    bat 批示处理详解-2
    什么无线蓝牙耳机好用?双十一新手必看的蓝牙耳机推荐
    解决npm install报错: No module named gyp
    ElementUl-布局+分页+表格+导航栏
    Docker安装RocketMQ
    【Svelte】-(4)If 条件判断语句 / Each 循环语句 / Await 异步处理块
    [Vue3] 滚动条自动滚动到底部
    [PyTorch][chapter 60][强化学习-2-有模型学习2]
    MongoDB数据库
  • 原文地址:https://blog.csdn.net/qq_36004521/article/details/125551899