mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-02-10 19:52:24 +00:00
android: add A16's new bluetooth identifier for log collection
just why...
This commit is contained in:
@@ -53,12 +53,20 @@ class LogCollector(private val context: Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private suspend fun getBluetoothUID(): String? {
|
||||||
|
val pkgs = listOf("com.android.bluetooth", "com.google.android.bluetooth")
|
||||||
|
for (pkg in pkgs) {
|
||||||
|
val uid = executeRootCommand(
|
||||||
|
"dumpsys package $pkg | grep -m 1 \"uid=\" | sed -E 's/.*uid=([0-9]+).*/\\1/'"
|
||||||
|
).trim()
|
||||||
|
if (uid.isNotEmpty()) return uid
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
private suspend fun getPackageUIDs(): Pair<String?, String?> {
|
private suspend fun getPackageUIDs(): Pair<String?, String?> {
|
||||||
return withContext(Dispatchers.IO) {
|
return withContext(Dispatchers.IO) {
|
||||||
val btUid = executeRootCommand("dumpsys package com.android.bluetooth | grep -m 1 \"uid=\" | sed -E 's/.*uid=([0-9]+).*/\\1/'")
|
val btUid = getBluetoothUID()
|
||||||
.trim()
|
|
||||||
.takeIf { it.isNotEmpty() }
|
|
||||||
|
|
||||||
val appUid = executeRootCommand("dumpsys package me.kavishdevar.librepods | grep -m 1 \"uid=\" | sed -E 's/.*uid=([0-9]+).*/\\1/'")
|
val appUid = executeRootCommand("dumpsys package me.kavishdevar.librepods | grep -m 1 \"uid=\" | sed -E 's/.*uid=([0-9]+).*/\\1/'")
|
||||||
.trim()
|
.trim()
|
||||||
.takeIf { it.isNotEmpty() }
|
.takeIf { it.isNotEmpty() }
|
||||||
|
|||||||
Reference in New Issue
Block a user