2022-09-02 23:19:48 +08:00
|
|
|
#!/bin/sh
|
2022-10-01 04:41:06 +08:00
|
|
|
set -e
|
2022-09-02 23:19:48 +08:00
|
|
|
|
|
|
|
if [ -d "./out" ]
|
|
|
|
then
|
|
|
|
rm -rf ./out
|
|
|
|
fi
|
|
|
|
mkdir -p ./out
|
|
|
|
|
|
|
|
# Step one: Compile TrollStore
|
|
|
|
|
|
|
|
cd ../Store
|
|
|
|
make clean
|
|
|
|
make FINALPACKAGE=1
|
|
|
|
cd -
|
|
|
|
|
|
|
|
cp -r ../Store/.theos/obj/TrollStore.app ./out/TrollStore.app
|
|
|
|
ldid -S -M -Kcert.p12 ./out/TrollStore.app
|
|
|
|
|
|
|
|
# Step two: Compile and permasign helper
|
|
|
|
|
|
|
|
cd ../Helper
|
|
|
|
make clean
|
|
|
|
make FINALPACKAGE=1
|
|
|
|
cd -
|
|
|
|
|
|
|
|
cp ../Helper/.theos/obj/trollstorehelper ./out/TrollStore.app/trollstorehelper
|
|
|
|
ldid -S -M -Kcert.p12 ./out/TrollStore.app/trollstorehelper
|
|
|
|
|
|
|
|
# Step three: Compile and permasign persistence helper
|
|
|
|
|
|
|
|
# (copy helper into persistence helper)
|
|
|
|
cp ./out/TrollStore.app/trollstorehelper ../PersistenceHelper/Resources/trollstorehelper
|
|
|
|
|
|
|
|
cd ../PersistenceHelper
|
|
|
|
make clean
|
2022-09-03 00:55:53 +08:00
|
|
|
make package FINALPACKAGE=1
|
2022-09-02 23:19:48 +08:00
|
|
|
cd -
|
|
|
|
|
2022-09-04 00:49:43 +08:00
|
|
|
rm ../PersistenceHelper/Resources/trollstorehelper
|
|
|
|
|
2022-09-02 23:19:48 +08:00
|
|
|
cp ../PersistenceHelper/.theos/obj/TrollStorePersistenceHelper.app/TrollStorePersistenceHelper ./out/TrollStore.app/PersistenceHelper
|
|
|
|
ldid -S -M -Kcert.p12 ./out/TrollStore.app/PersistenceHelper
|
|
|
|
|
|
|
|
# Step four: tar everything
|
|
|
|
|
|
|
|
cd out
|
|
|
|
COPYFILE_DISABLE=1 tar -czvf TrollStore.tar ./TrollStore.app
|
|
|
|
rm -rf ./TrollStore.app
|
|
|
|
cd -
|
2022-09-04 06:48:40 +08:00
|
|
|
|
2022-09-22 23:38:58 +08:00
|
|
|
if [[ $1 == "installer" ]]; then
|
|
|
|
# Step five: compile installer
|
|
|
|
xcodebuild -project ../Installer/TrollInstaller/TrollInstaller.xcodeproj -scheme TrollInstaller -destination generic/platform=iOS -archivePath ./out/Installer.xcarchive archive
|
|
|
|
|
|
|
|
if [[ -f "./out/Installer.xcarchive/Products/Applications/TrollInstaller.app/embedded.mobileprovision" ]]; then
|
|
|
|
rm ./out/Installer.xcarchive/Products/Applications/TrollInstaller.app/embedded.mobileprovision
|
|
|
|
fi
|
|
|
|
|
|
|
|
ldid -s ./out/Installer.xcarchive/Products/Applications/TrollInstaller.app
|
|
|
|
mkdir ./out/Payload
|
|
|
|
mv ./out/Installer.xcarchive/Products/Applications/TrollInstaller.app ./out/Payload/TrollInstaller.app
|
|
|
|
cd out
|
|
|
|
zip -vr TrollInstaller.ipa Payload
|
|
|
|
cd -
|
|
|
|
rm -rf ./out/Payload
|
|
|
|
rm -rf ./out/Installer.xcarchive
|
|
|
|
fi
|