Build NeoFreeBird #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build NeoFreeBird | |
on: | |
workflow_dispatch: | |
inputs: | |
decrypted_ipa_url: | |
description: "Direct URL of the decrypted Twitter/X ipa" | |
required: true | |
type: string | |
sdk_version: | |
description: "iOS SDK Version for Theos" | |
default: "16.5" | |
required: true | |
type: string | |
target_version: | |
description: "Target iOS Version for Theos" | |
default: "14.0" | |
required: true | |
type: string | |
repo_commit: | |
description: "(Optional) Commit for main repo (patches)" | |
default: "" | |
required: false | |
type: string | |
tweak_commit: | |
description: "(Optional) Commit for tweak repo" | |
default: "" | |
required: false | |
type: string | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-and-inject: | |
name: Build NeoFreeBird | |
runs-on: macos-13 | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout main repo | |
uses: actions/checkout@v4 | |
with: | |
repository: NeoFreeBird/app | |
path: main | |
ref: ${{ inputs.repo_commit || github.ref }} | |
submodules: recursive | |
- name: Checkout tweak repo (NeoFreeBird/tweak) | |
uses: actions/checkout@v4 | |
with: | |
repository: NeoFreeBird/tweak | |
path: tweak | |
ref: ${{ inputs.tweak_commit || 'refs/heads/master' }} | |
submodules: recursive | |
- name: Install Dependencies | |
run: brew install make dpkg ldid | |
- name: Add GNU Make to PATH | |
run: | | |
echo "$(brew --prefix make)/libexec/gnubin" >> "$GITHUB_PATH" | |
- name: Download Theos | |
uses: actions/checkout@v4 | |
with: | |
repository: theos/theos | |
ref: master | |
path: theos | |
submodules: recursive | |
- name: Install cyan | |
run: pip install https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip | |
- name: Prepare Twitter/X iPA | |
run: | | |
wget "$IPA_URL" --no-verbose -O main/packages/com.atebits.Tweetie2.ipa | |
unzip -q main/packages/com.atebits.Tweetie2.ipa -d main/tmp | |
X_VERSION=$(grep -A 1 '<key>CFBundleShortVersionString</key>' main/tmp/Payload/Twitter.app/Info.plist | | |
grep '<string>' | awk -F'[><]' '{print $3}') | |
echo "X_VERSION=${X_VERSION}" >> "$GITHUB_ENV" | |
echo "$X_VERSION" | |
env: | |
IPA_URL: ${{ inputs.decrypted_ipa_url }} | |
- name: Download iOS SDK | |
if: steps.SDK.outputs.cache-hit != 'true' | |
run: | | |
git clone -n --depth=1 --filter=tree:0 https://github.com/theos/sdks/ | |
cd sdks | |
git sparse-checkout set --no-cone iPhoneOS${{ inputs.sdk_version }}.sdk | |
git checkout | |
mv ./*.sdk "${THEOS}/sdks" | |
env: | |
THEOS: ${{ github.workspace }}/theos | |
- name: Build tweak with Theos | |
run: | | |
cd tweak | |
sed -i '' "s/^TARGET.*$/TARGET := iphone:clang:${{ inputs.sdk_version }}:${{ inputs.target_version }}/" Makefile | |
make package | |
env: | |
THEOS: ${{ github.workspace }}/theos | |
- name: Copy built tweak to main/packages | |
run: | | |
TWEAK_DEB=$(find tweak -type f -name "*.deb" | head -n1) | |
if [ -z "$TWEAK_DEB" ]; then | |
echo "No .deb built in tweak repo (tweak/)" | |
exit 1 | |
fi | |
cp "$TWEAK_DEB" main/packages/ | |
- name: Apply patches and inject tweak | |
run: | | |
# Apply patches to the extracted Twitter.app | |
PATCH_SRC="main/assets/main" | |
if [ -d "${PATCH_SRC}" ]; then | |
rsync -av "${PATCH_SRC}/" main/tmp/Payload/Twitter.app/ | |
fi | |
# Find the .deb file in main/packages | |
DEB_FILE=$(find main/packages -name "*.deb" -type f | head -n1) | |
# Use cyan to inject the tweak | |
cd main/tmp | |
zip -qr ../packages/temp.ipa Payload | |
cd .. | |
cyan -i packages/temp.ipa -f "$DEB_FILE" -o packages/NeoFreeBird_${{ github.run_id }}_${{ env.X_VERSION }}.ipa | |
# Create .tipa copy | |
cp packages/NeoFreeBird_${{ github.run_id }}_${{ env.X_VERSION }}.ipa packages/NeoFreeBird_${{ github.run_id }}_${{ env.X_VERSION }}.tipa | |
- name: Pass package name | |
id: package_name | |
run: | | |
echo "ipa_package=NeoFreeBird_${{ github.run_id }}_${{ env.X_VERSION }}.ipa" >> "$GITHUB_OUTPUT" | |
echo "tipa_package=NeoFreeBird_${{ github.run_id }}_${{ env.X_VERSION }}.tipa" >> "$GITHUB_OUTPUT" | |
- name: Upload IPA | |
uses: actions/upload-artifact@v4 | |
with: | |
name: NeoFreeBird-injected-IPA | |
path: main/packages/${{ steps.package_name.outputs.ipa_package }} | |
if-no-files-found: error | |
- name: Upload TIPA | |
uses: actions/upload-artifact@v4 | |
with: | |
name: NeoFreeBird-injected-TIPA | |
path: main/packages/${{ steps.package_name.outputs.tipa_package }} | |
if-no-files-found: error |