xcertplay README

The project's README from github.com/shilapi/xcertplay. As one markdown file: README.md.

xcertplay icon

xcertplay

English | 中文

An Android head-unit CarPlay receiver. It supports connecting to the MFi chip through a CH341 I2C bridge or directly through the board's I2C controller, and supports both wired and wireless CarPlay connections.

Features

Usage

  1. Pair your iPhone with the head unit via Bluetooth.
  2. Before a CarPlay video stream starts, tap the Settings button in the lower-right corner. You can also swipe down with three fingers to open Settings.
  3. Make sure all the settings are configured as desired. To enable another entry gesture, turn on More gestures to Settings page. Start with one finger in the upper quarter of the left eighth of the screen, slide down along that strip, and lift in the lower quarter.
  4. Scroll to the bottom and select Save & Reconnect.
  5. Connect your MFi chip using the method you selected.
  6. Wait for the connection to complete, then enjoy.

TODO

Current progress

It works 👍. It has been tested on car head units and phones. If you encounter an incompatible car head unit, please open an issue and attach your log from /sdcard/Android/data/com.shilapi.xcertplay/files/logs/xcertplay.log.

Adapter board: CH341-to-MFI

Waiting for the MFI chip adapter board to arrive...

Project structure

Path Purpose
common/ Shared CarPlay host activity, settings UI, persistence, and app resources used by both targets.
mobile/ Standard Android target using the shared CarPlay host UI.
automotive/ Android Automotive OS target with the shared host UI and advanced audio channel mapping.
shared/ Car App Library code plus the CH341, I2C, MFi, iPhone, iAP2, NCM, VPN, AirPlay, and media implementations.

Remote MFI

The Remote MFi client treats a remote service as an MFi chip for remote calls, or uses BAA authentication. Remote authentication avoids the process of connecting to a local MFi chip for authentication.

Endpoints

Method Path Purpose Request body Success response Failure response
GET /mfi/certificate Get the MFi chip version, certificate type, and certificate contents; cached by the client after the first call None Certificate JSON {"detail":"..."}
POST /mfi/sign Sign the challenge {"challenge":"...","requestId":"..."} {"signature":"..."} {"detail":"..."}
POST /mfi/reset Request a reset of the remote MFi chip {} {"detail":""} {"detail":"..."}

(Optional) Standard Bearer Authentication can be used for verification.

Currently, only BAA Authentication has been tested.

Requirements

Build

On Windows PowerShell:

$env:JAVA_HOME = "C:\Program Files\Android\Android Studio\jbr"
.\gradlew.bat :shared:testDebugUnitTest :common:lintDebug :mobile:lintDebug :automotive:lintDebug :mobile:assembleDebug :automotive:assembleDebug

On macOS or Linux:

./gradlew :shared:testDebugUnitTest :common:lintDebug :mobile:lintDebug :automotive:lintDebug :mobile:assembleDebug :automotive:assembleDebug

Unsigned release APKs:

.\gradlew.bat :mobile:assembleRelease :automotive:assembleRelease

Acknowledgements

Thanks to LIVI for providing important reference for this project. Thanks to the showcase project for providing important reference for the BAA authentication in this project.

License

Licensed under the GNU General Public License v3.0.

xcertplay (shilapi/xcertplay)

Searching Database…

这是什么?xcertplay 能把 Android 车机变成 CarPlay 接收器,通过 CH341 I2C 桥接器或板载原生 I2C 控制器连接 MFi 认证芯片,同时支持有线和无线 CarPlay 会话。
这是刷进车机的应用,还是别的东西?它是一个 Android 应用,有两个共享同一 CarPlay 宿主界面的构建目标:标准手机版目标,以及带高级音频通道映射的 Android Automotive OS 目标。
怎么在车机上让 CarPlay 会话跑起来?先用蓝牙把 iPhone 和车机配对,在视频串流开始前打开设置,配置 MFi 芯片的连接方式,选择 Save & Reconnect,然后连接芯片并等待握手完成。
需要什么硬件和软件?你需要一枚通过 CH341 桥接器或原生 /dev/i2c-N 设备接线的实体 MFi 认证芯片,外加一台支持 USB Host/OTG、运行 Android 9(API 28)或更新版本的 Android 设备;构建则需要 JDK 17+、Android SDK Platform 37 和 NDK 28.2.13676358。
这里的东西都能正常用吗,还是有些只做了一半?核心 CarPlay 功能可用,并已在真实车机和手机上测试过,但 CarPlay Ultra 支持未经测试、尚不完整(只能在 iPhone 上触发提示),还有一个已知的麦克风透传 bug,而且目前只提供未签名的 release APK。
Remote MFI 是干什么用的?它让远程 HTTP 服务通过 /mfi/certificate、/mfi/sign、/mfi/reset 等端点充当 MFi 芯片,这样无需给本地 MFi 芯片接线也能完成 CarPlay 认证;目前实际测试过的只有 BAA 认证。
为什么用 CH341 而不是直接连接 MFi 芯片?CH341 是一个 USB 转 I2C 桥接器,用于没有内置 I2C 控制器的板子;自带 I2C 控制器的板子则可以直接通过原生 /dev/i2c-N 设备与 MFi 芯片通信。
它能分开导航、语音和音乐音频吗?可以。语音、导航和音乐各自作为独立通道路由,映射到对应的 Android 音频输出。
如果我的车机用不了怎么办?作者希望你带着 /sdcard/Android/data/com.shilapi.xcertplay/files/logs/xcertplay.log 的日志开一个 issue,因为不同车机的兼容性仍在验证中。
Creator
shilapi
Size
7.2 MB
Stars
1.5K
Age
1mo
Commits · 90 Days