时间:2014-07-03 14:31:37 来源: 复制分享
声明:Bash脚本非小编发明,请Mac用户看好再行使用,如出现意外,请理解。如果有能力改善,欢迎联系我们。
众所周知iTunes的升级固件功能有时候非常讨厌,稍不注意就会点到升级,而越狱的iPhone在升级后会丢失越狱,有锁版用户更会丢失解锁而变成砖头或者Touch。下面这个脚本通过修改iTunes默认下载路径权限等办法避免以上情况的发生,下面就进入正式的内容(使用脚本,按文章最后的办法将下面文字复制到TextEdit内保存成相应格式即可):
#!/bin/bash
clear
echo "This script will chmod the download locations for Firmware Files, So iTunes can not download firmware."
echo "AKA it will prevent iTunes from auto updating your device."
echo ""
echo ""
echo "To restore firmware just hold down option and manually select the firmware file."
echo ""
clear
echo "Made By: Wesley K"
echo "[email protected]"
echo "http://wesleyk.me"
echo "http://wesleyk.me/twitter"
sleep 2
read -sn 1 -p "Press any key to continue..."
clear
echo "Now I need your password to continue"
echo "Killing iTunes now"
sudo -v
sudo killall -9 iTunes
sleep 2
clear
echo "Im going to make all the folder needed to future proof a few things"
echo "If errors occur here, No big deals."
sudo mkdir ~/Library/iTunes/iPad\ Software\ Updates/
sudo mkdir ~/Library/iTunes/iPod\ Software\ Updates/
sudo mkdir ~/Library/iTunes/iPhone\ Software\ Updates/
sleep 2
clear
echo "I am going to dump all the current files in your update folders."
echo "This will prevent any updates from downloaded firmware."
sudo rm -rf ~/Library/iTunes/iPad\ Software\ Updates/*
sudo rm -rf ~/Library/iTunes/iPhone\ Software\ Updates/*
sudo rm -rf ~/Library/iTunes/iPod\ Software\ Updates/*\
sleep 2
clear
echo "Now preventing iTunes from downloading new firmwares."
sudo chmod 444 ~/Library/iTunes/iPad\ Software\ Updates
sudo chmod 444 ~/Library/iTunes/iPod\ Software\ Updates
sudo chmod 444 ~/Library/iTunes/iPhone\ Software\ Updates
sleep 2
clear
echo "Made By Wesley K"
echo "Give me credit if you use it"
echo "For safe measures I would run this script after iTunes updates, It shouldn't affect it but I don't know yet."
在TextEdit内容,找到Format > Make Plain Text。之后将文件保存在任意不会被删除或者更改的地址即可。 文件名保存为blockitunesupdates.sh或者阻止iTunes升级iPhone固件.sh也可以,随便,只要格式是.sh。
然后打开终端,使用chmod +x 文件名的命令给予脚本执行权限,执行时只要将此.sh文件拖入终端(Terminal)窗口后点击回车或者Return并注意按提示操作即可。
当然,在升级iTunes、OS X或者使用Disk Utility修复文件权限后,可能要重新运行此脚本一次。若想取消此脚本,将脚本中的444都改为755后再执行一次就可以。相信对于很多使用Mac系统的朋友来说,都很容易。