You cannot use JailBreakMe method to jailbreak and unlock iOS 4.0.2 on iPhone 3G. However you can still jailbreak and unlock iPhone 3G using redsn0w. Here are the instructions:
Run RedSn0w and point it at the 4.0 IPSW. (Yes – point it at the 4.0 IPSW even though you’re at 4.0.2). This will also hacktivate your iPhone3G at 4.0.1 if you haven’t already been activated by iTunes.
If you need a carrier unlock – install ultrasn0w in Cydia (add repository http://repo666.ultrasn0w.com). For T-Mobile in the USA remember to turn off 3G mode in Settings→General→Network.
Run RedSn0w and point it at the 4.0 IPSW. (Yes – point it at the 4.0 IPSW even though you’re at 4.0.1). This will also hacktivate your iPhone3G at 4.0.1 if you haven’t already been activated by iTunes.
Install ultrasn0w in Cydia (add repository http://repo666.ultrasn0w.com) if you need a carrier unlock (and in the USA, remember to turn off 3G mode in Settings→General→Network).
DevTeam updated iOS 4 jailbreak utility redsn0w to version 0.9.5b5-5. That should fix any APN or MMS issues that users were seeing. It’s safe to re-run it on an already jailbroken iPhone without restoring. Just deselect “Install Cydia” if you do that.
Supported devices are still only iPhone3G and iPod Touch 2G (not MC)
DevTeam successfully jailbreaked new iOS 4. They updated jailbreak utility redsn0w to version 0.9.5b5-3. Supported devices are iPhone3G and iPod Touch 2G (not MC). New redsn0w is also able to hacktivate iOS 4.0 for iPhone3G.
For those who can legitimately activate to the iPhone3G 4.0GM seed, the “point to previous IPSW” redsn0w trick works and will jailbreak your 4.0GM. The “trick” is to point redsn0w at the 4.0beta4 IPSW instead of 4.0GM (do this after you’ve updated to 4.0GM and activated through the new iTunes 9.2 on your Mac). Since the carrier unlocks aren’t yet supported at 4.0, don’t do this if you use yellowsn0w/ultrasn0w/blacksn0w. Many JB apps are still pretty buggy in 4.0, so again this is mostly useful only for developers of those JB apps.
Note: If you’re experiencing MobileSafari crashes, double check that you’re running the version at the bottom of this page.
For those without legit iPhone3G 4.0GM seed access, please wait until the full public 4.0 release for updates to the jailbreak tools.