我做了一个应用程序Spring引导,我使用maven。我还想混淆代码。我这样做的帮助下的proGuard maven插件。下面是pom.xml的代码:
<build>
<finalName>${artifactId}</finalName>
<plugins>
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals><goal>proguard</goal></goals>
</execution>
</executions>
<configuration>
<proguardVersion>6.0beta1</proguardVersion>
<injar>${project.build.finalName}.jar</injar>
<outjar>${project.build.finalName}.jar</outjar>
<obfuscate>true</obfuscate>
<proguardInclude>${basedir}/proguard.conf</proguardInclude>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
<lib>${java.home}/lib/jce.jar</lib>
</libs>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>6.0beta1</version>
<scope>system</scope> <systemPath>${basedir}/src/main/resources/libs/proguard/proguard.jar</systemPath>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<mainClass>com.dfd.Application</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
这是我的前卫。配置文件:
#-injars BOOT-INF\lib\
#-injars BOOT-INF\classes\
-libraryjars 'C:\Program Files\Java\jre1.8.0_201\lib\rt.jar'
-keepdirectories
-dontshrink
-dontoptimize
-dontobfuscate
-obfuscationdictionary 'obfuc.txt'
-classobfuscationdictionary 'obfuc.txt'
-packageobfuscationdictionary 'obfuc.txt'
-dontnote
-ignorewarnings
# Keep - Applications. Keep all application classes, along with their 'main' methods.
-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}
# Also keep - Enumerations. Keep the special static methods that are required in
# enumeration classes.
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
# Also keep - Database drivers. Keep all implementations of java.sql.Driver.
-keep class * extends java.sql.Driver
# Also keep - Swing UI L&F. Keep all extensions of javax.swing.plaf.ComponentUI,
# along with the special 'createUI' method.
-keep class * extends javax.swing.plaf.ComponentUI {
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent);
}
# Keep - Native method names. Keep all native class/method names.
-keepclasseswithmembers,includedescriptorclasses,allowshrinking class * {
native <methods>;
}
我试图用Intellegi的思想构建一个jar文件,但是我得到了很多错误。结果,生成的jar没有通过模糊处理。我做错了什么,以及如何实现混淆?感谢
日志:
[proguard] ProGuard, version 6.0.3
[proguard] Reading program jar [D:\Yandex.Disk\YandexDisk\programming\intellegi_idea\dfd-editor-projects\dfd-editor-v0.4\target\dfd-editor_proguard_base.jar] (filtered)
[proguard] Warning: class [BOOT-INF/classes/com/dfd/Application.class] unexpectedly contains class [com.dfd.Application]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/logic/GeneratorCode$1.class] unexpectedly contains class [com.dfd.logic.GeneratorCode$1]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/cells/COutput.class] unexpectedly contains class [com.dfd.model.blocks.cells.COutput]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/cells/factory/CInputCreator.class] unexpectedly contains class [com.dfd.model.blocks.cells.factory.CInputCreator]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/cells/maincreator/CellCreator$1.class] unexpectedly contains class [com.dfd.model.blocks.cells.maincreator.CellCreator$1]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/parsed/CellConstantsCreator.class] unexpectedly contains class [com.dfd.model.blocks.parsed.CellConstantsCreator]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/collections/SpecialList.class] unexpectedly contains class [com.dfd.model.collections.SpecialList]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/logic/generator/code/ClassGenerator.class] unexpectedly contains class [com.dfd.logic.generator.code.ClassGenerator]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/logic/generator/code/Method.class] unexpectedly contains class [com.dfd.logic.generator.code.Method]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/logic/generator/code/Pair.class] unexpectedly contains class [com.dfd.logic.generator.code.Pair]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/cells/CInput.class] unexpectedly contains class [com.dfd.model.blocks.cells.CInput]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/cells/factory/CCreator.class] unexpectedly contains class [com.dfd.model.blocks.cells.factory.CCreator]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/cells/factory/CTempDatabaseCreator.class] unexpectedly contains class [com.dfd.model.blocks.cells.factory.CTempDatabaseCreator]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/collections/comparators/LineComparator.class] unexpectedly contains class [com.dfd.model.collections.comparators.LineComparator]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/logic/generator/code/GeneralGenerator.class] unexpectedly contains class [com.dfd.logic.generator.code.GeneralGenerator]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/logic/generator/code/InterfaceGenerator.class] unexpectedly contains class [com.dfd.logic.generator.code.InterfaceGenerator]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/cells/Cell.class] unexpectedly contains class [com.dfd.model.blocks.cells.Cell]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/cells/CProcess.class] unexpectedly contains class [com.dfd.model.blocks.cells.CProcess]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/cells/factory/COutputCreator.class] unexpectedly contains class [com.dfd.model.blocks.cells.factory.COutputCreator]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/cells/maincreator/CellCreator.class] unexpectedly contains class [com.dfd.model.blocks.cells.maincreator.CellCreator]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/parsed/CellText.class] unexpectedly contains class [com.dfd.model.blocks.parsed.CellText]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/entity/Diagram.class] unexpectedly contains class [com.dfd.model.entity.Diagram]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/controller/DfdController.class] unexpectedly contains class [com.dfd.controller.DfdController]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/logic/GeneratorCode.class] unexpectedly contains class [com.dfd.logic.GeneratorCode]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/cells/CTempDatabase.class] unexpectedly contains class [com.dfd.model.blocks.cells.CTempDatabase]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/cells/factory/CProcessCreator.class] unexpectedly contains class [com.dfd.model.blocks.cells.factory.CProcessCreator]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/Line.class] unexpectedly contains class [com.dfd.model.blocks.Line]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/blocks/parsed/CellConstants.class] unexpectedly contains class [com.dfd.model.blocks.parsed.CellConstants]
[proguard] Warning: class [BOOT-INF/classes/com/dfd/model/collections/ListElem.class] unexpectedly contains class [com.dfd.model.collections.ListElem]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\boot\spring-boot-starter-web\2.0.5.RELEASE\spring-boot-starter-web-2.0.5.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\boot\spring-boot-starter\2.0.5.RELEASE\spring-boot-starter-2.0.5.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\boot\spring-boot-starter-logging\2.0.5.RELEASE\spring-boot-starter-logging-2.0.5.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar]
[proguard] Warning: class [META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class] unexpectedly contains class [org.apache.logging.log4j.util.ProcessIdUtil]
[proguard] Warning: class [META-INF/versions/9/org/apache/logging/log4j/util/StackLocator.class] unexpectedly contains class [org.apache.logging.log4j.util.StackLocator]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.10.0\log4j-to-slf4j-2.10.0.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\apache\logging\log4j\log4j-api\2.10.0\log4j-api-2.10.0.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\slf4j\jul-to-slf4j\1.7.25\jul-to-slf4j-1.7.25.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\spring-core\5.0.9.RELEASE\spring-core-5.0.9.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\spring-jcl\5.0.9.RELEASE\spring-jcl-5.0.9.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\boot\spring-boot-starter-json\2.0.5.RELEASE\spring-boot-starter-json-2.0.5.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.6\jackson-databind-2.9.6.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.6\jackson-core-2.9.6.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.6\jackson-datatype-jdk8-2.9.6.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.6\jackson-datatype-jsr310-2.9.6.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.6\jackson-module-parameter-names-2.9.6.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\boot\spring-boot-starter-tomcat\2.0.5.RELEASE\spring-boot-starter-tomcat-2.0.5.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\8.5.34\tomcat-embed-core-8.5.34.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\8.5.34\tomcat-embed-el-8.5.34.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\8.5.34\tomcat-embed-websocket-8.5.34.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\hibernate\validator\hibernate-validator\6.0.12.Final\hibernate-validator-6.0.12.Final.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\com\fasterxml\classmate\1.3.4\classmate-1.3.4.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\spring-web\5.0.9.RELEASE\spring-web-5.0.9.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\spring-beans\5.0.9.RELEASE\spring-beans-5.0.9.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\spring-webmvc\5.0.9.RELEASE\spring-webmvc-5.0.9.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\spring-aop\5.0.9.RELEASE\spring-aop-5.0.9.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\spring-context\5.0.9.RELEASE\spring-context-5.0.9.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\spring-expression\5.0.9.RELEASE\spring-expression-5.0.9.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\boot\spring-boot-starter-thymeleaf\2.0.5.RELEASE\spring-boot-starter-thymeleaf-2.0.5.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\thymeleaf\thymeleaf-spring5\3.0.9.RELEASE\thymeleaf-spring5-3.0.9.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\thymeleaf\thymeleaf\3.0.9.RELEASE\thymeleaf-3.0.9.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\attoparser\attoparser\2.0.4.RELEASE\attoparser-2.0.4.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\unbescape\unbescape\1.1.5.RELEASE\unbescape-1.1.5.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\thymeleaf\extras\thymeleaf-extras-java8time\3.0.1.RELEASE\thymeleaf-extras-java8time-3.0.1.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\boot\spring-boot-devtools\2.0.5.RELEASE\spring-boot-devtools-2.0.5.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\boot\spring-boot\2.0.5.RELEASE\spring-boot-2.0.5.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.0.5.RELEASE\spring-boot-autoconfigure-2.0.5.RELEASE.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\jsoup\jsoup\1.11.3\jsoup-1.11.3.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\com\google\googlejavaformat\google-java-format\1.6\google-java-format-1.6.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\com\google\guava\guava\22.0\guava-22.0.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\com\google\errorprone\error_prone_annotations\2.0.18\error_prone_annotations-2.0.18.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\org\codehaus\mojo\animal-sniffer-annotations\1.14\animal-sniffer-annotations-1.14.jar]
[proguard] Reading library jar [C:\Users\admin_test\.m2\repository\com\google\errorprone\javac-shaded\9+181-r4173-1\javac-shaded-9+181-r4173-1.jar]
[proguard] Reading library jar [C:\Program Files\Java\jre1.8.0_201\lib\rt.jar]
[proguard] Reading library jar [C:\Program Files\Java\jdk1.8.0_191\jre\lib\rt.jar]
[proguard] Warning: there were 31 classes in incorrectly named files.
[proguard] You should make sure all file names correspond to their class names.
[proguard] The directory hierarchies must correspond to the package hierarchies.
[proguard] (http://proguard.sourceforge.net/manual/troubleshooting.html#unexpectedclass)
[proguard] Reading library jar [C:\Program Files\Java\jdk1.8.0_191\jre\lib\jce.jar]
[proguard] Preparing output jar [D:\Yandex.Disk\YandexDisk\programming\intellegi_idea\dfd-editor-projects\dfd-editor-v0.4\target\dfd-editor.jar]
对于混淆,我使用这个应用程序:github
这个应用程序完全混淆了!
UPD:
注意内部jar库:模糊器会压缩它们,它们会变得不正确。在混淆之后,有必要将可执行jar文件中的所有jar库替换为旧的jar库(来自旧的可执行jar文件)。
我在摆弄弹力靴,但每向前走一步,就会让我后退两步。 我将我的简单应用程序与Springboot连接在一起,但我没有得到这个错误: 还有这一点: 我不用任何数据库。应用程序非常简单。下面是主要的类: 下面是其他两个类和: 就是这样。尽管它可能很简单。 下面是文件结构以及build.gradle文件内容: 能有人请帮助我让这个小程序运行,指出我在正确的方向,以解决这个问题? 事先好心谢谢你。
本文向大家介绍c# GridControl的模糊查询实现代码,包括了c# GridControl的模糊查询实现代码的使用技巧和注意事项,需要的朋友参考一下 如上图所示,如果查询供应商名称包括机械的公司,正常设置是不可以的,只能从头开始筛选: 方法1: 以下是以为网名为[不是小宽]的网友发给我的完美解决方案,我在此贴出来,大家可以共同学习: 在要查询的窗体中调用即可: SetFilter( grid
本文向大家介绍模糊化和反模糊化之间的区别,包括了模糊化和反模糊化之间的区别的使用技巧和注意事项,需要的朋友参考一下 模糊化 模糊化可以被定义为将清晰集转换为模糊集或将模糊集转换为模糊集的过程。基本上,此操作会将准确的明晰输入值转换为语言变量。 模糊化 模糊化可以定义为将模糊集简化为清晰集或将模糊成员转换为清晰成员的过程。 我们已经研究了模糊化过程涉及从清晰数量到模糊数量的转换。在许多工程应用中,必
在我简单的gradle构建中,我想使用暗影罐和ProGuard一起。我发现了一些例子,其中shadowJar任务的输出是proguard任务的输入,这很好地工作,但是在我的例子中,我希望首先创建一个小的模糊jar,首先我很好地指定库依赖关系,让proguard只关注我的代码,然后我想把它传递给shadowJar插件进行fatjar打包。 我的问题是shadowJar输出包含所有未混淆的库(fine