Rewrite + Clean All Used Code

This commit is contained in:
Yaya4 2020-07-15 22:57:58 +02:00 committed by GitHub
parent c45f54b439
commit 4e9055f278
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,99 +16,58 @@ echo "If you're already jailbroken, you can run this script on the checkra1n dev
echo "If you'd rather start clean, please Reset System via the Loader app first." echo "If you'd rather start clean, please Reset System via the Loader app first."
read -p "Press enter to continue" read -p "Press enter to continue"
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
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..." 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 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 if [[ -f "/.bootstrapped" ]]; then
echo "Copying Files to your device" mkdir -p /odyssey && mv migration /odyssey
echo "Default password is: alpine" chmod 0755 /odyssey/migration
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/ /odyssey/migration
clear rm -rf /odyssey
fi
echo "Installing Procursus bootstrap and Sileo on your device"
if [[ "${ARM}" = yes ]]; then
zsh ./odyssey-device-deploy.sh
else else
echo "Default password is: alpine" VER=$(/usr/bin/plutil -key ProductVersion /System/Library/CoreServices/SystemVersion.plist)
ssh -p4444 -o "StrictHostKeyChecking no" -o "UserKnownHostsFile=/dev/null" root@127.0.0.1 "zsh /var/root/odyssey-device-deploy.sh" if [[ "${VER%.*}" -ge 12 ]] && [[ "${VER%.*}" -lt 13 ]]; then
echo "All Done!" CFVER=1500
killall iproxy elif [[ "${VER%.*}" -ge 13 ]]; then
CFVER=1600
else
echo "${VER} not compatible."
exit 1
fi fi
gzip -d bootstrap_${CFVER}-ssh.tar.gz
mount -uw -o union /dev/disk0s1s1
rm -rf /etc/profile
rm -rf /etc/profile.d
rm -rf /etc/alternatives
rm -rf /etc/apt
rm -rf /etc/ssl
rm -rf /etc/ssh
rm -rf /etc/dpkg
rm -rf /Library/dpkg
rm -rf /var/cache
rm -rf /var/lib
tar --preserve-permissions -xkf bootstrap_${CFVER}-ssh.tar -C /
/Library/dpkg/info/openssh.postinst || true
launchctl load -w /Library/LaunchDaemons/com.openssh.sshd.plist || true
fi
/usr/libexec/firmware
mkdir -p /etc/apt/sources.list.d/
echo "Types: deb" > /etc/apt/sources.list.d/odyssey.sources
echo "URIs: https://yaya48.github.io/uncursusrepo" >> /etc/apt/sources.list.d/odyssey.sources
echo "Suites: ./" >> /etc/apt/sources.list.d/odyssey.sources
echo "Components: " >> /etc/apt/sources.list.d/odyssey.sources
echo "" >> /etc/apt/sources.list.d/odyssey.sources
mkdir -p /etc/apt/preferenced.d/
echo "Package: *" > /etc/apt/preferenced.d/odyssey
echo "Pin: release n=uncursus-ios" >> /etc/apt/preferenced.d/odyssey
echo "Pin-Priority: 1001" >> /etc/apt/preferenced.d/odyssey
echo "" >> /etc/apt/preferenced.d/odyssey
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
uicache -p /Applications/Sileo.app
echo -n "" > /var/lib/dpkg/available
/Library/dpkg/info/profile.d.postinst
touch /.mount_rw
touch /.installed_odyssey
rm bootstrap*.tar*
rm org.coolstar.sileo_1.8.1_iphoneos-arm.deb
rm odyssey-device-deploy.sh