noeasydb/proguard/examples/ant/proguard.xml
2023-04-13 07:10:18 +02:00

110 lines
4.5 KiB
XML

<!-- This Ant build file illustrates how to process ProGuard (including its
main application, its GUI, its Ant task, and its WTK plugin), and the
ReTrace tool, all in one go.
Usage: ant -f proguard.xml -->
<project name="ProGuard" default="obfuscate" basedir="../..">
<target name="obfuscate">
<taskdef resource="proguard/ant/task.properties"
classpath="lib/proguard.jar" />
<proguard verbose="true"
printmapping="proguard.map"
overloadaggressively="on"
repackageclasses=""
renamesourcefileattribute="SourceFile">
<!-- Specify the input jars, output jars, and library jars. -->
<injar file="lib/proguard.jar" />
<outjar file="examples/ant/proguard_out.jar" />
<!-- Before Java 9, the runtime classes were packaged in a single jar file. -->
<!-- libraryjar file="${java.home}/lib/rt.jar" -->
<!-- As of Java 9, the runtime classes are packaged in modular jmod files. -->
<libraryjar file="${java.home}/jmods/java.base.jmod" jarfilter="!**.jar" filter="!module-info.class" />
<libraryjar file="${java.home}/jmods/java.sql.jmod" jarfilter="!**.jar" filter="!module-info.class" />
<libraryjar file="${user.home}/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.31/11289d20fd95ae219333f3456072be9f081c30cc/kotlin-stdlib-1.3.31.jar" />
<libraryjar file="${user.home}/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.31/20c34a04ea25cb1ef0139598bd67c764562cb170/kotlin-stdlib-common-1.3.31.jar" />
<libraryjar file="${user.home}/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-metadata-jvm/0.1.0/505481587ce23e1d8207734e496632df5c4e6f58/kotlinx-metadata-jvm-0.1.0.jar" />
<libraryjar file="${user.home}/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.5/f645ed69d595b24d4cf8b3fbb64cc505bede8829/gson-2.8.5.jar" />
<!-- Don't print notes about reflection in GSON code, the Kotlin runtime, and our own optionally injected code. -->
<dontnote filter="kotlin.**" />
<dontnote filter="kotlinx.**" />
<dontnote filter="com.google.gson.**" />
<dontnote filter="proguard.configuration.ConfigurationLogger" />
<!-- Preserve injected GSON utility classes and their members. -->
<keep name="proguard.optimize.gson._*" allowobfuscation="true" />
<keepclassmembers name="proguard.optimize.gson._*">
<field name="*" />
<method name="*" />
</keepclassmembers>
<!-- Obfuscate class strings of injected GSON utility classes. -->
<adaptclassstrings name="proguard.optimize.gson.**" />
<!-- Adapt the resource file names, based on the corresponding obfuscated
class names. -->
<adaptresourcefilenames filter="**.properties,**.gif,**.jpg" />
<adaptresourcefilecontents filter="proguard/ant/task.properties" />
<!-- Optionally preserve line numbers in the obfuscated stack traces.
<keepattribute name="LineNumberTable">
<keepattribute name="SourceFile">
-->
<!-- The main seeds: ProGuard and its companion tool ReTrace. -->
<keep access="public" name="proguard.ProGuard">
<method access ="public static"
type ="void"
name ="main"
parameters="java.lang.String[]" />
</keep>
<keep access="public" name="proguard.gui.ProGuardGUI">
<method access ="public static"
type ="void"
name ="main"
parameters="java.lang.String[]" />
</keep>
<keep access="public" name="proguard.retrace.ReTrace">
<method access ="public static"
type ="void"
name ="main"
parameters="java.lang.String[]" />
</keep>
<!-- If we have ant.jar, we can properly process the Ant task. -->
<keeppackagename name="proguard.ant" />
<keep name="proguard.ant.*" allowobfuscation="true" />
<keepclassmembers access="public" name="proguard.ant.*">
<constructor parameters="org.apache.tools.ant.Project" />
<method access="public" type="void" name="set*" parameters="***" />
<method access="public" type="void" name="add*" parameters="***" />
</keepclassmembers>
<!-- If we have the Gradle jars, we can properly process the Gradle task. -->
<keep access="public" name="proguard.gradle.*">
<method access="public" />
</keep>
<!-- If we have kenv.zip, we can process the J2ME WTK plugin. -->
<keep access="public" name="proguard.wtk.ProGuardObfuscator" />
</proguard>
</target>
</project>