Although I can’t and don’t guarantee this will work 100% of the time, if you’ve tried to jailbreak your iPhone and your phone gets stuck at the Apple Logo and reboots every 5-10 minutes, you need to follow these steps:
Setting the iPhone to recovery mode allows you to perform firmware restore using iTunes.
1) Power off the iPhone by depressing both the sleep/wake button on the top of the iPhone and the home button. Wait for the iPhone screen to turn black aka screen-off.
2) Depress the home button and connect the iPhone/iPod sync cable into the docking port on the bottom of the iPhone at the sametime without removing pressure on the home button.
3) You should be able to see the Apple logo coming up on the iPhone and then the recovery screen with be shown after the Apple logo:
4) iTunes will start and inform you that it has detected an iPhone in recovery mode and you should restore your iPhone to start using it.
5) Perform your firmware restore.
6) Exit iTunes and Re-jailbreak.
7) Don’t restore from a backup, just set up your phone as a new phone, then re-sync to add back all your data and apps.
DONE!