The guy who made his own iPhone entirely with parts bought in Chinese markets is back with a new achievement: Scotty of Strange Parts was not happy about his iPhone 7 lacking a headphone jack, so he decided to add his own. The biggest challenge was getting everything to fit inside the handset, but he ultimately managed to create the first modern iPhone with a functional 3.5mm connector.
I took apart an Apple lightning to headphone adapter, put that inside the phone, and hooked it up by man-in-the-middling the lightning jack with a flexible PCB. The PCB has a switching chip that switches between connecting the headphone adapter to the phone by default, and then disconnecting it and connecting the lightning jack when something is plugged into it. I have a couple other timer chips that briefly disconnect everything from the phone when something is connected/disconnected to improve the reliability of the phone detecting when something is plugged/unplugged (otherwise it sometimes gets confused).
Discussion
Source: [H]ardOCP – Bringing Back the iPhone Headphone Jack in China