1
1
#! /bin/sh
2
2
3
- OUT_DIR=" ./iloveusomuch/originalAssets"
3
+ # ##
4
+ # ## Injects assets from the original app into an .ipa or the project itself
5
+ # ##
4
6
5
- IPA_NAME=" original.ipa"
7
+ ORIGINAL_IPA_NAME=" original.ipa"
8
+ IPA_NAME=" iloveusomuch.ipa"
9
+
10
+ if [ " $1 " == " project" ]; then
11
+ OUT_DIR=" ./iloveusomuch/originalAssets"
12
+ else
13
+ OUT_DIR=" ./Payload/iloveusomuch.app"
14
+ mkdir -p $OUT_DIR
15
+ fi
6
16
7
17
zipPath=" Payload/Cassius.app/"
8
18
zipFiles=(
@@ -12,13 +22,13 @@ zipFiles=(
12
22
" ${zipPath} Videos.m4v"
13
23
)
14
24
15
- if ! [ -f " ./original.ipa " ]; then
16
- echo " Please put the original .ipa file under the 'original.ipa ' name first"
25
+ if ! [ -f " ./$ORIGINAL_IPA_NAME " ]; then
26
+ echo " Please put the original .ipa file under the '$ORIGINAL_IPA_NAME ' name first"
17
27
exit 1
18
28
fi
19
29
20
30
# Check if the required files are in place
21
- givenZipFileList=` unzip -Z1 $IPA_NAME `
31
+ givenZipFileList=` unzip -Z1 $ORIGINAL_IPA_NAME `
22
32
for file in ${zipFiles[@]} ; do
23
33
if ! echo " $givenZipFileList " | grep $file >> /dev/null; then
24
34
echo " '$file ' not found. Are you sure that you're using the correct .ipa file?"
@@ -32,7 +42,7 @@ for file in ${zipFiles[@]}; do
32
42
zipFilesArg=" ${zipFilesArg} ${file} "
33
43
done
34
44
35
- unzip -j $IPA_NAME ${zipFilesArg} -d $OUT_DIR
45
+ unzip -j $ORIGINAL_IPA_NAME ${zipFilesArg} -d $OUT_DIR
36
46
37
47
if ! [ $? = 0 ]; then
38
48
echo " Failed to uncompress the archive"
43
53
44
54
# Download the original app icon from web.archive.org
45
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"
56
+ if ! [ $? = 0 ]; then
57
+ echo " Failed to download an app icon"
58
+ exit 1
59
+ fi ;
60
+
61
+ if [ " $1 " == " project" ]; then
62
+ exit 0;
63
+ fi
64
+
65
+ # Inject files into a compiled .ipa
66
+ zip -ru $IPA_NAME Payload
67
+ rm -R ./Payload
0 commit comments