forked from dayanch96/Glow
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (89 loc) · 3.53 KB
/
main.yml
File metadata and controls
112 lines (89 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Create Glow for Facebook app
on:
workflow_dispatch:
inputs:
ipa_url:
description: "URL to the decrypted IPA file"
default: ""
required: true
type: string
display_name:
description: "App Name (Optional)"
default: "Facebook"
required: true
type: string
bundle_id:
description: "BundleID (Optional)"
default: "com.facebook.Facebook"
required: true
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name:
runs-on: macos-latest
permissions:
contents: write
steps:
- name: Checkout Main
uses: actions/checkout@v4.1.1
with:
path: main
submodules: recursive
- name: Hide sensitive inputs
uses: levibostian/action-hide-sensitive-inputs@v1
with:
exclude_inputs: display_name,bundle_id
- name: Download and validate IPA
run: |
wget "${{ inputs.ipa_url }}" --no-verbose -O ${{ github.workspace }}/facebook.ipa
file_type=$(file --mime-type -b ${{ github.workspace }}/facebook.ipa)
if [[ "$file_type" != "application/x-ios-app" && "$file_type" != "application/zip" ]]; then
echo "::error::Validation failed: The downloaded file is not a valid IPA. Detected type: $file_type."
exit 1
fi
- name: Install Dependencies
run: brew install make ldid
- name: Set PATH environment variable
run: echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH
- name: Install cyan
run: pipx install --force https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip
- name: Download Glow for Facebook
id: download_glow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
api_url="https://api.github.com/repos/dayanch96/Glow/releases/latest"
# Workaround
curl -s -H "Authorization: Bearer $GITHUB_TOKEN" "$api_url" > /dev/null
response=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" "$api_url")
tag_name=$(echo "$response" | jq -r '.tag_name')
deb_url=$(echo "$response" | jq -r '.assets[0].browser_download_url')
if [[ "$deb_url" == "null" || -z "$deb_url" ]]; then
echo "::error::Failed to get tweak URL from Github API"
exit 1
fi
echo "GLOW_TAG=$tag_name" >> $GITHUB_ENV
echo "Downloading: $deb_url"
wget "$deb_url" --no-verbose -O ${{ github.workspace }}/glow_fb.deb
- name: Inject tweaks into IPA
run: cyan -i facebook.ipa -o Glow_FB_${{ env.GLOW_TAG }}.ipa -uwef glow_fb.deb -n "${{ inputs.display_name }}" -b ${{ inputs.bundle_id }} -s
- name: Strip embedded Swift dylibs
run: |
unzip -q Glow_FB_${{ env.GLOW_TAG }}.ipa -d tmp_payload
find tmp_payload/Payload/*.app/ -name "libswift*.dylib" -print -delete
cd tmp_payload
zip -qr ../Glow_FB_${{ env.GLOW_TAG }}_clean.ipa Payload
cd ..
mv Glow_FB_${{ env.GLOW_TAG }}_clean.ipa Glow_FB_${{ env.GLOW_TAG }}.ipa
- uses: softprops/action-gh-release@v2.0.1
with:
tag_name: glow-fb-${{ env.GLOW_TAG }}
name: Glow_FB ${{ env.GLOW_TAG }}
files: Glow_FB_${{ env.GLOW_TAG }}.ipa
draft: true
- name: Output Release URL
run: |
echo "::notice::Release available at: https://github.com/${{ github.repository }}/releases"