-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scripts to automatically build and copy an appropriate CydiaSubstrate…
….framework to the appropriate location.
- Loading branch information
Thatchapon Unprasert
committed
Oct 14, 2018
1 parent
19f28f3
commit 6f4bfd4
Showing
3 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
|
||
if [ "$EUID" -ne 0 ];then | ||
echo "This script must be run as root" | ||
exit 1 | ||
fi | ||
|
||
if [[ -z $1 ]];then | ||
echo "Runtime version is required" | ||
echo "Example: ./substrate-pre10.sh 8.4" | ||
exit 1 | ||
fi | ||
|
||
SJ_RUNTIME_ROOT=/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ ${1}.simruntime/Contents/Resources/RuntimeRoot | ||
# In-Xcode directory: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot | ||
|
||
if [[ ! -d "${SJ_RUNTIME_ROOT}" ]];then | ||
echo "Error: iOS $1 runtime is not found in /Library/Developer/CoreSimulator/Profiles/Runtimes" | ||
exit 1 | ||
fi | ||
|
||
mkdir -p "${SJ_RUNTIME_ROOT}/Library/Frameworks" | ||
|
||
curl -Lo /tmp/simject_cycript.zip https://cache.saurik.com/cycript/mac/cycript_0.9.594.zip | ||
unzip /tmp/simject_cycript.zip -d /tmp/simject_cycript | ||
mkdir -p CydiaSubstrate.framework | ||
mv /tmp/simject_cycript/Cycript.lib/libsubstrate.dylib CydiaSubstrate.framework/CydiaSubstrate | ||
rm -rf /tmp/simject_cycript /tmp/simject_cycript.zip | ||
|
||
rm -rf "${SJ_RUNTIME_ROOT}/Library/Frameworks/CydiaSubstrate.framework" | ||
mv CydiaSubstrate.framework "${SJ_RUNTIME_ROOT}/Library/Frameworks/CydiaSubstrate.framework" | ||
|
||
if [ $? -eq 0 ];then | ||
echo "Done copying" | ||
else | ||
echo "Error copying" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/sh | ||
|
||
if [ "$EUID" -ne 0 ];then | ||
echo "This script must be run as root" | ||
exit 1 | ||
fi | ||
|
||
if [[ -z $1 ]];then | ||
echo "Runtime version is required" | ||
echo "Example: ./substrate.sh 12.0" | ||
exit 1 | ||
fi | ||
|
||
SJ_RUNTIME_ROOT=/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ ${1}.simruntime/Contents/Resources/RuntimeRoot | ||
# In-Xcode directory: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot | ||
|
||
if [[ ! -d "${SJ_RUNTIME_ROOT}" ]];then | ||
echo "Error: iOS $1 runtime is not found in /Library/Developer/CoreSimulator/Profiles/Runtimes" | ||
exit 1 | ||
fi | ||
|
||
mkdir -p "${SJ_RUNTIME_ROOT}/Library/Frameworks" | ||
|
||
git clone https://github.com/PoomSmart/substitute.git | ||
cd substitute/ | ||
./configure --xcode-sdk=iphonesimulator --xcode-archs=x86_64 && make | ||
mv out/libsubstitute.dylib out/CydiaSubstrate | ||
codesign -f -s - out/CydiaSubstrate | ||
mkdir -p ../CydiaSubstrate.framework | ||
mv out/CydiaSubstrate ../CydiaSubstrate.framework/CydiaSubstrate | ||
cd .. && rm -rf substitute | ||
|
||
rm -rf "${SJ_RUNTIME_ROOT}/Library/Frameworks/CydiaSubstrate.framework" | ||
mv CydiaSubstrate.framework "${SJ_RUNTIME_ROOT}/Library/Frameworks/CydiaSubstrate.framework" | ||
|
||
if [ $? -eq 0 ];then | ||
echo "Done copying" | ||
else | ||
echo "Error copying" | ||
fi |