So your jailbroken iPhone is eligible for a repair under warranty, but you already voided that when you replaced the software. Is all hope lost?

You could restore the phone to its former untampered-with glory and then return it to Apple for service – a technique used by many, successfully over the years. Then again, being a jailbreaker you should be prepared for complications and raised eyebrows.

Here's how to restore a jailbroken phone while hopefully keeping Apple in the dark.

The Problem With Jailbreaking

Jailbreaking affords you a lot of freedom over what you do with your iPhone, iPad or iPod Touch. You can install OS-level tweaks, replace whole stock apps, override permissions and install any software you like; even if it isn't signed by Apple. While a good number of users claim they're jailbreaking to merely tweak their homescreens, there's a longstanding stigma of piracy and privacy concerns associated with the practice; and that's exactly what Apple doesn't like.

If you jailbreak your Apple device and are refused service, it's entirely your own fault. This goes two-fold for anyone who simply walks into an Apple store with a pre-jailbroken device: you're going to be turned away. The reason? You violated the company's terms and conditions (which most people don't read) by tampering with the software on your device.

The other problem with jailbreaking is that even once you have successfully restored your device; there's still a chance that Apple can tell it has been jailbroken. It's very likely that the company has measures in place to indicate whether a device has had its software tampered with – but we can't say for sure.

There are stories online from those convinced that Apple can detect the remnants of an old jailbreak, while an equally vocal online collective recount tales of restoring successfully and having their phone serviced as normal.

The bottom line: you will have the best odds of success by restoring properly using the technique below, but you should be prepared for a technician to call your bluff – you did violate their terms, after all.

Rebuilding Apple's Walls

I have read some painful stories about users trying to un-jailbreak their devices by deleting Cydia files and data on the phone itself. This will result in a less-than-ideal jailbroken device, in a state of compromise without the necessary software left to actually do anything. Worst case scenario: your device won't boot at all and may require a complete DFU mode reset.

The restore procedure is actually very straightforward, and involves a Mac or PC running the latest version of iTunes. On your device you should head over to Settings > iCloud > Find My iPhone (or iPad/iPod) and turn it off, which will require you to input your Apple ID password.

This removes a level of protection known as Activation Lock, designed to stop thieves from being able to use stolen phones even after software restores. Then, complete the process in the following order:

  1. Update or download iTunes for Windows.
  2. Connect your iPhone to your Mac or PC and launch iTunes.
  3. Under the Backups heading, select your device and click Back Up Now to create a backup.
  4. Under your device's listings in iTunes, click Restore. This will reset the device to an as-new condition and install the latest version of iOS.

Now, you have a "new" iPhone – you could take it straight to Apple and get it serviced for that faulty home button or crackly speaker that's been irking you; but you might want to wait before you restore your backup. Despite iTunes not taking a backup of your firmware, many users are reporting that iTunes does backup (and subsequently restores) files related to your jailbreak, as these are stored in the same place iOS stores your standard apps.

The likelihood of Apple finding these files is anyone's guess, but it's a clear indication of a jailbreak when they do. Rather than restore your device, you can simply leave it in its blank state and restore your backup at a later date once everything is back to normal.

Note: You will of course lose your jailbreak doing this, and the procedure will also update your device software to a point where a jailbreak may no longer be possible. This is probably worth it if you're making a warranty claim.

What Did We Learn?

Aside from the fact that jailbreaking can often create more problems than it solves; restoring an iPhone in iTunes should return it to an as-new state. You just need to be careful when copying your own data back onto the device, as iTunes will restore your jailbreak data too – and that might be your undoing.

As to whether Apple can tell if your device was previously jailbroken: only Apple knows the answer to that – but we can piece it together, using anecdotal Internet musings, in the comments below.

Image credit: The Amazing Apple Store ()For The Love Of God (Brandon Heyer), iPhone 5S (Nicole Kasper)