iLex RAT, Restore And Keep Jailbreak

#1
First some background. I have been running my iPhone 5 on 6.1.2 jailbroken with Evasion for quite some time. I don't mess with it all the time, but I have a significant number of Cydia apps, tweaks and even some Themes. I like it, and have no plans to upgrade to iOS 7 until there is a stable JB available for it.

About 4 days ago I noticed that my battery suddenly would discharge completely within about 3-4 hours while just sitting in my pocket at work. I hadn't recently installed anything new or updated anything from Cydia so I began a search for the issue.

The first place I looked was at my CPU and network usage while my phone was 'idle'. To do this I installed xCode on my iMac (no dev acct needed) and used the Instruments tool to view the usage in real time. It seemed to indicate that the problem was something in the Springboard process which was constantly running at 40% or so. To me this indicated that perhaps something was attached to Springboard, probably via mobilesubstrate hooks, and it was causing a use issue. However, finding the culprit wasn't easy. After uninstalling a few obvious tweaks without success, I began checking other possibilities.

Standard procedure for checking on high battery use says to remove all email accounts, Facetime, iCloud, and other login configurations, just in case one of them was running rampant and checking connections continuously. I did so, but noticed no improvement.

My last effort was to make use of a Cydia program called iLex RAT. It is downloadable from the repository http://cydia.myrepospace.com/iLEXiNFO/ R.A.T. is an acronym for Remove All Tweaks. As indicated in the title of this thread, one option in iLex RAT allows you to restore your iOS device to factory defaults and keep its jailbreak. It is a script tweak that runs in the Mobile Terminal app and includes several options to make changes to your device.

BEFORE ATTEMPTING THIS BE SURE TO CREATE A BACKUP IN iTunes, AND I RECOMMEND USING THE CYDIA APP PKGBACKUP TO CREATE A BACKUP OF ALL OF YOUR JAILBREAK TWEAKS, THEMES AND SETTINGS AS WELL.

ALSO KEEP IN MIND THAT THIS PROCESS ISN'T NECESSARILY FOOLPROOF. WHILE MOST USERS SEEMS TO HAVE NO PROBLEMS, YOUR MILEAGE MAY VARY AND YOU MAY END UP WITH A DEVICE THAT NEEDS TO BE RESTORED AND LOSE YOUR JAILBREAK.


First, download iLex RAT in Cydia after adding the repository to your Sources. The second step is to download and install MobileTerminal and iFile from Cydia. These two apps are required to run RAT.Third, launch Mobile Terminal and type RAT, then tap the Return key. MobileTerminal will offer you twelve different options for working with iLEX RAT, including the complete restore of jailbroken device which is choice number 12, "ILEX-RESTORE: Revive, Speed Up, Clean Up". Fourth, type 12 and press Return. You will then be asked to confirm your choice by pressing Y.

Be patient. Depending on how many tweaks, apps, photos, and other items you have on your device, you may have to wait minutes for the script to continue. Once it does, it displays a scrolling list of completion notifications. It will ask you if you want it to reboot after it is finished. Enter Y and press Return.

After rebooting your device it will start up as if you just restored your iOS (in my case, iOS 6.1.2). Mine walked me through the standard setup questions of langauge, WiFi, iCloud, etc. When asked if I wanted to set it up as a new iPhone or restore from a backup, I selected my iTunes backup. It then began the restore process, followed by a Sync that restored all my apps, photos, etc.

This process retains your jailbreak and Cydia was still installed on my device. I then downloaded PkgBackup from Cydia and restored my jailbreak settings and tweaks. Obviously the other option would be to start from scratch and reinstall only the tweaks desired.

I now have my iPhone running again and the battery issue seems to be resolved. All of my customization is back and things seem to be working great.

[additional info and instructions on this tweak are available on the net, including video instructions and snapshots]