From 6800267272d34ac4b665d0ee3678a4a5163e2c2a Mon Sep 17 00:00:00 2001 From: Davinci9196 Date: Fri, 22 May 2026 10:09:19 +0800 Subject: [PATCH] Fixed: [Android Auto] "Requires a newer version of Android Auto" prompt --- .../org/microg/gms/phenotype/PhenotypeService.kt | 6 ++++++ .../org/microg/gms/phenotype/extensions.kt | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/play-services-core/src/main/kotlin/org/microg/gms/phenotype/PhenotypeService.kt b/play-services-core/src/main/kotlin/org/microg/gms/phenotype/PhenotypeService.kt index c925faf26f..3ee29cf2ea 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/phenotype/PhenotypeService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/phenotype/PhenotypeService.kt @@ -78,6 +78,12 @@ private val CONFIGURATION_OPTIONS = mapOf( "com.google.android.apps.photos" to arrayOf( Flag("45617431", true, 0), ), + // Android Auto (Gearhead) — lift Car App Library API max for third-party apps. + // Without this, AA falls back to baked-in default "DEFAULT:7, gearhead:8" which + // blocks Spotify / YouTube Music (require minCarAppApiLevel=8). + "com.google.android.projection.gearhead" to arrayOf( + Flag("Watevra__host_max_api_level", encodeRepeatedString(listOf("DEFAULT:8")), 0), + ), ) class PhenotypeServiceImpl(val packageName: String?) : IPhenotypeService.Stub() { diff --git a/play-services-core/src/main/kotlin/org/microg/gms/phenotype/extensions.kt b/play-services-core/src/main/kotlin/org/microg/gms/phenotype/extensions.kt index 8c360e416d..848b4827c2 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/phenotype/extensions.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/phenotype/extensions.kt @@ -21,6 +21,22 @@ fun encodeSupportedLanguageList(): ByteArray { }.toByteArray() } +fun encodeRepeatedString(entries: List): ByteArray { + val out = mutableListOf() + for (entry in entries) { + val bytes = entry.toByteArray(Charsets.UTF_8) + out.add(0x0A.toByte()) + var n = bytes.size + while (n >= 0x80) { + out.add(((n and 0x7F) or 0x80).toByte()) + n = n ushr 7 + } + out.add(n.toByte()) + for (b in bytes) out.add(b) + } + return out.toByteArray() +} + fun configurationsResult(configurations: Array = emptyArray()) = Configurations().apply { serverToken = "unknown" snapshotToken = "unknown"