Skip to content

Commit

Permalink
refactor: fix gh cli exit code 1 & use pyzule instead of azule and pa…
Browse files Browse the repository at this point in the history
…tcher (#11)

* feat: use pyzule instead of azule

* fix: gh cli throws and exits workflow

* fix: gh cli throws and exits workflow

* feat: get rid of go patcher

* chore: cleanup

* chore: adjust

* chore: cleanup

* chore: trollstore deep link

* chore: add trollstore deep link

* chore: improvement

* chore: additional useful information

* chore: grammar

* chore: cleanup
  • Loading branch information
castdrian authored Jul 1, 2024
1 parent 3b37dce commit f42db38
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 52 deletions.
35 changes: 11 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,22 @@ jobs:

- name: Download Tweak
run: |
set -e
set +e
release_info=$(gh api --header 'Accept: application/vnd.github+json' repos/${{ github.repository }}/releases/latest)
status_code=$(echo $release_info | jq -r ".status")
if [ "$status_code" != "null" ]; then
echo "No releases found or request failed, status code: $status_code"
echo "DEB_DOWNLOADED=false" >> $GITHUB_ENV
exit 0
fi
set -e
release_version=$(echo "$release_info" | jq -r '.assets[] | select(.name | contains("iphoneos-arm.deb")) | .name' | grep -o '_[0-9.]\+_' | tr -d '_')
control_version=$(grep '^Version:' control | cut -d ' ' -f 2)
if [ "$release_version" = "$control_version" ]; then
echo "Versions match. Downloading DEB files..."
echo "$release_info" | jq -r '.assets[] | select(.name | endswith(".deb")) | .browser_download_url' | xargs -I {} curl -L -O {}
Expand Down Expand Up @@ -110,19 +115,11 @@ jobs:
- name: Download Discord IPA
run: |
curl -L -o discord.ipa ${{ github.event.inputs.ipa_url }}
- name: Make patcher directory
run: mkdir patcher

- name: Download IPA patcher
working-directory: patcher
run: |
curl -L -o patcher https://github.com/amsyarasyiq/bunny-ipa-patcher/releases/download/release-pyon/patcher.mac-amd64
chmod +x patcher
- name: Download IPA icons
working-directory: patcher
run: |
curl -L -o ipa-icons.zip https://raw.githubusercontent.com/pyoncord/assets/main/ipa-icons.zip
unzip ipa-icons.zip
- name: Extract Values
run: |
Expand All @@ -135,21 +132,11 @@ jobs:
- name: Inject tweak
run: |
mkdir -p ${{ github.workspace }}/build
git clone https://github.com/Al4ise/Azule.git
./Azule/azule -i discord.ipa -o ${{ github.workspace }}/build -f $(find ${{ github.workspace }} -name 'dev.theos.orion14_*_iphoneos-arm.deb' | head -n 1) ${{ github.workspace }}/${{ env.DEB_FILE_NAME }}
mv "${{ github.workspace }}/build/"*.ipa "${{ github.workspace }}/build/${{ env.APP_NAME }}.ipa"
- name: Patch Discord
working-directory: patcher
run : |
./patcher \
-d ${{ github.workspace }}/build/${{ env.APP_NAME }}.ipa \
-o ${{ github.workspace }}/build/${{ env.APP_NAME }}.ipa \
-i ./ipa-icons.zip
bash -c "$(curl https://raw.githubusercontent.com/asdfzxcvbn/pyzule/main/install-pyzule.sh)"
pyzule -n ${{ env.APP_NAME }} -k PyoncordIcon60x60@2x.png -d -i discord.ipa -o ${{ github.workspace }}/${{ env.APP_NAME }}.ipa -f $(find ${{ github.workspace }} -name 'dev.theos.orion14_*_iphoneos-arm.deb' | head -n 1) ${{ github.workspace }}/${{ env.DEB_FILE_NAME }}
- name: Upload ipa as artifact
uses: actions/upload-artifact@v4
with:
name: ipa
path: ${{ github.workspace }}/build/${{ env.APP_NAME }}.ipa
path: ${{ github.workspace }}/${{ env.APP_NAME }}.ipa
34 changes: 10 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,22 @@ jobs:

- name: Download Tweak
run: |
set -e
set +e
release_info=$(gh api --header 'Accept: application/vnd.github+json' repos/${{ github.repository }}/releases/latest)
status_code=$(echo $release_info | jq -r ".status")
if [ "$status_code" != "null" ]; then
echo "No releases found or request failed, status code: $status_code"
echo "DEB_DOWNLOADED=false" >> $GITHUB_ENV
exit 0
fi
set -e
release_version=$(echo "$release_info" | jq -r '.assets[] | select(.name | contains("iphoneos-arm.deb")) | .name' | grep -o '_[0-9.]\+_' | tr -d '_')
control_version=$(grep '^Version:' control | cut -d ' ' -f 2)
if [ "$release_version" = "$control_version" ]; then
echo "Versions match. Downloading DEB files..."
echo "$release_info" | jq -r '.assets[] | select(.name | endswith(".deb")) | .browser_download_url' | xargs -I {} curl -L -O {}
Expand Down Expand Up @@ -111,19 +116,10 @@ jobs:
run: |
curl -L -o discord.ipa ${{ github.event.inputs.ipa_url }}
- name: Make patcher directory
run: mkdir patcher

- name: Download IPA patcher
working-directory: patcher
run: |
curl -L -o patcher https://github.com/amsyarasyiq/bunny-ipa-patcher/releases/download/release-pyon/patcher.mac-amd64
chmod +x patcher
- name: Download IPA icons
working-directory: patcher
run: |
curl -L -o ipa-icons.zip https://raw.githubusercontent.com/pyoncord/assets/main/ipa-icons.zip
unzip ipa-icons.zip
- name: Extract Values
run: |
Expand All @@ -138,24 +134,14 @@ jobs:
- name: Inject tweak
run: |
mkdir -p ${{ github.workspace }}/build
git clone https://github.com/Al4ise/Azule.git
./Azule/azule -i discord.ipa -o ${{ github.workspace }}/build -f $(find ${{ github.workspace }} -name 'dev.theos.orion14_*_iphoneos-arm.deb' | head -n 1) ${{ github.workspace }}/${{ env.DEB_FILE_NAME }}
mv "${{ github.workspace }}/build/"*.ipa "${{ github.workspace }}/build/${{ env.APP_NAME }}.ipa"
- name: Patch Discord
working-directory: patcher
run : |
./patcher \
-d ${{ github.workspace }}/build/${{ env.APP_NAME }}.ipa \
-o ${{ github.workspace }}/build/${{ env.APP_NAME }}.ipa \
-i ./ipa-icons.zip
bash -c "$(curl https://raw.githubusercontent.com/asdfzxcvbn/pyzule/main/install-pyzule.sh)"
pyzule -n ${{ env.APP_NAME }} -k PyoncordIcon60x60@2x.png -d -i discord.ipa -o ${{ github.workspace }}/${{ env.APP_NAME }}.ipa -f $(find ${{ github.workspace }} -name 'dev.theos.orion14_*_iphoneos-arm.deb' | head -n 1) ${{ github.workspace }}/${{ env.DEB_FILE_NAME }}
- name: Upload ipa as artifact
uses: actions/upload-artifact@v4
with:
name: ipa
path: ${{ github.workspace }}/build/${{ env.APP_NAME }}.ipa
path: ${{ github.workspace }}/${{ env.APP_NAME }}.ipa

release-app:
runs-on: macos-14
Expand Down
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# BunnyTweak

A rootful/rootless tweak to inject [Bunny](https://github.com/pyoncord/Bunny) into Discord. Forked [VendettaTweak](https://github.com/vendetta-mod/VendettaTweak), modified to match with [BunnyXposed](https://github.com/pyoncord/BunnyXposed) behavior. There are still slight differences between these two, and this tweak may be missing some loader features.
Tweak to inject [Bunny](https://github.com/pyoncord/Bunny) into Discord. Forked [VendettaTweak](https://github.com/vendetta-mod/VendettaTweak), modified to match with [BunnyXposed](https://github.com/pyoncord/BunnyXposed) behavior. There are still slight differences between these two, and this tweak may be missing some loader features.

> [!NOTE]
> As of right now this tweak does not encompass some functionalities when running in a jailed environment with a wildcard certificate \
> If you value these features sign the application with a local dev certificate:
> - setAlternateAppIcon does not work, thus breaking dynamic app icons
> - sharing files to the application/selecting items via the Files app does not work
## Installation

Expand All @@ -10,16 +16,20 @@ Builds can be found in the [Releases](https://github.com/pyoncord/BunnyTweak/rel
> Raw decrypted IPAs which are used to provide prepatched IPAs are sourced from the [Enmity](https://github.com/enmity-mod/) community. These raw decrypted IPAs are also used throughout Enmity related projects such as [enmity-mod/tweak](https://github.com/enmity-mod/tweak/) and [acquitelol/rosiecord](https://github.com/acquitelol/rosiecord).\
> All credits are attributed to the owner(s) of the raw IPAs.
### Jailbroken (Rootful/Rootless)
### Jailbroken

1. Install the Orion runtime via your preferred package manager, by adding `https://repo.chariz.com/` to your sources, then finding `Orion Runtime`.
1. Install Bunny by downloading the appropriate `.deb` file (or by building your own, see [Building BunnyTweak locally](#building-bunnytweak-locally)). Use the file ending in `arm.deb` for rootful jailbreaks, and the file ending in `arm64.deb` for rootless jailbreaks.
1. Install Bunny by downloading the appropriate Debian package (or by building your own, see [Building BunnyTweak locally](#building-bunnytweak-locally)) and adding it to your package manager. Use the file ending in `arm.deb` for rootful jailbreaks, and the file ending in `arm64.deb` for rootless jailbreaks.

### Jailed

<a href="https://tinyurl.com/24zjszuf"><img src="https://i.imgur.com/dsbDLK9.png" width="230"></a>
<a href="https://tinyurl.com/yh455zk6"><img src="https://i.imgur.com/46qhEAv.png" width="230"></a>

1. Download and install `Bunny.ipa` using your preferred sideloading method.
> [!NOTE]
> TrollStore may display an encryption warning, which you can disregard.
1. Download and install [Bunny.ipa](https://github.com/pyoncord/BunnyTweak/releases/latest/download/Bunny.ipa) using your preferred sideloading method.

## Building BunnyTweak locally

Expand Down

0 comments on commit f42db38

Please sign in to comment.