Rear microphone not detected
From the following article, it could be due to need for an impedance (a resistor) between the Mic and the Ground wires. As per


  The trick in detecting the external microphone on the smart phone is
  to have right impedance between the mic pins. Samsung phones seem to
  require a microphone with impedance of around 1.0k – 1.5k Ohm. Some
  other devices might also work with somewhat higher resistance values
  (1 kohm to few kilo-ohms).


I don't think it's a matter of altering the OS as detection is probably reliant upon the physical/electronic components used.

The article explains that there are two standards used for 4 pin OMTP and AHJ. It also has links to some articles about how to connect (aka DIY wiring/rewiring).

Here's a link to the article. 

Android device external mic wiring

I don't think that it's a matter of changing the OS, rather catering for the specific components used.