Source
http://www.e398mod.com/
With this picture tutorial you can mod your USB cable to not only flash, but also charge your phone while it is connected.

This is how the cable looks like (before modding)

Open it up and get all wires out

Unpack step 1

Unpack step 2

Remove the protection

Check out the pin scheme by clicking on the picture

Scratch the panel on the back

Solder 22Komh resistor end on pin 2 and the second on the scratched place (ground)

Put back the protector

Put the wires trough the hole

Pack

Make a hole on the plastic cover, so the wire can run out trough it

Pack

Ready to connect a switch

You are ready. You have ON/OFF for USB charger

Proof 1

Proof 2

Proof 3
SOURCE: E398MOD.COM