Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Prevent iTunes from updating jailbroken devices iOS devices
This is a simple bash script I made that will prevent iTunes from updating any device. To update after you use this script you just manually download the firmware and do option restore. I made it because I was hearing about a lot of people who 'accidentally' upgraded to a non-jailbreakable firmware.

All this script will do is chmod the download directorys of the iTunes software updates. When it tries to download it will be denied permission. Quite simple.
#!/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 "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."
Heres a link to download the script from the Pastie online service.

[crarko adds: I haven't tested this one. As I've mentioned before, I don't jailbreak. If you download the script it has a ruby (.rb) extension. It's not ruby so change it to .sh. Note that you could also just go chmod 444 the relevant directories by hand in Terminal. The original permissions on the directories is 755 if you wanted to change them back.]
    •    
  • Currently 2.78 / 5
  You rated: 5 / 5 (9 votes cast)
 
[5,894 views]  

Prevent iTunes from updating jailbroken devices | 9 comments | Create New Account
Click here to return to the 'Prevent iTunes from updating jailbroken devices' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Prevent iTunes from updating jailbroken devices
Authored by: jaguarcy on Oct 08, '10 08:48:37AM

What happens when you run Disk Utilitiy's Repair Disk Permissions? It's a bad idea to rely on this.



[ Reply to This | # ]
Prevent iTunes from updating jailbroken devices
Authored by: gjm25 on Oct 08, '10 10:35:39AM

There is no need for using 'sudo' in any of these commands, since the user is only changing their own user folder. It's safer to leave it out.
I think that Disk Utility repair permissions only looks at system files and not user files so this should not be affected by that.



[ Reply to This | # ]
Prevent iTunes from updating jailbroken devices
Authored by: crarko on Oct 08, '10 11:39:32AM

You are absolutely right. Thanks.



[ Reply to This | # ]
Prevent iTunes from updating jailbroken devices
Authored by: gjm25 on Oct 08, '10 01:42:17PM

Here is a modified version of the script, less of a sledgehammer approach and more 'softly softly' without sudo and also taking into account the comment about mkdir -p

It is safer not to use sudo to limit what could go wrong if you make a typo.

#!/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 "http://wesleyk.me"
echo "http://wesleyk.me/twitter"
sleep 2
read -sn 1 -p "Press any key to continue..."
clear
echo "Killing iTunes now"
killall 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."
mkdir -p ~/Library/iTunes/iPad Software Updates/
mkdir -p ~/Library/iTunes/iPod Software Updates/
mkdir -p ~/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."
rm -rf ~/Library/iTunes/iPad Software Updates/*
rm -rf ~/Library/iTunes/iPhone Software Updates/*
rm -rf ~/Library/iTunes/iPod Software Updates/*
sleep 2
clear

echo "Now preventing iTunes from downloading new firmwares."
chmod 444 ~/Library/iTunes/iPad Software Updates
chmod 444 ~/Library/iTunes/iPod Software Updates
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."
Edited on Oct 08, '10 01:44:09PM by gjm25


[ Reply to This | # ]
Prevent iTunes from updating jailbroken devices
Authored by: cyberdave on Oct 08, '10 12:01:38PM

There's a comment noting that the 'mkdir' commands may produce an error, which can be ignored.

That's because 'mkdir' will complain if the directory already exists. This can be changed to 'mkdir -p', which will cause mkdir to be quiet if that's the case.



[ Reply to This | # ]
Prevent iTunes from updating jailbroken devices
Authored by: creamers on Oct 09, '10 10:11:30AM

Thanks will update it with that function.

---
~Wesley K



[ Reply to This | # ]
Overkill
Authored by: bankshot on Oct 08, '10 01:36:30PM

Just as sudo is unnecessary to kill iTunes and change directory permissions, the "-9" argument to killall is really unnecessary. It doesn't give iTunes a chance to exit gracefully and do the normal cleanup that it does when it exits. Either a regular killall without "-9" would be better, or just tell the user to quit. Heck, you could even do it via AppleScript:

osascript -e 'tell application "iTunes" to quit'

The current method is kind of like using a sledgehammer to ring a doorbell - it'll get the job done, but it's overkill and may cause unintended damage.

The one way in which sudo would be useful here is if the script changed ownership of the directories to root. Then a future version of iTunes wouldn't be able to change permissions back. As it is now, if the directories don't exist, they will be owned by root (because they are created using sudo), but if they do already exist, ownership won't change. I'd just create directories as the user and then only use sudo to chown them to root.

Finally, I'd prefer to move any existing updates out of the way rather than deleting them.



[ Reply to This | # ]
Overkill
Authored by: bglnelissen on Oct 09, '10 02:32:13AM
Running oascript on Snow Leopard can give a strange error. To prevent this you can change: osascript to: arch -i386 osascript

[ Reply to This | # ]
prevent error from
Authored by: bglnelissen on Oct 09, '10 02:22:59AM
Running oascript on Snow Leopard can give a strange error. To prevent this you can change:

osascript
to:
arch -i386 osascript

...and most people who know how to run a script and have there iPhone jailbroken aren't foolish enough to update anyway.

I personally think that using 'Folder actions' is a much more gentle approach. http://www.apple.com/pro/tips/folderactions.html

Edited on Oct 09, '10 02:30:41AM by bglnelissen


[ Reply to This | # ]