forked from arichornlover/uYouEnhanced
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·63 lines (50 loc) · 1.95 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·63 lines (50 loc) · 1.95 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
#!/bin/bash
# To build, either place the IPA file in the project's root directory, or get the path to the IPA, then run `./build.sh`
read -p $'\e[34m==> \e[1;39mPath to the decrypted YouTube.ipa or YouTube.app. If nothing is provied, any ipa/app in the project\'s root directory will be used: ' PATHTOYT
# Check if PATHTOYT is empty
if [ -z "$PATHTOYT" ]; then
# Look for ipa/app files in the current directory
IPAS=$(find . -maxdepth 1 -type f \( -name "*.ipa" -o -name "*.app" \))
# Check if there are two or more ipa/app files
COUNT=$(echo "$IPAS" | wc -l)
if [ "$COUNT" -ge 2 ]; then
echo "❌ Error: Multiple IPA/app files found in the project's root directory directory. Make sure there is only one ipa."
exit 1
elif [ -n "$IPAS" ]; then
PATHTOYT=$(echo "$IPAS" | head -n 1)
else
echo "❌ Error: No IPA/app file found in the project's root directory directory."
exit 1
fi
fi
if [ -d "$PATHTOYT" ]; then
YOUTUBE_APP="$PATHTOYT"
else
TEMP_DIR=$(mktemp -d)
trap 'rm -rf "$TEMP_DIR"' EXIT
unzip -q "$PATHTOYT" -d "$TEMP_DIR"
YOUTUBE_APP="$TEMP_DIR/Payload/YouTube.app"
fi
if [ ! -f "$YOUTUBE_APP/Info.plist" ]; then
echo "❌ Error: The IPA does not contain Payload/YouTube.app."
exit 1
fi
YOUTUBE_EXECUTABLE=$(/usr/libexec/PlistBuddy -c "Print :CFBundleExecutable" "$YOUTUBE_APP/Info.plist")
if ! otool -l "$YOUTUBE_APP/$YOUTUBE_EXECUTABLE" | awk '
$1 == "cryptid" {
found_encryption_info = 1
if ($2 != 0) encrypted = 1
}
END { exit !found_encryption_info || encrypted }
'; then
echo "❌ Error: The YouTube IPA must be decrypted before patching. Use a decrypted IPA, not an App Store download."
exit 1
fi
make package THEOS_PACKAGE_SCHEME=rootless IPA="$PATHTOYT" FINALPACKAGE=1
# SHASUM
if [[ $? -eq 0 ]]; then
open packages
echo "SHASUM256: $(shasum -a 256 packages/*.ipa)"
else
echo "Failed building uYouPlus"
fi