Multiple iPhones bricked by jailbreak legacy

Multiple users are reporting that attempts to upgrade iPhone 4 and iPhone 3Gs are resulting in bricked handsets stuck in infinite Recovery Mode loops.

Although the vast majority of forum posters are reporting that their current handsets have never been jailbroken (it is an official Apple Forum after all) digging deeper into the threads it turns out that a large proportion of the users experiencing difficulties have, at some time in the past, either jailbroken another device or allowed their computers to be used for such nefarious purposes by a third party.

In nearly all of the cases, iTunes gets most of the way through the install process but eventually returns an error 1013 and then throws the iPhone into an infinite restore loop which can only be stopped by doing a hard reboot - hold down home button and power button for about 15 seconds or more until the Apple logo appears.

From our investigations, it seems that a previous version of Cydia has modified a line in the /etc/hosts file to point a particular hostname to 74.208.10.249 rather than the official Apple IP address - with the modification turning out to be an IP address registered to 1and1 networks and used as a repository by jailbreaking app Cydia.

Unfortunately, the Cydia code did not rewrite the hosts file to point back to Apple after it was finished, hence the unfortunate brickage.

Forum poster Dave01978 has offered the following fix which involves using the Terminal application to 'comment out' the offending lines of code from the hosts file.

On a Mac:

1. Go to your "Applications" folder
2. Go to your "Utilities" folder
3. Launch "Terminal"
4. Type "sudo nano /etc/hosts" (without quotes) and hit return
5. Enter your password
6. Use the down arrow key to find the "gs.apple.com" entries. Once the cursor is in front, make sure you comment out the line(s) by entering "#" (no quotes) in front of the text
7. Save the file by pressing CONTROL+O on the keyboard
8. Exit the nano editor by pressing CONTROL+X on the keyboard
9. Restore your iDevice

On Windows:

1. Start > Programs > Accessories > Notepad
2. File > Open
3. Navigate to c:\windows\system32\drivers\etc\
4. Select the "hosts" file and click "open"
5. Delete any line that has "sc.apple.com"
6. File > Save
7. Restore your iDevice

The usual caveats apply... if you have any other error than 1013, or are absolutely sure no-one has ever used your computer to jailbreak an Apple device, you probably have another problem. In this case you should contact Apple before you make things any worse.

If it works, get yourself on the Apple Forum and thank C. Castillo and Dave01978 for their help.

If it doesn't work, don't blame us, we did our best. And next time your brother/sister/friend/fat bloke down the pub asks you if he can use your machine to jailbreak his iPhone, tell him to bugger off.