1. Download iPhone OS 3.1.2 firmware from here and save it into a folder.
2. Connect your iPhone via USB and launch iTunes.
Note: I suggest not to use the docking for the jailbreak. Connect the USB cable directly with your iPhone.
3. Restore your iPhone with iPhone OS 3.1.2. For Windows, hold SHIFT key and click on the “Restore” button and select the firmware file (i.e. iPhone1,1_3.1.2_7D11_Restore.ipsw) you have just downloaded. For Mac, hold option key and click on the “Restore” button and select the firmware file (i.e. iPhone1,1_3.1.2_7D11_Restore.ipsw) to restore.
4. If you’re not using official sim, your iPhone will not be recognized by iTunes after restoration. Don’t worry. It’s normal. You can then close iTunes and continues with the next step.
5. Go to blackra1n.com and download blackra1n. Both Windows and Mac versions are available. So, you should download the correct version depending on your OS.
6. After downloading, unzip the blackra1n.zip.
7. Make sure your iPhone is still connected with your computer via USB. Launch blackra1n.
8. Click “make it ra1n” to start the jailbreak.
9. Once you click the button, the jailbreak process starts and it’ll take around 30 seconds to complete.
10. Wait until you see the following message and your iPhone should be jailbroken after reboot.
Great! Up to this point, your iPhone should have been activated and jailbroken.
Tip: Before proceeding, if you have WiFi connection, I suggest you to first enable it before continuing. This should speed up the download process of cydia.
11. Next, you’ll have to install Cydia. Tap on the “blackra1n” icon.
12. Tap on “Cydia” and then “Install” button to install Cydia. Just wait until the download and installation to complete.
Okay, with cydia installed, the whole jailbreak process is complete. But if you need to unlock your iPhone 2G to work with unofficial sim, launch cydia and install bootneuter. After installation, reboot your iPhone and enjoy iPhone OS 3.1.2!
Note: If you want to uninstall blackra1n from iPhone home screen, launch blackra1n again and select “uninstall blackra1n”.