The JailbreakMe jailbreak tool has turned incompatible with the newly released iOS 4.0.2. But you could still jailbreak iPhone 3G on iOS 4.0.2 using the Redsn0w 0.9.5 beta 5 tool. If you want to jailbreak iPhone 3G 4.0.2 firmware, then here is how to do it using Redsn0w 0.9.5 beta 5.
But you should also download the iOS 4 .ipsw file for iPhone 3G for this to work.
1. Download Redsn0w 0.9.5 beta 5 for Mac OS X or Windows.
2. Download the iOS 4.0.2 firmware for iPhone 3G from here.
3. Update your iPhone 3G to iOS 4.0.2 using iTunes.
4. Launch Redsn0w and browse to the iOS 4 firmware file (Not the iOS 4.0.2 firmware).
5. Check the ” Install Cydia ” box and click ” Next “.
6. Now switch off your device but keep it plugged in to the computer.
7. Now go into recovery mode by pressing the power and buttons for 10 seconds and then release the power button, but keep holding the home button until the iPhone 3G iOS 4.0.2 jailbreak process begins.
8. Now wait till Redsn0w jailbreak your iPhone 3G running iOS 4.0.2 firmware.
After the jailbreak, it will automatically restart and you will find your iPhone 3G completely jailbroken on iOS 4.0.2 firmware.