### Build and run commands Source: https://github.com/alexandrevega/pillion/blob/main/docs/IOS.md Commands to install xcodegen, generate the Xcode project, and open it. Requires a real iPhone for the extension and External Accessory features. ```bash brew install xcodegen # once cd iosApp && xcodegen generate # writes iosApp.xcodeproj (gitignored) open iosApp.xcodeproj ``` -------------------------------- ### Streaming flow diagram Source: https://github.com/alexandrevega/pillion/blob/main/docs/IOS.md ASCII diagram showing the flow from the Compose Start mirroring button through the system broadcast picker to the PillionBroadcast extension, which captures via ReplayKit, encodes to JPEG, and sends via NaviLite to the bike or emulator. ```text Compose "Start mirroring" ──► system broadcast picker ──► PillionBroadcast extension │ ReplayKit capture → JPEG → NaviLite ▼ bike (External Accessory) or emulator (TCP) ``` -------------------------------- ### Conventional Commits examples for commit messages Source: https://github.com/alexandrevega/pillion/blob/main/CONTRIBUTING.md Commit messages must follow Conventional Commits. Examples include feat(android): …, fix(protocol): …, docs: …, chore: …, and refactor(core): …. ```text feat(android): … ``` ```text fix(protocol): … ``` ```text docs: … ``` ```text chore: … ``` ```text refactor(core): … ``` -------------------------------- ### Build unsigned Pillion.ipa with build-ipa.sh Source: https://github.com/alexandrevega/pillion/blob/main/docs/IOS-SIDELOAD.md Builds an unsigned Pillion.ipa in Release configuration from the iosApp directory. The IPA is intentionally unsigned so AltStore, Sideloadly, or TrollStore can re-sign it with your Apple ID during installation. ```bash cd iosApp && ./build-ipa.sh # produces an unsigned Pillion.ipa (Release) ``` -------------------------------- ### Pillion protocol handshake and image loop sequence Source: https://github.com/alexandrevega/pillion/blob/main/docs/PROTOCOL.md Shows the end-to-end message sequence: ESN update/ack, auth request/ack, setup burst, and the image frame loop with IMAGE_FRAME_UPDATE and IMAGE_ACK. Comments indicate XOR operations for auth data and image dimensions. ```text dash → ESN_UPDATE(66) phone → ESN_ACK(81) phone → AUTH_REQUEST(33) dash → AUTH_REQUEST_SEC_DATA(83) # ("partnumber"+nonce) XOR 0x0A phone → AUTH_REQUEST_SEC_DATA_ACK(84) # nonce XOR 0x0A phone → setup burst (nav status, day/night, gps, zoom, ...) loop: phone → IMAGE_FRAME_UPDATE(0) # imageType + seq + JPEG(480x240 or 480×236) dash → IMAGE_ACK(80) ``` -------------------------------- ### Build and Test Pillion from Source Source: https://github.com/alexandrevega/pillion/blob/main/README.md Commands to clone the repository, build the debug APK, and run protocol unit tests. ```bash git clone https://github.com/alexandrevega/pillion.git cd pillion ./gradlew :composeApp:assembleDebug # -> composeApp/build/outputs/apk/debug/composeApp-debug.apk ./gradlew :composeApp:testDebugUnitTest # protocol unit tests (CRC + auth vectors) ``` -------------------------------- ### Set Android SDK path in local.properties Source: https://github.com/alexandrevega/pillion/blob/main/CONTRIBUTING.md Create a local.properties file with sdk.dir pointing to the Android SDK; the file is gitignored. ```properties sdk.dir=/path/to/Android/sdk ``` -------------------------------- ### Build APK and run protocol unit tests with Gradle Source: https://github.com/alexandrevega/pillion/blob/main/CONTRIBUTING.md Builds the Android APK with :composeApp:assembleDebug and runs protocol unit tests with :composeApp:testDebugUnitTest. Requires Android SDK and JDK 17 (or Android Studio). ```bash ./gradlew :composeApp:assembleDebug # build the APK ./gradlew :composeApp:testDebugUnitTest # run protocol unit tests ``` -------------------------------- ### Build shared framework only Source: https://github.com/alexandrevega/pillion/blob/main/docs/IOS.md Gradle command to compile the Kotlin iOS simulator target. The first run downloads the Kotlin/Native toolchain. ```bash ./gradlew :composeApp:compileKotlinIosSimulatorArm64 ``` -------------------------------- ### Project source layout for composeApp Source: https://github.com/alexandrevega/pillion/blob/main/CONTRIBUTING.md Shows the Kotlin Multiplatform source sets: commonMain holds protocol, core, and Compose UI; androidMain holds Android actuals; commonTest holds protocol unit tests. Platform pieces are injected through ByteChannel and ScreenSource interfaces. ```text composeApp/src/ commonMain/ # shared, platform-agnostic: protocol + engine + Compose UI protocol/ # NaviLite framing, CRC-32/MPEG-2, auth (see docs/PROTOCOL.md) core/ # ByteChannel / ScreenSource abstractions, MirrorEngine, Handshake ui/ # Compose UI androidMain/ # Android actuals: RFCOMM transport, MediaProjection capture, service commonTest/ # protocol unit tests (CRC + captured auth vectors) ``` -------------------------------- ### Add SDL Android dependency (gradle/libs.versions.toml + composeApp/build.gradle.kts) Source: https://github.com/alexandrevega/pillion/blob/main/docs/SDL_INTEGRATION.md Add the SDL Android library version 5.8.0 to the Android main source set. This dependency is required for the SDL integration. ```gradle com.smartdevicelink:sdl_android:5.8.0 ``` -------------------------------- ### Frame format table Source: https://github.com/alexandrevega/pillion/blob/main/docs/PROTOCOL.md Shows the byte layout of a NaviLite frame: 4-byte magic, version, frame type, service type, payload size, payload data type, CRC, and payload. The header is 12 bytes (offsets 0-11), followed by a 4-byte CRC and the payload. ```text offset size field 0 4 magic "nAl@" (0x6E 0x41 0x6C 0x40) 4 1 version observed: 0x01 5 1 frameType e.g. PHONE = 6 6 1 serviceType see table below 7 4 payloadSize uint32, little-endian 11 1 payloadDataType VALUE = 0, POINTER = 1 12 4 crc uint32, little-endian (see below) 16 var payload payloadSize bytes ``` -------------------------------- ### LinkKind open value class with first-party link kinds Source: https://github.com/alexandrevega/pillion/blob/main/docs/ARCHITECTURE_HEADUNITS.md Defines LinkKind as an open value class so plugins can extend the set of link kinds without modifying an enum. The companion object lists first-party kinds: BluetoothRfcomm, UsbAoa, UsbIap2, MfiAccessory, and TcpDebug. ```kotlin @JvmInline value class LinkKind(val id: String) { companion object { val BluetoothRfcomm=LinkKind("bt-rfcomm"); val UsbAoa=LinkKind("usb-aoa") val UsbIap2=LinkKind("usb-iap2"); val MfiAccessory=LinkKind("mfi"); val TcpDebug=LinkKind("tcp") } } ``` -------------------------------- ### AUTH_REQUEST_SEC_DATA payload obfuscation formula Source: https://github.com/alexandrevega/pillion/blob/main/docs/PROTOCOL.md Formula for the AUTH_REQUEST_SEC_DATA payload. Each byte is XOR-ed with 0x0A; de-obfuscating reveals the CCU part number as an ASCII string followed by a 4-byte nonce. ```plaintext payload = ( ASCII(part-number) + nonce[4] ) XOR 0x0A (byte-wise) ``` -------------------------------- ### IMAGE_FRAME_UPDATE payload layout Source: https://github.com/alexandrevega/pillion/blob/main/docs/PROTOCOL.md Layout of the IMAGE_FRAME_UPDATE payload. imageType is observed as 3 for expanded navigation view; sequence is a little-endian uint16 that increments per frame; the JPEG is baseline, 480×240 or 480×236. ```plaintext offset size field 0 1 imageType observed 3 = expanded navigation view 1 2 sequence uint16, little-endian, increments per frame 3 var jpeg baseline JPEG, 480 × 240 or 480 × 236 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.