feat: Add dialog

This commit is contained in:
J-Jamet
2025-09-17 13:58:12 +02:00
parent d5c378ac85
commit 1e7e464e65
5 changed files with 244 additions and 78 deletions

View File

@@ -49,6 +49,9 @@ data class AppOrigin(
* return the first verified origin or throw an exception if none is found
*/
fun checkAppOrigin(compare: AppOrigin): String {
if (compare.androidOrigins.isNotEmpty()) {
throw SignatureNotFoundException(this, "Android origin not found")
}
return androidOrigins.firstOrNull { androidOrigin ->
compare.androidOrigins.any {
it.packageName == androidOrigin.packageName
@@ -100,6 +103,14 @@ data class AppOrigin(
}
}
/**
* Exception indicating that no signature is present for the Android origin
*/
class SignatureNotFoundException(
val temptingApp: AppOrigin,
message: String
) : Exception(message)
/**
* Represents an Android app origin, the [packageName] is the applicationId of the app
* and the [fingerprint] is the