PDA

View Full Version : Securely restore your iPhone before resale (< 2.0 firmware)



pande_monium
11-07-2008, 11:22 AM
Now that iPhone 3G is out, some of you may be looking to sell your old iPhones (< 2.0 firmware) and upgrading to the new one.

However, when you restore your iphone normally, it will keep your contacts/settings/etc by default. So, the next gent in line will have a ball calling up your girlfriend !!

So, how do you get out of this mess? Here's how...

Launch iTunes, connect your iPhone & Select it in the menu on the left in iTunes

On the Summary tab on the right, click on the "Restore" button
When asked if you want to Backup your iPhone. Say Dont Back Up.
Also choose Restore when asked - if you want to restore the iPhone to its Factory Settings.
iTunes will now restore your iPhone to its Factory Settings.
The iPhone will now reboot. Leave it connected.

After the iPhone reboots, you will need to jailbreak/unlock it. There's a few things you need to do to unlock an iPhone:
a) Jailbreak (use any one of the various tools like Ziphone/iPwanage/etc) <Tutorial (To view links or images in this forum your post count must be 1 or greater. You currently have 0 posts. b) Set auto-lock to Never in >> Settings:General:Auto-Lock
c) Install BSD subsystem <Tutorial (To view links or images in this forum your post count must be 1 or greater. You currently have 0 posts. d) Install SSH <Tutorial (To view links or images in this forum your post count must be 1 or greater. You currently have 0 posts. Download Unmount from HERE (http://rapidshare.com/files/122525674/umount.html) & install it. It'll install in your Applications>Utilities Folder.
Open a Terminal window from your Mac

Enter the following command replacing the ip with the ip of your iPhone
scp ~/Desktop/umount root@192.168.0.192:/sbin/umount
If asked for a password, use "alpine".

Now SSH into your phone... (use your iPhone's ip instead of the following one)
ssh root@192.168.0.192
If asked for a password, use "alpine".

Now, to give unmount the executable permissions, enter:
chmod 755 /sbin/umount
To force both mount points in to read only mode, enter the following commands into Terminal:
umount -f /private/var
mount -o ro /private/var
mount -o ro /
We now will wipe both partitions clean by copying /dev/zero over them. Enter the following commands into your Terminal window:
cat /dev/zero > /dev/rdisk0s2; cat /dev/zero > /dev/rdisk0s1
NOTE: This will likely take up to an hour to complete! After completion your iPhone, iPod touch GUI will be unresponsive. This is expected.
# chmod 775 /sbin/unmount
# unmount -f /private/var
# mount -o ro /private/var
# mount -r ro /
cat /dev/zero > /dev/rdisk0s2; cat /dev/zero > /dev/rdisk0s1
cat: stdout: Input/Output error
cat: stdout: Input/Output error

Now put the phone in recovery mode by pressing the Sleep/Wake button (on the top) and the Home button untill the iTunes icon + dock connector appear on the screen
Now follow the steps above (till step 7) to restore your iPhone AGAIN. Once done, your iPhone touch will be ready for re-sale!QED !