Now, you can jailbreak your iPhone 3GS (Old Bootrom) on iOS 4.0.2 using the unofficial release of PwangeTool, As you know, you don’t need to update to iOS 4.0.2 as the iPhone dev team announced with PDF Patch which close security holes on all Apple devices! but in case you already upgrade to iOS 4.0.2 and can’t downgrade so here’s a quick guide to jailbreak your iPhone 3GS on iOS 4.0.2 below,
Step 1: Download and iTunes 9.2.1 from Here, and the Original iOS 4.0.2 from Here
Step 2: Start iTunes, Sync your iPhone with your PC or Mac and backup all your data by Right click on your iPhone and click on “Backup”
Step 3: Now, Download the UnOfficial PwnageTool from Here
Step 4: Launch PwnageTool you have just Downloaded, Then choose your Device and Click on the blue arrow
Step 5: Now PwnageTool should detect the correct original firmware of your Device, Check on it and Click on the blue arrow
Step 6: When PwnageTool asks you “Do you have an iPhone contract that would activate normally through iTunes?” Click “No”
Step 7: A menu of several options will appear, Check on General and Choose your settings
Step 8: After choosing your Options, Check on Build and Hit the Blue arrow
Step 9: Now, PwnageTool will ask you to Save Custom Firmware, Choose the place you want then Save it
Step 10: PwnageTool will now create the custom .ipsw file for your iPhone which will be jailbroken.
Step 11: Once the .ipsw file created, navigate to itunes, Click on iPhone on the left, then hold left “alt” button (“Shift” button on Windows) on the keyboard and then click on “Restore” then release the alt button
Step 12: iTunes now should ask you about the .ipsw file, head up it to the created custom firmware by PwnageTool
Step 13: Now, Sit back and let iTunes do it.. After several steps of installing the new firmware, Your device should be Jailbroken Successfully
In case you want to jailbreak iPhone 3G on iOS 4.0.2 you can use Redsn0w for both Windows and Mac by following the guide posted here.After done with the jailbreak, then you can follow the step by step guide posted here to unlock any device using Ultrasn0w 1.0-1.