add export to c# button

This commit is contained in:
Mystikfluu
2023-04-13 07:10:18 +02:00
parent a1a397d06d
commit 1a20bea369
164 changed files with 14362 additions and 1 deletions
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example"
android:versionCode="1"
android:versionName="1.0">
<application android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:theme="@style/AppTheme">
<activity android:name="HelloWorldActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
@@ -0,0 +1,75 @@
// This build file illustrates how to apply ProGuard in the Android build
// process with AGP < 7, by swapping the built-in version of ProGuard for a newer version.
// This process relies on setting `android.enableR8=false` in `gradle.properties`,
// which is deprecated. For AGP7, please see the `android-plugin` example.
buildscript {
repositories {
mavenLocal() // For local testing
google() // For the Android plugin.
mavenCentral() // For anything else.
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
}
configurations.all {
resolutionStrategy {
// Override the default version of ProGuard with the most recent one.
dependencySubstitution {
substitute module('net.sf.proguard:proguard-gradle') with module('com.guardsquare:proguard-gradle:7.3.0')
}
}
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
defaultConfig {
minSdkVersion 11
targetSdkVersion 28
signingConfig signingConfigs.debug
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
buildTypes {
debug {
minifyEnabled false
shrinkResources false
}
release {
minifyEnabled true
shrinkResources true
proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
proguardFile 'proguard-project.txt'
}
}
}
repositories {
google() // For the Android plugin.
mavenCentral() // For anything else.
}
Binary file not shown.
@@ -0,0 +1,4 @@
# Make sure that we use ProGuard instead of R8.
android.enableR8=false
android.enableR8.libraries=false
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+183
View File
@@ -0,0 +1,183 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"
+100
View File
@@ -0,0 +1,100 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@@ -0,0 +1,127 @@
###############################################################################
# General settings.
###############################################################################
-verbose
# We can debug the ProGuard configuration by instrumenting the code and
# checking the log for feedback. Disable the option again for actual releases!
#-addconfigurationdebugging
# We can also disable the individual processing steps.
#-dontshrink
#-dontoptimize
#-dontobfuscate
# Specifically target Android.
-android
###############################################################################
# Settings to handle reflection in the code.
###############################################################################
# Preserve annotated and generated classes for Dagger.
-keepclassmembers,allowobfuscation class * {
@dagger.** *;
}
-keep class **$$ModuleAdapter
-keep class **$$InjectAdapter
-keep class **$$StaticInjection
-if class **$$ModuleAdapter
-keep class <1>
-if class **$$InjectAdapter
-keep class <1>
-if class **$$StaticInjection
-keep class <1>
-keepnames class dagger.Lazy
# Preserve annotated and generated classes for Butterknife.
-keep class **$$ViewBinder {
public static void bind(...);
public static void unbind(...);
}
-if class **$$ViewBinder
-keep class <1>
-keep class **_ViewBinding {
<init>(<1>, android.view.View);
}
-if class **_ViewBinding
-keep class <1>
# Preserve fields that are serialized with GSON.
#-keepclassmembers class com.example.SerializedClass1,
# com.example.SerializedClass2 {
# <fields>;
#}
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
-keep,allowobfuscation @interface com.google.gson.annotations.**
###############################################################################
# Further optimizations.
###############################################################################
# If you wish, you can let the optimization step remove Android logging calls.
#-assumenosideeffects class android.util.Log {
# public static boolean isLoggable(java.lang.String, int);
# public static int v(...);
# public static int i(...);
# public static int w(...);
# public static int d(...);
# public static int e(...);
#}
# In that case, it's especially useful to also clean up any corresponding
# string concatenation calls.
-assumenoexternalsideeffects class java.lang.StringBuilder {
public java.lang.StringBuilder();
public java.lang.StringBuilder(int);
public java.lang.StringBuilder(java.lang.String);
public java.lang.StringBuilder append(java.lang.Object);
public java.lang.StringBuilder append(java.lang.String);
public java.lang.StringBuilder append(java.lang.StringBuffer);
public java.lang.StringBuilder append(char[]);
public java.lang.StringBuilder append(char[], int, int);
public java.lang.StringBuilder append(boolean);
public java.lang.StringBuilder append(char);
public java.lang.StringBuilder append(int);
public java.lang.StringBuilder append(long);
public java.lang.StringBuilder append(float);
public java.lang.StringBuilder append(double);
public java.lang.String toString();
}
-assumenoexternalreturnvalues class java.lang.StringBuilder {
public java.lang.StringBuilder append(java.lang.Object);
public java.lang.StringBuilder append(java.lang.String);
public java.lang.StringBuilder append(java.lang.StringBuffer);
public java.lang.StringBuilder append(char[]);
public java.lang.StringBuilder append(char[], int, int);
public java.lang.StringBuilder append(boolean);
public java.lang.StringBuilder append(char);
public java.lang.StringBuilder append(int);
public java.lang.StringBuilder append(long);
public java.lang.StringBuilder append(float);
public java.lang.StringBuilder append(double);
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">#4B7FCE</color>
<color name="primary_dark">#4B7FCE</color>
<color name="primary_light">#7BAFCE</color>
<color name="accent">#4B7FCE</color>
</resources>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">HelloWorld Sample</string>
</resources>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">
<item name="android:colorPrimary">@color/primary</item>
<item name="android:colorPrimaryDark">@color/primary_dark</item>
<item name="android:colorAccent">@color/accent</item>
</style>
</resources>
@@ -0,0 +1,29 @@
/*
* Sample application to illustrate processing with ProGuard.
*
* Copyright (c) 2012-2020 Guardsquare NV
*/
package com.example;
import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.widget.TextView;
/**
* Sample activity that displays "Hello world!".
*/
public class HelloWorldActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Display the message.
TextView view = new TextView(this);
view.setText("Hello World");
view.setGravity(Gravity.CENTER);
setContentView(view);
}
}
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example"
android:versionCode="1"
android:versionName="1.0">
<application android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:theme="@style/AppTheme">
<activity android:name="HelloWorldActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
@@ -0,0 +1,73 @@
// This build file illustrates how to apply ProGuard in the Android build
// process, with ProGuard's own plugin instead of the built-in minification
// support of the Android Gradle plugin.
buildscript {
repositories {
mavenLocal() // For local testing
google() // For the Android Gradle plugin.
mavenCentral() // For the ProGuard Gradle Plugin and anything else.
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.3.0'
classpath 'com.android.tools.build:gradle:7.0.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.guardsquare.proguard'
repositories {
google() // For the Android plugin.
mavenCentral() // For anything else.
}
android {
compileSdkVersion 28
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
defaultConfig {
minSdkVersion 11
targetSdkVersion 29
signingConfig signingConfigs.debug
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
buildTypes {
debug {
// Disable the built-in minification
minifyEnabled false
}
release {
// Disable the built-in minification
minifyEnabled false
}
}
}
proguard {
configurations {
release {
defaultConfiguration 'proguard-android-optimize.txt'
configuration 'proguard-project.txt'
}
}
}
Binary file not shown.
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+188
View File
@@ -0,0 +1,188 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
+100
View File
@@ -0,0 +1,100 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@@ -0,0 +1,127 @@
###############################################################################
# General settings.
###############################################################################
-verbose
# We can debug the ProGuard configuration by instrumenting the code and
# checking the log for feedback. Disable the option again for actual releases!
#-addconfigurationdebugging
# We can also disable the individual processing steps.
#-dontshrink
#-dontoptimize
#-dontobfuscate
# Specifically target Android.
-android
###############################################################################
# Settings to handle reflection in the code.
###############################################################################
# Preserve annotated and generated classes for Dagger.
-keepclassmembers,allowobfuscation class * {
@dagger.** *;
}
-keep class **$$ModuleAdapter
-keep class **$$InjectAdapter
-keep class **$$StaticInjection
-if class **$$ModuleAdapter
-keep class <1>
-if class **$$InjectAdapter
-keep class <1>
-if class **$$StaticInjection
-keep class <1>
-keepnames class dagger.Lazy
# Preserve annotated and generated classes for Butterknife.
-keep class **$$ViewBinder {
public static void bind(...);
public static void unbind(...);
}
-if class **$$ViewBinder
-keep class <1>
-keep class **_ViewBinding {
<init>(<1>, android.view.View);
}
-if class **_ViewBinding
-keep class <1>
# Preserve fields that are serialized with GSON.
#-keepclassmembers class com.example.SerializedClass1,
# com.example.SerializedClass2 {
# <fields>;
#}
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
-keep,allowobfuscation @interface com.google.gson.annotations.**
###############################################################################
# Further optimizations.
###############################################################################
# If you wish, you can let the optimization step remove Android logging calls.
#-assumenosideeffects class android.util.Log {
# public static boolean isLoggable(java.lang.String, int);
# public static int v(...);
# public static int i(...);
# public static int w(...);
# public static int d(...);
# public static int e(...);
#}
# In that case, it's especially useful to also clean up any corresponding
# string concatenation calls.
-assumenoexternalsideeffects class java.lang.StringBuilder {
public java.lang.StringBuilder();
public java.lang.StringBuilder(int);
public java.lang.StringBuilder(java.lang.String);
public java.lang.StringBuilder append(java.lang.Object);
public java.lang.StringBuilder append(java.lang.String);
public java.lang.StringBuilder append(java.lang.StringBuffer);
public java.lang.StringBuilder append(char[]);
public java.lang.StringBuilder append(char[], int, int);
public java.lang.StringBuilder append(boolean);
public java.lang.StringBuilder append(char);
public java.lang.StringBuilder append(int);
public java.lang.StringBuilder append(long);
public java.lang.StringBuilder append(float);
public java.lang.StringBuilder append(double);
public java.lang.String toString();
}
-assumenoexternalreturnvalues class java.lang.StringBuilder {
public java.lang.StringBuilder append(java.lang.Object);
public java.lang.StringBuilder append(java.lang.String);
public java.lang.StringBuilder append(java.lang.StringBuffer);
public java.lang.StringBuilder append(char[]);
public java.lang.StringBuilder append(char[], int, int);
public java.lang.StringBuilder append(boolean);
public java.lang.StringBuilder append(char);
public java.lang.StringBuilder append(int);
public java.lang.StringBuilder append(long);
public java.lang.StringBuilder append(float);
public java.lang.StringBuilder append(double);
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">#4B7FCE</color>
<color name="primary_dark">#4B7FCE</color>
<color name="primary_light">#7BAFCE</color>
<color name="accent">#4B7FCE</color>
</resources>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">HelloWorld Sample</string>
</resources>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">
<item name="android:colorPrimary">@color/primary</item>
<item name="android:colorPrimaryDark">@color/primary_dark</item>
<item name="android:colorAccent">@color/accent</item>
</style>
</resources>
@@ -0,0 +1,29 @@
/*
* Sample application to illustrate processing with ProGuard.
*
* Copyright (c) 2012-2020 Guardsquare NV
*/
package com.example;
import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.widget.TextView;
/**
* Sample activity that displays "Hello world!".
*/
public class HelloWorldActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Display the message.
TextView view = new TextView(this);
view.setText("Hello World");
view.setGravity(Gravity.CENTER);
setContentView(view);
}
}
@@ -0,0 +1,65 @@
#
# This ProGuard configuration file illustrates how to use annotations for
# specifying which classes and class members should be kept.
# Usage:
# java -jar proguard.jar @examples.pro
#
# Specify the input, output, and library jars.
# This is assuming the code has been compiled in the examples directory.
-injars examples(*.class)
-outjars out
# Before Java 9, the runtime classes were packaged in a single jar file.
#-libraryjars <java.home>/lib/rt.jar
# As of Java 9, the runtime classes are packaged in modular jmod files.
-libraryjars <java.home>/jmods/java.base.jmod(!**.jar;!module-info.class)
#-libraryjars <java.home>/jmods/.....
# Some important configuration is based on the annotations in the code.
# We have to specify what the annotations mean to ProGuard.
-include lib/annotations.pro
#
# We can then still add any other options that might be useful.
#
# Print out a list of what we're preserving.
-printseeds
# Preserve all annotations themselves.
-keepattributes *Annotation*
# Preserve all native method names and the names of their classes.
-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
# Preserve the special static methods that are required in all enumeration
# classes.
-keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
# Explicitly preserve all serialization members. The Serializable interface
# is only a marker interface, so it wouldn't save them.
# You can comment this out if your application doesn't use serialization.
# If your code contains serializable classes that have to be backward
# compatible, please refer to the manual.
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
@@ -0,0 +1,23 @@
import proguard.annotation.*;
/**
* This applet illustrates the use of annotations for configuring ProGuard.
*
* You can compile it with:
* javac -classpath ../lib/annotations.jar Applet.java
* You can then process it with:
* java -jar ../../../lib/proguard.jar @ ../examples.pro
*
* The annotation will preserve the class and its essential methods,
* as a result of the specifications in lib/annotations.pro.
*/
@Keep
public class Applet extends java.applet.Applet
{
// Implementations for Applet.
public void init()
{
// ...
}
}
@@ -0,0 +1,21 @@
import proguard.annotation.KeepApplication;
/**
* This application illustrates the use of annotations for configuring ProGuard.
*
* You can compile it with:
* javac -classpath ../lib/annotations.jar Application.java
* You can then process it with:
* java -jar ../../../lib/proguard.jar @ ../examples.pro
*
* The annotation will preserve the class and its main method,
* as a result of the specifications in lib/annotations.pro.
*/
@KeepApplication
public class Application
{
public static void main(String[] args)
{
System.out.println("The answer is 42");
}
}
@@ -0,0 +1,57 @@
import proguard.annotation.*;
/**
* This bean illustrates the use of annotations for configuring ProGuard.
*
* You can compile it with:
* javac -classpath ../lib/annotations.jar Bean.java
* You can then process it with:
* java -jar ../../../lib/proguard.jar @ ../examples.pro
*
* The annotations will preserve the class and its public getters and setters,
* as a result of the specifications in lib/annotations.pro.
*/
@Keep
@KeepPublicGettersSetters
public class Bean
{
public boolean booleanProperty;
public int intProperty;
public String stringProperty;
public boolean isBooleanProperty()
{
return booleanProperty;
}
public void setBooleanProperty(boolean booleanProperty)
{
this.booleanProperty = booleanProperty;
}
public int getIntProperty()
{
return intProperty;
}
public void setIntProperty(int intProperty)
{
this.intProperty = intProperty;
}
public String getStringProperty()
{
return stringProperty;
}
public void setStringProperty(String stringProperty)
{
this.stringProperty = stringProperty;
}
}
@@ -0,0 +1,52 @@
import proguard.annotation.*;
/**
* This application illustrates the use of annotations for configuring ProGuard.
*
* You can compile it with:
* javac -classpath ../lib/annotations.jar NativeCallBack.java
* You can then process it with:
* java -jar ../../../lib/proguard.jar @ ../examples.pro
*
* The annotation will preserve the class and its main method,
* as a result of the specifications in lib/annotations.pro.
*/
@KeepApplication
public class NativeCallBack
{
/**
* Suppose this is a native method that computes an answer.
*
* The -keep option for native methods in the regular ProGuard
* configuration will make sure it is not removed or renamed when
* processing this code.
*/
public native int computeAnswer();
/**
* Suppose this method is called back from the above native method.
*
* ProGuard would remove it, because it is not referenced from java.
* The annotation will make sure it is preserved anyhow.
*/
@Keep
public int getAnswer()
{
return 42;
}
/**
* The main entry point of the application.
*
* The @KeepApplication annotation of this class will make sure it is not
* removed or renamed when processing this code.
*/
public static void main(String[] args)
{
int answer = new NativeCallBack().computeAnswer();
System.out.println("The answer is " + answer);
}
}
+89
View File
@@ -0,0 +1,89 @@
<!-- This Ant build file illustrates how to process applets.
Usage: ant -f applets.xml -->
<project name="Applets" default="obfuscate" basedir="../..">
<target name="obfuscate">
<taskdef resource="proguard/ant/task.properties"
classpath="lib/proguard.jar" />
<proguard verbose="true"
printseeds="on"
printmapping="out.map"
renamesourcefileattribute="SourceFile">
<!-- Specify the input jars, output jars, and library jars. -->
<injar file="in.jar" />
<outjar file="out.jar" />
<libraryjar file="${java.home}/lib/rt.jar" />
<!-- Optionally preserve line numbers in the obfuscated stack traces.
<keepattribute name="LineNumberTable">
<keepattribute name="SourceFile">
-->
<!-- Preserve all annotations. -->
<keepattribute name="*Annotation*" />
<!-- Preserve all public applets. -->
<keep access="public" extends="java.applet.Applet" />
<!-- Preserve all native method names and the names of their classes. -->
<keepclasseswithmembernames includedescriptorclasses="true">
<method access="native" />
</keepclasseswithmembernames>
<!-- Preserve the methods that are required in all enumeration classes. -->
<keepclassmembers allowoptimization="true" type="enum">
<method access="public static"
type="**[]"
name="values"
parameters="" />
<method access="public static"
type="**"
name="valueOf"
parameters="java.lang.String" />
</keepclassmembers>
<!-- Explicitly preserve all serialization members. The Serializable
interface is only a marker interface, so it wouldn't save them.
You can comment this out if your library doesn't use serialization.
If your code contains serializable classes that have to be backward
compatible, please refer to the manual. -->
<keepclassmembers implements="java.io.Serializable">
<field access ="static final"
type ="long"
name ="serialVersionUID" />
<field access ="static final"
type ="java.io.ObjectStreamField[]"
name ="serialPersistentFields" />
<method access ="private"
type ="void"
name ="writeObject"
parameters="java.io.ObjectOutputStream" />
<method access ="private"
type ="void"
name ="readObject"
parameters="java.io.ObjectInputStream" />
<method type ="java.lang.Object"
name ="writeReplace"
parameters="" />
<method type ="java.lang.Object"
name ="readResolve"
parameters="" />
</keepclassmembers>
<!-- Your application may contain more items that need to be preserved;
typically classes that are dynamically created using Class.forName -->
</proguard>
</target>
</project>
+15
View File
@@ -0,0 +1,15 @@
<!-- This Ant build file illustrates how to process applications,
by including a ProGuard-style configuration file.
Usage: ant -f applications1.xml -->
<project name="Applications" default="obfuscate" basedir="../..">
<target name="obfuscate">
<taskdef resource="proguard/ant/task.properties"
classpath="lib/proguard.jar" />
<proguard configuration="examples/applications.pro" />
</target>
</project>
+76
View File
@@ -0,0 +1,76 @@
<!-- This Ant build file illustrates how to process applications,
by including ProGuard-style configuration options.
Usage: ant -f applications2.xml -->
<project name="Applications" default="obfuscate" basedir="../..">
<target name="obfuscate">
<taskdef resource="proguard/ant/task.properties"
classpath="lib/proguard.jar" />
<proguard>
-verbose
<!-- Specify the input jars, output jars, and library jars. -->
-injars in.jar
-outjars out.jar
-libraryjars ${java.home}/lib/rt.jar
<!-- -libraryjars junit.jar -->
<!-- -libraryjars servlet.jar -->
<!-- -libraryjars jai_core.jar -->
<!-- ... -->
<!-- Save the obfuscation mapping to a file, and preserve line numbers. -->
-printmapping out.map
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
<!-- Preserve all annotations. -->
-keepattributes *Annotation*
<!-- Preserve all public applications. -->
-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}
<!-- Preserve all native method names and the names of their classes. -->
-keepclasseswithmembernames class * {
native &lt;methods&gt;;
}
<!-- Preserve the methods that are required in all enumeration classes. -->
-keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
<!-- Explicitly preserve all serialization members. The Serializable
interface is only a marker interface, so it wouldn't save them.
You can comment this out if your library doesn't use serialization.
If your code contains serializable classes that have to be backward
compatible, please refer to the manual. -->
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
<!-- Your application may contain more items that need to be preserved;
typically classes that are dynamically created using Class.forName -->
</proguard>
</target>
</project>
+99
View File
@@ -0,0 +1,99 @@
<!-- This Ant build file illustrates how to process applications,
using a full-blown XML configuration.
Usage: ant -f applications3.xml -->
<project name="Applications" default="obfuscate" basedir="../..">
<target name="obfuscate">
<taskdef resource="proguard/ant/task.properties"
classpath="lib/proguard.jar" />
<proguard verbose="true"
printseeds="on"
printmapping="out.map"
renamesourcefileattribute="SourceFile">
<!-- Specify the input jars, output jars, and library jars. -->
<injar file="in.jar" />
<outjar file="out.jar" />
<libraryjar file="${java.home}/lib/rt.jar" />
<!-- libraryjar file="junit.jar" / -->
<!-- libraryjar file="servlet.jar" / -->
<!-- libraryjar file="jai_core.jar" / -->
<!-- ... / -->
<!-- Preserve line numbers in the obfuscated stack traces. -->
<keepattribute name="LineNumberTable" />
<keepattribute name="SourceFile" />
<!-- Preserve all annotations. -->
<keepattribute name="*Annotation*" />
<!-- Preserve all public applications. -->
<keepclasseswithmembers access="public">
<method access ="public static"
type ="void"
name ="main"
parameters="java.lang.String[]" />
</keepclasseswithmembers>
<!-- Preserve all native method names and the names of their classes. -->
<keepclasseswithmembernames includedescriptorclasses="true">
<method access="native" />
</keepclasseswithmembernames>
<!-- Preserve the methods that are required in all enumeration classes. -->
<keepclassmembers allowoptimization="true" type="enum">
<method access="public static"
type="**[]"
name="values"
parameters="" />
<method access="public static"
type="**"
name="valueOf"
parameters="java.lang.String" />
</keepclassmembers>
<!-- Explicitly preserve all serialization members. The Serializable
interface is only a marker interface, so it wouldn't save them.
You can comment this out if your library doesn't use serialization.
If your code contains serializable classes that have to be backward
compatible, please refer to the manual. -->
<keepclassmembers implements="java.io.Serializable">
<field access ="static final"
type ="long"
name ="serialVersionUID" />
<field access ="static final"
type ="java.io.ObjectStreamField[]"
name ="serialPersistentFields" />
<method access ="private"
type ="void"
name ="writeObject"
parameters="java.io.ObjectOutputStream" />
<method access ="private"
type ="void"
name ="readObject"
parameters="java.io.ObjectInputStream" />
<method type ="java.lang.Object"
name ="writeReplace"
parameters="" />
<method type ="java.lang.Object"
name ="readResolve"
parameters="" />
</keepclassmembers>
<!-- Your application may contain more items that need to be preserved;
typically classes that are dynamically created using Class.forName -->
</proguard>
</target>
</project>
+106
View File
@@ -0,0 +1,106 @@
<!-- This Ant build file illustrates how to process a program library,
such that it remains usable as a library.
Usage: ant -f library.xml -->
<project name="Library" default="obfuscate" basedir="../..">
<target name="obfuscate">
<taskdef resource="proguard/ant/task.properties"
classpath="lib/proguard.jar" />
<proguard verbose="true"
printmapping="out.map"
renamesourcefileattribute="SourceFile">
<!-- Specify the input jars, output jars, and library jars. -->
<injar file="library.jar" />
<outjar file="library_out.jar" />
<libraryjar file="${java.home}/lib/rt.jar" />
<!-- Keep some useful attributes. -->
<keepattribute name="Signature" />
<keepattribute name="Exceptions" />
<keepattribute name="InnerClasses" />
<keepattribute name="PermittedSubclasses" />
<keepattribute name="EnclosingMethod" />
<keepattribute name="Deprecated" />
<keepattribute name="SourceFile" />
<keepattribute name="LineNumberTable" />
<!-- Preserve all public classes, and their public and protected fields
and methods. -->
<keep access="public">
<field access="public protected" />
<method access="public protected" />
</keep>
<!-- Preserve all .class method names. -->
<keepclassmembernames access="public">
<method type ="java.lang.Class"
name ="class$"
parameters="java.lang.String" />
<method type ="java.lang.Class"
name ="class$"
parameters="java.lang.String,boolean" />
</keepclassmembernames>
<!-- Preserve all native method names and the names of their classes. -->
<keepclasseswithmembernames includedescriptorclasses="true">
<method access="native" />
</keepclasseswithmembernames>
<!-- Preserve the methods that are required in all enumeration classes. -->
<keepclassmembers allowoptimization="true" type="enum">
<method access="public static"
type="**[]"
name="values"
parameters="" />
<method access="public static"
type="**"
name="valueOf"
parameters="java.lang.String" />
</keepclassmembers>
<!-- Explicitly preserve all serialization members. The Serializable
interface is only a marker interface, so it wouldn't save them.
You can comment this out if your library doesn't use serialization.
If your code contains serializable classes that have to be backward
compatible, please refer to the manual. -->
<keepclassmembers implements="java.io.Serializable">
<field access ="final"
type ="long"
name ="serialVersionUID" />
<field access ="static final"
type ="java.io.ObjectStreamField[]"
name ="serialPersistentFields" />
<method access ="private"
type ="void"
name ="writeObject"
parameters="java.io.ObjectOutputStream" />
<method access ="private"
type ="void"
name ="readObject"
parameters="java.io.ObjectInputStream" />
<method type ="java.lang.Object"
name ="writeReplace"
parameters="" />
<method type ="java.lang.Object"
name ="readResolve"
parameters="" />
</keepclassmembers>
<!-- Your application may contain more items that need to be preserved;
typically classes that are dynamically created using Class.forName -->
</proguard>
</target>
</project>
+53
View File
@@ -0,0 +1,53 @@
<!-- This Ant build file illustrates how to process J2ME midlets.
Usage: ant -f midlets.xml -->
<project name="Midlets" default="obfuscate" basedir="../..">
<target name="obfuscate">
<taskdef resource="proguard/ant/task.properties"
classpath="lib/proguard.jar" />
<proguard verbose="true"
microedition="on"
printseeds="on"
printmapping="out.map"
overloadaggressively="on"
repackageclasses=""
allowaccessmodification="on"
renamesourcefileattribute="SourceFile">
<!-- On Windows, you can't use mixed case class names,
should you still want to use the preverify tool.
usemixedcaseclassnames="false">
-->
<!-- Specify the input jars, output jars, and library jars. -->
<injar file="in.jar" />
<outjar file="out.jar" />
<libraryjar file="/usr/local/java/wtk2.5.2/lib/midpapi20.jar" />
<libraryjar file="/usr/local/java/wtk2.5.2/lib/cldcapi11.jar" />
<!-- Optionally preserve line numbers in the obfuscated stack traces.
<keepattribute name="LineNumberTable">
<keepattribute name="SourceFile">
-->
<!-- Preserve all public midlets. -->
<keep access="public" extends="javax.microedition.midlet.MIDlet" />
<!-- Preserve all native method names and the names of their classes. -->
<keepclasseswithmembernames includedescriptorclasses="true">
<method access="native" />
</keepclasseswithmembernames>
<!-- Your application may contain more items that need to be preserved;
typically classes that are dynamically created using Class.forName -->
</proguard>
</target>
</project>
+109
View File
@@ -0,0 +1,109 @@
<!-- 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>
+89
View File
@@ -0,0 +1,89 @@
<!-- This Ant build file illustrates how to process servlets.
Usage: ant -f servlets.xml -->
<project name="Servlets" default="obfuscate" basedir="../..">
<target name="obfuscate">
<taskdef resource="proguard/ant/task.properties"
classpath="lib/proguard.jar" />
<proguard verbose="true"
printseeds="on"
printmapping="proguard.map"
renamesourcefileattribute="SourceFile">
<!-- Specify the input jars, output jars, and library jars. -->
<injar file="in.jar" />
<outjar file="out.jar" />
<libraryjar file="${java.home}/lib/rt.jar" />
<!-- Optionally preserve line numbers in the obfuscated stack traces.
<keepattribute name="LineNumberTable">
<keepattribute name="SourceFile">
-->
<!-- Preserve all annotations. -->
<keepattribute name="*Annotation*" />
<!-- Keep all public servlets. -->
<keep access="public" implements="javax.servlet.Servlet" />
<!-- Preserve all native method names and the names of their classes. -->
<keepclasseswithmembernames includedescriptorclasses="true">
<method access="native" />
</keepclasseswithmembernames>
<!-- Preserve the methods that are required in all enumeration classes. -->
<keepclassmembers allowoptimization="true" type="enum">
<method access="public static"
type="**[]"
name="values"
parameters="" />
<method access="public static"
type="**"
name="valueOf"
parameters="java.lang.String" />
</keepclassmembers>
<!-- Explicitly preserve all serialization members. The Serializable
interface is only a marker interface, so it wouldn't save them.
You can comment this out if your library doesn't use serialization.
If your code contains serializable classes that have to be backward
compatible, please refer to the manual. -->
<keepclassmembers implements="java.io.Serializable">
<field access ="static final"
type ="long"
name ="serialVersionUID" />
<field access ="static final"
type ="java.io.ObjectStreamField[]"
name ="serialPersistentFields" />
<method access ="private"
type ="void"
name ="writeObject"
parameters="java.io.ObjectOutputStream" />
<method access ="private"
type ="void"
name ="readObject"
parameters="java.io.ObjectInputStream" />
<method type ="java.lang.Object"
name ="writeReplace"
parameters="" />
<method type ="java.lang.Object"
name ="readResolve"
parameters="" />
</keepclassmembers>
<!-- Your application may contain more items that need to be preserved;
typically classes that are dynamically created using Class.forName -->
</proguard>
</target>
</project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="11" />
</component>
</project>
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$USER_HOME$/.sdkman/candidates/gradle/4.10.2" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>
@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="ReplaceUntilWithRangeUntil" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
</profile>
</component>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
</component>
</project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.7.21" />
</component>
</project>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>
+67
View File
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="beb0481a-9fcb-40ec-a128-e9a0bc35ae01" name="Changes" comment="Add simple Kotlin example application" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="DefaultGradleProjectSettings">
<option name="isMigrated" value="true" />
</component>
<component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$">
<ProjectState />
</projectState>
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectId" id="2KGgLM0XNRr9GUCTrjtWmKoLSqY" />
<component name="ProjectViewState">
<option name="autoscrollFromSource" value="true" />
<option name="foldersAlwaysOnTop" value="false" />
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
<option name="showMembers" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"last_opened_file_path": "/home/james/Projects/jlox"
}
}]]></component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$" />
</key>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="beb0481a-9fcb-40ec-a128-e9a0bc35ae01" name="Changes" comment="" />
<created>1673606278294</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1673606278294</updated>
</task>
<task id="LOCAL-00001" summary="Add simple Kotlin example application">
<created>1673610276662</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1673610276662</updated>
</task>
<option name="localTasksCounter" value="2" />
<servers />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Add simple Kotlin example application" />
<option name="LAST_COMMIT_MESSAGE" value="Add simple Kotlin example application" />
</component>
</project>
@@ -0,0 +1,69 @@
import proguard.gradle.ProGuardTask
buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.3.1'
}
}
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.0'
id 'application'
}
group = 'org.example'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.jetbrains.kotlin:kotlin-test'
}
test {
useJUnitPlatform()
}
compileKotlin {
kotlinOptions.jvmTarget = '1.8'
}
compileTestKotlin {
kotlinOptions.jvmTarget = '1.8'
}
application {
mainClassName = 'AppKt'
}
ext.baseCoordinates = "${project.name}-${project.version}"
tasks.register('proguard', ProGuardTask) {
configuration file('proguard.pro')
injars(tasks.named('jar', Jar).flatMap { it.archiveFile })
// Automatically handle the Java version of this build.
if (System.getProperty('java.version').startsWith('1.')) {
// Before Java 9, the runtime classes were packaged in a single jar file.
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
} else {
// As of Java 9, the runtime classes are packaged in modular jmod files.
libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
//libraryjars "${System.getProperty('java.home')}/jmods/....."
}
// This will include the Kotlin library jars
libraryjars sourceSets.main.compileClasspath
verbose
outjars(layout.buildDirectory.file("libs/${baseCoordinates}-minified.jar"))
}
@@ -0,0 +1 @@
kotlin.code.style=official
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+234
View File
@@ -0,0 +1,234 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
+89
View File
@@ -0,0 +1,89 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
+8
View File
@@ -0,0 +1,8 @@
-verbose
-keepattributes *Annotation*
-keep class kotlin.Metadata { *; }
# Entry point to the app.
-keep class com.example.AppKt { *; }
@@ -0,0 +1,3 @@
rootProject.name = 'application-kotlin'
@@ -0,0 +1,9 @@
package com.example
fun main(args: Array<String>) {
println("Hello World!")
// Try adding program arguments via Run/Debug configuration.
// Learn more about running applications: https://www.jetbrains.com/help/idea/running-applications.html.
println("Program arguments: ${args.joinToString()}")
}
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$USER_HOME$/.sdkman/candidates/gradle/4.10.2" />
<option name="gradleJvm" value="openjdk-18" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
</project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>
+60
View File
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="a1af7d33-b76d-4846-ac1c-b7fb8b26f9d9" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/../../docs/md/manual/releasenotes.md" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/md/manual/releasenotes.md" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="DefaultGradleProjectSettings">
<option name="isMigrated" value="true" />
</component>
<component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$">
<ProjectState />
</projectState>
</component>
<component name="ProjectId" id="2KGgOQVwJzrLPY2uSXWiSAvfd8n" />
<component name="ProjectViewState">
<option name="autoscrollFromSource" value="true" />
<option name="foldersAlwaysOnTop" value="false" />
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
<option name="showMembers" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"last_opened_file_path": "/home/james/Projects/kotlin-metadata-printer"
}
}]]></component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="a1af7d33-b76d-4846-ac1c-b7fb8b26f9d9" name="Changes" comment="" />
<created>1673606300818</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1673606300818</updated>
</task>
<servers />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/build.gradle</url>
<line>34</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>
@@ -0,0 +1,53 @@
import proguard.gradle.ProGuardTask
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.3.0'
}
}
plugins {
id 'application'
id 'java'
}
group = 'com.example'
version = '0.0.1'
application {
mainClass.set('com.example.App')
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.google.guava:guava:30.1.1-jre'
}
ext.baseCoordinates = "${project.name}-${project.version}"
tasks.register('proguard', ProGuardTask) {
configuration file('proguard.pro')
injars(tasks.named('jar', Jar).flatMap { it.archiveFile })
// Automatically handle the Java version of this build.
if (System.getProperty('java.version').startsWith('1.')) {
// Before Java 9, the runtime classes were packaged in a single jar file.
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
} else {
// As of Java 9, the runtime classes are packaged in modular jmod files.
libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
//libraryjars "${System.getProperty('java.home')}/jmods/....."
}
verbose
outjars(layout.buildDirectory.file("libs/${baseCoordinates}-minified.jar"))
}
Binary file not shown.
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+185
View File
@@ -0,0 +1,185 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"
+89
View File
@@ -0,0 +1,89 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
+6
View File
@@ -0,0 +1,6 @@
# We only want minification, not obfuscation.
-dontobfuscate
-verbose
# Entry point to the app.
-keep class com.example.App { *; }
@@ -0,0 +1 @@
rootProject.name = 'demo'
@@ -0,0 +1,7 @@
package com.example;
public class App {
public static void main(String... args) {
System.out.println("Hello, world!");
}
}
@@ -0,0 +1,18 @@
#
# This obfuscation dictionary contains strings that are already present
# in many class files. Since these strings can be shared, the resulting
# obfuscated class files will generally be a little bit more compact.
# Usage:
# java -jar proguard.jar ..... -obfuscationdictionary compact.txt
#
Code
V
I
Z
B
C
S
F
D
L
@@ -0,0 +1,58 @@
#
# This obfuscation dictionary contains reserved Java keywords. They can't
# be used in Java source files, but they can be used in compiled class files.
# Note that this hardly improves the obfuscation. Decent decompilers can
# automatically replace reserved keywords, and the effect can fairly simply be
# undone by obfuscating again with simpler names.
# Usage:
# java -jar proguard.jar ..... -obfuscationdictionary keywords.txt
#
do
if
for
int
new
try
byte
case
char
else
goto
long
this
void
break
catch
class
const
final
float
short
super
throw
while
double
import
native
public
return
static
switch
throws
boolean
default
extends
finally
package
private
abstract
continue
strictfp
volatile
interface
protected
transient
implements
instanceof
synchronized
@@ -0,0 +1,23 @@
#
# This obfuscation dictionary contains quotes from plays by Shakespeare.
# It illustrates that any text can be used, for whatever flippant reasons
# one may have.
# Usage:
# java -jar proguard.jar ..... -obfuscationdictionary shakespeare.txt
#
"This thing of darkness I acknowledge mine."
--From The Tempest (V, i, 275-276)
"Though this be madness, yet there is method in 't."
--From Hamlet (II, ii, 206)
"What's in a name? That which we call a rose
By any other word would smell as sweet."
--From Romeo and Juliet (II, ii, 1-2)
+209
View File
@@ -0,0 +1,209 @@
#
# This obfuscation dictionary contains names that are not allowed as file names
# in Windows, not even with extensions like .class or .java. They can however
# be used without problems in jar archives, which just begs to apply them as
# obfuscated class names. Trying to unpack the obfuscated archives in Windows
# will probably generate some sparks.
# Usage:
# java -jar proguard.jar ..... -classobfuscationdictionary windows.txt
# -packageobfuscationdictionary windows.txt
#
aux
Aux
aUx
AUx
auX
AuX
aUX
AUX
AUX
con
Con
cOn
COn
coN
CoN
cON
CON
CON
nul
Nul
nUl
NUl
nuL
NuL
nUL
NUL
NUL
prn
Prn
pRn
PRn
prN
PrN
pRN
PRN
PRN
com1
Com1
cOm1
COm1
coM1
CoM1
cOM1
COM1
COM1
com2
Com2
cOm2
COm2
coM2
CoM2
cOM2
COM2
COM2
com3
Com3
cOm3
COm3
coM3
CoM3
cOM3
COM3
COM3
com4
Com4
cOm4
COm4
coM4
CoM4
cOM4
COM4
COM4
com5
Com5
cOm5
COm5
coM5
CoM5
cOM5
COM5
COM5
com6
Com6
cOm6
COm6
coM6
CoM6
cOM6
COM6
COM6
com7
Com7
cOm7
COm7
coM7
CoM7
cOM7
COM7
COM7
com8
Com8
cOm8
COm8
coM8
CoM8
cOM8
COM8
COM8
com9
Com9
cOm9
COm9
coM9
CoM9
cOM9
COM9
COM9
lpt1
Lpt1
lPt1
LPt1
lpT1
LpT1
lPT1
LPT1
LPT1
lpt2
Lpt2
lPt2
LPt2
lpT2
LpT2
lPT2
LPT2
LPT2
lpt3
Lpt3
lPt3
LPt3
lpT3
LpT3
lPT3
LPT3
LPT3
lpt4
Lpt4
lPt4
LPt4
lpT4
LpT4
lPT4
LPT4
LPT4
lpt5
Lpt5
lPt5
LPt5
lpT5
LpT5
lPT5
LPT5
LPT5
lpt6
Lpt6
lPt6
LPt6
lpT6
LpT6
lPT6
LPT6
LPT6
lpt7
Lpt7
lPt7
LPt7
lpT7
LpT7
lPT7
LPT7
LPT7
lpt8
Lpt8
lPt8
LPt8
lpT8
LpT8
lPT8
LPT8
LPT8
lpt9
Lpt9
lPt9
LPt9
lpT9
LpT9
lPT9
LPT9
LPT9
@@ -0,0 +1,72 @@
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath("com.guardsquare:proguard-gradle:7.3.0")
}
}
plugins {
java
application
}
repositories {
mavenCentral()
}
dependencies {
testImplementation("junit:junit:4.12")
}
application {
mainClassName = "gradlekotlindsl.App"
}
tasks.withType<Jar> {
manifest {
attributes["Main-Class"] = application.mainClassName
}
}
tasks.register<proguard.gradle.ProGuardTask>("proguard") {
verbose()
// Alternatively put your config in a separate file
// configuration("config.pro")
// Use the jar task output as a input jar. This will automatically add the necessary task dependency.
injars(tasks.named("jar"))
outjars("build/proguard-obfuscated.jar")
val javaHome = System.getProperty("java.home")
// Automatically handle the Java version of this build.
if (System.getProperty("java.version").startsWith("1.")) {
// Before Java 9, the runtime classes were packaged in a single jar file.
libraryjars("$javaHome/lib/rt.jar")
} else {
// As of Java 9, the runtime classes are packaged in modular jmod files.
libraryjars(
// filters must be specified first, as a map
mapOf("jarfilter" to "!**.jar",
"filter" to "!module-info.class"),
"$javaHome/jmods/java.base.jmod"
)
}
allowaccessmodification()
repackageclasses("")
printmapping("build/proguard-mapping.txt")
keep("""class gradlekotlindsl.App {
public static void main(java.lang.String[]);
}
""")
}
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+185
View File
@@ -0,0 +1,185 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"
+89
View File
@@ -0,0 +1,89 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@@ -0,0 +1 @@
rootProject.name = "gradle-kotlin-dsl"
@@ -0,0 +1,14 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package gradlekotlindsl;
public class App {
public String getGreeting() {
return "Hello world.";
}
public static void main(String[] args) {
System.out.println(new App().getGreeting());
}
}
@@ -0,0 +1,14 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package gradlekotlindsl;
import org.junit.Test;
import static org.junit.Assert.*;
public class AppTest {
@Test public void testAppHasAGreeting() {
App classUnderTest = new App();
assertNotNull("app should have a greeting", classUnderTest.getGreeting());
}
}
+281
View File
@@ -0,0 +1,281 @@
//
// This Gradle build file illustrates how to process Android
// applications.
//
// If you're using the Android SDK, the provided build systems with Gradle,
// Android Studio, Eclipse, and Ant already take care of the proper settings.
// You only need to enable ProGuard as explained in the Android documentation.
// You can still add project-specific configuration in proguard-project.txt.
//
// This configuration file is for custom, stand-alone builds.
// Usage:
// gradle -b android.gradle proguard
// Tell Gradle where to find the ProGuard task.
buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.0.1'
}
}
// Define a ProGuard task.
task ('proguard', type: proguard.gradle.ProGuardTask) {
// You should probably import a more compact ProGuard-style configuration
// file for all static settings, but we're specifying them all here, for
// the sake of the example.
//configuration 'configuration.pro'
//##############################################################################
// Input and output.
//##############################################################################
// Specify the input jars, output jars, and library jars.
// Note that ProGuard works with Java bytecode (.class),
// before the dex compiler converts it into Dalvik code (.dex).
injars 'classes'
injars 'libs'
outjars 'classes-processed.jar'
libraryjars '/usr/local/android-sdk/platforms/android-27/android.jar'
//libraryjars '/usr/local/java/android-sdk/extras/android/support/v4/android-support-v4.jar'
//libraryjars '/usr/local/java/android-sdk/add-ons/addon-google_apis-google-21/libs/maps.jar'
// ...
// Save the obfuscation mapping to a file, so you can de-obfuscate any stack
// traces later on.
printmapping 'bin/classes-processed.map'
// You can print out the seeds that are matching the keep options below.
//printseeds 'bin/classes-processed.seeds'
//##############################################################################
// General settings.
//##############################################################################
verbose
// We can debug the ProGuard configuration by instrumenting the code and
// checking the log for feedback. Disable the option again for actual releases!
//addconfigurationdebugging
// We can also disable the individual processing steps.
//dontshrink
//dontoptimize
//dontobfuscate
// Specifically target Android.
android
// The dex compiler ignores preverification information.
dontpreverify
// Reduce the size of the output some more.
repackageclasses ''
allowaccessmodification
// Switch off some optimizations that trip older versions of the Dalvik VM.
optimizations '!code/simplification/arithmetic'
// Keep a fixed source file attribute and all line number tables to get line
// numbers in the stack traces.
renamesourcefileattribute 'SourceFile'
keepattributes 'SourceFile,LineNumberTable'
//##############################################################################
// Settings to handle reflection in the code.
//##############################################################################
// RemoteViews might need annotations.
keepattributes '*Annotation*'
// Preserve all fundamental application classes.
keep 'public class * extends android.app.Activity'
keep 'public class * extends android.app.Application'
keep 'public class * extends android.app.Service'
keep 'public class * extends android.content.BroadcastReceiver'
keep 'public class * extends android.content.ContentProvider'
// Preserve all View implementations, their special context constructors, and
// their setters.
keep 'public class * extends android.view.View { \
public <init>(android.content.Context); \
public <init>(android.content.Context, android.util.AttributeSet); \
public <init>(android.content.Context, android.util.AttributeSet, int); \
public void set*(...); \
}'
// Preserve all classes that have special context constructors, and the
// constructors themselves.
keepclasseswithmembers 'class * { \
public <init>(android.content.Context, android.util.AttributeSet); \
}'
// Preserve all classes that have special context constructors, and the
// constructors themselves.
keepclasseswithmembers 'class * { \
public <init>(android.content.Context, android.util.AttributeSet, int); \
}'
// Preserve all possible onClick handlers.
keepclassmembers 'class * extends android.content.Context { \
public void *(android.view.View); \
public void *(android.view.MenuItem); \
}'
// Preserve the special fields of all Parcelable implementations.
keepclassmembers 'class * implements android.os.Parcelable { \
static android.os.Parcelable$Creator CREATOR; \
}'
// Preserve static fields of inner classes of R classes that might be accessed
// through introspection.
keepclassmembers 'class **.R$* { \
public static <fields>; \
}'
// Preserve annotated Javascript interface methods.
keepclassmembers 'class * { \
@android.webkit.JavascriptInterface <methods>; \
}'
// Preserve annotated and generated classes for Dagger.
keepclassmembers allowobfuscation: true, 'class * { \
@dagger.** *; \
}'
keep 'class **$$ModuleAdapter'
keep 'class **$$InjectAdapter'
keep 'class **$$StaticInjection'
keep if: 'class **$$ModuleAdapter', 'class <1>'
keep if: 'class **$$InjectAdapter', 'class <1>'
keep if: 'class **$$StaticInjection', 'class <1>'
keepnames 'class dagger.Lazy'
// Preserve annotated and generated classes for Butterknife.
keep 'class **$$ViewBinder { \
public static void bind(...); \
public static void unbind(...); \
}'
keep if: 'class **$$ViewBinder', 'class <1>'
keep 'class **_ViewBinding { \
<init>(<1>, android.view.View); \
}'
keep if: 'class **_ViewBinding', 'class <1>'
// Preserve fields that are serialized with GSON.
//keepclassmembers 'class com.example.SerializedClass1,'
// com.example.SerializedClass2 {
// <fields>;
//}'
keepclassmembers allowobfuscation: true, 'class * { \
@com.google.gson.annotations.SerializedName <fields>; \
}'
keep allowobfuscation: true, '@interface com.google.gson.annotations.**'
// Preserve the required interface from the License Verification Library
// (but don't nag the developer if the library is not used at all).
keep 'public interface com.android.vending.licensing.ILicensingService'
dontnote 'com.android.vending.licensing.ILicensingService'
// The Android Compatibility library references some classes that may not be
// present in all versions of the API, but we know that's ok.
dontwarn 'android.support.**'
// Preserve all native method names and the names of their classes.
keepclasseswithmembernames includedescriptorclasses: true, 'class * { \
native <methods>; \
}'
// Preserve the special static methods that are required in all enumeration
// classes.
keepclassmembers allowoptimization: true, 'enum * { \
public static **[] values(); \
public static ** valueOf(java.lang.String); \
}'
// Explicitly preserve all serialization members. The Serializable interface
// is only a marker interface, so it wouldn't save them.
// You can comment this out if your application doesn't use serialization.
// If your code contains serializable classes that have to be backward
// compatible, please refer to the manual.
keepclassmembers 'class * implements java.io.Serializable { \
static final long serialVersionUID; \
static final java.io.ObjectStreamField[] serialPersistentFields; \
private void writeObject(java.io.ObjectOutputStream); \
private void readObject(java.io.ObjectInputStream); \
java.lang.Object writeReplace(); \
java.lang.Object readResolve(); \
}'
// Your application may contain more items that need to be preserved;
// typically classes that are dynamically created using Class.forName:
// keep 'public class com.example.MyClass'
// keep 'public interface com.example.MyInterface'
// keep 'public class * implements com.example.MyInterface'
//##############################################################################
// Further optimizations.
//##############################################################################
// If you wish, you can let the optimization step remove Android logging calls.
assumenosideeffects 'class android.util.Log { \
public static boolean isLoggable(java.lang.String, int); \
public static int v(...); \
public static int i(...); \
public static int w(...); \
public static int d(...); \
public static int e(...); \
}'
}
+102
View File
@@ -0,0 +1,102 @@
//
// This Gradle build file illustrates how to process applets.
// Usage:
// gradle -b applets.gradle proguard
//
// Tell Gradle where to find the ProGuard task.
buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.0.1'
}
}
// Define a ProGuard task.
task ('proguard', type: proguard.gradle.ProGuardTask) {
// You should probably import a more compact ProGuard-style configuration
// file for all static settings, but we're specifying them all here, for
// the sake of the example.
//configuration 'configuration.pro'
verbose
// Specify the input jars, output jars, and library jars.
injars 'in.jar'
outjars 'out.jar'
// Automatically handle the Java version of this build.
if (System.getProperty('java.version').startsWith('1.')) {
// Before Java 9, the runtime classes were packaged in a single jar file.
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
} else {
// As of Java 9, the runtime classes are packaged in modular jmod files.
libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod ", jarfilter: '!**.jar', filter: '!module-info.class'
libraryjars "${System.getProperty('java.home')}/jmods/java.desktop.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
}
// Save the obfuscation mapping to a file, so you can de-obfuscate any stack
// traces later on. Keep a fixed source file attribute and all line number
// tables to get line numbers in the stack traces.
// You can comment this out if you're not interested in stack traces.
printmapping 'out.map'
renamesourcefileattribute 'SourceFile'
keepattributes 'SourceFile,LineNumberTable'
// Preserve all annotations.
keepattributes '*Annotation*'
// You can print out the seeds that are matching the keep options below.
//printseeds 'out.seeds'
// Preserve all public applets.
keep 'public class * extends java.applet.Applet'
// Preserve all native method names and the names of their classes.
keepclasseswithmembernames,includedescriptorclasses 'class * { \
native <methods>; \
}'
// Preserve the special static methods that are required in all enumeration
// classes.
keepclassmembers allowoptimization: true, 'enum * { \
public static **[] values(); \
public static ** valueOf(java.lang.String); \
}'
// Explicitly preserve all serialization members. The Serializable interface
// is only a marker interface, so it wouldn't save them.
// You can comment this out if your library doesn't use serialization.
// If your code contains serializable classes that have to be backward
// compatible, please refer to the manual.
keepclassmembers 'class * implements java.io.Serializable { \
static final long serialVersionUID; \
static final java.io.ObjectStreamField[] serialPersistentFields; \
private void writeObject(java.io.ObjectOutputStream); \
private void readObject(java.io.ObjectInputStream); \
java.lang.Object writeReplace(); \
java.lang.Object readResolve(); \
}'
// Your application may contain more items that need to be preserved;
// typically classes that are dynamically created using Class.forName:
// keep 'public class com.example.MyClass'
// keep 'public interface com.example.MyInterface'
// keep 'public class * implements com.example.MyInterface'
}
@@ -0,0 +1,109 @@
//
// This Gradle build file illustrates how to process applications.
// Usage:
// gradle -b applications.gradle proguard
//
// Tell Gradle where to find the ProGuard task.
buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.0.1'
}
}
// Define a ProGuard task.
task ('proguard', type: proguard.gradle.ProGuardTask) {
// You should probably import a more compact ProGuard-style configuration
// file for all static settings, but we're specifying them all here, for
// the sake of the example.
//configuration 'configuration.pro'
verbose
// Specify the input jars, output jars, and library jars.
injars 'in.jar'
outjars 'out.jar'
// Automatically handle the Java version of this build.
if (System.getProperty('java.version').startsWith('1.')) {
// Before Java 9, the runtime classes were packaged in a single jar file.
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
} else {
// As of Java 9, the runtime classes are packaged in modular jmod files.
libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
//libraryjars "${System.getProperty('java.home')}/jmods/....."
}
//libraryjars 'junit.jar'
//libraryjars 'servlet.jar'
//libraryjars 'jai_core.jar'
//...
// Save the obfuscation mapping to a file, so you can de-obfuscate any stack
// traces later on. Keep a fixed source file attribute and all line number
// tables to get line numbers in the stack traces.
// You can comment this out if you're not interested in stack traces.
printmapping 'out.map'
renamesourcefileattribute 'SourceFile'
keepattributes 'SourceFile,LineNumberTable'
// Preserve all annotations.
keepattributes '*Annotation*'
// You can print out the seeds that are matching the keep options below.
//printseeds 'out.seeds'
// Preserve all public applications.
keepclasseswithmembers 'public class * { \
public static void main(java.lang.String[]); \
}'
// Preserve all native method names and the names of their classes.
keepclasseswithmembernames includedescriptorclasses: true, 'class * { \
native <methods>; \
}'
// Preserve the special static methods that are required in all enumeration
// classes.
keepclassmembers allowoptimization: true, 'enum * { \
public static **[] values(); \
public static ** valueOf(java.lang.String); \
}'
// Explicitly preserve all serialization members. The Serializable interface
// is only a marker interface, so it wouldn't save them.
// You can comment this out if your application doesn't use serialization.
// If your code contains serializable classes that have to be backward
// compatible, please refer to the manual.
keepclassmembers 'class * implements java.io.Serializable { \
static final long serialVersionUID; \
static final java.io.ObjectStreamField[] serialPersistentFields; \
private void writeObject(java.io.ObjectOutputStream); \
private void readObject(java.io.ObjectInputStream); \
java.lang.Object writeReplace(); \
java.lang.Object readResolve(); \
}'
// Your application may contain more items that need to be preserved;
// typically classes that are dynamically created using Class.forName:
// keep 'public class com.example.MyClass'
// keep 'public interface com.example.MyInterface'
// keep 'public class * implements com.example.MyInterface'
}
+111
View File
@@ -0,0 +1,111 @@
//
// This Gradle build file illustrates how to process a program
// library, such that it remains usable as a library.
// Usage:
// gradle -b library.gradle proguard
//
// Tell Gradle where to find the ProGuard task.
buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.0.1'
}
}
// Define a ProGuard task.
task ('proguard', type: proguard.gradle.ProGuardTask) {
// You should probably import a more compact ProGuard-style configuration
// file for all static settings, but we're specifying them all here, for
// the sake of the example.
//configuration 'configuration.pro'
verbose
// Specify the input jars, output jars, and library jars.
// In this case, the input jar is the program library that we want to process.
injars 'in.jar'
outjars 'out.jar'
// Automatically handle the Java version of this build.
if (System.getProperty('java.version').startsWith('1.')) {
// Before Java 9, the runtime classes were packaged in a single jar file.
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
} else {
// As of Java 9, the runtime classes are packaged in modular jmod files.
libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
//libraryjars "${System.getProperty('java.home')}/jmods/....."
}
// Save the obfuscation mapping to a file, so we can de-obfuscate any stack
// traces later on. Keep a fixed source file attribute and all line number
// tables to get line numbers in the stack traces.
// You can comment this out if you're not interested in stack traces.
printmapping 'out.map'
keepparameternames
renamesourcefileattribute 'SourceFile'
keepattributes 'Signature,Exceptions,InnerClasses,PermittedSubclasses,EnclosingMethod,Deprecated,SourceFile,LineNumberTable'
// Preserve all annotations.
keepattributes '*Annotation*'
// Preserve all public classes, and their public and protected fields and
// methods.
keep 'public class * { \
public protected *; \
}'
// Preserve all .class method names.
keepclassmembernames 'class * { \
java.lang.Class class$(java.lang.String); \
java.lang.Class class$(java.lang.String, boolean); \
}'
// Preserve all native method names and the names of their classes.
keepclasseswithmembernames includedescriptorclasses: true, 'class * { \
native <methods>; \
}'
// Preserve the special static methods that are required in all enumeration
// classes.
keepclassmembers allowoptimization: true, 'enum * { \
public static **[] values(); \
public static ** valueOf(java.lang.String); \
}'
// Explicitly preserve all serialization members. The Serializable interface
// is only a marker interface, so it wouldn't save them.
// You can comment this out if your library doesn't use serialization.
// If your code contains serializable classes that have to be backward
// compatible, please refer to the manual.
keepclassmembers 'class * implements java.io.Serializable { \
static final long serialVersionUID; \
static final java.io.ObjectStreamField[] serialPersistentFields; \
private void writeObject(java.io.ObjectOutputStream); \
private void readObject(java.io.ObjectInputStream); \
java.lang.Object writeReplace(); \
java.lang.Object readResolve(); \
}'
// Your library may contain more items that need to be preserved;
// typically classes that are dynamically created using Class.forName:
// keep 'public class com.example.MyClass'
// keep 'public interface com.example.MyInterface'
// keep 'public class * implements com.example.MyInterface'
}
+92
View File
@@ -0,0 +1,92 @@
//
// This Gradle build file illustrates how to process J2ME midlets.
// Usage:
// gradle -b midlets.gradle proguard
//
// Tell Gradle where to find the ProGuard task.
buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.0.1'
}
}
// Define a ProGuard task.
task ('proguard', type: proguard.gradle.ProGuardTask) {
// You should probably import a more compact ProGuard-style configuration
// file for all static settings, but we're specifying them all here, for
// the sake of the example.
//configuration 'configuration.pro'
verbose
// Specify the input jars, output jars, and library jars.
injars 'in.jar'
outjars 'out.jar'
libraryjars '/usr/local/java/wtk2.5.2/lib/midpapi20.jar'
libraryjars '/usr/local/java/wtk2.5.2/lib/cldcapi11.jar'
// Preverify the code suitably for Java Micro Edition.
microedition
// Allow methods with the same signature, except for the return type,
// to get the same obfuscation name.
overloadaggressively
// Put all obfuscated classes into the nameless root package.
repackageclasses ''
// Allow classes and class members to be made public.
allowaccessmodification
// On Windows, you can't use mixed case class names,
// should you still want to use the preverify tool.
//
// dontusemixedcaseclassnames
// Save the obfuscation mapping to a file, so you can de-obfuscate any stack
// traces later on.
printmapping 'out.map'
// You can keep a fixed source file attribute and all line number tables to
// get stack traces with line numbers.
//renamesourcefileattribute 'SourceFile'
//keepattributes 'SourceFile,LineNumberTable'
// You can print out the seeds that are matching the keep options below.
//printseeds 'out.seeds'
// Preserve all public midlets.
keep 'public class * extends javax.microedition.midlet.MIDlet'
// Preserve all native method names and the names of their classes.
keepclasseswithmembernames includedescriptorclasses: true, 'class * { \
native <methods>; \
}'
// Your midlet may contain more items that need to be preserved;
// typically classes that are dynamically created using Class.forName:
// keep 'public class com.example.MyClass'
// keep 'public interface com.example.MyInterface'
// keep 'public class * implements com.example.MyInterface'
}
+121
View File
@@ -0,0 +1,121 @@
//
// This Gradle build file illustrates how to process ProGuard itself.
// Configuration files for typical applications will be very similar.
// Usage:
// gradle -b proguard.gradle proguard
//
// Tell Gradle where to find the ProGuard task.
buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.0.1'
}
}
// Define a ProGuard task.
task ('proguard', type: proguard.gradle.ProGuardTask) {
// You should probably import a more compact ProGuard-style configuration
// file for all static settings, but we're specifying them all here, for
// the sake of the example.
//configuration 'configuration.pro'
verbose
// Specify the input jars, output jars, and library jars.
injars '../../lib/proguard.jar'
outjars 'proguard_out.jar'
// Automatically handle the Java version of this build.
if (System.getProperty('java.version').startsWith('1.')) {
// Before Java 9, the runtime classes were packaged in a single jar file.
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
} else {
// As of Java 9, the runtime classes are packaged in modular jmod files.
libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
libraryjars "${System.getProperty('java.home')}/jmods/java.sql.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
//libraryjars "${System.getProperty('java.home')}/jmods/....."
}
// Write out an obfuscation mapping file, for de-obfuscating any stack traces
// later on, or for incremental obfuscation of extensions.
printmapping 'proguard.map'
// Don't print notes about reflection in GSON code, the Kotlin runtime, and
// our own optionally injected code.
dontnote 'kotlin.**'
dontnote 'kotlinx.**'
dontnote 'com.google.gson.**'
dontnote 'proguard.configuration.ConfigurationLogger'
// Preserve injected GSON utility classes and their members.
keep allowobfuscation: true, 'class proguard.optimize.gson._*'
keepclassmembers 'class proguard.optimize.gson._* { \
*; \
}'
// Obfuscate class strings of injected GSON utility classes.
adaptclassstrings 'proguard.optimize.gson.**'
// Allow methods with the same signature, except for the return type,
// to get the same obfuscation name.
overloadaggressively
// Put all obfuscated classes into the nameless root package.
repackageclasses ''
// Allow classes and class members to be made public.
allowaccessmodification
// The entry point: ProGuard and its main method.
keep 'public class proguard.ProGuard { \
public static void main(java.lang.String[]); \
}'
// If you want to preserve the Ant task as well, you'll have to specify the
// main ant.jar.
//libraryjars '/usr/local/java/ant/lib/ant.jar'
//adaptresourcefilecontents 'proguard/ant/task.properties'
//
//keep allowobfuscation: true, 'class proguard.ant.*'
//keepclassmembers 'public class proguard.ant.* { \
// <init>(org.apache.tools.ant.Project); \
// public void set*(***); \
// public void add*(***); \
//}'
// If you want to preserve the Gradle task, you'll have to specify the Gradle
// jars.
//libraryjars '/usr/local/java/gradle-4.2.1/lib/plugins/gradle-plugins-4.2.1.jar'
//libraryjars '/usr/local/java/gradle-4.2.1/lib/gradle-base-services-4.2.1.jar'
//libraryjars '/usr/local/java/gradle-4.2.1/lib/gradle-core-4.2.1.jar'
//libraryjars '/usr/local/java/gradle-4.2.1/lib/groovy-all-2.4.12.jar'
//keep 'public class proguard.gradle.* { \
// public *; \
//}'
// If you want to preserve the WTK obfuscation plug-in, you'll have to specify
// the kenv.zip file.
//libraryjars '/usr/local/java/wtk2.5.2/wtklib/kenv.zip'
//keep 'public class proguard.wtk.ProGuardObfuscator'
}
@@ -0,0 +1,95 @@
//
// This Gradle build file illustrates how to process the ProGuard GUI.
// Configuration files for typical applications will be very similar.
// Usage:
// gradle -b proguardgui.gradle proguard
//
// Tell Gradle where to find the ProGuard task.
buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.0.1'
}
}
// Define a ProGuard task.
task ('proguard', type: proguard.gradle.ProGuardTask) {
// You should probably import a more compact ProGuard-style configuration
// file for all static settings, but we're specifying them all here, for
// the sake of the example.
//configuration 'configuration.pro'
verbose
// Specify the input jars, output jars, and library jars.
// The input jars will be merged in a single output jar.
injars '../../lib/proguardgui.jar'
outjars 'proguardgui_out.jar'
// Automatically handle the Java version of this build.
if (System.getProperty('java.version').startsWith('1.')) {
// Before Java 9, the runtime classes were packaged in a single jar file.
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
} else {
// As of Java 9, the runtime classes are packaged in modular jmod files.
libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
libraryjars "${System.getProperty('java.home')}/jmods/java.sql.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
libraryjars "${System.getProperty('java.home')}/jmods/java.desktop.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
//libraryjars "${System.getProperty('java.home')}/jmods/....."
}
// Write out an obfuscation mapping file, for de-obfuscating any stack traces
// later on, or for incremental obfuscation of extensions.
printmapping 'proguardgui.map'
// If we wanted to reuse the previously obfuscated proguard_out.jar, we could
// perform incremental obfuscation based on its mapping file, and only keep the
// additional GUI files instead of all files.
//applymapping 'proguard.map'
//injars '../../lib/proguardgui.jar'
//outjars 'proguardgui_out.jar'
//libraryjars '../../lib/proguard.jar', filter: '!proguard/ant/**,!proguard/wtk/**'
//libraryjars '../../lib/retrace.jar'
//libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
//libraryjars "${System.getProperty('java.home')}/jmods/java.desktop.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
// Don't print notes about reflection in GSON code, the Kotlin runtime, and
// our own optionally injected code.
dontnote 'kotlin.**'
dontnote 'kotlinx.**'
dontnote 'com.google.gson.**'
dontnote 'proguard.configuration.ConfigurationLogger'
// Allow methods with the same signature, except for the return type,
// to get the same obfuscation name.
overloadaggressively
// Put all obfuscated classes into the nameless root package.
repackageclasses ''
// Adapt the names of resource files, based on the corresponding obfuscated
// class names. Notably, in this case, the GUI resource properties file will
// have to be renamed.
adaptresourcefilenames '**.properties,**.gif,**.jpg'
// The entry point: ProGuardGUI and its main method.
keep 'public class proguard.gui.ProGuardGUI { \
public static void main(java.lang.String[]); \
}'
}
+87
View File
@@ -0,0 +1,87 @@
//
// This Gradle build file illustrates how to process the ReTrace tool.
// Configuration files for typical applications will be very similar.
// Usage:
// gradle -b retrace.gradle proguard
//
// Tell Gradle where to find the ProGuard task.
buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.0.1'
}
}
// Define a ProGuard task.
task ('proguard', type: proguard.gradle.ProGuardTask) {
// You should probably import a more compact ProGuard-style configuration
// file for all static settings, but we're specifying them all here, for
// the sake of the example.
//configuration 'configuration.pro'
verbose
// Specify the input jars, output jars, and library jars.
// The input jars will be merged in a single output jar.
injars '../../lib/retrace.jar'
outjars 'retrace_out.jar'
// Automatically handle the Java version of this build.
if (System.getProperty('java.version').startsWith('1.')) {
// Before Java 9, the runtime classes were packaged in a single jar file.
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
} else {
// As of Java 9, the runtime classes are packaged in modular jmod files.
libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
libraryjars "${System.getProperty('java.home')}/jmods/java.sql.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
//libraryjars "${System.getProperty('java.home')}/jmods/....."
}
// Write out an obfuscation mapping file, for de-obfuscating any stack traces
// later on, or for incremental obfuscation of extensions.
printmapping 'retrace.map'
// If we wanted to reuse the previously obfuscated proguard_out.jar, we could
// perform incremental obfuscation based on its mapping file, and only keep the
// additional ReTrace files instead of all files.
//applymapping 'proguard.map'
//outjars 'retrace_out.jar', filter: 'proguard/retrace/**'
// Don't print notes about reflection in GSON code, the Kotlin runtime, and
// our own optionally injected code.
dontnote 'kotlin.**'
dontnote 'kotlinx.**'
dontnote 'com.google.gson.**'
dontnote 'proguard.configuration.ConfigurationLogger'
// Allow methods with the same signature, except for the return type,
// to get the same obfuscation name.
overloadaggressively
// Put all obfuscated classes into the nameless root package.
repackageclasses ''
// Allow classes and class members to be made public.
allowaccessmodification
// The entry point: ReTrace and its main method.
keep 'public class proguard.retrace.ReTrace { \
public static void main(java.lang.String[]); \
}'
}
+166
View File
@@ -0,0 +1,166 @@
//
// This Gradle build file illustrates how to process Scala
// applications, including the Scala runtime.
// Usage:
// gradle -b scala.gradle proguard
//
// Tell Gradle where to find the ProGuard task.
buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.0.1'
}
}
// Define a ProGuard task.
task ('proguard', type: proguard.gradle.ProGuardTask) {
// You should probably import a more compact ProGuard-style configuration
// file for all static settings, but we're specifying them all here, for
// the sake of the example.
//configuration 'configuration.pro'
verbose
// Specify the input jars, output jars, and library jars.
injars 'in.jar'
injars '/usr/local/java/scala-2.9.1/lib/scala-library.jar'
//injars '/usr/local/java/scala-2.9.1/lib/scala-compiler.jar', filter: '!META-INF/MANIFEST.MF'
//injars '/usr/local/java/scala-2.9.1/lib/jline.jar', filter: '!META-INF/MANIFEST.MF'
outjars 'out.jar'
// Automatically handle the Java version of this build.
if (System.getProperty('java.version').startsWith('1.')) {
// Before Java 9, the runtime classes were packaged in a single jar file.
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
} else {
// As of Java 9, the runtime classes are packaged in modular jmod files.
libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
//libraryjars "${System.getProperty('java.home')}/jmods/....."
}
//libraryjars '/usr/local/java/ant/lib/ant.jar'
//...
// Ignore some compiler artefacts.
dontwarn 'scala.**'
// Save the obfuscation mapping to a file, so you can de-obfuscate any stack
// traces later on. Keep a fixed source file attribute and all line number
// tables to get line numbers in the stack traces.
// You can comment this out if you're not interested in stack traces.
printmapping 'out.map'
renamesourcefileattribute 'SourceFile'
keepattributes 'SourceFile,LineNumberTable'
// Preserve all annotations.
keepattributes '*Annotation*'
// You can print out the seeds that are matching the keep options below.
//printseeds 'out.seeds'
// Preserve all public applications.
keepclasseswithmembers 'public class * { \
public static void main(java.lang.String[]); \
}'
// Preserve some classes and class members that are accessed by means of
// introspection.
keep 'class * implements org.xml.sax.EntityResolver'
keepclassmembers 'class * { \
** MODULE$; \
}'
keepclassmembernames 'class scala.concurrent.forkjoin.ForkJoinPool { \
long eventCount; \
int workerCounts; \
int runControl; \
scala.concurrent.forkjoin.ForkJoinPool$WaitQueueNode syncStack; \
scala.concurrent.forkjoin.ForkJoinPool$WaitQueueNode spareStack; \
}'
keepclassmembernames 'class scala.concurrent.forkjoin.ForkJoinWorkerThread { \
int base; \
int sp; \
int runState; \
}'
keepclassmembernames 'class scala.concurrent.forkjoin.ForkJoinTask { \
int status; \
}'
keepclassmembernames 'class scala.concurrent.forkjoin.LinkedTransferQueue { \
scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference head; \
scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference tail; \
scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference cleanMe; \
}'
// Preserve some classes and class members that are accessed by means of
// introspection in the Scala compiler library, if it is processed as well.
//keep 'class * implements jline.Completor'
//keep 'class * implements jline.Terminal'
//keep 'class scala.tools.nsc.Global'
//keepclasseswithmembers 'class * { \
// <init>(scala.tools.nsc.Global); \
//}'
//keepclassmembers 'class * { \
// *** scala_repl_value(); \
// *** scala_repl_result(); \
//}'
// Preserve all native method names and the names of their classes.
keepclasseswithmembernames includedescriptorclasses: true, 'class * { \
native <methods>; \
}'
// Preserve the special static methods that are required in all enumeration
// classes.
keepclassmembers allowoptimization: true, 'enum * { \
public static **[] values(); \
public static ** valueOf(java.lang.String); \
}'
// Explicitly preserve all serialization members. The Serializable interface
// is only a marker interface, so it wouldn't save them.
// You can comment this out if your application doesn't use serialization.
// If your code contains serializable classes that have to be backward
// compatible, please refer to the manual.
keepclassmembers 'class * implements java.io.Serializable { \
static final long serialVersionUID; \
static final java.io.ObjectStreamField[] serialPersistentFields; \
private void writeObject(java.io.ObjectOutputStream); \
private void readObject(java.io.ObjectInputStream); \
java.lang.Object writeReplace(); \
java.lang.Object readResolve(); \
}'
// Your application may contain more items that need to be preserved;
// typically classes that are dynamically created using Class.forName:
// keep 'public class com.example.MyClass'
// keep 'public interface com.example.MyInterface'
// keep 'public class * implements com.example.MyInterface'
}
+103
View File
@@ -0,0 +1,103 @@
//
// This Gradle build file illustrates how to process servlets.
// Usage:
// gradle -b servlets.gradle proguard
//
// Tell Gradle where to find the ProGuard task.
buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.0.1'
}
}
// Define a ProGuard task.
task ('proguard', type: proguard.gradle.ProGuardTask) {
// You should probably import a more compact ProGuard-style configuration
// file for all static settings, but we're specifying them all here, for
// the sake of the example.
//configuration 'configuration.pro'
verbose
// Specify the input jars, output jars, and library jars.
injars 'in.jar'
outjars 'out.jar'
// Automatically handle the Java version of this build.
if (System.getProperty('java.version').startsWith('1.')) {
// Before Java 9, the runtime classes were packaged in a single jar file.
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
} else {
// As of Java 9, the runtime classes are packaged in modular jmod files.
libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
}
libraryjars '/usr/local/java/servlet/servlet.jar'
// Save the obfuscation mapping to a file, so you can de-obfuscate any stack
// traces later on. Keep a fixed source file attribute and all line number
// tables to get line numbers in the stack traces.
// You can comment this out if you're not interested in stack traces.
printmapping 'out.map'
renamesourcefileattribute 'SourceFile'
keepattributes 'SourceFile,LineNumberTable'
// Preserve all annotations.
keepattributes '*Annotation*'
// You can print out the seeds that are matching the keep options below.
//printseeds 'out.seeds'
// Preserve all public servlets.
keep 'public class * implements javax.servlet.Servlet'
// Preserve all native method names and the names of their classes.
keepclasseswithmembernames includedescriptorclasses: true, 'class * { \
native <methods>; \
}'
// Preserve the special static methods that are required in all enumeration
// classes.
keepclassmembers allowoptimization: true, 'enum * { \
public static **[] values(); \
public static ** valueOf(java.lang.String); \
}'
// Explicitly preserve all serialization members. The Serializable interface
// is only a marker interface, so it wouldn't save them.
// You can comment this out if your library doesn't use serialization.
// If your code contains serializable classes that have to be backward
// compatible, please refer to the manual.
keepclassmembers 'class * implements java.io.Serializable { \
static final long serialVersionUID; \
static final java.io.ObjectStreamField[] serialPersistentFields; \
private void writeObject(java.io.ObjectOutputStream); \
private void readObject(java.io.ObjectInputStream); \
java.lang.Object writeReplace(); \
java.lang.Object readResolve(); \
}'
// Your application may contain more items that need to be preserved;
// typically classes that are dynamically created using Class.forName:
// keep 'public class com.example.MyClass'
// keep 'public interface com.example.MyInterface'
// keep 'public class * implements com.example.MyInterface'
}
+6
View File
@@ -0,0 +1,6 @@
//
// Gradle Settings file, required to test any of the example gradle build files in this directory.
// Invoke Gradle with the `-b` argument to point at a particular build file
//
rootProject.name = "proguard-gradle-examples"
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$USER_HOME$/.sdkman/candidates/gradle/4.10.2" />
<option name="gradleJvm" value="openjdk-18" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
</project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>
+53
View File
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="caca31b7-fab9-4160-950c-8d09afbc6602" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/../application-kotlin/proguard.pro" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/md/manual/releasenotes.md" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/md/manual/releasenotes.md" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="DefaultGradleProjectSettings">
<option name="isMigrated" value="true" />
</component>
<component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$">
<ProjectState />
</projectState>
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectId" id="2KGlCgpAYhponRQWaT3PUnDCPJE" />
<component name="ProjectViewState">
<option name="autoscrollFromSource" value="true" />
<option name="foldersAlwaysOnTop" value="false" />
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
<option name="showMembers" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"last_opened_file_path": "/home/james/Projects/proguard-github/examples/spring-boot"
}
}]]></component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="caca31b7-fab9-4160-950c-8d09afbc6602" name="Changes" comment="" />
<created>1673608674514</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1673608674514</updated>
</task>
<servers />
</component>
</project>
+28
View File
@@ -0,0 +1,28 @@
# Demo Application demonstrating ProGuard applied to a Spring Boot application
## Building
```
./gradlew clean proguard --info
```
Spring Boot applications contain a BOOT-INF folder which contains the application class files and library jars.
We must first extract the program classes, then apply ProGuard to them and finally repackage the application.
## Executing
The unobfuscated application will be located at `build/libs/demo-0.0.1.jar` and the
obfuscated application will be located at `build/libs/demo-0.0.1-obfuscated.jar`.
They can be executed as follows:
```
java -jar build/libs/demo-0.0.1.jar
```
or
```
java -jar build/libs/demo-0.0.1-obfuscated.jar
```
+111
View File
@@ -0,0 +1,111 @@
import proguard.gradle.ProGuardTask
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.3.0'
}
}
plugins {
id 'org.springframework.boot' version '2.3.5.RELEASE'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
}
task extractJar(type: Copy) {
dependsOn tasks.assemble
def zipFile = file("${buildDir}/libs/demo-${version}.jar")
def outputDir = file("${buildDir}/extracted/")
from zipTree(zipFile)
into outputDir
}
task deleteClasses(type: Delete) {
delete "${buildDir}/extracted/BOOT-INF/classes/"
}
task copyObfuscatedClasses(type: Copy) {
dependsOn tasks.deleteClasses
from zipTree("${buildDir}/obfuscatedClasses.jar")
into "${buildDir}/extracted/BOOT-INF/classes/"
}
task deleteObfuscated(type: Delete) {
delete 'build/obfuscatedClasses.jar'
}
task repackage(type: Zip) {
dependsOn tasks.deleteClasses
dependsOn tasks.copyObfuscatedClasses
dependsOn tasks.deleteObfuscated
from "${buildDir}/extracted"
entryCompression ZipEntryCompression.STORED
archiveFileName= "demo-${archiveVersion.get()}-obfuscated.jar"
destinationDirectory = file("${buildDir}/libs")
}
task proguard(type: ProGuardTask) {
dependsOn tasks.extractJar
verbose
injars "${buildDir}/extracted/BOOT-INF/classes"
outjars "${buildDir}/obfuscatedClasses.jar"
// Automatically handle the Java version of this build.
if (System.getProperty('java.version').startsWith('1.')) {
// Before Java 9, the runtime classes were packaged in a single jar file.
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
} else {
// As of Java 9, the runtime classes are packaged in modular jmod files.
libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
//libraryjars "${System.getProperty('java.home')}/jmods/....."
}
// This will contain the Spring dependencies.
libraryjars sourceSets.main.compileClasspath
keepdirectories
// Keep the main class entry point.
keep 'public class com.example.demo.DemoApplication { \
public static void main(java.lang.String[]); \
}'
keepattributes '*Annotation*'
// This simple example requires classes with @Component annotation classes
// to be kept, since otherwise components could end up with clashing names,
// if they do not set the name explicitly.
keep 'public @org.springframework.stereotype.Component class *'
// You may need to keep classes or members based on other annotations such as:
keepclassmembers 'public class * { \
@org.springframework.beans.factory.annotation.Autowired *; \
@org.springframework.beans.factory.annotation.Value *; \
}'
// After ProGuard has executed, repackage the app.
finalizedBy tasks.repackage
}

Some files were not shown because too many files have changed in this diff Show More