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=/ python=/
fi fi
if [[ $platform != "win" ]]; then
expect="$(which expect)"
fi
cherrybin="../$cherry/cherry" cherrybin="../$cherry/cherry"
ideviceenterrecovery="$MPath/ideviceenterrecovery" ideviceenterrecovery="$MPath/ideviceenterrecovery"
ideviceinfo="$MPath/ideviceinfo" ideviceinfo="$MPath/ideviceinfo"
@ -64,7 +61,6 @@ SetToolPaths() {
ipwndfu="$python ipwndfu" ipwndfu="$python ipwndfu"
irecoverychk="$MPath/irecovery" irecoverychk="$MPath/irecovery"
irecovery="$irecoverychk" irecovery="$irecoverychk"
irecovery2="../tools/irecovery_$platform"
partialzip="./resources/tools/partialzip_$platform" partialzip="./resources/tools/partialzip_$platform"
ping="ping -c1" ping="ping -c1"
powdersn0w="../resources/tools/powdersn0w_$platform" powdersn0w="../resources/tools/powdersn0w_$platform"
@ -80,7 +76,6 @@ SetToolPaths() {
if [[ $platform == "linux" ]]; then if [[ $platform == "linux" ]]; then
irecovery="env LD_LIBRARY_PATH=./resources/lib $irecovery" irecovery="env LD_LIBRARY_PATH=./resources/lib $irecovery"
irecovery2="env LD_LIBRARY_PATH=../lib $irecovery2"
opensslver=$(openssl version | awk '{print $2}' | cut -c -3) opensslver=$(openssl version | awk '{print $2}' | cut -c -3)
if [[ $opensslver == "3"* ]]; then if [[ $opensslver == "3"* ]]; then
cherrybin="env LD_LIBRARY_PATH=../resources/lib $cherrybin" cherrybin="env LD_LIBRARY_PATH=../resources/lib $cherrybin"
@ -165,23 +160,23 @@ InstallDepends() {
fi fi
if [[ $ID == "arch" || $ID_LIKE == "arch" || $ID == "artix" ]]; then 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"* ]] || elif [[ -n $UBUNTU_CODENAME && $VERSION_ID == "2"* ]] ||
(( DebianVer >= 11 )) || [[ $DebianVer == "sid" ]]; then (( DebianVer >= 11 )) || [[ $DebianVer == "sid" ]]; then
[[ -n $UBUNTU_CODENAME ]] && sudo add-apt-repository -y universe [[ -n $UBUNTU_CODENAME ]] && sudo add-apt-repository -y universe
sudo apt update 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 sudo systemctl enable --now udev systemd-udevd usbmuxd 2>/dev/null
elif [[ $ID == "fedora" ]] && (( VERSION_ID >= 36 )); then elif [[ $ID == "fedora" ]] && (( VERSION_ID >= 36 )); then
ln -sf /usr/lib64/libbz2.so.1.* ../resources/lib/libbz2.so.1.0 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 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 elif [[ $ID == "opensuse-tumbleweed" || $PRETTY_NAME == *"Leap 15.4" ]]; then
[[ $ID == "opensuse-leap" ]] && ln -sf /lib64/libreadline.so.7 ../resources/lib/libreadline.so.8 [[ $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 elif [[ $platform == "macos" ]]; then
xcode-select --install xcode-select --install

View File

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

Binary file not shown.

Binary file not shown.

View File

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