Wednesday, December 21, 2011

Restoring a Jailbroken iPhone made Painless (relatively)

One of the most sure-fire ways to fix a myriad of problems with an Iphone is to restore the firmware in iTunes. One of the most dreadded tasks apparently is the need to restore a modded and jailbroken iPhone. I have come up with a process that is realitvely simple and painless. Many people want to restore from backup- but this generally only causes problems in the long run from carrying forward corrupted data so always restore as "new".

This process assumes a jailbroken, modded iPhone with both Cydia and AppStore apps installed, 2G or 3G on 2.x firmware.

1. If you do not already have installed, install AppBackup and Chronus from Cydia. Note on these apps, if you installed apps after installing Chronus, you may want to reinstall so that the new apps show up in the list. AppBackup will not reliably restore app data in 3.1.2 so you should back everythign up using CHronus. It now works well for both jailbreak apps and AppStore apps.


1a. Purchase and install PkgBackup form Cydia. It is well worth the cost as a time saver in reinstalling Cydia apps. Backup your packages and then dont forget to sync in iTunes before you restore.

2. Use those apps to backup whatever apps you want data saved for.

3. Using SSH (WinSCP, for XP/Vista or Fugu or Cyberduck on OS X) copy the following to your computer:
a. /var/Stash/Themes<random characters>
b. /var/mobile/Library/Preferences/TimeCapsule
c. /var/mobile/Library/Preferences/com.apple.mobilephone.speeddial.plist (if you have favorites saved in your phone app)
d. /var/mobile/Library/AppBackup
e. /var/mobile/Library/YouTube (if you have bookmarks saved- Chronus does not copy the VideoCache)
f. /var/mobile/Library/MxTube (if you have that app and have downloaded videos saved- Chronus does not save the VideoLibrary.plist).
g. if you want to backup sms history, call history, cache, bookmarks and contacts (besides using itunes) then copy the folders of the same name in User/Library folder

Note: If you have a Mac, you can simply SSH the Themes folder , skip steps b-f and then SSH the entire var/mobile/Library folder to your desktop.

4. Sync iPhone in iTunes.

5. Restore firmware in itunes - restore iPhone as NEW.

6. After new firmware is installed and phone is activated, uncheck the box that says automatically sync iPhone when connected

7. Jailbreak with your preferred jailbreak method.

8. Open Cydia, do all the upgrades

9. Install Open SSH from Cydia (always good to have when installing apps in case something goes wrong)

9a. Install PkgBackup from Cydia. You will NOT have to repurchase it.


10. Reboot phone

11. Resync iPhone, This next part is crucial, If you sync contact, email, bookmarks and calendars before you click sync, make sure you scroll down to the bottom of the Info screen and check off the box that says replace info on iPhone this sync only" (not exact wording) I believe many people lose their info this way, since the iphone at this point is blank, if you do not do this step your sync will erase your data on the computer. Reboot iPhone.

12. Once all your apps both Cydia and AppStore ones are installed, install Chronus and AppBackup from Cydia.
Note: If you theme with Winterboard, or use Categories folders, you may install those apps but do not do anything with them yet

13. SSH all the files and folders you previously saved to your computer back to their appropriate locations on your iPhone.

13a. You will probably have to fix file wonership on teh AppBackup and TimeCapsule Library folders in order to restore the data you saved. Using Putty on Windows or Terminal on a Mac type the following commands hitting enter after each command:
chown -R mobile:mobile /var/mobile/Library/AppBackup/
chown -R mobile:mobile /var/mobile/Library/Preferences/TimeCapsule


13b. You may also need to change permissions on the com.apple.mobilephone.speeddial.plist to 600 to get the phone favorites to show up. This you can do with WinSCP (Windows) or Cyberduck or Fugu (Mac)


14. Open up Chronus and select the apps you want data restored from.

15. Open up AppBackup and restore app data for your selected apps.

16. Now you may apply your Winterboard theme and create your Categories folders.

17. Reboot iPhone for good measure.

Enjoy.

This entire process takes no more than about an hour and I have about 60 apps installed. Most of that hour is spent restoring the firmware and resyncing. reinstalling Cydia apps is not a terrible process. I usually just scroll through the list of apps and methodically install as i come up on an app i use. However, using PkgBackup greatly reduces the time involved in reinstalling the Cydia apps. PkgBackup will not reinstall any of the apps that are not compatible with your firmware or hardware. I used it when I upgraded from a 3G to a 3GS and it worked flawlessly.

No comments:

Post a Comment