Remove nvram wifiaddr "workaround"

To undo the nvram changes, run "nvram -d wifiaddr" as root
This commit is contained in:
LukeZGD 2021-01-24 11:47:51 +08:00
parent cef83c9dca
commit 6f0fdbf691
2 changed files with 6 additions and 22 deletions

View File

@ -94,7 +94,6 @@
- Other than the above, unfortunately there's not much else I can do to help regarding entering pwnDFU mode. - Other than the above, unfortunately there's not much else I can do to help regarding entering pwnDFU mode.
- For 32-bit devices: - For 32-bit devices:
- To devices with baseband, this script will restore your device with the latest baseband (except when jailbreak is enabled, and on iPhone5,1 as there are reported issues) - To devices with baseband, this script will restore your device with the latest baseband (except when jailbreak is enabled, and on iPhone5,1 as there are reported issues)
- This script has a workaround for the activation error on devices downgrading from iOS 10
- This script can also be used to just enter kDFU mode for all supported devices - This script can also be used to just enter kDFU mode for all supported devices
- As alternatives to kloader/kDFU, checkm8 A5 or ipwndfu can also be used in DFU advanced menu - As alternatives to kloader/kDFU, checkm8 A5 or ipwndfu can also be used in DFU advanced menu
- To enter DFU advanced menu, put your iOS device in DFU mode before running the script - To enter DFU advanced menu, put your iOS device in DFU mode before running the script

View File

@ -140,7 +140,6 @@ function Main {
Mode='Downgrade' Mode='Downgrade'
Log "32-bit device in DFU mode detected." Log "32-bit device in DFU mode detected."
Echo "* Advanced options menu - use at your own risk" Echo "* Advanced options menu - use at your own risk"
Echo "* Warning: A6 devices won't have activation error workaround yet when using this method"
Input "This device is in:" Input "This device is in:"
select opt in "kDFU mode" "DFU mode (ipwndfu A6)" "pwnDFU mode (checkm8 A5)" "(Any other key to exit)"; do select opt in "kDFU mode" "DFU mode (ipwndfu A6)" "pwnDFU mode (checkm8 A5)" "(Any other key to exit)"; do
case $opt in case $opt in
@ -296,38 +295,24 @@ function kDFU {
[ ! $(which $iproxy) ] && Error "iproxy cannot be found. Please re-install dependencies and try again" "./restore.sh Install" [ ! $(which $iproxy) ] && Error "iproxy cannot be found. Please re-install dependencies and try again" "./restore.sh Install"
$iproxy 2222 22 & $iproxy 2222 22 &
iproxyPID=$! iproxyPID=$!
WifiAddr=$(echo "$ideviceinfo2" | grep 'WiFiAddress' | cut -c 14-)
WifiAddrDecr=$(echo $(printf "%x\n" $(expr $(printf "%d\n" 0x$(echo "${WifiAddr}" | tr -d ':')) - 1)) | sed 's/\(..\)/\1:/g;s/:$//')
echo '#!/bin/sh' > tmp/pwn.sh
echo "/usr/sbin/nvram wifiaddr=$WifiAddrDecr" >> tmp/pwn.sh
chmod +x tmp/pwn.sh
Log "Copying stuff to device via SSH..." Log "Copying stuff to device via SSH..."
Echo "* Make sure OpenSSH/Dropbear is installed on the device!" Echo "* Make sure OpenSSH/Dropbear is installed on the device!"
Echo "* Enter root password of your iOS device when prompted, default is 'alpine'" Echo "* Enter root password of your iOS device when prompted, default is 'alpine'"
scp -P 2222 resources/tools/$kloader tmp/pwnediBSS tmp/pwn.sh root@127.0.0.1:/ scp -P 2222 resources/tools/$kloader tmp/pwnediBSS root@127.0.0.1:/
if [ $? == 1 ]; then if [ $? == 1 ]; then
Log "Cannot connect to device via USB SSH. Will try again with Wi-Fi SSH..." Log "Cannot connect to device via USB SSH. Will try again with Wi-Fi SSH..."
Echo "* Make sure that the device and your PC/Mac are on the same network!" Echo "* Make sure that the device and your PC/Mac are on the same network!"
Echo "* You can check for your device's IP Address in: Settings > WiFi/WLAN > tap the 'i' next to your network name" Echo "* You can check for your device's IP Address in: Settings > WiFi/WLAN > tap the 'i' next to your network name"
read -p "$(Input 'Enter the IP Address of your device: ')" IPAddress read -p "$(Input 'Enter the IP Address of your device: ')" IPAddress
Log "Copying stuff to device via SSH..." Log "Copying stuff to device via SSH..."
scp resources/tools/$kloader tmp/pwnediBSS tmp/pwn.sh root@$IPAddress:/ scp resources/tools/$kloader tmp/pwnediBSS root@$IPAddress:/
[ $? == 1 ] && Error "Cannot connect to device via SSH. Please check your ~/.ssh/known_hosts file and try again" "You may also run: rm ~/.ssh/known_hosts" [ $? == 1 ] && Error "Cannot connect to device via SSH. Please check your ~/.ssh/known_hosts file and try again" "You may also run: rm ~/.ssh/known_hosts"
Log "Entering kDFU mode..."
if [[ $VersionDetect == 1 ]]; then
ssh root@$IPAddress "/pwn.sh; /$kloader /pwnediBSS" &
else
ssh root@$IPAddress "/$kloader /pwnediBSS" & ssh root@$IPAddress "/$kloader /pwnediBSS" &
fi
else
Log "Entering kDFU mode..."
if [[ $VersionDetect == 1 ]]; then
ssh -p 2222 root@127.0.0.1 "/pwn.sh; /$kloader /pwnediBSS" &
else else
ssh -p 2222 root@127.0.0.1 "/$kloader /pwnediBSS" & ssh -p 2222 root@127.0.0.1 "/$kloader /pwnediBSS" &
fi fi
fi Log "Entering kDFU mode..."
echo echo
Echo "* Press POWER or HOME button when screen goes black on the device" Echo "* Press POWER or HOME button when screen goes black on the device"
Log "Finding device in DFU mode..." Log "Finding device in DFU mode..."
@ -539,7 +524,7 @@ function Downgrade {
fi fi
if [[ $Jailbreak == 1 ]]; then if [[ $Jailbreak == 1 ]]; then
Log "Proceeding to idevicerestore..." Log "Proceeding to idevicerestore... (Enter root password of your PC/Mac when prompted)"
mkdir shsh mkdir shsh
mv $SHSH shsh/${UniqueChipID}-${ProductType}-${OSVer}.shsh mv $SHSH shsh/${UniqueChipID}-${ProductType}-${OSVer}.shsh
$idevicerestore -y -e -w $IPSW.ipsw $idevicerestore -y -e -w $IPSW.ipsw