From b2aa1155d081dc678a35c59d63a2c7b9b5334ddd Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Mon, 11 Sep 2023 21:13:26 +0200 Subject: [PATCH 1/3] fix: Autofill authentication --- CHANGELOG | 3 +++ .../keepass/autofill/KeeAutofillService.kt | 25 ++++++++++++------- .../metadata/android/en-US/changelogs/125.txt | 1 + .../metadata/android/fr-FR/changelogs/125.txt | 1 + 4 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/125.txt create mode 100644 fastlane/metadata/android/fr-FR/changelogs/125.txt diff --git a/CHANGELOG b/CHANGELOG index cea61f7fb..ad1483790 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +KeePassDX(4.0.2) + * Fix Autofill with API 33 + KeePassDX(4.0.1) * Fix back lock #1635 #1629 #1634 * Fix lock button in settings #1630 diff --git a/app/src/main/java/com/kunzisoft/keepass/autofill/KeeAutofillService.kt b/app/src/main/java/com/kunzisoft/keepass/autofill/KeeAutofillService.kt index 6e7c3290e..e5b792aed 100644 --- a/app/src/main/java/com/kunzisoft/keepass/autofill/KeeAutofillService.kt +++ b/app/src/main/java/com/kunzisoft/keepass/autofill/KeeAutofillService.kt @@ -283,15 +283,22 @@ class KeeAutofillService : AutofillService() { // Build response if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - responseBuilder.setAuthentication( - autofillIds, - intentSender, - Presentations.Builder().apply { - inlinePresentation?.let { - setInlinePresentation(it) - } - }.setDialogPresentation(remoteViewsUnlock).build() - ) + try { + responseBuilder.setAuthentication( + autofillIds, + intentSender, + Presentations.Builder().apply { + inlinePresentation?.let { + setInlinePresentation(it) + } + setDialogPresentation(remoteViewsUnlock) + }.build() + ) + } catch (e: Exception) { + Log.e(TAG, "Unable to use the new setAuthentication method.", e) + @Suppress("DEPRECATION") + responseBuilder.setAuthentication(autofillIds, intentSender, remoteViewsUnlock, inlinePresentation) + } } else { @Suppress("DEPRECATION") responseBuilder.setAuthentication(autofillIds, intentSender, remoteViewsUnlock, inlinePresentation) diff --git a/fastlane/metadata/android/en-US/changelogs/125.txt b/fastlane/metadata/android/en-US/changelogs/125.txt new file mode 100644 index 000000000..02b015d9c --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/125.txt @@ -0,0 +1 @@ + * Fix Autofill with API 33 \ No newline at end of file diff --git a/fastlane/metadata/android/fr-FR/changelogs/125.txt b/fastlane/metadata/android/fr-FR/changelogs/125.txt new file mode 100644 index 000000000..5dda0f3e7 --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/125.txt @@ -0,0 +1 @@ + * Correction de l'Autofill avec l'API 33 \ No newline at end of file From 11a98267a27bb10cd14097a663b659c1faffc9d2 Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Mon, 11 Sep 2023 21:17:18 +0200 Subject: [PATCH 2/3] fix: Upgrade to 4.0.2 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8e244ac37..9477f777b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { applicationId "com.kunzisoft.keepass" minSdkVersion 15 targetSdkVersion 33 - versionCode = 124 - versionName = "4.0.1" + versionCode = 125 + versionName = "4.0.2" multiDexEnabled true testApplicationId = "com.kunzisoft.keepass.tests" From ef77c2acfbf1acabc08cbc3ccb609f61654dd3f4 Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Mon, 11 Sep 2023 21:38:12 +0200 Subject: [PATCH 3/3] fix: Add buggy method comment #1638 --- .../java/com/kunzisoft/keepass/autofill/KeeAutofillService.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/com/kunzisoft/keepass/autofill/KeeAutofillService.kt b/app/src/main/java/com/kunzisoft/keepass/autofill/KeeAutofillService.kt index e5b792aed..e2422373d 100644 --- a/app/src/main/java/com/kunzisoft/keepass/autofill/KeeAutofillService.kt +++ b/app/src/main/java/com/kunzisoft/keepass/autofill/KeeAutofillService.kt @@ -284,6 +284,7 @@ class KeeAutofillService : AutofillService() { // Build response if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { try { + // Buggy method on some API 33 devices responseBuilder.setAuthentication( autofillIds, intentSender,