From e8cdc2077f295cf61ed7157f8ae2cdbb53c39054 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 8 Aug 2024 02:46:08 +0530 Subject: fix(build): compile against SDK 35 --- .../github/androidpasswordstore/autofillparser/AutofillHelper.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'autofill-parser/src') 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) { -- cgit v1.2.3