Skip to content

Instantly share code, notes, and snippets.

@beer-psi
Last active April 1, 2022 06:38
Show Gist options
  • Save beer-psi/5adfd84dd5a60f9c7c733321cd187529 to your computer and use it in GitHub Desktop.
Save beer-psi/5adfd84dd5a60f9c7c733321cd187529 to your computer and use it in GitHub Desktop.
odysseyra1n bootstrap script but it's in PowerShell

Run by doing

iwr https://gist.github.com/beerpiss/5adfd84dd5a60f9c7c733321cd187529/raw/b1e991f56b35f151b82e68fe8386a6fa7f589d84/procursus-deploy.ps1 | iex
#!/usr/bin/env pwsh
function New-TemporaryDirectory {
$parent = [System.IO.Path]::GetTempPath()
[string] $name = [System.Guid]::NewGuid()
New-Item -ItemType Directory -Path (Join-Path $parent $name) | Out-Null
return (Join-Path $parent $name)
}
$CURRENTDIR = (Get-Location)
$ODYSSEYDIR = (New-TemporaryDirectory)
Write-Output @"
Odysseyra1n Installation Script
Proudly written in PowerShell (idea by cameren#0420)
Before you begin:
If you're currently jailbroken with a different bootstrap
installed, you will need to Reset System via the Loader app
before running this script.
Press any key to continue.
"@
[Console]::ReadKey() | Out-Null
if (!(Get-Command iproxy)) {
Write-Output "Error: iproxy not found."
Write-Output "Install from https://github.com/libimobiledevice-win32/imobiledevice-net/releases/tag/v1.3.17"
exit 1
}
if (!(Get-Command ssh)) {
Write-Output "Error: ssh not found."
Write-Ouput "(Windows) Install with the command: Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0"
exit 1
}
Set-Location $ODYSSEYDIR
@'
if [[ -f "/.bootstrapped" ]]; then
echo "Error: Migration from other bootstraps is no longer supported."
rm ./bootstrap* ./*.deb odysseyra1n-install.bash
exit 1
fi
if [[ -f "/.installed_odyssey" ]]; then
echo "Error: Odysseyra1n is already installed."
rm ./bootstrap* ./*.deb odysseyra1n-install.bash
exit 1
fi
VER=$(/binpack/usr/bin/plutil -key ProductVersion /System/Library/CoreServices/SystemVersion.plist)
if [[ "${VER%%.*}" -ge 12 ]] && [[ "${VER%%.*}" -lt 13 ]]; then
CFVER=1500
elif [[ "${VER%%.*}" -ge 13 ]] && [[ "${VER%%.*}" -lt 14 ]]; then
CFVER=1600
elif [[ "${VER%%.*}" -ge 14 ]] && [[ "${VER%%.*}" -lt 15 ]]; then
CFVER=1700
else
echo "${VER} not compatible."
exit 1
fi
mount -o rw,union,update /dev/disk0s1s1
rm -rf /etc/{alternatives,apt,ssl,ssh,dpkg,profile{,.d}} /Library/dpkg /var/{cache,lib}
gzip -d bootstrap_${CFVER}.tar.gz
tar --preserve-permissions -xkf bootstrap_${CFVER}.tar -C /
SNAPSHOT=$(snappy -s | cut -d ' ' -f 3 | tr -d '\n')
snappy -f / -r "$SNAPSHOT" -t orig-fs > /dev/null 2>&1
/prep_bootstrap.sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games
if [[ $VER = 12.1* ]] || [[ $VER = 12.0* ]]; then
dpkg -i org.swift.libswift_5.0-electra2_iphoneos-arm.deb > /dev/null
fi
echo "(4) Installing Sileo and upgrading Procursus packages..."
dpkg -i org.coolstar.sileo_2.2.3_iphoneos-arm.deb > /dev/null
uicache -p /Applications/Sileo.app
mkdir -p /etc/apt/sources.list.d /etc/apt/preferences.d
{
echo "Types: deb"
echo "URIs: https://repo.theodyssey.dev/"
echo "Suites: ./"
echo "Components: "
echo ""
} > /etc/apt/sources.list.d/odyssey.sources
touch /var/lib/dpkg/available
touch /.mount_rw
touch /.installed_odyssey
apt-get update -o Acquire::AllowInsecureRepositories=true
apt-get dist-upgrade -y --allow-downgrades --allow-unauthenticated
uicache -p /var/binpack/Applications/loader.app
rm ./bootstrap* ./*.deb odysseyra1n-install.bash
echo "Done!"
'@ | Out-File -FilePath odysseyra1n-install.bash
$IPROXY = Start-Job -ScriptBlock { iproxy 28605 44 }
Write-Output "[1] Downloading resources..."
Invoke-WebExpression -UseBasicParsing -Uri "https://github.com/coolstar/Odyssey-bootstrap/raw/master/bootstrap_1500.tar.gz" -OutFile "bootstrap_1500.tar.gz"
Invoke-WebExpression -UseBasicParsing -Uri "https://github.com/coolstar/Odyssey-bootstrap/raw/master/bootstrap_1600.tar.gz" -OutFile "bootstrap_1600.tar.gz"
Invoke-WebExpression -UseBasicParsing -Uri "https://github.com/coolstar/Odyssey-bootstrap/raw/master/bootstrap_1700.tar.gz" -OutFile "bootstrap_1700.tar.gz"
Invoke-WebExpression -UseBasicParsing -Uri "https://github.com/coolstar/Odyssey-bootstrap/raw/master/org.coolstar.sileo_2.2.3_iphoneos-arm.deb" -OutFile "org.coolstar.sileo_2.2.3_iphoneos-arm.deb"
Invoke-WebExpression -UseBasicParsing -Uri "https://github.com/coolstar/Odyssey-bootstrap/raw/master/org.swift.libswift_5.0-electra2_iphoneos-arm.deb" -OutFile "org.swift.libswift_5.0-electra2_iphoneos-arm.deb"
Write-Output "[2] Copying resources to your device"
Write-Output "Default password is: alpine"
scp -qP28605 -o "StrictHostKeyChecking no" -o "UserKnownHostsFile=/dev/null" bootstrap_1500.tar.gz `
bootstrap_1600.tar.gz bootstrap_1700.tar.gz `
org.coolstar.sileo_2.2.3_iphoneos-arm.deb `
org.swift.libswift_5.0-electra2_iphoneos-arm.deb `
odysseyra1n-install.bash `
[email protected]:/var/root/
Write-Output "[3] Bootstrapping your device"
Write-Output "Default password is: alpine"
ssh -qp28605 -o "StrictHostKeyChecking no" -o "UserKnownHostsFile=/dev/null" [email protected] "bash /var/root/odysseyra1n-install.bash"
Stop-Job $IPROXY
Remove-Job $IPROXY
Set-Location $CURRENTDIR
Remove-Item -Recurse -Force $ODYSSEYDIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment