This repository has been archived by the owner on Nov 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.sh
66 lines (50 loc) · 1.59 KB
/
build.sh
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
64
65
66
#!/bin/bash
export LC_CTYPE=C
export LANG=C
appName=Serial
project=${appName}.xcodeproj
schemeName=${appName}
rm -rf Archives/
rm -rf deb/Applications/*
mkdir Archives
# Create archive
xcodebuild -project ${project} -scheme ${schemeName} -sdk iphoneos \
-configuration Release build CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO build \
-archivePath 'Archives/Build.xcarchive' \
archive
# Isolate application folder
mkdir Archives/Payload
cp -R Archives/Build.xcarchive/Products/Applications/${appName}.app Archives/Payload/
rm -rf Archives/Build.xcarchive
# Clean out files
cd Archives/Payload
find . -name '*.DS_Store' -type f -delete
find . -name '*embedded.mobileprovision' -type f -delete
find . -name '*_CodeSignature' -type f -delete
cd ../..
# Create IPA
cd Archives
zip -r -X Sideload.ipa Payload
cd ..
# Move application payload to deb source
mv Archives/Payload/* deb/Applications/
# Remove Swift libraries from deb source (since we have libswift for that)
rm -rf deb/Applications/*.app/Frameworks/libswift*
# Clean up .DS_Store files in deb folder
cd deb
find . -name '*.DS_Store' -type f -delete
cd ..
# Fake-sign app
ldid -S deb/Applications/*.app/${appName}
ldid -S deb/Applications/*.app/Frameworks/*.framework/*
ldid -S deb/Applications/*.app/${appName}/PlugIns/*.appex/*
ldid -S deb/Applications/*.app/${appName}/PlugIns/*.appex/Frameworks/*.framework/*
# Create deb
dpkg-deb -Zgzip -b deb
mv deb.deb Archives/Jailbreak.deb
# Clean up
rm -rf Archives/Payload
rm -rf deb/Applications/*
# Show in Finder
open Archives/
echo Done! The files are ready for distribution.