Skip to content

Commit 5e80de6

Browse files
authored
Merge branch 'master' into master
2 parents 083129a + e9bce19 commit 5e80de6

273 files changed

Lines changed: 36087 additions & 1101 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
uses: actions/upload-artifact@v3.1.0
2929
with:
3030
name: Skidfuscator.jar
31-
path: staging/client-1.0.0-SNAPSHOT.jar
31+
path: staging/client-standalone-all.jar

.github/workflows/release.yml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: Update Homebrew Formula
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: "Release tag to update the formula (e.g., 'v2.0.12')"
11+
required: false
12+
default: "2.0.11"
13+
14+
jobs:
15+
update-formula:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Extract version from input or release
19+
id: extract_version
20+
run: |
21+
# Use the provided tag if triggered manually, otherwise use the release tag
22+
if [ "${{ github.event.inputs.tag }}" != "" ]; then
23+
VERSION="${{ github.event.inputs.tag }}"
24+
else
25+
VERSION="${GITHUB_REF#refs/tags/}"
26+
fi
27+
28+
# Normalize by removing a leading 'v' if present
29+
VERSION="${VERSION#v}"
30+
echo "version=$VERSION" >> $GITHUB_OUTPUT
31+
32+
- name: Find jar asset download URL
33+
id: find_asset
34+
run: |
35+
# Get release data from GitHub API
36+
release_data=$(curl -sL -H "Accept: application/vnd.github+json" \
37+
"https://api.github.com/repos/skidfuscatordev/skidfuscator-java-obfuscator/releases/tags/${{ steps.extract_version.outputs.version }}")
38+
39+
# Find the asset named 'skidfuscator.jar' (adjust if needed)
40+
asset_url=$(echo "$release_data" | jq -r '.assets[] | select(.name == "skidfuscator.jar") | .browser_download_url')
41+
42+
if [ -z "$asset_url" ]; then
43+
echo "Could not find skidfuscator.jar in the release."
44+
exit 1
45+
fi
46+
47+
echo "asset_url=$asset_url" >> $GITHUB_OUTPUT
48+
49+
- name: Download jar
50+
run: |
51+
curl -L ${{ steps.find_asset.outputs.asset_url }} -o skidfuscator.jar
52+
53+
- name: Compute SHA256
54+
id: sha256
55+
run: |
56+
SHA256=$(shasum -a 256 skidfuscator.jar | awk '{print $1}')
57+
echo "sha256=$SHA256" >> $GITHUB_OUTPUT
58+
59+
- name: Checkout tap repository
60+
uses: actions/checkout@v3
61+
with:
62+
repository: skidfuscatordev/homebrew-skidfuscator
63+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
64+
ref: master
65+
- name: List Files
66+
run: ls -R
67+
- name: Cleanup and Prepare Formula
68+
run: |
69+
# Ensure Formula directory exists
70+
mkdir -p Formula
71+
72+
# Use absolute path and verify directory exists
73+
FORMULA_DIR="$(pwd)/Formula"
74+
FORMULA_PATH="${FORMULA_DIR}/skidfuscator.rb"
75+
76+
echo "Working directory: $(pwd)"
77+
echo "Formula directory: ${FORMULA_DIR}"
78+
echo "Formula path: ${FORMULA_PATH}"
79+
80+
# Remove any existing formula files
81+
rm -f ${FORMULA_DIR}/skidfuscator*.rb
82+
83+
# Create the new formula file
84+
cat > "${FORMULA_PATH}" << 'EOF'
85+
class Skidfuscator < Formula
86+
desc "A JVM-based obfuscation suite designed for Java and Android bytecode"
87+
homepage "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator"
88+
url "https://github.com/skidfuscatordev/skidfuscator-java-obfuscator/releases/download/2.0.11/skidfuscator.jar"
89+
sha256 "8d5bc1f6854995495a8451417cf5235a31a56d20fc4ce6079b19963ed84c49d9"
90+
version "2.0.11"
91+
license "MIT"
92+
93+
def install
94+
libexec.install Dir["*.jar"]
95+
jar_name = Dir["#{libexec}/*.jar"].first
96+
(bin/"skidfuscator").write <<~EOS
97+
#!/usr/bin/env bash
98+
exec java -jar "#{jar_name}" "$@"
99+
EOS
100+
(bin/"skidfuscator").chmod 0755
101+
end
102+
103+
test do
104+
output = shell_output("#{bin}/skidfuscator --help", 0)
105+
assert_match "Usage", output
106+
end
107+
end
108+
EOF
109+
110+
# Verify file was created
111+
ls -la ${FORMULA_DIR}
112+
113+
# Show file contents
114+
echo "Formula contents:"
115+
cat "${FORMULA_PATH}"
116+
117+
- name: Debug Formula Content
118+
run: |
119+
echo "Formula content:"
120+
cat Formula/skidfuscator.rb || echo "Failed to read formula file"
121+
echo "Git status:"
122+
git status
123+
echo "Directory contents:"
124+
ls -R
125+
126+
- name: Commit and push changes
127+
run: |
128+
git config user.name "github-actions"
129+
git config user.email "github-actions@github.com"
130+
git add Formula/skidfuscator.rb
131+
git commit -m "Update Skidfuscator formula to version 2.0.11"
132+
git push origin HEAD:master
133+
env:
134+
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
135+
136+

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
.idea/*
66
*.iml
77

8+
*.json
89

910
# Maven output
1011
*/target/*
@@ -93,6 +94,16 @@ dev.skidfuscator.obfuscator/src/test/resources/test.jar.compressed.json
9394

9495
dev.skidfuscator.obfuscator/src/test/resources/test.jar.compressed.skid
9596

97+
dev.skidfuscator.obfuscator/out/production/resources/log4j.properties
98+
99+
dev.skidfuscator.obfuscator/out/test/resources/exempt.txt
100+
96101
skidfuscator.log
97102

98103
calculations.txt
104+
105+
dev.skidfuscator.obfuscator/out/test/resources/test.jar.compressed.skid
106+
107+
dev.skidfuscator.obfuscator/out/test/resources/test.jar.compressed.json
108+
109+
dev.skidfuscator.obfuscator/out/test/resources/test.jar.compressed

.gitmodules

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[submodule "dev.xdark.ssvm"]
2+
url = https://github.com/terminalsin/SSVM.git

0 commit comments

Comments
 (0)