Jailbreak is 100% legal in US but it voids the warranty of your iPhone, iPad or iPod Touch.If you have jailbroken your iPhone and facing some issues with the device and thinking of going to Apple Store to replace your device, no worries.Apple Store will not accept a jailbroken device hence first of all you will have to remove jailbreak.
Steps to be followed to remove jailbreak on iPhone,iPad or iPod Touch
1. First of all open iTunes on your PC or Mac and connect your device through USB cable.
2. Now you can cancel the automatic backup of your device or let it complete.
3. Select your device from the left column of iTunes on PC or Mac and click on “Restore”.
4. If you have cancelled back up in step 2 then “select Backup” otherwise go for the option “Don’t Back Up”.
5. Voila, your device is now been restored to Factory Settings and jailbreak removed.
6. Lastly, select the backup which was created through iTunes to re-install your Apps and Settings.
Also Read: How To Reinstall Cydia