Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ fun encodeSupportedLanguageList(): ByteArray {
}.toByteArray()
}

fun encodeRepeatedString(entries: List<String>): ByteArray {
val out = mutableListOf<Byte>()
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<Configuration> = emptyArray()) = Configurations().apply {
serverToken = "unknown"
snapshotToken = "unknown"
Expand Down