I have an LG Lotus phone. It charges over a USB cable, which plugs into a USB-like port on the charger. I recently wanted to be able to charge my phone in the woods of Vermont, where outlets to plug a charger into are few and far between. To fix this, I built a simple regulator that draws power from a 7.2V RC car battery and provides 5V DC to a USB jack.
Unfortunately, when I plugged my phone into it, the phone displayed a message that said “Please use only genuine LJ accessories”.
To figure out how the phone identified the charger, I opened the charger up. I had visions of LG using an I2C EEPROM to store a unique identifier or some sort of crypto chip performing a handshake with the phone based on a shared secret that was baked in at the factory.
In reality, it’s nothing that complicated. The data lines of the USB port are connected to each other. This means that anything the phone sends down one data line will show back up on the other one, so it can detect the connected pins by driving one line high and seeing if the other line also goes high. I connected the data pins on my homebrew charger, and the phone started charging from it.