-
Notifications
You must be signed in to change notification settings - Fork 28
/
gen-control.sh
executable file
·47 lines (37 loc) · 1.35 KB
/
gen-control.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
#!/bin/sh
# This script is used to generate the control file for the Debian package.
if [ $# -ne 1 ]; then
echo "Usage: $0 <version>"
exit 1
fi
VERSION=$1
# Strip leading "v" from version if present
VERSION=${VERSION#v}
# Create the layout directory
mkdir -p layout/DEBIAN
# Write the control file
cat > layout/DEBIAN/control << __EOF__
Package: ch.xxtou.hudapp.jb
Name: TrollSpeed JB
Version: $VERSION
Section: Tweaks
Depends: firmware (>= 14.0)
Architecture: iphoneos-arm
Author: Lessica <[email protected]>
Maintainer: Lessica <[email protected]>
Description: Troll your speed, but jailbroken.
__EOF__
# Set permissions
chmod 0644 layout/DEBIAN/control
RAND_BUILD_STR=$(openssl rand -hex 4)
# Write the Info.plist file
defaults write $PWD/Resources/Info.plist CFBundleShortVersionString $VERSION
defaults write $PWD/Resources/Info.plist CFBundleVersion $RAND_BUILD_STR
plutil -convert xml1 $PWD/Resources/Info.plist
chmod 0644 $PWD/Resources/Info.plist
defaults write $PWD/supports/Sandbox-Info.plist CFBundleShortVersionString $VERSION
defaults write $PWD/supports/Sandbox-Info.plist CFBundleVersion $RAND_BUILD_STR
plutil -convert xml1 $PWD/supports/Sandbox-Info.plist
chmod 0644 $PWD/supports/Sandbox-Info.plist
XCODE_PROJ_PBXPROJ=$PWD/TrollSpeed.xcodeproj/project.pbxproj
sed -i '' "s/MARKETING_VERSION = .*;/MARKETING_VERSION = $VERSION;/g" $XCODE_PROJ_PBXPROJ