Update the ramdisk thing

expect and irecovery2 are not needed at all
This commit is contained in:
LukeZGD 2022-07-29 16:59:38 +08:00
parent bbb11ea01f
commit 88f94dfd47
5 changed files with 15 additions and 34 deletions

View File

@ -52,9 +52,6 @@ SetToolPaths() {
python=/
fi
if [[ $platform != "win" ]]; then
expect="$(which expect)"
fi
cherrybin="../$cherry/cherry"
ideviceenterrecovery="$MPath/ideviceenterrecovery"
ideviceinfo="$MPath/ideviceinfo"
@ -64,7 +61,6 @@ SetToolPaths() {
ipwndfu="$python ipwndfu"
irecoverychk="$MPath/irecovery"
irecovery="$irecoverychk"
irecovery2="../tools/irecovery_$platform"
partialzip="./resources/tools/partialzip_$platform"
ping="ping -c1"
powdersn0w="../resources/tools/powdersn0w_$platform"
@ -80,7 +76,6 @@ SetToolPaths() {
if [[ $platform == "linux" ]]; then
irecovery="env LD_LIBRARY_PATH=./resources/lib $irecovery"
irecovery2="env LD_LIBRARY_PATH=../lib $irecovery2"
opensslver=$(openssl version | awk '{print $2}' | cut -c -3)
if [[ $opensslver == "3"* ]]; then
cherrybin="env LD_LIBRARY_PATH=../resources/lib $cherrybin"
@ -165,23 +160,23 @@ InstallDepends() {
fi
if [[ $ID == "arch" || $ID_LIKE == "arch" || $ID == "artix" ]]; then
sudo pacman -Sy --noconfirm --needed base-devel bsdiff curl expect libimobiledevice openssh python2 udev unzip usbmuxd usbutils vim xmlstarlet zenity
sudo pacman -Sy --noconfirm --needed base-devel bsdiff curl libimobiledevice openssh python2 udev unzip usbmuxd usbutils vim xmlstarlet zenity
elif [[ -n $UBUNTU_CODENAME && $VERSION_ID == "2"* ]] ||
(( DebianVer >= 11 )) || [[ $DebianVer == "sid" ]]; then
[[ -n $UBUNTU_CODENAME ]] && sudo add-apt-repository -y universe
sudo apt update
sudo apt install -y bsdiff curl expect libimobiledevice6 openssh-client python2 unzip usbmuxd usbutils xmlstarlet xxd zenity
sudo apt install -y bsdiff curl libimobiledevice6 openssh-client python2 unzip usbmuxd usbutils xmlstarlet xxd zenity
sudo systemctl enable --now udev systemd-udevd usbmuxd 2>/dev/null
elif [[ $ID == "fedora" ]] && (( VERSION_ID >= 36 )); then
ln -sf /usr/lib64/libbz2.so.1.* ../resources/lib/libbz2.so.1.0
sudo dnf install -y bsdiff ca-certificates expect libimobiledevice openssl python2 systemd udev usbmuxd vim-common xmlstarlet zenity
sudo dnf install -y bsdiff ca-certificates libimobiledevice openssl python2 systemd udev usbmuxd vim-common xmlstarlet zenity
sudo ln -sf /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-certificates.crt
elif [[ $ID == "opensuse-tumbleweed" || $PRETTY_NAME == *"Leap 15.4" ]]; then
[[ $ID == "opensuse-leap" ]] && ln -sf /lib64/libreadline.so.7 ../resources/lib/libreadline.so.8
sudo zypper -n in bsdiff curl expect libimobiledevice-1_0-6 openssl python-base usbmuxd vim xmlstarlet zenity
sudo zypper -n in bsdiff curl libimobiledevice-1_0-6 openssl python-base usbmuxd vim xmlstarlet zenity
elif [[ $platform == "macos" ]]; then
xcode-select --install

View File

@ -511,36 +511,21 @@ Ramdisk4() {
cp -rf ramdisk ../resources
cd ..
fi
cd resources/ramdisk
Log "Sending iBSS..."
$irecovery2 -f iBSS.n90ap.RELEASE.dfu
$irecovery -f resources/ramdisk/iBSS.n90ap.RELEASE.dfu
sleep 2
Log "Sending iBEC..."
$irecovery2 -f iBEC.n90ap.RELEASE.dfu
$irecovery -f resources/ramdisk/iBEC.n90ap.RELEASE.dfu
FindDevice "Recovery" error
Log "Booting..."
$expect -c "
spawn $irecovery2 -s
expect \"iRecovery>\"
send \"/send DeviceTree.n90ap.img3\r\"
expect \"iRecovery>\"
send \"devicetree\r\"
expect \"iRecovery>\"
send \"/send 058-1056-002.dmg\r\"
expect \"iRecovery>\"
send \"ramdisk\r\"
expect \"iRecovery>\"
send \"/send kernelcache.release.n90\r\"
expect \"iRecovery>\"
send \"bootx\r\"
expect \"iRecovery>\"
send \"/exit\r\"
expect eof"
cd ../..
$irecovery -f resources/ramdisk/DeviceTree.n90ap.img3
$irecovery -c devicetree
$irecovery -f resources/ramdisk/058-1056-002.dmg
$irecovery -c ramdisk
$irecovery -f resources/ramdisk/kernelcache.release.n90
$irecovery -c bootx
FindDevice "Restore" error
Log "Device should now be in SSH ramdisk mode."
@ -553,6 +538,8 @@ Ramdisk4() {
Echo "* Mount filesystems with these commands:"
Echo " mount_hfs /dev/disk0s1s1 /mnt1"
Echo " mount_hfs /dev/disk0s1s2 /mnt1/private/var"
Echo "* To reboot, use this command:"
Echo " reboot_bak"
}
EnterPwnREC() {

Binary file not shown.

Binary file not shown.

View File

@ -137,8 +137,7 @@ Main() {
[[ $DeviceProc != 4 ]] && Selection+=("Save OTA Blobs")
if [[ $ProductType == "iPhone3,1" && $NoDevice != 1 ]]; then
Selection+=("Disable/Enable Exploit" "Restore to 7.1.2")
[[ $platform != "win" ]] && Selection+=("SSH Ramdisk")
Selection+=("Disable/Enable Exploit" "Restore to 7.1.2" "SSH Ramdisk")
fi
if [[ $DeviceProc != 7 ]]; then