• 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。

  • 相关阅读:
    Selenium+Pytest自动化测试框架能碰撞出什么样的火花
    图片像素缩放,支持个性化自定义与精准比例调整,让图像处理更轻松便捷!
    【PAT甲级】1082 Read Number in Chinese
    JVM探究
    企业全域风控管理的最优解
    家政服务小程序:打造便捷生活,让家政服务触手可及
    鲸选小试界,存量时代的新「金矿」
    SpringCloudAlibaba — — OpenFeign的简单应用
    java毕业设计校园管理系统mybatis+源码+调试部署+系统+数据库+lw
    Flutter快速入门学习(一)
  • 原文地址:https://blog.csdn.net/qq_36004521/article/details/125551899