File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
android/app/src/main/java/me/kavishdevar/librepods/utils Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -53,12 +53,20 @@ class LogCollector(private val context: Context) {
5353 }
5454 }
5555
56+ private suspend fun getBluetoothUID (): String? {
57+ val pkgs = listOf (" com.android.bluetooth" , " com.google.android.bluetooth" )
58+ for (pkg in pkgs) {
59+ val uid = executeRootCommand(
60+ " dumpsys package $pkg | grep -m 1 \" uid=\" | sed -E 's/.*uid=([0-9]+).*/\\ 1/'"
61+ ).trim()
62+ if (uid.isNotEmpty()) return uid
63+ }
64+ return null
65+ }
66+
5667 private suspend fun getPackageUIDs (): Pair <String ?, String ?> {
5768 return withContext(Dispatchers .IO ) {
58- val btUid = executeRootCommand(" dumpsys package com.android.bluetooth | grep -m 1 \" uid=\" | sed -E 's/.*uid=([0-9]+).*/\\ 1/'" )
59- .trim()
60- .takeIf { it.isNotEmpty() }
61-
69+ val btUid = getBluetoothUID()
6270 val appUid = executeRootCommand(" dumpsys package me.kavishdevar.librepods | grep -m 1 \" uid=\" | sed -E 's/.*uid=([0-9]+).*/\\ 1/'" )
6371 .trim()
6472 .takeIf { it.isNotEmpty() }
You can’t perform that action at this time.
0 commit comments