This repository has been archived on 2023-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Uncursus/procursus-deploy-u0.sh

114 lines
5.8 KiB
Bash
Raw Normal View History

2020-06-13 16:52:54 +02:00
#!/bin/bash
2020-07-20 05:21:48 +02:00
if [ $(uname) = "Darwin" ]; then
if [ $(uname -p) = "arm" ] || [ $(uname -p) = "arm64" ]; then
echo "It's recommended this script be ran on macOS/Linux with a clean iOS device running checkra1n attached unless migrating from older bootstrap."
ARM=yes
fi
fi
2020-06-13 16:52:54 +02:00
echo "odysseyra1n deployment script"
echo "(C) 2020, CoolStar. All Rights Reserved"
2020-07-16 00:02:07 +02:00
echo "Uncursus Version"
2020-06-13 16:52:54 +02:00
echo ""
echo "Before you begin: This script includes experimental migration from older bootstraps to Procursus/Odyssey."
echo "If you're already jailbroken, you can run this script on the checkra1n device."
echo "If you'd rather start clean, please Reset System via the Loader app first."
2020-07-15 23:33:21 +02:00
2020-07-16 00:01:24 +02:00
if ! which curl >> /dev/null; then
echo "Error: curl not found"
exit 1
fi
if [[ "${ARM}" = yes ]]; then
if ! which zsh >> /dev/null; then
echo "Error: zsh not found"
exit 1
fi
else
if which iproxy >> /dev/null; then
iproxy 4444 44 >> /dev/null 2>/dev/null &
else
echo "Error: iproxy not found"
exit 1
fi
fi
rm -rf odyssey-tmp
mkdir odyssey-tmp
cd odyssey-tmp
2020-07-15 22:57:58 +02:00
2020-07-16 00:01:24 +02:00
echo '#!/bin/zsh' > odyssey-device-deploy.sh
if [[ ! "${ARM}" = yes ]]; then
echo 'cd /var/root' >> odyssey-device-deploy.sh
fi
echo 'if [[ -f "/.bootstrapped" ]]; then' >> odyssey-device-deploy.sh
echo 'mkdir -p /odyssey && mv migration /odyssey' >> odyssey-device-deploy.sh
echo 'chmod 0755 /odyssey/migration' >> odyssey-device-deploy.sh
echo '/odyssey/migration' >> odyssey-device-deploy.sh
echo 'rm -rf /odyssey' >> odyssey-device-deploy.sh
echo 'else' >> odyssey-device-deploy.sh
echo 'VER=$(/usr/bin/plutil -key ProductVersion /System/Library/CoreServices/SystemVersion.plist)' >> odyssey-device-deploy.sh
echo 'if [[ "${VER%.*}" -ge 12 ]] && [[ "${VER%.*}" -lt 13 ]]; then' >> odyssey-device-deploy.sh
echo 'CFVER=1500' >> odyssey-device-deploy.sh
echo 'elif [[ "${VER%.*}" -ge 13 ]]; then' >> odyssey-device-deploy.sh
echo 'CFVER=1600' >> odyssey-device-deploy.sh
echo 'else' >> odyssey-device-deploy.sh
echo 'echo "${VER} not compatible."' >> odyssey-device-deploy.sh
echo 'exit 1' >> odyssey-device-deploy.sh
echo 'fi' >> odyssey-device-deploy.sh
echo 'gzip -d bootstrap_${CFVER}-ssh.tar.gz' >> odyssey-device-deploy.sh
echo 'mount -uw -o union /dev/disk0s1s1' >> odyssey-device-deploy.sh
echo 'rm -rf /etc/profile' >> odyssey-device-deploy.sh
echo 'rm -rf /etc/profile.d' >> odyssey-device-deploy.sh
echo 'rm -rf /etc/alternatives' >> odyssey-device-deploy.sh
echo 'rm -rf /etc/apt' >> odyssey-device-deploy.sh
echo 'rm -rf /etc/ssl' >> odyssey-device-deploy.sh
echo 'rm -rf /etc/ssh' >> odyssey-device-deploy.sh
echo 'rm -rf /etc/dpkg' >> odyssey-device-deploy.sh
echo 'rm -rf /Library/dpkg' >> odyssey-device-deploy.sh
echo 'rm -rf /var/cache' >> odyssey-device-deploy.sh
echo 'rm -rf /var/lib' >> odyssey-device-deploy.sh
echo 'tar --preserve-permissions -xkf bootstrap_${CFVER}-ssh.tar -C /' >> odyssey-device-deploy.sh
echo '/Library/dpkg/info/openssh.postinst || true' >> odyssey-device-deploy.sh
echo 'launchctl load -w /Library/LaunchDaemons/com.openssh.sshd.plist || true' >> odyssey-device-deploy.sh
echo 'fi' >> odyssey-device-deploy.sh
echo '/usr/libexec/firmware' >> odyssey-device-deploy.sh
echo 'mkdir -p /etc/apt/sources.list.d/' >> odyssey-device-deploy.sh
echo 'echo "Types: deb" > /etc/apt/sources.list.d/odyssey.sources' >> odyssey-device-deploy.sh
echo 'echo "URIs: https://yaya48.github.io/uncursusrepo" >> /etc/apt/sources.list.d/odyssey.sources' >> odyssey-device-deploy.sh
echo 'echo "Suites: ./" >> /etc/apt/sources.list.d/odyssey.sources' >> odyssey-device-deploy.sh
echo 'echo "Components: " >> /etc/apt/sources.list.d/odyssey.sources' >> odyssey-device-deploy.sh
echo 'echo "" >> /etc/apt/sources.list.d/odyssey.sources' >> odyssey-device-deploy.sh
echo 'mkdir -p /etc/apt/preferenced.d/' >> odyssey-device-deploy.sh
echo 'echo "Package: *" > /etc/apt/preferenced.d/odyssey' >> odyssey-device-deploy.sh
echo 'echo "Pin: release n=uncursus-ios" >> /etc/apt/preferenced.d/odyssey' >> odyssey-device-deploy.sh
echo 'echo "Pin-Priority: 1001" >> /etc/apt/preferenced.d/odyssey' >> odyssey-device-deploy.sh
echo 'echo "" >> /etc/apt/preferenced.d/odyssey' >> odyssey-device-deploy.sh
echo 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games dpkg -i org.coolstar.sileo_1.8.1_iphoneos-arm.deb' >> odyssey-device-deploy.sh
echo 'uicache -p /Applications/Sileo.app' >> odyssey-device-deploy.sh
echo 'echo -n "" > /var/lib/dpkg/available' >> odyssey-device-deploy.sh
echo '/Library/dpkg/info/profile.d.postinst' >> odyssey-device-deploy.sh
echo 'touch /.mount_rw' >> odyssey-device-deploy.sh
echo 'touch /.installed_odyssey' >> odyssey-device-deploy.sh
echo 'rm bootstrap*.tar*' >> odyssey-device-deploy.sh
echo 'rm org.coolstar.sileo_1.8.1_iphoneos-arm.deb' >> odyssey-device-deploy.sh
echo 'rm odyssey-device-deploy.sh' >> odyssey-device-deploy.sh
echo "Downloading Resources..."
curl -L -O https://github.com/coolstar/odyssey-bootstrap/raw/master/bootstrap_1500-ssh.tar.gz -O https://github.com/coolstar/odyssey-bootstrap/raw/master/bootstrap_1600-ssh.tar.gz -O https://github.com/coolstar/odyssey-bootstrap/raw/master/migration -O https://github.com/coolstar/odyssey-bootstrap/raw/master/org.coolstar.sileo_1.8.1_iphoneos-arm.deb
clear
if [[ ! "${ARM}" = yes ]]; then
echo "Copying Files to your device"
echo "Default password is: alpine"
scp -P4444 -o "StrictHostKeyChecking no" -o "UserKnownHostsFile=/dev/null" bootstrap_1500-ssh.tar.gz bootstrap_1600-ssh.tar.gz migration org.coolstar.sileo_1.8.1_iphoneos-arm.deb odyssey-device-deploy.sh root@127.0.0.1:/var/root/
clear
fi
echo "Installing Procursus bootstrap and Sileo on your device"
if [[ "${ARM}" = yes ]]; then
zsh ./odyssey-device-deploy.sh
else
echo "Default password is: alpine"
ssh -p4444 -o "StrictHostKeyChecking no" -o "UserKnownHostsFile=/dev/null" root@127.0.0.1 "zsh /var/root/odyssey-device-deploy.sh"
echo "All Done!"
killall iproxy
fi