有没有人使用proguard来混淆.war文件并成功?

时间:2018-11-02 10:39:47

标签: proguard

有人使用过proguard来混淆.war文件并成功吗?如果是的话,请告诉我混淆战争的确切步骤。 我找不到符合我要求的理想文档。 我已经在spring boot和jsp中创建了我的Web应用程序。

<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>5.3.3</proguardVersion>
                    <injar>${project.build.finalName}.jar</injar>
                    <outjar>${project.build.finalName}.jar</outjar>
                    <obfuscate>true</obfuscate>
                    <options>
                        <option>-dontshrink</option>
                        <option>-dontoptimize</option>

                        <option>-adaptclassstrings</option>

                        <option>-keepattributes
                            Exceptions,InnerClasses,Signature,Deprecated,
                            SourceFile,LineNumberTable,*Annotation*,EnclosingMethod</option>

                        <option>-keepnames interface **</option>

                        <option>-keepparameternames</option>

                        <option>-keep class
                            !com.slm.proguard.example.spring.boot.domain.**
                            { *; }</option>

                        <option>-keep class com.slm.proguard.example.spring.boot.service {
                            *; }</option>

                        <option>-keep interface * extends * { *; }</option>

                        <option>-keepclassmembers class * {
                            @org.springframework.beans.factory.annotation.Autowired *;
                            @org.springframework.beans.factory.annotation.Value *;
                            }
                        </option>
                    </options>
                    <libs>
                        Include main JAVA library required.
                        <lib>${java.home}/lib/rt.jar</lib>
                        Include crypto JAVA library if necessary.
                        <lib>${java.home}/lib/jce.jar</lib>
                    </libs>
                </configuration>

                <dependencies>
                    <dependency>
                        <groupId>net.sf.proguard</groupId>
                        <artifactId>proguard-base</artifactId>
                        <version>5.3.3</version>
                    </dependency>
                </dependencies>
            </plugin>

0 个答案:

没有答案