Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
Use custom build script for Liberation
Browse files Browse the repository at this point in the history
Fix build issues caused by the default one
  • Loading branch information
Naville authored Feb 27, 2017
1 parent b505231 commit 956548e
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions Setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ brew install wget
brew install cmake
brew install homebrew/dupes/unzip
echo "Clean-up"
rm -rf ./Hooks/keystone/ >> /dev/null 2>&1
rm -rf ./Hooks/capstone/ >> /dev/null 2>&1
rm ./ExtraFWs/libcapstone.a >> /dev/null 2>&1
rm ./ExtraFWs/libkeystone.a >> /dev/null 2>&1
rm ./ExtraFWs/Reveal.framework >> /dev/null 2>&1
rm ./Reveal.app.zip >> /dev/null 2>&1
rm -rf ./RevealTMP >> /dev/null 2>&1
rm -rf ./CYTMP >> /dev/null 2>&1
rm ./ExtraFWs/libLiberation.a >> /dev/null 2>&1
rm ./Hooks/Liberation.h >> /dev/null 2>&1
mkdir ExtraFWs >> /dev/null 2>&1
mkdir Packages >> /dev/null 2>&1
rm -rf ./Hooks/keystone/ >> /dev/null 2>&1
rm -rf ./Hooks/capstone/ >> /dev/null 2>&1
rm ./ExtraFWs/libcapstone.a >> /dev/null 2>&1
rm ./ExtraFWs/libkeystone.a >> /dev/null 2>&1
rm ./ExtraFWs/Reveal.framework >> /dev/null 2>&1
rm ./Reveal.app.zip >> /dev/null 2>&1
rm -rf ./RevealTMP >> /dev/null 2>&1
rm -rf ./CYTMP >> /dev/null 2>&1
rm ./ExtraFWs/libLiberation.a >> /dev/null 2>&1
rm ./Hooks/Liberation.h >> /dev/null 2>&1
mkdir ExtraFWs >> /dev/null 2>&1
mkdir Packages >> /dev/null 2>&1
echo "Pulling Latest Trunk"
git submodule update --init --recursive
echo "Installing colorama from python-pip"
Expand All @@ -35,8 +35,7 @@ cd "${OrigDIR}"
echo "Building Liberation"
cd ./Liberation
cd keystone&&git pull origin master &&cd ../
./liberation setup > /dev/null
./liberation build > /dev/null
mkdir Build && cd Build && cmake ../ && make -j8
cd "${OrigDIR}"
echo "Moving Liberation"
mv ./Liberation/lib/libLiberation.a ./ExtraFWs/
Expand All @@ -45,42 +44,43 @@ cd "${OrigDIR}"
echo "Downloading Cycript"
wget https://cydia.saurik.com/api/latest/3 -O Cycript.zip
echo "Cleaning old framework"
rm -rf ./Cycript.framework>> /dev/null 2>&1
rm -rf ./ExtraFWs/Cycript.framework >> /dev/null 2>&1
rm -rf ./Reveal.framework >> /dev/null 2>&1
rm -rf ./ExtraFWs/Reveal.framework>> /dev/null 2>&1

rm -rf ./Cycript.framework>> /dev/null 2>&1
rm -rf ./ExtraFWs/Cycript.framework >> /dev/null 2>&1
rm -rf ./Reveal.framework >> /dev/null 2>&1
rm -rf ./ExtraFWs/Reveal.framework>> /dev/null 2>&1
cd "${OrigDIR}"
#Cycript's static library hasn't been updated for years and ages. Use system dylib instead

echo "Extracting Cycript"
rm -rf ./Cycript
mkdir Cycript
unzip Cycript.zip -d ./Cycript >> /dev/null 2>&1
cp -avR ./Cycript/Cycript.lib/libcycript.dylib ./ >> /dev/null 2>&1
unzip Cycript.zip -d ./Cycript >> /dev/null 2>&1
cp -avR ./Cycript/Cycript.lib/libcycript.dylib ./ >> /dev/null 2>&1
rm -rf ./Cycript.zip
cd "${OrigDIR}"
echo "Downloading Reveal"
wget http://download.revealapp.com/Reveal.app.zip
unzip Reveal.app.zip -d ./RevealTMP >> /dev/null 2>&1
cp -rf ./RevealTMP/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib ./ >> /dev/null 2>&1
rm -rf ./RevealTMP >> /dev/null 2>&1
rm -rf ./Reveal.app.zip >> /dev/null 2>&1
unzip Reveal.app.zip -d ./RevealTMP >> /dev/null 2>&1
cp -rf ./RevealTMP/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib ./ >> /dev/null 2>&1
rm -rf ./RevealTMP >> /dev/null 2>&1
rm -rf ./Reveal.app.zip >> /dev/null 2>&1
cd "${OrigDIR}"
echo "Building FLEX"
cd ./FLEX && xcodebuild -workspace FLEX.xcworkspace -scheme FLEX CONFIGURATION_BUILD_DIR=./&& mv ./FLEX.framework ../ExtraFWs&&cd ../ > /dev/null
cd "${OrigDIR}"
echo "Downloading Reveal2"
wget -O Reveal2.zip https://dl.devmate.com/com.ittybittyapps.Reveal2/Reveal.zip
unzip Reveal2.zip -d ./Reveal2TMP >> /dev/null 2>&1
cp -rf ./Reveal2TMP/Reveal.app/Contents/SharedSupport/iOS-Libraries/RevealServer.framework/RevealServer ./Reveal2Server >> /dev/null 2>&1
unzip Reveal2.zip -d ./Reveal2TMP >> /dev/null 2>&1
cp -rf ./Reveal2TMP/Reveal.app/Contents/SharedSupport/iOS-Libraries/RevealServer.framework/RevealServer ./Reveal2Server >> /dev/null 2>&1
rm ./Reveal2.zip
rm -rf ./Reveal2TMP >>/dev/null 2>&1
cd "${OrigDIR}"
echo 'Downloading Frida'
python ./CIScripts/DownloadFrida.py
echo 'Cleaning useless archs'
for meh in ./ExtraFWs/frida-gadget.dylib ./ExtraFWs/FLEX.framework/FLEX ./Reveal2Server ./libReveal.dylib ./libcycript.dylib
do
echo "Cleaning $meh"
lipo -remove i386 $meh -output $meh >> /dev/null 2>&1 ||true
lipo -remove i386 $meh -output $meh >> /dev/null 2>&1 ||true
lipo -remove x86_64 $meh -output $meh >> /dev/null 2>&1 ||true
done



0 comments on commit 956548e

Please sign in to comment.