springboot模块化后所有代码整合ProGuard混淆代码

修改pom配置文件

我使用的是JDK21,所以需要高版本的ProGuard,低版本的不行

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>iptvcrm</artifactId>
        <groupId>com.wisetv</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <build>
        <plugins>
            <plugin>
                <groupId>com.github.wvengen</groupId>
                <artifactId>proguard-maven-plugin</artifactId>
                <version>2.6.1</version>
                <executions>
                    <execution>
                        <id>proguard</id>
                        <!-- 在打包阶段混淆-->
                        <phase>package</phase>
                        <goals>
                            <!-- 只使用混淆功能-->
                            <goal>proguard</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <proguardVersion>7.5.0</proguardVersion>
                    <!-- 原始jar包-->
                    <injar>${project.build.finalName}.jar</injar>
                    <!-- 混淆之后的jar包名  此处与原始一样 混覆盖原始jar包-->
                    <outjar>${project.build.finalName}-pg.jar</outjar>
                    <obfuscate>true</obfuscate>
                    <options>
                        <option>-dontshrink</option>
                        <option>-dontoptimize</option>
                        <!--  ##对于类成员的命名的混淆采取唯一策略-->
                        <option>-useuniqueclassmembernames</option>
                        <!-- This option will replace all strings in reflections method invocations with new class names.
                             For example, invokes Class.forName('className')-->
                        <option>-adaptclassstrings</option>
                        <!--  ## 混淆时不生成大小写混合的类名,默认是可以大小写混合-->
                        <option>-dontusemixedcaseclassnames</option>
                        <!-- This option will save all original annotations and etc. Otherwise all we be removed from files.-->
                        <option>-keepattributes
                            Exceptions,
                            InnerClasses,
                            Signature,
                            Deprecated,
                            SourceFile,
                            LineNumberTable,
                            *Annotation*,
                            EnclosingMethod
                        </option>
                        <!-- This option will save all original names in interfaces (without obfuscate).-->
                        <option>-keepnames interface **</option>
                        <!-- This option will save all original methods parameters in files defined in -keep sections,
                             otherwise all parameter names will be obfuscate.-->
<!--                        <option>-keepparameternames</option>-->
                        <!-- This option will save all original class files (without obfuscate) but obfuscate all
                             in domain and service packages.-->
                        <option>-keep
                            class com.wisetv.useroutbound.app.UserOutBoundApplication {
                            public static void main(java.lang.String[]);
                            }
         
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值