-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.sh
65 lines (52 loc) · 1.77 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
#!/bin/bash
echo "Sudo Chop!!!"
# Clean up old staging files from subversi0n and rebuild
rm -rf ddi.dmg
rm -rf dump.dylib
rm -rf patch.dylib
rm -rf crack.dylib
# Build dump.dylib
cd dump
rm -rf build
xcodebuild
cp build/Release-iphoneos/dump ../dump.dylib
cd ..
# Build patch.dylib
cd patch
rm -rf build
xcodebuild
cp build/Release-iphoneos/patch ../patch.dylib
cd ..
# Build crack.dylib
cd crack
rm -rf build
xcodebuild
cp build/Release-iphoneos/crack ../crack.dylib
cd ..
# Codesign everything
codesign -f -s "iPhone Developer" dump.dylib
codesign -f -s "iPhone Developer" patch.dylib
codesign -f -s "iPhone Developer" crack.dylib
# Mount our new image
sudo hdiutil detach /Volumes/DDI
sudo hdiutil mount udrw.dmg
# Remove old files
sudo rm -rf /Volumes/DDI/dump.dylib
sudo rm -rf /Volumes/DDI/patch.dylib
sudo rm -rf /Volumes/DDI/crack.dylib
sudo rm -rf /Volumes/DDI/Library/LaunchDaemons/com.sudo-sec.dump.plist
sudo rm -rf /Volumes/DDI/Library/LaunchDaemons/com.sudo-sec.patch.plist
sudo rm -rf /Volumes/DDI/Library/LaunchDaemons/com.sudo-sec.crack.plist
sudo rm -rf /Volumes/DDI/Library/LaunchDaemons/com.sudo-sec.panic.plist
# Copy over new dylibs
sudo cp ./dump.dylib /Volumes/DDI/dump.dylib
sudo cp ./patch.dylib /Volumes/DDI/patch.dylib
sudo cp ./crack.dylib /Volumes/DDI/crack.dylib
# Copy over LaunchServices
sudo cp ./dump/dump/com.sudo-sec.dump.plist /Volumes/DDI/Library/LaunchDaemons/com.sudo-sec.dump.plist
sudo cp ./patch/patch/com.sudo-sec.patch.plist /Volumes/DDI/Library/LaunchDaemons/com.sudo-sec.patch.plist
sudo cp ./crack/crack/com.sudo-sec.crack.plist /Volumes/DDI/Library/LaunchDaemons/com.sudo-sec.crack.plist
# Unmount and convert to UDRO
sudo hdiutil detach /Volumes/DDI
sudo hdiutil convert -format UDRO -o ddi.dmg udrw.dmg
echo "Done, copy ddi.dmg over to SudoPunch"