forked from opa334/SafariPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_simulator.sh
executable file
·65 lines (49 loc) · 2.74 KB
/
install_simulator.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/sh
set -e
make SIMJECT=1
THEOS_OBJ_DIR=./.theos/obj/iphone_simulator/debug
#install tweak into simject folder
rm -rf /opt/simject/SafariPlus.plist ||:
cp -rfv ./MobileSafari/SafariPlus.plist /opt/simject
rm -rf /opt/simject/SafariPlus.dylib ||:
cp -rfv $THEOS_OBJ_DIR/SafariPlus.dylib /opt/simject
rm -rf /opt/simject/SafariPlusWC.plist ||:
cp -rfv ./WebContent/SafariPlusWC.plist /opt/simject
rm -rf /opt/simject/SafariPlusWC.dylib ||:
cp -rfv $THEOS_OBJ_DIR/SafariPlusWC.dylib /opt/simject
#install PreferenceBundle into all additionally installed simulators
for runtime in /Library/Developer/CoreSimulator/Profiles/Runtimes/*
do
if [ -d "$runtime" ]; then
echo "Installing PreferenceBundle to $runtime"
SIMULATOR_ROOT=$runtime/Contents/Resources/RuntimeRoot
SIMULATOR_BUNDLES_PATH=$SIMULATOR_ROOT/Library/PreferenceBundles
SIMULATOR_PLISTS_PATH=$SIMULATOR_ROOT/Library/PreferenceLoader/Preferences
if [ -d "$SIMULATOR_BUNDLES_PATH" ]; then
rm -rf "$SIMULATOR_BUNDLES_PATH/SafariPlusPrefs.bundle" ||:
cp -rf "$THEOS_OBJ_DIR/SafariPlusPrefs.bundle" "$SIMULATOR_BUNDLES_PATH"
fi
if [ -d "$SIMULATOR_PLISTS_PATH" ]; then
rm -rf "$SIMULATOR_PLISTS_PATH/SafariPlusPrefs.plist" ||:
cp -rf "./Preferences/entry.plist" "$SIMULATOR_PLISTS_PATH/SafariPlusPrefs.plist"
fi
fi
done
#install PreferenceBundle into the simulator that ships with Xcode
for SIMULATOR_ROOT in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
do
if [ -d "$SIMULATOR_ROOT" ]; then
echo "Installing PreferenceBundle to $SIMULATOR_ROOT"
SIMULATOR_BUNDLES_PATH=$SIMULATOR_ROOT/Library/PreferenceBundles
SIMULATOR_PLISTS_PATH=$SIMULATOR_ROOT/Library/PreferenceLoader/Preferences
if [ -d "$SIMULATOR_BUNDLES_PATH" ]; then
sudo rm -rf "$SIMULATOR_BUNDLES_PATH/SafariPlusPrefs.bundle" ||:
sudo cp -rf "$THEOS_OBJ_DIR/SafariPlusPrefs.bundle" "$SIMULATOR_BUNDLES_PATH"
fi
if [ -d "$SIMULATOR_PLISTS_PATH" ]; then
sudo rm -rf "$SIMULATOR_PLISTS_PATH/SafariPlusPrefs.plist" ||:
sudo cp -rf "./Preferences/entry.plist" "$SIMULATOR_PLISTS_PATH/SafariPlusPrefs.plist"
fi
fi
done
resim all