Headswap is an open-source Android application that enables Android Auto functionality on vehicles equipped only with the Baidu CarLife protocol. The application acts as a bridge, appearing as a phone to the car's head unit and as a head unit to the Android Auto system on the user's smartphone. The project code is licensed under GPL-3.0 and is available on GitHub.

The developer reverse-engineered the CarLife protocol by analyzing the Baidu CarLife 8.6.7 APK and native libraries. The application handles protocol-specific handshake requirements, including RSA-based authentication using a shared key extracted from the official Baidu app. Headswap supports various connection methods, including USB AOA and Wi-Fi, and manages video stream compatibility through on-the-fly transcoding or direct passthrough.

The development process involved addressing numerous hardware-specific limitations across various car brands, including Honda, Mazda, Volkswagen, and Hyundai. Issues ranged from buffer overflows caused by large data packets to crashes triggered by non-standard video encoding profiles. The application now includes adaptive bitrate control and specific workarounds for different head unit suppliers like Mobis, Desay, and LG.

To ensure stability, the developer implemented a system of feature flags and automated testing tools, including Python-based emulators for both the head unit and the Android Auto server. Headswap currently supports a wide range of vehicles, with future updates focusing on optimizing performance for older, lower-spec head units and refining compatibility for diverse automotive infotainment systems.