5
5
# ##
6
6
7
7
ORIGINAL_IPA_NAME=" original.ipa"
8
+ ORIGINAL_IPA_SHA256=" 187253d4aa1c951af95957a49b926cfb7be4e953af578b6963fb4c7c9c0b6cb0"
9
+ ORIGINAL_IPA_URL=" https://archive.org/download/i-3-u-so-com.julienadam.cassius-1.04/I-3-U-SO-com.julienadam.cassius-1.04.ipa"
10
+ ORIGINAL_ICON_URL=" https://web.archive.org/web/20240111215624if_/https://is4-ssl.mzstatic.com/image/thumb/Purple/2b/df/56/mzi.rptjtlhi.png/738x0w.png"
8
11
IPA_NAME=" iloveusomuch.ipa"
9
12
10
13
if [ " $1 " == " project" ]; then
11
14
OUT_DIR=" ./iloveusomuch/originalAssets"
12
15
else
13
16
OUT_DIR=" ./Payload/iloveusomuch.app"
14
- mkdir -p $OUT_DIR
15
17
fi
16
18
17
19
zipPath=" Payload/Cassius.app/"
@@ -22,8 +24,28 @@ zipFiles=(
22
24
" ${zipPath} Videos.m4v"
23
25
)
24
26
27
+ # Suggest downloading the original ipa file if it doesn't exit
25
28
if ! [ -f " ./$ORIGINAL_IPA_NAME " ]; then
26
- echo " Please put the original .ipa file under the '$ORIGINAL_IPA_NAME ' name first"
29
+ echo " The original.ipa file doesn't exist. This script can automatically download it from archive.org."
30
+ echo " Note: this file contains copyrighted materials that will be injected into the resulting app."
31
+ echo " \033[0;31m$( tput bold) You CANNOT distribute the resulting $IPA_NAME file in any way. For personal use only.$( tput sgr0) \033[0m"
32
+ while [ " $choice " != " n" ] && [ " $choice " != " y" ]; do
33
+ printf " Do you want to continue? [y/n]: "
34
+ read choice
35
+ done
36
+ if [ " $choice " == " n" ]; then
37
+ exit 0
38
+ fi
39
+ echo " Downloading the original app..."
40
+ curl -SLo " ./$ORIGINAL_IPA_NAME " " $ORIGINAL_IPA_URL "
41
+ if ! [ $? = 0 ]; then
42
+ echo " Failed to download the original app"
43
+ exit 1
44
+ fi
45
+ fi
46
+
47
+ if [ " ` openssl dgst -sha256 " ./$ORIGINAL_IPA_NAME " | sed -E ' s/SHA(2-)?256(.*)= //' ` " != " $ORIGINAL_IPA_SHA256 " ]; then
48
+ echo " $ORIGINAL_IPA_NAME has an unexpected checksum. Try downloading it again."
27
49
exit 1
28
50
fi
29
51
@@ -36,23 +58,29 @@ for file in ${zipFiles[@]}; do
36
58
fi
37
59
done
38
60
61
+ if [ " $1 " != " project" ]; then
62
+ mkdir -p " $OUT_DIR "
63
+ fi
64
+
39
65
# Create an argument for unzip to extract only these files
40
66
zipFilesArg=" "
41
67
for file in ${zipFiles[@]} ; do
42
68
zipFilesArg=" ${zipFilesArg} ${file} "
43
69
done
44
70
45
- unzip -j $ORIGINAL_IPA_NAME ${zipFilesArg} -d $OUT_DIR
71
+ echo " Extracting original files..."
72
+ unzip -j " $ORIGINAL_IPA_NAME " ${zipFilesArg} -d " $OUT_DIR " > /dev/null
46
73
47
74
if ! [ $? = 0 ]; then
48
75
echo " Failed to uncompress the archive"
49
76
exit 1
50
- fi ;
77
+ fi
51
78
52
- mv
$OUT_DIR /
[email protected] $OUT_DIR /loader.png
79
+ mv
" $OUT_DIR /[email protected] " " $OUT_DIR /loader.png"
53
80
54
81
# Download the original app icon from web.archive.org
55
- curl -o $OUT_DIR /AppIcon.png " https://web.archive.org/web/20240111215624if_/https://is4-ssl.mzstatic.com/image/thumb/Purple/2b/df/56/mzi.rptjtlhi.png/738x0w.png"
82
+ echo " Downloading the original app icon..."
83
+ curl -LsSo " $OUT_DIR /AppIcon.png" " $ORIGINAL_ICON_URL "
56
84
if ! [ $? = 0 ]; then
57
85
echo " Failed to download an app icon"
58
86
exit 1
@@ -63,5 +91,8 @@ if [ "$1" == "project" ]; then
63
91
fi
64
92
65
93
# Inject files into a compiled .ipa
66
- zip -ru $IPA_NAME Payload
94
+ echo " Injecting files into iloveusomuch.ipa..."
95
+ zip -ru " $IPA_NAME " Payload > /dev/null
67
96
rm -R ./Payload
97
+
98
+ echo " \nIPA is ready!"
0 commit comments