Unify patch scripts and add output options

This commit is contained in:
√(noham)²
2026-08-01 14:15:04 +02:00
parent 81ab62324c
commit ec1b0a17f0
4 changed files with 64 additions and 80 deletions

1
.gitignore vendored
View File

@@ -4,3 +4,4 @@ Build.md
/PineHeartsUnlock
/App
/GoodnotesPro
/StravaPremium

View File

@@ -4,18 +4,21 @@ iOS tweaks built with [Theos](https://theos.dev), injected into IPAs via [cyan](
## Tweaks
| Tweak | App | Target |
| ------------------------------------------------------- | ---------------- | ---------- |
| [ServerCatPremium](ServerCatPremium/index.md) | ServerCat 1.30.0 / 1.6.4 | iOS 15+ |
| [TextasticPro](TextasticPro/index.md) | Textastic 10.9.2 | iOS 18+ |
| [BusinessJB](BusinessJB/index.md) | Business 2.3.000 | iOS 15 |
| [CreditAgricoleJB](CreditAgricoleJB/index.md) | Ma Banque 47.0.0 | iOS 15.8.6 |
| [Infuse](Infuse/Infuse-tvOS/index.md) | Infuse 8.2.4 | tvOS 18.3 |
| [Infuse (iOS)](Infuse/Infuse-iOS/index.md) | Infuse 8.4.2 | iOS 18+ |
| [TF1+ (tvOS)](TF1Plus/TF1Plus-tvOS/index.md) | TF1+ 11.36.0 | tvOS |
| [TF1+ (iOS)](TF1Plus/TF1Plus-iOS/index.md) | TF1+ 11.36.0 | iOS 14+ |
| [OqeePlus (tvOS)](OqeePlus/OqeePlus-tvOS/index.md) | Oqee 2.40 | tvOS 18.3 |
| [OqeePlus (iOS)](OqeePlus/OqeePlus-iOS/index.md) | Oqee 2.40 | iOS 18+ |
| Tweak | App | Target |
| -------------------------------------------------- | ------------------------ | ----------- |
| [ServerCatPremium](ServerCatPremium/index.md) | ServerCat 1.30.0 / 1.6.4 | iOS 15+ |
| [TextasticPro](TextasticPro/index.md) | Textastic 10.9.2 | iOS 18+ |
| [BusinessJB](BusinessJB/index.md) | Business 2.3.000 | iOS 15 |
| [CreditAgricoleJB](CreditAgricoleJB/index.md) | Ma Banque 47.0.0 | iOS 15.8.6 |
| [Infuse](Infuse/Infuse-tvOS/index.md) | Infuse 8.2.4 | tvOS 18.3 |
| [Infuse (iOS)](Infuse/Infuse-iOS/index.md) | Infuse 8.4.2 | iOS 18+ |
| [TF1+ (tvOS)](TF1Plus/TF1Plus-tvOS/index.md) | TF1+ 11.36.0 | tvOS |
| [TF1+ (iOS)](TF1Plus/TF1Plus-iOS/index.md) | TF1+ 11.36.0 | iOS 14+ |
| [OqeePlus (tvOS)](OqeePlus/OqeePlus-tvOS/index.md) | Oqee 2.40 | tvOS 18.3 |
| [OqeePlus (iOS)](OqeePlus/OqeePlus-iOS/index.md) | Oqee 2.40 | iOS 18+ |
| [VolkswagenJB](VolkswagenJB/index.md) | Volkswagen 2.72.0 | iOS 16.7.15 |
| [GPXViewer2](GPXViewer2) | GPXViewer 2 | iOS 14+ |
| [RMHook](RMHook/index.md) | reMarkable | iOS |
## Build

View File

@@ -2,49 +2,5 @@
set -e
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <file.ipa> <file.deb>"
exit 1
fi
IPA=""
DEB=""
for arg in "$@"; do
case "$arg" in
*.ipa)
IPA="$arg"
;;
*.deb)
DEB="$arg"
;;
*)
echo "Unknown file type: $arg"
exit 1
;;
esac
done
if [ -z "$IPA" ] || [ -z "$DEB" ]; then
echo "You must provide one .ipa and one .deb file."
exit 1
fi
# ---- Prepare output folder ----
OUT_DIR="/tmp/ipa_patched"
mkdir -p "$OUT_DIR"
IPA_NAME=$(basename "$IPA")
OUTPUT_IPA="$OUT_DIR/$IPA_NAME"
echo "[+] Patching IPA with cyan..."
# cyan -i "$IPA" -o "$OUTPUT_IPA" -f "$DEB" -u --overwrite -c 0
cyan -i "$IPA" -o "$OUTPUT_IPA" -f "$DEB" -u --overwrite -c 9 --tv
echo "[+] Patch complete."
# Copy patched IPA next to the original with _patched suffix
ORIG_DIR=$(dirname "$IPA")
ORIG_BASENAME=$(basename "$IPA" .ipa)
PATCHED_IPA="$ORIG_DIR/${ORIG_BASENAME}_patched.ipa"
cp "$OUTPUT_IPA" "$PATCHED_IPA"
echo "[+] Patched IPA saved as: $PATCHED_IPA"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
"$SCRIPT_DIR/patch.sh" --tv "$@"

