Skip to content

Commit

Permalink
fix: improve system lpa discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
septs committed Sep 1, 2024
1 parent 75d0d59 commit 9ac239c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/src/main/java/app/septs/euiccprobe/SystemApps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ package app.septs.euiccprobe
import java.io.File

object SystemApps {
private val perms = setOf(
private val requiredPermissions = setOf(
"android.permission.MODIFY_PHONE_STATE",
"android.permission.READ_PRIVILEGED_PHONE_STATE",
"android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS",
)

private val optionalPermissions = setOf(
"android.permission.SECURE_ELEMENT_PRIVILEGED_OPERATION",
"com.android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS",
)

Expand All @@ -25,6 +29,9 @@ object SystemApps {
file.inputStream().use(parser::parse)
}
}
return parser.filter { perm -> perm.allowedPermissions.containsAll(perms) }
return parser.filter { perm ->
perm.allowedPermissions.containsAll(requiredPermissions) &&
perm.allowedPermissions.any(optionalPermissions::contains)
}
}
}

0 comments on commit 9ac239c

Please sign in to comment.