Skip to content

Inject Deb Into IPA #27

Inject Deb Into IPA

Inject Deb Into IPA #27

Workflow file for this run

# I modified the github action from @arichornlover 's uYouEnhanced repo, but the original idea is by @ISnackable. Thanks to both of them!
# https://github.com/ISnackable/YTCubePlus/blob/main/.github/workflows/Build.yml
name: Inject Deb Into IPA
on:
workflow_dispatch:
inputs:
sdk_version:
description: "iOS SDK version to be used during build (don't change it if you don't know what you are doing)"
default: "16.2"
required: true
type: string
decrypted_ipa_url:
description: "The direct URL to the decrypted IPA"
default: ""
required: true
type: string
deb1_url:
description: "The direct URL to the Tweak deb 1"
default: ""
required: false
type: string
deb1_url_choose:
description: "Using Deb 1"
default: true
required: false
type: boolean
deb2_url:
description: "The direct URL to the Tweak deb 2"
default: ""
required: false
type: string
deb2_url_choose:
description: "Using Deb 2"
default: false
required: false
type: boolean
deb3_url:
description: "The direct URL to the Tweak deb 3"
default: ""
required: false
type: string
deb3_url_choose:
description: "Using Deb 3"
default: false
required: false
type: boolean
remove_watch:
description: "Remove Watch folder?"
default: true
required: false
type: boolean
remove_plugins:
description: "Remove PlugIns folder?"
default: true
required: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Inject Deb Into IPA
runs-on: macos-12
permissions:
contents: write
steps:
- name: Checkout Main
uses: actions/[email protected]
with:
path: main
submodules: recursive
- name: Install Dependencies
run: brew install ldid dpkg make
- name: Set PATH environment variable
run: echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH
- name: Setup Theos
uses: actions/[email protected]
with:
repository: theos/theos
ref: 4bcc52914e0eeca719288522938185decaa8a1cb
path: theos
submodules: recursive
- name: SDK Caching
id: SDK
uses: actions/[email protected]
env:
cache-name: iOS-${{ inputs.sdk_version }}-SDK
with:
path: theos/sdks/
key: ${{ env.cache-name }}
restore-keys: ${{ env.cache-name }}
- name: Download iOS SDK
if: steps.SDK.outputs.cache-hit != 'true'
run: |
git clone --quiet -n --depth=1 --filter=tree:0 https://github.com/thaibm92/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: Setup Theos Jailed
uses: actions/[email protected]
with:
repository: qnblackcat/theos-jailed
ref: master
path: theos-jailed
submodules: recursive
- name: Install Theos Jailed
run: |
./theos-jailed/install
env:
THEOS: ${{ github.workspace }}/theos
- name: Install Azule
run: |
cd ${{ github.workspace }}/main
git clone https://github.com/Al4ise/Azule
sudo ln -sf ~/Azule/azule /usr/local/bin/azule
- name: Downloading IPA
run: |
wget "$IPA_URL" --no-verbose -O main/IPA.ipa
env:
IPA_URL: ${{ inputs.decrypted_ipa_url }}
- name: Downloading DEB1
if: ${{ inputs.deb1_url_choose }}
run: |
wget "$DEB1_URL" --no-verbose -O main/packages/DEB1.deb
env:
DEB1_URL: ${{ inputs.deb1_url }}
- name: Downloading DEB2
if: ${{ inputs.deb2_url_choose }}
run: |
wget "$DEB2_URL" --no-verbose -O main/packages/DEB2.deb
env:
DEB2_URL: ${{ inputs.deb2_url }}
- name: Downloading DEB3
if: ${{ inputs.deb3_url_choose }}
run: |
wget "$DEB3_URL" --no-verbose -O main/packages/DEB3.deb
env:
DEB3_URL: ${{ inputs.deb3_url }}
- name: Inject tweak into provided IPA
run: |
brew install coreutils
cd ${{ github.workspace }}/main
./Azule/azule -i $PWD/IPA.ipa -o $PWD/packages/IPA_OUT.ipa -f $PWD/packages/*.deb
- name: Unzip IPA
id: unzip_ipa
run: |
mv main/packages/IPA_OUT.ipa main/packages/IPA_OUT.zip
unzip -q main/packages/IPA_OUT.zip -d main/packages
APP_NAME=$(plutil -extract CFBundleName xml1 -o - main/packages/Payload/*.app/Info.plist | xmllint --xpath 'string(//plist/string)' -)
rm -rf main/packages/Payload/*.app/_CodeSignature/CodeResources
echo "ipa_name=${APP_NAME}" >> $GITHUB_OUTPUT
echo "==> App $APP_NAME Unziped!"
- name: Remove Watch Folder
if: ${{ inputs.remove_watch }}
run: |
cd ${{ github.workspace }}/main/packages/Payload/*.app
rm -rf Watch
echo "==> Removed Watch folder"
- name: Remove PlugIns Folder
if: ${{ inputs.remove_plugins }}
run: |
cd ${{ github.workspace }}/main/packages/Payload/*.app
rm -rf PlugIns/*
echo "==> Removed PlugIns folder"
- name: Zip IPA
run: |
cd ${{ github.workspace }}/main/packages
zip -r ${{steps.unzip_ipa.outputs.ipa_name}}_injected.ipa Payload > /dev/null
echo "==> ${{steps.unzip_ipa.outputs.ipa_name}}_injected.ipa Ziped!"
- name: Upload Artifact
uses: actions/[email protected]
with:
name: ${{steps.unzip_ipa.outputs.ipa_name}}_injected
path: |
main/packages/${{steps.unzip_ipa.outputs.ipa_name}}_injected.ipa
if-no-files-found: error
- name: Upload Artifact to Catbox
run: |
RESPONSE_IPA=$(curl -F "reqtype=fileupload" -F "fileToUpload=@main/packages/${{steps.unzip_ipa.outputs.ipa_name}}_injected.ipa" https://catbox.moe/user/api.php)
CATBOX_URL_IPA=$(echo $RESPONSE_IPA | grep -o -E 'https://files.catbox.moe/[^"]*')
echo "Uploaded .ipa artifact to $CATBOX_URL_IPA"
- name: Create Release
id: create_release
uses: softprops/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRAFT: ${{ inputs.create_release }}
with:
tag_name: ${{steps.unzip_ipa.outputs.ipa_name}}_injected
name: ${{steps.unzip_ipa.outputs.ipa_name}}_injected
files: |
main/packages/${{steps.unzip_ipa.outputs.ipa_name}}_injected.ipa
draft: ${{ env.DRAFT }}