View File

@@ -2,25 +2,48 @@
set -e
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <file.ipa> <file.deb>"
usage() {
echo "Usage: $0 [--tv] [-o <output.ipa> | --output <output.ipa>] <file.ipa> <file.deb>"
exit 1
fi
}
TV=0
IPA=""
DEB=""
OUTPUT_IPA=""
OUTPUT_SPECIFIED=0
for arg in "$@"; do
case "$arg" in
while [ "$#" -gt 0 ]; do
case "$1" in
-o|--output)
if [ -z "$2" ]; then
echo "Error: $1 requires an argument."
exit 1
fi
OUTPUT_IPA="$2"
OUTPUT_SPECIFIED=1
shift 2
;;
-o=*|--output=*)
OUTPUT_IPA="${1#*=}"
OUTPUT_SPECIFIED=1
shift
;;
--tv)
TV=1
shift
;;
*.ipa)
IPA="$arg"
IPA="$1"
shift
;;
*.deb)
DEB="$arg"
DEB="$1"
shift
;;
*)
echo "Unknown file type: $arg"
exit 1
echo "Unknown argument: $1"
usage
;;
esac
done
@@ -30,21 +53,22 @@ if [ -z "$IPA" ] || [ -z "$DEB" ]; then
exit 1
fi
# ---- Prepare output folder ----
OUT_DIR="/tmp/ipa_patched"
mkdir -p "$OUT_DIR"
if [ -z "$OUTPUT_IPA" ]; then
OUTPUT_IPA="/tmp/ipa_patched/$(basename "$IPA")"
mkdir -p "$(dirname "$OUTPUT_IPA")"
fi
IPA_NAME=$(basename "$IPA")
OUTPUT_IPA="$OUT_DIR/$IPA_NAME"
CYAN_ARGS=(-i "$IPA" -o "$OUTPUT_IPA" -f "$DEB" -u --overwrite -c 9)
if [ "$TV" -eq 1 ]; then
CYAN_ARGS+=(--tv)
fi
echo "[+] Patching IPA with cyan..."
# cyan -i "$IPA" -o "$OUTPUT_IPA" -f "$DEB" -u --overwrite -c 0
cyan -i "$IPA" -o "$OUTPUT_IPA" -f "$DEB" -u --overwrite -c 9
cyan "${CYAN_ARGS[@]}"
echo "[+] Patch complete."
# Copy patched IPA next to the original with _patched suffix
ORIG_DIR=$(dirname "$IPA")
ORIG_BASENAME=$(basename "$IPA" .ipa)
PATCHED_IPA="$ORIG_DIR/${ORIG_BASENAME}_patched.ipa"
cp "$OUTPUT_IPA" "$PATCHED_IPA"
echo "[+] Patched IPA saved as: $PATCHED_IPA"
if [ "$OUTPUT_SPECIFIED" -eq 0 ]; then
PATCHED_IPA="$(dirname "$IPA")/$(basename "$IPA" .ipa)_patched.ipa"
cp "$OUTPUT_IPA" "$PATCHED_IPA"
echo "[+] Patched IPA saved as: $PATCHED_IPA"
fi