From ffa11faec4d8048fe69a3ac547ec145d8b29a4ea Mon Sep 17 00:00:00 2001 From: Shanyu Thibaut Juneja Date: Fri, 6 Dec 2024 22:37:42 -0500 Subject: [PATCH] feat: add examples --- .gitignore | 1 + examples/default-exemption/config.hocon | 51 +++++++++++++++++++++++ examples/default-exemption/start.sh | 25 +++++++++++ examples/default-no-config/start.sh | 25 +++++++++++ examples/default-with-config/config.hocon | 49 ++++++++++++++++++++++ examples/default-with-config/start.sh | 25 +++++++++++ 6 files changed, 176 insertions(+) create mode 100644 examples/default-exemption/config.hocon create mode 100644 examples/default-exemption/start.sh create mode 100644 examples/default-no-config/start.sh create mode 100644 examples/default-with-config/config.hocon create mode 100644 examples/default-with-config/start.sh diff --git a/.gitignore b/.gitignore index 89b6855..a452024 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ .idea/* *.iml +*.json # Maven output */target/* diff --git a/examples/default-exemption/config.hocon b/examples/default-exemption/config.hocon new file mode 100644 index 0000000..d2d07d1 --- /dev/null +++ b/examples/default-exemption/config.hocon @@ -0,0 +1,51 @@ +exempt: [ + "class{^codes\\/som\\/oof4j\\/fizzbuzz\\/enterprise}" +] + +libs: [] + +interprocedural: { + enabled: true + exempt: [] +} + +stringEncryption { + type: STANDARD + enabled: true + exempt: [] +} + +numberEncryption { + enabled: true + exempt: [] +} + +flowCondition { + enabled: true + exempt: [] +} + +flowException { + enabled: true + strength: AGGRESSIVE + exempt: [] +} + +flowRange { + enabled: true + exempt: [] +} + +flowSwitch { + enabled: true + exempt: [] +} + +ahegao { + enabled: true + exempt: [] +} + +driver: { + enabled: false +} \ No newline at end of file diff --git a/examples/default-exemption/start.sh b/examples/default-exemption/start.sh new file mode 100644 index 0000000..d29b1af --- /dev/null +++ b/examples/default-exemption/start.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Check if curl is installed +if ! command -v curl &> /dev/null +then + echo "curl could not be found. Please install curl to proceed." + exit 1 +fi + +# Get the latest release tag from GitHub +LATEST_TAG=$(curl -s https://api.github.com/repos/skidfuscatordev/skidfuscator-java-obfuscator/releases/latest | grep 'tag_name' | cut -d\" -f4) + +# Download the latest Skidfuscator jar file +echo "Downloading the latest Skidfuscator jar..." +curl -L -o Skidfuscator.Community.$LATEST_TAG.jar https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/releases/download/$LATEST_TAG/Skidfuscator.Community.$LATEST_TAG.jar + +# Download the obfuscation tester jar +echo "Downloading the obfuscation tester jar..." +curl -L -o obf-test-1.0-SNAPSHOT.jar https://github.com/sim0n/jvm-obfuscation-tester/releases/download/1.0.0/obf-test-1.0-SNAPSHOT.jar + +# Run the main skidfuscator command +echo "Running the main skidfuscator command..." +java -jar Skidfuscator.Community.$LATEST_TAG.jar obfuscate obf-test-1.0-SNAPSHOT.jar --config config.hocon + +echo "Process completed." \ No newline at end of file diff --git a/examples/default-no-config/start.sh b/examples/default-no-config/start.sh new file mode 100644 index 0000000..b91642b --- /dev/null +++ b/examples/default-no-config/start.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Check if curl is installed +if ! command -v curl &> /dev/null +then + echo "curl could not be found. Please install curl to proceed." + exit 1 +fi + +# Get the latest release tag from GitHub +LATEST_TAG=$(curl -s https://api.github.com/repos/skidfuscatordev/skidfuscator-java-obfuscator/releases/latest | grep 'tag_name' | cut -d\" -f4) + +# Download the latest Skidfuscator jar file +echo "Downloading the latest Skidfuscator jar..." +curl -L -o Skidfuscator.Community.$LATEST_TAG.jar https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/releases/download/$LATEST_TAG/Skidfuscator.Community.$LATEST_TAG.jar + +# Download the obfuscation tester jar +echo "Downloading the obfuscation tester jar..." +curl -L -o obf-test-1.0-SNAPSHOT.jar https://github.com/sim0n/jvm-obfuscation-tester/releases/download/1.0.0/obf-test-1.0-SNAPSHOT.jar + +# Run the main skidfuscator command +echo "Running the main skidfuscator command..." +java -jar Skidfuscator.Community.$LATEST_TAG.jar obfuscate obf-test-1.0-SNAPSHOT.jar + +echo "Process completed." \ No newline at end of file diff --git a/examples/default-with-config/config.hocon b/examples/default-with-config/config.hocon new file mode 100644 index 0000000..ab163e6 --- /dev/null +++ b/examples/default-with-config/config.hocon @@ -0,0 +1,49 @@ +exempt: [] + +libs: [] + +interprocedural: { + enabled: true + exempt: [] +} + +stringEncryption { + type: STANDARD + enabled: true + exempt: [] +} + +numberEncryption { + enabled: true + exempt: [] +} + +flowCondition { + enabled: true + exempt: [] +} + +flowException { + enabled: true + strength: AGGRESSIVE + exempt: [] +} + +flowRange { + enabled: true + exempt: [] +} + +flowSwitch { + enabled: true + exempt: [] +} + +ahegao { + enabled: true + exempt: [] +} + +driver: { + enabled: false +} \ No newline at end of file diff --git a/examples/default-with-config/start.sh b/examples/default-with-config/start.sh new file mode 100644 index 0000000..d29b1af --- /dev/null +++ b/examples/default-with-config/start.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Check if curl is installed +if ! command -v curl &> /dev/null +then + echo "curl could not be found. Please install curl to proceed." + exit 1 +fi + +# Get the latest release tag from GitHub +LATEST_TAG=$(curl -s https://api.github.com/repos/skidfuscatordev/skidfuscator-java-obfuscator/releases/latest | grep 'tag_name' | cut -d\" -f4) + +# Download the latest Skidfuscator jar file +echo "Downloading the latest Skidfuscator jar..." +curl -L -o Skidfuscator.Community.$LATEST_TAG.jar https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/releases/download/$LATEST_TAG/Skidfuscator.Community.$LATEST_TAG.jar + +# Download the obfuscation tester jar +echo "Downloading the obfuscation tester jar..." +curl -L -o obf-test-1.0-SNAPSHOT.jar https://github.com/sim0n/jvm-obfuscation-tester/releases/download/1.0.0/obf-test-1.0-SNAPSHOT.jar + +# Run the main skidfuscator command +echo "Running the main skidfuscator command..." +java -jar Skidfuscator.Community.$LATEST_TAG.jar obfuscate obf-test-1.0-SNAPSHOT.jar --config config.hocon + +echo "Process completed." \ No newline at end of file