aboutsummaryrefslogtreecommitdiff
path: root/autofill-parser/src
diff options
context:
space:
mode:
Diffstat (limited to 'autofill-parser/src')
-rw-r--r--autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillHelper.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillHelper.kt b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillHelper.kt
index f08f3172..3514e8f1 100644
--- a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillHelper.kt
+++ b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillHelper.kt
@@ -50,7 +50,10 @@ public fun computeCertificatesHash(context: Context, appPackage: String): String
@SuppressLint("PackageManagerGetSignatures")
@Suppress("DEPRECATION")
val signaturesOld =
- context.packageManager.getPackageInfo(appPackage, PackageManager.GET_SIGNATURES).signatures
+ context.packageManager
+ .getPackageInfo(appPackage, PackageManager.GET_SIGNATURES)
+ .signatures
+ .orEmpty()
val stableHashOld = stableHash(signaturesOld.map { it.toByteArray() })
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
val info =
@@ -63,7 +66,7 @@ public fun computeCertificatesHash(context: Context, appPackage: String): String
context.packageManager.getPackageInfo(appPackage, PackageManager.GET_SIGNING_CERTIFICATES)
}
val signaturesNew =
- info.signingInfo.signingCertificateHistory ?: info.signingInfo.apkContentsSigners
+ info.signingInfo?.signingCertificateHistory ?: info.signingInfo?.apkContentsSigners.orEmpty()
val stableHashNew = stableHash(signaturesNew.map { it.toByteArray() })
if (stableHashNew != stableHashOld)
logcat("CertificatesHash", ERROR) {