1. buy a plug
Note that it has three – not just two – insulating rings.
2. prepare wires
|blue||right speaker||ring 1|
This is the configuration I used and it worked fine for me. However, there seems to be a different configuration where microphone and ground connectors switch places.
First you need to remove the insulation. I used a pocket lighter to remove this stuff. But be careful, it burns pretty well.
Now you might put the plug cover and a piece of heat shrink tube in place (see step 5).
Then you can carefully solder the connectors onto the corresponding pins. If you have problems soldering check out this comic by Andie Nordgren.
At this point you should test the new plug (e.g. with your phone). Make sure right and left audio channels are in the right place and the mircophone is working.
Now you have to make sure no uninsulated wires or pins are touching each other. I used a good amount of hot glue but you can also use clear nail polish. The hot glue brings extra stability and keeps the wires in place.
Additionally I used a piece of heat shrink tube for more stability. Shrinking the tube (again with a pocket lighter) melted part of the hot glue so I could screw the cover easily on the plug. This is the result: