From a7a93fa2a22e664c33d0007ff871da413bb5fe98 Mon Sep 17 00:00:00 2001 From: Stefan Hauser Date: Thu, 16 Jan 2025 09:15:32 +0100 Subject: [PATCH 01/13] Use local date/time in filename for saving a copy of the database --- .../java/com/kunzisoft/keepass/activities/GroupActivity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/kunzisoft/keepass/activities/GroupActivity.kt b/app/src/main/java/com/kunzisoft/keepass/activities/GroupActivity.kt index 19d963469..d6b1f7470 100644 --- a/app/src/main/java/com/kunzisoft/keepass/activities/GroupActivity.kt +++ b/app/src/main/java/com/kunzisoft/keepass/activities/GroupActivity.kt @@ -116,7 +116,7 @@ import com.kunzisoft.keepass.view.showActionErrorIfNeeded import com.kunzisoft.keepass.view.updateLockPaddingLeft import com.kunzisoft.keepass.viewmodels.GroupEditViewModel import com.kunzisoft.keepass.viewmodels.GroupViewModel -import org.joda.time.Instant +import org.joda.time.LocalDateTime class GroupActivity : DatabaseLockActivity(), @@ -343,7 +343,7 @@ class GroupActivity : DatabaseLockActivity(), mExternalFileHelper?.createDocument( getString(R.string.database_file_name_default) + "_" + - Instant.now().toString() + + LocalDateTime.now().toString() + mDatabase?.defaultFileExtension) } R.id.menu_lock_all -> { From 8470c4e39b09a230b8bdfe63a87e90c1e804ce90 Mon Sep 17 00:00:00 2001 From: d20n <108351001+d20n@users.noreply.github.com> Date: Mon, 14 Jul 2025 17:20:42 +0200 Subject: [PATCH 02/13] Fix several incomplete en_GB strings --- app/src/main/res/values-en-rGB/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/values-en-rGB/strings.xml b/app/src/main/res/values-en-rGB/strings.xml index 9e3da4fa9..3381902a0 100644 --- a/app/src/main/res/values-en-rGB/strings.xml +++ b/app/src/main/res/values-en-rGB/strings.xml @@ -33,10 +33,10 @@ Encryption Contact Contribution - password - Encryption + Android implementation of the KeePass password manager + Encryption algorithm Timeout - database + Idle time before locking the database App Brackets Extended ASCII @@ -236,4 +236,4 @@ Show number of entries Displays OTP tokens in the list of entries Show OTP Token - \ No newline at end of file + From cb1316564e165011e57fdf8e1b4e26a6208ac0b9 Mon Sep 17 00:00:00 2001 From: Izzy Date: Tue, 15 Jul 2025 09:51:50 +0200 Subject: [PATCH 03/13] IzzyOnDroid provides both, the Free and the Libre variants --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ed22a1894..5602ac334 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Optional visual styles are accessible after a contribution (and a congratulatory |--------|--------|---------| | [Google Play](https://play.google.com/store/apps/details?id=com.kunzisoft.keepass.free) | ![Google Play Release](https://img.shields.io/endpoint?color=blue&logo=google-play&logoColor=green&url=https%3A%2F%2Fplay.cuzi.workers.dev%2Fplay%3Fi%3Dcom.kunzisoft.keepass.free%26gl%3DUS%26hl%3Den%26l%3DGoogle%2520Play%26m%3D%24version) | Free + [Pro](https://play.google.com/store/apps/details?id=com.kunzisoft.keepass.pro) | | [F-Droid](https://f-droid.org/en/packages/com.kunzisoft.keepass.libre/) | ![F-Droid Version](https://img.shields.io/f-droid/v/com.kunzisoft.keepass.libre?logo=F-Droid&label=F-Droid) | Libre | -| [IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.kunzisoft.keepass.free) | ![IzzyOnDroid Version](https://img.shields.io/endpoint?&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAADAFBMVEUA0////wAA0v8A0v8A0////wD//wAFz/QA0/8A0/8A0/8A0/8A0v///wAA0/8A0/8A0/8A0/8A0//8/gEA0/8A0/8B0/4A0/8A0/8A0/+j5QGAwwIA0//C9yEA0/8A0/8A0/8A0/8A0/8A0/+n4SAA0/8A0/8A0/+o6gCw3lKt7QCv5SC+422b3wC19AC36zAA0/+d1yMA0/8A0/+W2gEA0/+w8ACz8gCKzgG7+QC+9CFLfwkA0/8A0////wAA0/8A0/8A0/8A0/+f2xym3iuHxCGq5BoA1P+m2joI0vONyiCz3mLO7oYA0/8M1Piq3Ei78CbB8EPe8LLj9Ly751G77zWQ1AC96UYC0fi37CL//wAA0/8A0////wD//wCp3jcA0/+j3SGj2i/I72Sx4zHE8FLB8zak1kYeycDI6nRl3qEA0/7V7psA0v6WzTa95mGi2RvB5XkPy9zH5YJ3uwGV1yxVihRLiwdxtQ1ZkAf//wD//wD//wD//wD//wCn5gf//wD//wD//wD//wD//wAA0/+h4A3R6p8A0/+X1w565OD6/ARg237n9csz2vPz+gNt37V/vifO8HW68B/L6ZOCwxXY8KRQsWRzhExAtG/E612a1Rd/pTBpmR9qjysduKVhmxF9mTY51aUozK+CsDSA52T//wD//wAA0////wD//wBJ1JRRxFWjzlxDyXRc0pGT1wCG0CWB3VGUzSTh8h6c0TSr5CCJ5FFxvl6s4H3m8xML0/DA5CvK51EX1N+Y2gSt4Dag3ChE3fax2ki68yO57NF10FRZnUPl88eJxhuCxgCz5EOLwEGf1DFutmahzGW98x0W1PGk3R154MHE6bOn69qv3gy92oG90o+Hn07B7rhCmiyMwECv1nO+0pQfwrCo57xF2daXsVhKrEdenQAduaee1Bsjr42z5D9RoCXy+QNovXpy2Z5MtWDO/TiSukaF3UtE1K6j3B4YwLc5wXlzpyIK0u5zy3uJqg4pu5RTpkZmpVKyAP8A0wBHcExHcEyBUSeEAAABAHRSTlP///9F9wjAAxD7FCEGzBjd08QyEL39abMd6///8P/ZWAnipIv/cC6B//7////////L/1Dz/0D///////86/vYnquY3/v///5T//v///17///////////////84S3QNB/8L/////////////7r/////NP////9l/////wPD4yis/x7Ym2lWSP+em////0n////////v///////////////////7//7pdGN3Urr6/+v/6aT////+//H/o2P/1v+7r7jp4PM/3p4g////g///K///481LxO///v////9w////8v/////9/p3J///a+P9v/5KR/+n///+p/xf//8P//wAAe7FyaAAABCZJREFUSMdj+E8iYKBUgwIHnwQ3N7cEHxcH+///VayoAE0Dh41qR7aBnCIQ8MsJKHH9/99czYYMWlA0cIkJGjMgAKfq//9RNYzIgLcBWYOTiCgDMhDn+B9bh6LebiWyH6L5UZQzONoAHWSHoqEpDkkDsyKqelv1//9rG1HUN9YihZK9AKp6BkG+/6xNqA5ajhSsCkrIipmYGGRa//9vQXVQXSySBnkWJOUMfn5Myuz/G3hR1NdEIUUchwiy+bkTsg4dbW/fu6W/e1c3XMMy5JiOZkFxUFZo74mgKTqaKXu0+2HqVwkja3BH9kFu361JwcHTfPJD4mdfe8ULAdVRyGlJAcVFfg+CQOozZ4XrJ85+JgwBsVXIGriQw5Tp4ZScezd8JiWnBupru30qwJZa+ZAjmWlC8fUZM4qB6kPnLNSPLMWqQQ5ZQ5aOzs1HmamBaQHzFs6y+qAmJCTE8f9/QgKSBg4DJPWc6zVDQkIC09JkZSPD38kukpExFpT4z67uYI/QwCOOCCK/izvu5CWl6AcEWMnKWml7LWbKZfH9/99UkknQHhGsynDz+65eWXv3/JmJrq5eXienVlRUfH/z8VvCf45soKQIH1yDEQsszrp6gwq9C73T87xcXadKl5TkFev4A/2tygmSBqYXqAYJmK+ZuoJydDR1vP09DA0NOy2kpdML81+U/heCpH1JU3jig7lJ5nKOT4i/t6ZHkqGzs4lJmIVHfrj+JR4HqLQSD0yDkCNEpGNn5ix9D03/eJdElTZdKV2TpNOhkwt8YUlNUgimgV0dLMBvf1gz1MolPd5FRcVNSkpDQ8owJeBCDyIhrIDnOD5QcuIU+3/2QKSs9laQ+noNLS0zLWdtqyP7mBAFAw88TwsJgMuJYweBGjYngtWbmeuZOW+bvNQToUFOAlFqOBk4Ov3/L7Z60/aN0p1tUhpa5nqWlub7C3p2I9QzyAghlUvczOz/1fhzPT3XSIfpSmmYAdVbmm1gV0dSz8DSilpUQsqCddIWIA3meuZaJqdMJZEzl6gRqgZIWZAxUdoizERXN8yi5MltcZTChzMaRQM3JNUWHS8rL/+yaPGvMmvr5ywoGoxtkDWwQ+Pb89ycBeWfGSJeL/la+RS1eOPnRtbQKgMRjZg+t8x6PkP273nWQAoFOPAgaeAThKXAmXMrK39Kmr5fsuBlBqoXfJGLe3VbmHjG9Mczi9T//3h7vygXtcDlQtJg44iQiIjIBRbGPO7gghPJy0ZIxT2HOLIUgwxQzsgYrUR350HSIMaJLidhgKY+mw+pflBDrX8E7OGBjPCAPc76gQFSTqAIiYrb/8dRP4CyosJ/rmwU5XIxHMilt4QBJwsSkBMClxOQULBlkRRwEONmR2kJcDGjADX2/+xO8r5iqjExqmLyrWpcPFRta1BfAwCtyN3XpuJ4RgAAAABJRU5ErkJggg==&url=https://apt.izzysoft.de/fdroid/api/v1/shield/com.kunzisoft.keepass.free&label=IzzyOnDroid) | Free | +| [IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.kunzisoft.keepass.free) | ![IzzyOnDroid Version](https://img.shields.io/endpoint?&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAADAFBMVEUA0////wAA0v8A0v8A0////wD//wAFz/QA0/8A0/8A0/8A0/8A0v///wAA0/8A0/8A0/8A0/8A0//8/gEA0/8A0/8B0/4A0/8A0/8A0/+j5QGAwwIA0//C9yEA0/8A0/8A0/8A0/8A0/8A0/+n4SAA0/8A0/8A0/+o6gCw3lKt7QCv5SC+422b3wC19AC36zAA0/+d1yMA0/8A0/+W2gEA0/+w8ACz8gCKzgG7+QC+9CFLfwkA0/8A0////wAA0/8A0/8A0/8A0/+f2xym3iuHxCGq5BoA1P+m2joI0vONyiCz3mLO7oYA0/8M1Piq3Ei78CbB8EPe8LLj9Ly751G77zWQ1AC96UYC0fi37CL//wAA0/8A0////wD//wCp3jcA0/+j3SGj2i/I72Sx4zHE8FLB8zak1kYeycDI6nRl3qEA0/7V7psA0v6WzTa95mGi2RvB5XkPy9zH5YJ3uwGV1yxVihRLiwdxtQ1ZkAf//wD//wD//wD//wD//wCn5gf//wD//wD//wD//wD//wAA0/+h4A3R6p8A0/+X1w565OD6/ARg237n9csz2vPz+gNt37V/vifO8HW68B/L6ZOCwxXY8KRQsWRzhExAtG/E612a1Rd/pTBpmR9qjysduKVhmxF9mTY51aUozK+CsDSA52T//wD//wAA0////wD//wBJ1JRRxFWjzlxDyXRc0pGT1wCG0CWB3VGUzSTh8h6c0TSr5CCJ5FFxvl6s4H3m8xML0/DA5CvK51EX1N+Y2gSt4Dag3ChE3fax2ki68yO57NF10FRZnUPl88eJxhuCxgCz5EOLwEGf1DFutmahzGW98x0W1PGk3R154MHE6bOn69qv3gy92oG90o+Hn07B7rhCmiyMwECv1nO+0pQfwrCo57xF2daXsVhKrEdenQAduaee1Bsjr42z5D9RoCXy+QNovXpy2Z5MtWDO/TiSukaF3UtE1K6j3B4YwLc5wXlzpyIK0u5zy3uJqg4pu5RTpkZmpVKyAP8A0wBHcExHcEyBUSeEAAABAHRSTlP///9F9wjAAxD7FCEGzBjd08QyEL39abMd6///8P/ZWAnipIv/cC6B//7////////L/1Dz/0D///////86/vYnquY3/v///5T//v///17///////////////84S3QNB/8L/////////////7r/////NP////9l/////wPD4yis/x7Ym2lWSP+em////0n////////v///////////////////7//7pdGN3Urr6/+v/6aT////+//H/o2P/1v+7r7jp4PM/3p4g////g///K///481LxO///v////9w////8v/////9/p3J///a+P9v/5KR/+n///+p/xf//8P//wAAe7FyaAAABCZJREFUSMdj+E8iYKBUgwIHnwQ3N7cEHxcH+///VayoAE0Dh41qR7aBnCIQ8MsJKHH9/99czYYMWlA0cIkJGjMgAKfq//9RNYzIgLcBWYOTiCgDMhDn+B9bh6LebiWyH6L5UZQzONoAHWSHoqEpDkkDsyKqelv1//9rG1HUN9YihZK9AKp6BkG+/6xNqA5ajhSsCkrIipmYGGRa//9vQXVQXSySBnkWJOUMfn5Myuz/G3hR1NdEIUUchwiy+bkTsg4dbW/fu6W/e1c3XMMy5JiOZkFxUFZo74mgKTqaKXu0+2HqVwkja3BH9kFu361JwcHTfPJD4mdfe8ULAdVRyGlJAcVFfg+CQOozZ4XrJ85+JgwBsVXIGriQw5Tp4ZScezd8JiWnBupru30qwJZa+ZAjmWlC8fUZM4qB6kPnLNSPLMWqQQ5ZQ5aOzs1HmamBaQHzFs6y+qAmJCTE8f9/QgKSBg4DJPWc6zVDQkIC09JkZSPD38kukpExFpT4z67uYI/QwCOOCCK/izvu5CWl6AcEWMnKWml7LWbKZfH9/99UkknQHhGsynDz+65eWXv3/JmJrq5eXienVlRUfH/z8VvCf45soKQIH1yDEQsszrp6gwq9C73T87xcXadKl5TkFev4A/2tygmSBqYXqAYJmK+ZuoJydDR1vP09DA0NOy2kpdML81+U/heCpH1JU3jig7lJ5nKOT4i/t6ZHkqGzs4lJmIVHfrj+JR4HqLQSD0yDkCNEpGNn5ix9D03/eJdElTZdKV2TpNOhkwt8YUlNUgimgV0dLMBvf1gz1MolPd5FRcVNSkpDQ8owJeBCDyIhrIDnOD5QcuIU+3/2QKSs9laQ+noNLS0zLWdtqyP7mBAFAw88TwsJgMuJYweBGjYngtWbmeuZOW+bvNQToUFOAlFqOBk4Ov3/L7Z60/aN0p1tUhpa5nqWlub7C3p2I9QzyAghlUvczOz/1fhzPT3XSIfpSmmYAdVbmm1gV0dSz8DSilpUQsqCddIWIA3meuZaJqdMJZEzl6gRqgZIWZAxUdoizERXN8yi5MltcZTChzMaRQM3JNUWHS8rL/+yaPGvMmvr5ywoGoxtkDWwQ+Pb89ycBeWfGSJeL/la+RS1eOPnRtbQKgMRjZg+t8x6PkP273nWQAoFOPAgaeAThKXAmXMrK39Kmr5fsuBlBqoXfJGLe3VbmHjG9Mczi9T//3h7vygXtcDlQtJg44iQiIjIBRbGPO7gghPJy0ZIxT2HOLIUgwxQzsgYrUR350HSIMaJLidhgKY+mw+pflBDrX8E7OGBjPCAPc76gQFSTqAIiYrb/8dRP4CyosJ/rmwU5XIxHMilt4QBJwsSkBMClxOQULBlkRRwEONmR2kJcDGjADX2/+xO8r5iqjExqmLyrWpcPFRta1BfAwCtyN3XpuJ4RgAAAABJRU5ErkJggg==&url=https://apt.izzysoft.de/fdroid/api/v1/shield/com.kunzisoft.keepass.free&label=IzzyOnDroid) | Free & [Libre](https://apt.izzysoft.de/fdroid/index/apk/com.kunzisoft.keepass.libre) | | [GitHub](https://github.com/Kunzisoft/KeePassDX/releases) / [Obtainium](https://github.com/ImranR98/Obtainium) | ![GitHub Release](https://img.shields.io/github/v/release/Kunzisoft/KeePassDX?include_prereleases&logo=GitHub&label=GitHub) | Free & Libre | ## Package authenticity from GitHub From 6df8ff43109d25fec815f52cdafa08b591fb5f48 Mon Sep 17 00:00:00 2001 From: Izzy Date: Sun, 20 Jul 2025 00:31:38 +0200 Subject: [PATCH 04/13] fastlane: slight formatting adjustments to full descriptions --- .../android/de-DE/full_description.txt | 27 ++++++++++--------- .../android/en-US/full_description.txt | 27 ++++++++++--------- .../android/fr-FR/full_description.txt | 26 +++++++++--------- .../android/ja-JP/full_description.txt | 27 ++++++++++--------- .../android/ru-RU/full_description.txt | 27 ++++++++++--------- 5 files changed, 69 insertions(+), 65 deletions(-) diff --git a/fastlane/metadata/android/de-DE/full_description.txt b/fastlane/metadata/android/de-DE/full_description.txt index f5c24fffb..59e17e4dd 100644 --- a/fastlane/metadata/android/de-DE/full_description.txt +++ b/fastlane/metadata/android/de-DE/full_description.txt @@ -1,19 +1,20 @@ KeePassDX ist ein Passwort-Safe und -Manager, der es ermöglicht, verschlüsselte Daten in einer einzigen Datei im offenen KeePass-Format zu bearbeiten und die Formulare auf sichere Weise auszufüllen, erfordert keine Internetverbindung und integriert Android-Designstandards. Die App ist Open Source, ohne Werbung. Funktionalitäten - - Erstellung von Datenbanken / Einträgen und Gruppen. - - Unterstützung von .kdb- und .kdbx-Dateien (Version 1 bis 4) mit AES - Twofish - ChaCha20 - Argon2 Algorithmus. - - Kompatibel mit den meisten alternativen Programmen (KeePass, KeePassXC, KeeWeb, ...). - - Ermöglicht das schnelle Kopieren von Feldern und das Öffnen von URIs /URLs. - - Biometrische Erkennung für eine schnelle Entsperrung (Fingerabdrücke / Entsperrung durch Gesicht / ...). - - Verwaltung von Einmalpasswörtern (One-Time Password HOTP / TOTP) für die Zwei-Faktor-Authentifizierung (2FA). - - Material Design mit Themen. - - Automatisches Ausfüllen von Feldern. - - Tastatur zum Ausfüllen von Feldern. - - Dynamische Schablonen. - - Historie jedes Eintrags. - - Präzise Verwaltung der Parameter. - - In nativen Sprachen geschriebener Code (Kotlin / Java / JNI / C). + +- Erstellung von Datenbanken / Einträgen und Gruppen. +- Unterstützung von .kdb- und .kdbx-Dateien (Version 1 bis 4) mit AES - Twofish - ChaCha20 - Argon2 Algorithmus. +- Kompatibel mit den meisten alternativen Programmen (KeePass, KeePassXC, KeeWeb, ...). +- Ermöglicht das schnelle Kopieren von Feldern und das Öffnen von URIs /URLs. +- Biometrische Erkennung für eine schnelle Entsperrung (Fingerabdrücke / Entsperrung durch Gesicht / ...). +- Verwaltung von Einmalpasswörtern (One-Time Password HOTP / TOTP) für die Zwei-Faktor-Authentifizierung (2FA). +- Material Design mit Themen. +- Automatisches Ausfüllen von Feldern. +- Tastatur zum Ausfüllen von Feldern. +- Dynamische Schablonen. +- Historie jedes Eintrags. +- Präzise Verwaltung der Parameter. +- In nativen Sprachen geschriebener Code (Kotlin / Java / JNI / C). Sie können spenden oder die Pro-Version kaufen, um einen besseren Service und eine schnelle Entwicklung der von Ihnen gewünschten Funktionen zu erhalten: https://play.google.com/store/apps/details?id=com.kunzisoft.keepass.pro diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt index 321349131..5e57480c4 100644 --- a/fastlane/metadata/android/en-US/full_description.txt +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -1,19 +1,20 @@ KeePassDX is a password safe and manager allows editing encrypted data in a single file in the open KeePass format and fill in the forms in a secure way, requires no Internet connection and integrates Android design standards. The app is open source, with no advertising. Features - - Create database files / entries and groups. - - Support for .kdb and .kdbx files (version 1 to 4) with AES - Twofish - ChaCha20 - Argon2 algorithm. - - Compatible with the majority of alternative programs (KeePass, KeePassXC, KeeWeb, …). - - Allows opening and copying URI / URL fields quickly. - - Biometric recognition for fast unlocking (fingerprint / face unlock / …). - - One-time password management (HOTP / TOTP) for two-factor authentication (2FA). - - Material design with themes. - - Auto-Fill and integration. - - Field filling keyboard. - - Dynamic templates. - - History of each entry. - - Precise management of settings. - - Code written in native languages (Kotlin / Java / JNI / C). + +- Create database files / entries and groups. +- Support for .kdb and .kdbx files (version 1 to 4) with AES - Twofish - ChaCha20 - Argon2 algorithm. +- Compatible with the majority of alternative programs (KeePass, KeePassXC, KeeWeb, …). +- Allows opening and copying URI / URL fields quickly. +- Biometric recognition for fast unlocking (fingerprint / face unlock / …). +- One-time password management (HOTP / TOTP) for two-factor authentication (2FA). +- Material design with themes. +- Auto-Fill and integration. +- Field filling keyboard. +- Dynamic templates. +- History of each entry. +- Precise management of settings. +- Code written in native languages (Kotlin / Java / JNI / C). You can donate or buy the pro version for better service and a quick development of features you want: https://play.google.com/store/apps/details?id=com.kunzisoft.keepass.pro diff --git a/fastlane/metadata/android/fr-FR/full_description.txt b/fastlane/metadata/android/fr-FR/full_description.txt index facf84c42..f69c79e39 100644 --- a/fastlane/metadata/android/fr-FR/full_description.txt +++ b/fastlane/metadata/android/fr-FR/full_description.txt @@ -2,19 +2,19 @@ KeePassDX est un coffre-fort et un gestionnaire de mots de passe qui perm Fonctionnalités - - Création de bases de données / entrées et groupes. - - Support des fichiers .kdb et .kdbx (version 1 à 4) avec algorithme AES - Twofish - ChaCha20 - Argon2. - - Compatible avec la majorité des programmes alternatifs (KeePass, KeePassXC, KeeWeb, …) - - Permet la copie rapide de champs et l'ouverture d'URI /URL. - - Reconnaissance biométrique pour un déblocage rapide (Empreintes digitales / Déverouillage par visage / …). - - Gestion des mots de passe à usage unique (One-Time Password HOTP / TOTP) pour l'authentification à deux facteurs (2FA). - - Material design avec thèmes. - - Remplissage automatique de champs. - - Clavier de remplissage de champs. - - Gabarits dynamiques. - - Historique de chaque entrée. - - Gestion précise des paramètres. - - Code écrit en langages natifs (Kotlin / Java / JNI / C). +- Création de bases de données / entrées et groupes. +- Support des fichiers .kdb et .kdbx (version 1 à 4) avec algorithme AES - Twofish - ChaCha20 - Argon2. +- Compatible avec la majorité des programmes alternatifs (KeePass, KeePassXC, KeeWeb, …) +- Permet la copie rapide de champs et l'ouverture d'URI /URL. +- Reconnaissance biométrique pour un déblocage rapide (Empreintes digitales / Déverouillage par visage / …). +- Gestion des mots de passe à usage unique (One-Time Password HOTP / TOTP) pour l'authentification à deux facteurs (2FA). +- Material design avec thèmes. +- Remplissage automatique de champs. +- Clavier de remplissage de champs. +- Gabarits dynamiques. +- Historique de chaque entrée. +- Gestion précise des paramètres. +- Code écrit en langages natifs (Kotlin / Java / JNI / C). Vous pouvez faire un don ou acheter la version pro pour un meilleur service et un développement rapide des fonctionnalités que vous souhaitez : https://play.google.com/store/apps/details?id=com.kunzisoft.keepass.pro diff --git a/fastlane/metadata/android/ja-JP/full_description.txt b/fastlane/metadata/android/ja-JP/full_description.txt index 85182b32d..2d501d841 100644 --- a/fastlane/metadata/android/ja-JP/full_description.txt +++ b/fastlane/metadata/android/ja-JP/full_description.txt @@ -1,19 +1,20 @@ KeePassDX は オープンソースかつ広告なしです。複数の形式に対応する KeePass パスワード マネージャー。Android の設計基準が組み込まれており、パスワード、鍵、デジタル ID を安全な方法で保存して使用できます。インターネットに接続する必要はありません。 機能 - - データベースファイル / エントリー・グループの作成 - - .kdb、.kdbx ファイル(バージョン1から4)に対応。AES、Twofish、ChaCha20、Argon2 アルゴリズムが使用可能 - - 主流の代替ソフトウェア(KeePass、KeePassXC, KeeWeb など)との互換性あり - - URI / URL フィールドは開くのもコピーするのもすばやく行えます - - 生体認証を使った高速ロック解除 (指紋認証 / 顔認証 / …) - - 2 要素認証(2FA)のためのワンタイムパスワード管理(HOTP / TOTP) - - マテリアルデザインに準拠した複数のテーマ - - 自動入力機能の統合 - - フィールド入力用のキーボード - - ダイナミックテンプレート - - エントリーごとの履歴 - - 設定の細かな管理 - - コードはネイティブ言語(Kotlin / Java / JNI / C)で書かれています + +- データベースファイル / エントリー・グループの作成 +- .kdb、.kdbx ファイル(バージョン1から4)に対応。AES、Twofish、ChaCha20、Argon2 アルゴリズムが使用可能 +- 主流の代替ソフトウェア(KeePass、KeePassXC, KeeWeb など)との互換性あり +- URI / URL フィールドは開くのもコピーするのもすばやく行えます +- 生体認証を使った高速ロック解除 (指紋認証 / 顔認証 / …) +- 2 要素認証(2FA)のためのワンタイムパスワード管理(HOTP / TOTP) +- マテリアルデザインに準拠した複数のテーマ +- 自動入力機能の統合 +- フィールド入力用のキーボード +- ダイナミックテンプレート +- エントリーごとの履歴 +- 設定の細かな管理 +- コードはネイティブ言語(Kotlin / Java / JNI / C)で書かれています 寄付または pro バージョンの購入はサービスの改善と必要な機能の迅速な開発につながります: https://play.google.com/store/apps/details?id=com.kunzisoft.keepass.pro diff --git a/fastlane/metadata/android/ru-RU/full_description.txt b/fastlane/metadata/android/ru-RU/full_description.txt index 54fe878db..9b81b638b 100644 --- a/fastlane/metadata/android/ru-RU/full_description.txt +++ b/fastlane/metadata/android/ru-RU/full_description.txt @@ -1,19 +1,20 @@ KeePassDX имеет открытый исходный код и без рекламы. Многоформатный менеджер паролей KeePass это приложение которое позволяет безопасно сохранять и использовать пароли, ключи и цифровые идентификаторы за счет интеграции стандартов дизайна Android и не требует подключения к Интернету. Возможности - - Создание файлов/записей и групп. - — Поддержка файлов .kdb и .kdbx (версии от 1 до 4) с алгоритмом AES — Twofish — ChaCha20 — Argon2. - - Совместим с большинством альтернативных программ (KeePass, KeePassXC, KeeWeb, …). - - Позволяет быстро открывать и копировать поля URI / URL. - - Биометрическое распознавание для быстрой разблокировки (отпечаток пальца /разблокировка по лицу / …). - - Управление одноразовыми паролями (HOTP / TOTP) для двухфакторной аутентификации (2FA). - - Материальный дизайн с темами. - - Автозаполнение и интеграция. - - Клавиатура для заполнения полей. - - Динамические шаблоны. - - История каждой записи. - - Точное управление настройками. - — Код написан на родных языках для платформы (Kotlin / Java / JNI / C). + +- Создание файлов/записей и групп. +- Поддержка файлов .kdb и .kdbx (версии от 1 до 4) с алгоритмом AES — Twofish — ChaCha20 — Argon2. +- Совместим с большинством альтернативных программ (KeePass, KeePassXC, KeeWeb, …). +- Позволяет быстро открывать и копировать поля URI / URL. +- Биометрическое распознавание для быстрой разблокировки (отпечаток пальца /разблокировка по лицу / …). +- Управление одноразовыми паролями (HOTP / TOTP) для двухфакторной аутентификации (2FA). +- Материальный дизайн с темами. +- Автозаполнение и интеграция. +- Клавиатура для заполнения полей. +- Динамические шаблоны. +- История каждой записи. +- Точное управление настройками. +- Код написан на родных языках для платформы (Kotlin / Java / JNI / C). Вы можете пожертвовать или купить профессиональную версию чтобы улучшить обслуживание и ускорить разработку нужных вам возможностей: KeePass Pro From 962b547b361d77f8c533d354aa39480d158cdef3 Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Tue, 22 Jul 2025 18:40:36 +0200 Subject: [PATCH 05/13] fix: Registration #2089 --- .../activities/AutofillLauncherActivity.kt | 116 +++++++++--------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/app/src/main/java/com/kunzisoft/keepass/activities/AutofillLauncherActivity.kt b/app/src/main/java/com/kunzisoft/keepass/activities/AutofillLauncherActivity.kt index 39b98abab..f69d1475f 100644 --- a/app/src/main/java/com/kunzisoft/keepass/activities/AutofillLauncherActivity.kt +++ b/app/src/main/java/com/kunzisoft/keepass/activities/AutofillLauncherActivity.kt @@ -124,41 +124,41 @@ class AutofillLauncherActivity : DatabaseModeActivity() { if (autofillComponent == null) { setResult(Activity.RESULT_CANCELED) finish() - } else if (!KeeAutofillService.autofillAllowedFor( + } else if (KeeAutofillService.autofillAllowedFor( applicationId = searchInfo.applicationId, webDomain = searchInfo.webDomain, context = this )) { + // If database is open + SearchHelper.checkAutoSearchInfo(this, + database, + searchInfo, + { openedDatabase, items -> + // Items found + AutofillHelper.buildResponseAndSetResult(this, openedDatabase, items) + finish() + }, + { openedDatabase -> + // Show the database UI to select the entry + GroupActivity.launchForAutofillResult(this, + openedDatabase, + mAutofillActivityResultLauncher, + autofillComponent, + searchInfo, + false) + }, + { + // If database not open + FileDatabaseSelectActivity.launchForAutofillResult(this, + mAutofillActivityResultLauncher, + autofillComponent, + searchInfo) + } + ) + } else { showBlockRestartMessage() setResult(Activity.RESULT_CANCELED) finish() - } else { - // If database is open - SearchHelper.checkAutoSearchInfo(this, - database, - searchInfo, - { openedDatabase, items -> - // Items found - AutofillHelper.buildResponseAndSetResult(this, openedDatabase, items) - finish() - }, - { openedDatabase -> - // Show the database UI to select the entry - GroupActivity.launchForAutofillResult(this, - openedDatabase, - mAutofillActivityResultLauncher, - autofillComponent, - searchInfo, - false) - }, - { - // If database not open - FileDatabaseSelectActivity.launchForAutofillResult(this, - mAutofillActivityResultLauncher, - autofillComponent, - searchInfo) - } - ) } } @@ -169,40 +169,40 @@ class AutofillLauncherActivity : DatabaseModeActivity() { applicationId = searchInfo.applicationId, webDomain = searchInfo.webDomain, context = this - )) { - showBlockRestartMessage() - setResult(Activity.RESULT_CANCELED) - } else { + )) { val readOnly = database?.isReadOnly != false SearchHelper.checkAutoSearchInfo(this, - database, - searchInfo, - { openedDatabase, _ -> - if (!readOnly) { - // Show the database UI to select the entry - GroupActivity.launchForRegistration(this, - openedDatabase, - registerInfo) - } else { - showReadOnlySaveMessage() - } - }, - { openedDatabase -> - if (!readOnly) { - // Show the database UI to select the entry - GroupActivity.launchForRegistration(this, - openedDatabase, - registerInfo) - } else { - showReadOnlySaveMessage() - } - }, - { - // If database not open - FileDatabaseSelectActivity.launchForRegistration(this, - registerInfo) + database, + searchInfo, + { openedDatabase, _ -> + if (!readOnly) { + // Show the database UI to select the entry + GroupActivity.launchForRegistration(this, + openedDatabase, + registerInfo) + } else { + showReadOnlySaveMessage() } + }, + { openedDatabase -> + if (!readOnly) { + // Show the database UI to select the entry + GroupActivity.launchForRegistration(this, + openedDatabase, + registerInfo) + } else { + showReadOnlySaveMessage() + } + }, + { + // If database not open + FileDatabaseSelectActivity.launchForRegistration(this, + registerInfo) + } ) + } else { + showBlockRestartMessage() + setResult(Activity.RESULT_CANCELED) } finish() } From 56f8a1bf9f080e9ade2e6f453761893d03e95590 Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Tue, 22 Jul 2025 18:45:44 +0200 Subject: [PATCH 06/13] fix: Upgrade version and CHANGELOG --- CHANGELOG | 3 +++ app/build.gradle | 4 ++-- fastlane/metadata/android/en-US/changelogs/134.txt | 2 +- fastlane/metadata/android/en-US/changelogs/135.txt | 1 + fastlane/metadata/android/fr-FR/changelogs/135.txt | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/135.txt create mode 100644 fastlane/metadata/android/fr-FR/changelogs/135.txt diff --git a/CHANGELOG b/CHANGELOG index 1d02f6911..fc691fc55 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +KeePassDX(4.1.3) + * Fix Autofill Registration #2089 + KeePassDX(4.1.2) * Fix URL search #1940 #1946 #2003 #2040 #2044 * Fix Autofill popup #2054 diff --git a/app/build.gradle b/app/build.gradle index 3d9c1502c..9e1c0c0d6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.kunzisoft.keepass" minSdkVersion 15 targetSdkVersion 34 - versionCode = 134 - versionName = "4.1.2" + versionCode = 135 + versionName = "4.1.3" multiDexEnabled true testApplicationId = "com.kunzisoft.keepass.tests" diff --git a/fastlane/metadata/android/en-US/changelogs/134.txt b/fastlane/metadata/android/en-US/changelogs/134.txt index 5f1ee5fd3..ce8831b2e 100644 --- a/fastlane/metadata/android/en-US/changelogs/134.txt +++ b/fastlane/metadata/android/en-US/changelogs/134.txt @@ -3,6 +3,6 @@ * Fix Group notes #2053 * Fix Dialog background #2005 #2004 (Thx @codokie) * Fix OTP configuration #2042 #2065 (Thx @Dev-ClayP) - * Fix small UI elements #1987 #2007 (Thx @ymcx) + * Fix small UI elements #1987 #2007 (Thx @ymcx) * RTL layout support #2021 (Thx @codokie) * App Metadata to translation #1823 \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/changelogs/135.txt b/fastlane/metadata/android/en-US/changelogs/135.txt new file mode 100644 index 000000000..6293c5877 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/135.txt @@ -0,0 +1 @@ + * Fix Autofill Registration #2089 \ No newline at end of file diff --git a/fastlane/metadata/android/fr-FR/changelogs/135.txt b/fastlane/metadata/android/fr-FR/changelogs/135.txt new file mode 100644 index 000000000..07c6adfea --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/135.txt @@ -0,0 +1 @@ + * Correction de l'enregistrement pour le remplissage automatique #2089 \ No newline at end of file From 593b5c63385ef5e19ca4895bead66b912c5ee6f7 Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Thu, 24 Jul 2025 16:39:42 +0200 Subject: [PATCH 07/13] fix: Biometric error prompts #2081 --- .../activities/MainCredentialActivity.kt | 82 ++++++----- .../biometric/AdvancedUnlockFragment.kt | 78 +++++----- .../keepass/view/MainCredentialView.kt | 19 ++- .../viewmodels/AdvancedUnlockViewModel.kt | 139 +++++++++++++++++- 4 files changed, 231 insertions(+), 87 deletions(-) diff --git a/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt b/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt index 2748c34ea..eed24be68 100644 --- a/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt +++ b/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt @@ -32,7 +32,6 @@ import android.view.MenuItem import android.view.View import android.view.ViewGroup import android.widget.Button -import android.widget.CompoundButton import android.widget.TextView import android.widget.Toast import androidx.activity.result.ActivityResultLauncher @@ -43,6 +42,9 @@ import androidx.appcompat.widget.Toolbar import androidx.biometric.BiometricManager import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.fragment.app.commit +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.lifecycleScope +import androidx.lifecycle.repeatOnLifecycle import com.google.android.material.snackbar.Snackbar import com.kunzisoft.keepass.R import com.kunzisoft.keepass.activities.dialogs.DuplicateUuidDialog @@ -81,10 +83,11 @@ import com.kunzisoft.keepass.view.asError import com.kunzisoft.keepass.view.showActionErrorIfNeeded import com.kunzisoft.keepass.viewmodels.AdvancedUnlockViewModel import com.kunzisoft.keepass.viewmodels.DatabaseFileViewModel +import kotlinx.coroutines.launch import java.io.FileNotFoundException -class MainCredentialActivity : DatabaseModeActivity(), AdvancedUnlockFragment.BuilderListener { +class MainCredentialActivity : DatabaseModeActivity() { // Views private var toolbar: Toolbar? = null @@ -166,21 +169,13 @@ class MainCredentialActivity : DatabaseModeActivity(), AdvancedUnlockFragment.Bu } // Listen password checkbox to init advanced unlock and confirmation button - mainCredentialView?.onPasswordChecked = - CompoundButton.OnCheckedChangeListener { _, _ -> - mAdvancedUnlockViewModel.checkUnlockAvailability() - enableConfirmationButton() - } - mainCredentialView?.onKeyFileChecked = - CompoundButton.OnCheckedChangeListener { _, _ -> - // TODO mAdvancedUnlockViewModel.checkUnlockAvailability() - enableConfirmationButton() - } - mainCredentialView?.onHardwareKeyChecked = - CompoundButton.OnCheckedChangeListener { _, _ -> - // TODO mAdvancedUnlockViewModel.checkUnlockAvailability() - enableConfirmationButton() - } + mainCredentialView?.onConditionToStoreCredentialChanged = { credentialStorage, verified -> + mAdvancedUnlockViewModel.checkUnlockAvailability( + conditionToStoreCredentialVerified = verified + ) + // TODO Async by ViewModel + enableConfirmationButton() + } // Observe if default database mDatabaseFileViewModel.isDefaultDatabase.observe(this) { isDefaultDatabase -> @@ -228,6 +223,27 @@ class MainCredentialActivity : DatabaseModeActivity(), AdvancedUnlockFragment.Bu onDatabaseFileLoaded(databaseFile?.databaseUri, keyFileUri, hardwareKey) } + + lifecycleScope.launch { + repeatOnLifecycle(Lifecycle.State.STARTED) { + mAdvancedUnlockViewModel.uiState.collect { uiState -> + // New value received + if (uiState.isCredentialRequired) { + mAdvancedUnlockViewModel.provideCredentialForEncryption( + getCredentialForEncryption() + ) + } + uiState.cipherEncryptDatabase?.let { cipherEncryptDatabase -> + onCredentialEncrypted(cipherEncryptDatabase) + mAdvancedUnlockViewModel.consumeCredentialEncrypted() + } + uiState.cipherDecryptDatabase?.let { cipherDecryptDatabase -> + onCredentialDecrypted(cipherDecryptDatabase) + mAdvancedUnlockViewModel.consumeCredentialDecrypted() + } + } + } + } } override fun onResume() { @@ -400,23 +416,6 @@ class MainCredentialActivity : DatabaseModeActivity(), AdvancedUnlockFragment.Bu } } - override fun retrieveCredentialForEncryption(): ByteArray { - return mainCredentialView?.retrieveCredentialForStorage(credentialStorageListener) - ?: byteArrayOf() - } - - override fun conditionToStoreCredential(): Boolean { - return mainCredentialView?.conditionToStoreCredential() == true - } - - override fun onCredentialEncrypted(cipherEncryptDatabase: CipherEncryptDatabase) { - // Load the database if password is registered with biometric - loadDatabase(mDatabaseFileUri, - mainCredentialView?.getMainCredential(), - cipherEncryptDatabase - ) - } - private val credentialStorageListener = object: MainCredentialView.CredentialStorageListener { override fun passwordToStore(password: String?): ByteArray? { return password?.toByteArray() @@ -433,7 +432,20 @@ class MainCredentialActivity : DatabaseModeActivity(), AdvancedUnlockFragment.Bu } } - override fun onCredentialDecrypted(cipherDecryptDatabase: CipherDecryptDatabase) { + private fun getCredentialForEncryption(): ByteArray { + return mainCredentialView?.retrieveCredentialForStorage(credentialStorageListener) + ?: byteArrayOf() + } + + private fun onCredentialEncrypted(cipherEncryptDatabase: CipherEncryptDatabase) { + // Load the database if password is registered with biometric + loadDatabase(mDatabaseFileUri, + mainCredentialView?.getMainCredential(), + cipherEncryptDatabase + ) + } + + private fun onCredentialDecrypted(cipherDecryptDatabase: CipherDecryptDatabase) { // Load the database if password is retrieve from biometric // Retrieve from biometric val mainCredential = mainCredentialView?.getMainCredential() ?: MainCredential() diff --git a/app/src/main/java/com/kunzisoft/keepass/biometric/AdvancedUnlockFragment.kt b/app/src/main/java/com/kunzisoft/keepass/biometric/AdvancedUnlockFragment.kt index 45b949fa1..2165ae8fa 100644 --- a/app/src/main/java/com/kunzisoft/keepass/biometric/AdvancedUnlockFragment.kt +++ b/app/src/main/java/com/kunzisoft/keepass/biometric/AdvancedUnlockFragment.kt @@ -35,7 +35,9 @@ import androidx.biometric.BiometricPrompt import androidx.core.view.MenuProvider import androidx.fragment.app.Fragment import androidx.fragment.app.activityViewModels +import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope +import androidx.lifecycle.repeatOnLifecycle import com.kunzisoft.keepass.R import com.kunzisoft.keepass.app.database.CipherDatabaseAction import com.kunzisoft.keepass.database.exception.UnknownDatabaseLocationException @@ -52,8 +54,6 @@ import kotlinx.coroutines.launch class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCallback { - private var mBuilderListener: BuilderListener? = null - private var mAdvancedUnlockEnabled = false private var mAutoOpenPromptEnabled = false @@ -84,6 +84,8 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa // Only keep connection when we request a device credential activity private var keepConnection = false + private var isConditionToStoreCredentialVerified = false + private var mDeviceCredentialResultLauncher = registerForActivityResult( ActivityResultContracts.StartActivityForResult() ) { result -> @@ -120,14 +122,6 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa mAdvancedUnlockEnabled = PreferencesUtil.isAdvancedUnlockEnable(context) mAutoOpenPromptEnabled = PreferencesUtil.isAdvancedUnlockPromptAutoOpenEnable(context) - try { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - mBuilderListener = context as BuilderListener - } - } catch (e: ClassCastException) { - throw ClassCastException(context.toString() - + " must implement " + BuilderListener::class.java.name) - } } override fun onCreate(savedInstanceState: Bundle?) { @@ -138,11 +132,6 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa mAdvancedUnlockViewModel.onInitAdvancedUnlockModeRequested.observe(this) { initAdvancedUnlockMode() } - - mAdvancedUnlockViewModel.onUnlockAvailabilityCheckRequested.observe(this) { - checkUnlockAvailability() - } - mAdvancedUnlockViewModel.onDatabaseFileLoaded.observe(this) { onDatabaseLoaded(it) } @@ -162,6 +151,27 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa super.onViewCreated(view, savedInstanceState) activity?.addMenuProvider(menuProvider, viewLifecycleOwner) + + viewLifecycleOwner.lifecycleScope.launch { + viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { + mAdvancedUnlockViewModel.uiState.collect { uiState -> + // New credential value received + uiState.credential?.let { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + advancedUnlockManager?.encryptData(uiState.credential) + } + mAdvancedUnlockViewModel.consumeCredentialForEncryption() + } + // Condition to store credential verified + isConditionToStoreCredentialVerified = uiState.isConditionToStoreCredentialVerified + // Check unlock availability + if (uiState.onUnlockAvailabilityCheckRequested) { + checkUnlockAvailability() + mAdvancedUnlockViewModel.consumeCheckUnlockAvailability() + } + } + } + } } override fun onResume() { @@ -250,7 +260,7 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa if (advancedUnlockManager?.isKeyManagerInitialized != true) { toggleMode(Mode.KEY_MANAGER_UNAVAILABLE) } else { - if (mBuilderListener?.conditionToStoreCredential() == true) { + if (isConditionToStoreCredentialVerified) { // listen for encryption toggleMode(Mode.STORE_CREDENTIAL) } else { @@ -261,8 +271,13 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa // listen for decryption Mode.EXTRACT_CREDENTIAL } else { - // wait for typing - Mode.WAIT_CREDENTIAL + if (isConditionToStoreCredentialVerified) { + // if condition OK, key manager in error + Mode.KEY_MANAGER_UNAVAILABLE + } else { + // wait for typing + Mode.WAIT_CREDENTIAL + } }) } } @@ -523,9 +538,7 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa } Mode.STORE_CREDENTIAL -> { // newly store the entered password in encrypted way - mBuilderListener?.retrieveCredentialForEncryption()?.let { credential -> - advancedUnlockManager?.encryptData(credential) - } + mAdvancedUnlockViewModel.retrieveCredentialForEncryption() } Mode.EXTRACT_CREDENTIAL -> { // retrieve the encrypted value from preferences @@ -545,7 +558,7 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa override fun handleEncryptedResult(encryptedValue: ByteArray, ivSpec: ByteArray) { databaseFileUri?.let { databaseUri -> - mBuilderListener?.onCredentialEncrypted( + mAdvancedUnlockViewModel.onCredentialEncrypted( CipherEncryptDatabase().apply { this.databaseUri = databaseUri this.credentialStorage = credentialDatabaseStorage @@ -559,7 +572,7 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa override fun handleDecryptedResult(decryptedValue: ByteArray) { // Load database directly with password retrieve databaseFileUri?.let { databaseUri -> - mBuilderListener?.onCredentialDecrypted( + mAdvancedUnlockViewModel.onCredentialDecrypted( CipherDecryptDatabase().apply { this.databaseUri = databaseUri this.credentialStorage = credentialDatabaseStorage @@ -630,13 +643,6 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa EXTRACT_CREDENTIAL } - interface BuilderListener { - fun retrieveCredentialForEncryption(): ByteArray - fun conditionToStoreCredential(): Boolean - fun onCredentialEncrypted(cipherEncryptDatabase: CipherEncryptDatabase) - fun onCredentialDecrypted(cipherDecryptDatabase: CipherDecryptDatabase) - } - override fun onPause() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (!keepConnection) { @@ -645,13 +651,11 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa advancedUnlockManager = null } } - super.onPause() } override fun onDestroyView() { mAdvancedUnlockInfoView = null - super.onDestroyView() } @@ -659,20 +663,12 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { disconnect() advancedUnlockManager = null - mBuilderListener = null } - + mAdvancedUnlockViewModel.deleteData() super.onDestroy() } - override fun onDetach() { - mBuilderListener = null - - super.onDetach() - } - companion object { - private val TAG = AdvancedUnlockFragment::class.java.name } } \ No newline at end of file diff --git a/app/src/main/java/com/kunzisoft/keepass/view/MainCredentialView.kt b/app/src/main/java/com/kunzisoft/keepass/view/MainCredentialView.kt index 17c51b514..e4d9e2176 100644 --- a/app/src/main/java/com/kunzisoft/keepass/view/MainCredentialView.kt +++ b/app/src/main/java/com/kunzisoft/keepass/view/MainCredentialView.kt @@ -53,9 +53,7 @@ class MainCredentialView @JvmOverloads constructor(context: Context, private var checkboxHardwareView: CompoundButton private var hardwareKeySelectionView: HardwareKeySelectionView - var onPasswordChecked: (CompoundButton.OnCheckedChangeListener)? = null - var onKeyFileChecked: (CompoundButton.OnCheckedChangeListener)? = null - var onHardwareKeyChecked: (CompoundButton.OnCheckedChangeListener)? = null + var onConditionToStoreCredentialChanged: ((CredentialStorage, verified: Boolean) -> Unit)? = null var onValidateListener: (() -> Unit)? = null private var mCredentialStorage: CredentialStorage = CredentialStorage.PASSWORD @@ -104,7 +102,10 @@ class MainCredentialView @JvmOverloads constructor(context: Context, } checkboxPasswordView.setOnCheckedChangeListener { view, checked -> - onPasswordChecked?.onCheckedChanged(view, checked) + onConditionToStoreCredentialChanged?.invoke( + mCredentialStorage, + conditionToStoreCredential() + ) } checkboxKeyFileView.setOnCheckedChangeListener { view, checked -> if (checked) { @@ -112,7 +113,10 @@ class MainCredentialView @JvmOverloads constructor(context: Context, checkboxKeyFileView.isChecked = false } } - onKeyFileChecked?.onCheckedChanged(view, checked) + onConditionToStoreCredentialChanged?.invoke( + mCredentialStorage, + conditionToStoreCredential() + ) } checkboxHardwareView.setOnCheckedChangeListener { view, checked -> if (checked) { @@ -120,7 +124,10 @@ class MainCredentialView @JvmOverloads constructor(context: Context, checkboxHardwareView.isChecked = false } } - onHardwareKeyChecked?.onCheckedChanged(view, checked) + onConditionToStoreCredentialChanged?.invoke( + mCredentialStorage, + conditionToStoreCredential() + ) } hardwareKeySelectionView.selectionListener = { _ -> diff --git a/app/src/main/java/com/kunzisoft/keepass/viewmodels/AdvancedUnlockViewModel.kt b/app/src/main/java/com/kunzisoft/keepass/viewmodels/AdvancedUnlockViewModel.kt index 1c5c0a140..af22142e6 100644 --- a/app/src/main/java/com/kunzisoft/keepass/viewmodels/AdvancedUnlockViewModel.kt +++ b/app/src/main/java/com/kunzisoft/keepass/viewmodels/AdvancedUnlockViewModel.kt @@ -3,18 +3,23 @@ package com.kunzisoft.keepass.viewmodels import android.net.Uri import androidx.lifecycle.LiveData import androidx.lifecycle.ViewModel +import com.kunzisoft.keepass.model.CipherDecryptDatabase +import com.kunzisoft.keepass.model.CipherEncryptDatabase +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.update class AdvancedUnlockViewModel : ViewModel() { var allowAutoOpenBiometricPrompt : Boolean = true var deviceCredentialAuthSucceeded: Boolean? = null + private val _uiState = MutableStateFlow(DeviceUnlockUiStates()) + val uiState: StateFlow = _uiState + val onInitAdvancedUnlockModeRequested : LiveData get() = _onInitAdvancedUnlockModeRequested private val _onInitAdvancedUnlockModeRequested = SingleLiveEvent() - val onUnlockAvailabilityCheckRequested : LiveData get() = _onUnlockAvailabilityCheckRequested - private val _onUnlockAvailabilityCheckRequested = SingleLiveEvent() - val onDatabaseFileLoaded : LiveData get() = _onDatabaseFileLoaded private val _onDatabaseFileLoaded = SingleLiveEvent() @@ -22,11 +27,135 @@ class AdvancedUnlockViewModel : ViewModel() { _onInitAdvancedUnlockModeRequested.call() } - fun checkUnlockAvailability() { - _onUnlockAvailabilityCheckRequested.call() + fun checkUnlockAvailability(conditionToStoreCredentialVerified: Boolean) { + _uiState.update { currentState -> + currentState.copy( + onUnlockAvailabilityCheckRequested = true, + isConditionToStoreCredentialVerified = conditionToStoreCredentialVerified + ) + } + } + + fun consumeCheckUnlockAvailability() { + _uiState.update { currentState -> + currentState.copy( + onUnlockAvailabilityCheckRequested = false + ) + } } fun databaseFileLoaded(databaseUri: Uri?) { _onDatabaseFileLoaded.value = databaseUri } + + fun retrieveCredentialForEncryption() { + _uiState.update { currentState -> + currentState.copy( + isCredentialRequired = true, + credential = null + ) + } + } + + fun provideCredentialForEncryption(credential: ByteArray) { + _uiState.update { currentState -> + currentState.copy( + isCredentialRequired = false, + credential = credential + ) + } + } + + fun consumeCredentialForEncryption() { + _uiState.update { currentState -> + currentState.copy( + isCredentialRequired = false, + credential = null + ) + } + } + + fun onCredentialEncrypted(cipherEncryptDatabase: CipherEncryptDatabase) { + _uiState.update { currentState -> + currentState.copy( + cipherEncryptDatabase = cipherEncryptDatabase + ) + } + } + + fun consumeCredentialEncrypted() { + _uiState.update { currentState -> + currentState.copy( + cipherEncryptDatabase = null + ) + } + } + + fun onCredentialDecrypted(cipherDecryptDatabase: CipherDecryptDatabase) { + _uiState.update { currentState -> + currentState.copy( + cipherDecryptDatabase = cipherDecryptDatabase + ) + } + } + + fun consumeCredentialDecrypted() { + _uiState.update { currentState -> + currentState.copy( + cipherDecryptDatabase = null + ) + } + } + + fun deleteData() { + _uiState.update { currentState -> + currentState.copy( + initAdvancedUnlockMode = false, + databaseFileUri = null, + isCredentialRequired = false, + credential = null, + isConditionToStoreCredentialVerified = false, + onUnlockAvailabilityCheckRequested = false, + cipherEncryptDatabase = null, + cipherDecryptDatabase = null + ) + } + } +} + +data class DeviceUnlockUiStates( + val initAdvancedUnlockMode: Boolean = false, + val databaseFileUri: Uri? = null, + val isCredentialRequired: Boolean = false, + val credential: ByteArray? = null, + val isConditionToStoreCredentialVerified: Boolean = false, + val onUnlockAvailabilityCheckRequested: Boolean = false, + val cipherEncryptDatabase: CipherEncryptDatabase? = null, + val cipherDecryptDatabase: CipherDecryptDatabase? = null +) { + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as DeviceUnlockUiStates + + if (isCredentialRequired != other.isCredentialRequired) return false + if (isConditionToStoreCredentialVerified != other.isConditionToStoreCredentialVerified) return false + if (onUnlockAvailabilityCheckRequested != other.onUnlockAvailabilityCheckRequested) return false + if (!credential.contentEquals(other.credential)) return false + if (cipherEncryptDatabase != other.cipherEncryptDatabase) return false + if (cipherDecryptDatabase != other.cipherDecryptDatabase) return false + + return true + } + + override fun hashCode(): Int { + var result = isCredentialRequired.hashCode() + result = 31 * result + isConditionToStoreCredentialVerified.hashCode() + result = 31 * result + onUnlockAvailabilityCheckRequested.hashCode() + result = 31 * result + (credential?.contentHashCode() ?: 0) + result = 31 * result + (cipherEncryptDatabase?.hashCode() ?: 0) + result = 31 * result + (cipherDecryptDatabase?.hashCode() ?: 0) + return result + } } \ No newline at end of file From bb3a379965eddeca83294fbe1184cab70b80ba55 Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Thu, 24 Jul 2025 16:42:35 +0200 Subject: [PATCH 08/13] fix: Upgrade CHANGELOG --- CHANGELOG | 1 + fastlane/metadata/android/en-US/changelogs/135.txt | 3 ++- fastlane/metadata/android/fr-FR/changelogs/135.txt | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index fc691fc55..e8179b274 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ KeePassDX(4.1.3) * Fix Autofill Registration #2089 + * Fix Biometric errors #2081 KeePassDX(4.1.2) * Fix URL search #1940 #1946 #2003 #2040 #2044 diff --git a/fastlane/metadata/android/en-US/changelogs/135.txt b/fastlane/metadata/android/en-US/changelogs/135.txt index 6293c5877..300942076 100644 --- a/fastlane/metadata/android/en-US/changelogs/135.txt +++ b/fastlane/metadata/android/en-US/changelogs/135.txt @@ -1 +1,2 @@ - * Fix Autofill Registration #2089 \ No newline at end of file + * Fix Autofill Registration #2089 + * Fix Biometric errors #2081 \ No newline at end of file diff --git a/fastlane/metadata/android/fr-FR/changelogs/135.txt b/fastlane/metadata/android/fr-FR/changelogs/135.txt index 07c6adfea..ac529e6c1 100644 --- a/fastlane/metadata/android/fr-FR/changelogs/135.txt +++ b/fastlane/metadata/android/fr-FR/changelogs/135.txt @@ -1 +1,2 @@ - * Correction de l'enregistrement pour le remplissage automatique #2089 \ No newline at end of file + * Correction de l'enregistrement pour le remplissage automatique #2089 + * Correction des erreurs biométriques #2081 \ No newline at end of file From 4b20e035b299852918aeb712dd2b2d6cbc10f2d4 Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Thu, 24 Jul 2025 17:12:09 +0200 Subject: [PATCH 09/13] fix: Upgrade CHANGELOG --- CHANGELOG | 1 + fastlane/metadata/android/en-US/changelogs/135.txt | 3 ++- fastlane/metadata/android/fr-FR/changelogs/135.txt | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e8179b274..229b1cb39 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ KeePassDX(4.1.3) * Fix Autofill Registration #2089 * Fix Biometric errors #2081 + * Fixed timestamp in copy file #1981 #1983 KeePassDX(4.1.2) * Fix URL search #1940 #1946 #2003 #2040 #2044 diff --git a/fastlane/metadata/android/en-US/changelogs/135.txt b/fastlane/metadata/android/en-US/changelogs/135.txt index 300942076..4e08c9697 100644 --- a/fastlane/metadata/android/en-US/changelogs/135.txt +++ b/fastlane/metadata/android/en-US/changelogs/135.txt @@ -1,2 +1,3 @@ * Fix Autofill Registration #2089 - * Fix Biometric errors #2081 \ No newline at end of file + * Fix Biometric errors #2081 + * Fixed timestamp in copy file #1981 #1983 \ No newline at end of file diff --git a/fastlane/metadata/android/fr-FR/changelogs/135.txt b/fastlane/metadata/android/fr-FR/changelogs/135.txt index ac529e6c1..386f2bfd7 100644 --- a/fastlane/metadata/android/fr-FR/changelogs/135.txt +++ b/fastlane/metadata/android/fr-FR/changelogs/135.txt @@ -1,2 +1,3 @@ * Correction de l'enregistrement pour le remplissage automatique #2089 - * Correction des erreurs biométriques #2081 \ No newline at end of file + * Correction des erreurs biométriques #2081 + * Correction du timestamp dans le fichier de copie #1981 #1983 \ No newline at end of file From b743d004e2b88b8e4620c748b867efed895dc527 Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Thu, 24 Jul 2025 18:22:11 +0200 Subject: [PATCH 10/13] fix: Template EMAIL #1986 --- CHANGELOG | 1 + .../element/template/TemplateBuilder.kt | 137 +++++++++++++----- .../metadata/android/en-US/changelogs/135.txt | 3 +- .../metadata/android/fr-FR/changelogs/135.txt | 3 +- 4 files changed, 105 insertions(+), 39 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 229b1cb39..d902fdd6a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ KeePassDX(4.1.3) * Fix Autofill Registration #2089 * Fix Biometric errors #2081 * Fixed timestamp in copy file #1981 #1983 + * Fix Template Email #1986 KeePassDX(4.1.2) * Fix URL search #1940 #1946 #2003 #2040 #2044 diff --git a/database/src/main/java/com/kunzisoft/keepass/database/element/template/TemplateBuilder.kt b/database/src/main/java/com/kunzisoft/keepass/database/element/template/TemplateBuilder.kt index 74c783551..311bd4e17 100644 --- a/database/src/main/java/com/kunzisoft/keepass/database/element/template/TemplateBuilder.kt +++ b/database/src/main/java/com/kunzisoft/keepass/database/element/template/TemplateBuilder.kt @@ -24,52 +24,115 @@ import java.util.* class TemplateBuilder { - private val urlAttribute = TemplateAttribute(TemplateField.LABEL_URL, TemplateAttributeType.TEXT) - private val usernameAttribute = TemplateAttribute(TemplateField.LABEL_USERNAME, TemplateAttributeType.TEXT) + private val urlAttribute = TemplateAttribute( + label = TemplateField.LABEL_URL, + type = TemplateAttributeType.TEXT + ) + private val usernameAttribute = TemplateAttribute( + label = TemplateField.LABEL_USERNAME, + type = TemplateAttributeType.TEXT + ) private val notesAttribute = TemplateAttribute( - TemplateField.LABEL_NOTES, - TemplateAttributeType.TEXT, - false, - TemplateAttributeOption().apply { + label = TemplateField.LABEL_NOTES, + type = TemplateAttributeType.TEXT, + protected = false, + options = TemplateAttributeOption().apply { setNumberLinesToMany() - }) - private val holderAttribute = TemplateAttribute(TemplateField.LABEL_HOLDER, TemplateAttributeType.TEXT) - private val numberAttribute = TemplateAttribute(TemplateField.LABEL_NUMBER, TemplateAttributeType.TEXT) - private val cvvAttribute = TemplateAttribute(TemplateField.LABEL_CVV, TemplateAttributeType.TEXT, true) - private val pinAttribute = TemplateAttribute(TemplateField.LABEL_PIN, TemplateAttributeType.TEXT, true) - private val nameAttribute = TemplateAttribute(TemplateField.LABEL_NAME, TemplateAttributeType.TEXT) - private val placeOfIssueAttribute = TemplateAttribute(TemplateField.LABEL_PLACE_OF_ISSUE, TemplateAttributeType.TEXT) + } + ) + private val holderAttribute = TemplateAttribute( + label = TemplateField.LABEL_HOLDER, + type = TemplateAttributeType.TEXT + ) + private val numberAttribute = TemplateAttribute( + label = TemplateField.LABEL_NUMBER, + type = TemplateAttributeType.TEXT + ) + private val cvvAttribute = TemplateAttribute( + label = TemplateField.LABEL_CVV, + type = TemplateAttributeType.TEXT, + protected = true + ) + private val pinAttribute = TemplateAttribute( + label = TemplateField.LABEL_PIN, + type = TemplateAttributeType.TEXT, + protected = true + ) + private val nameAttribute = TemplateAttribute( + label = TemplateField.LABEL_NAME, + type = TemplateAttributeType.TEXT + ) + private val placeOfIssueAttribute = TemplateAttribute( + label = TemplateField.LABEL_PLACE_OF_ISSUE, + type = TemplateAttributeType.TEXT + ) private val dateOfIssueAttribute = TemplateAttribute( - TemplateField.LABEL_DATE_OF_ISSUE, - TemplateAttributeType.DATETIME, - false, - TemplateAttributeOption().apply { + label = TemplateField.LABEL_DATE_OF_ISSUE, + type = TemplateAttributeType.DATETIME, + protected = false, + options = TemplateAttributeOption().apply { setDateFormatToDate() - }) + } + ) private val expirationDateAttribute = TemplateAttribute( - TemplateField.LABEL_EXPIRATION, - TemplateAttributeType.DATETIME, - false, - TemplateAttributeOption().apply { + label = TemplateField.LABEL_EXPIRATION, + type = TemplateAttributeType.DATETIME, + protected = false, + options = TemplateAttributeOption().apply { setDateFormatToDate() - }) - private val emailAddressAttribute = TemplateAttribute(TemplateField.LABEL_EMAIL_ADDRESS, TemplateAttributeType.TEXT) - private val passwordAttribute = TemplateAttribute(TemplateField.LABEL_PASSWORD, TemplateAttributeType.TEXT, true) - private val ssidAttribute = TemplateAttribute(TemplateField.LABEL_SSID, TemplateAttributeType.TEXT) + } + ) + private val emailAddressAttribute = TemplateAttribute( + label = TemplateField.LABEL_USERNAME, + type = TemplateAttributeType.TEXT, + options = TemplateAttributeOption().apply { + alias = TemplateField.LABEL_EMAIL_ADDRESS + } + ) + private val passwordAttribute = TemplateAttribute( + label = TemplateField.LABEL_PASSWORD, + type = TemplateAttributeType.TEXT, + protected = true + ) + private val ssidAttribute = TemplateAttribute( + label = TemplateField.LABEL_SSID, + type = TemplateAttributeType.TEXT + ) private val wirelessTypeAttribute = TemplateAttribute( - TemplateField.LABEL_TYPE, - TemplateAttributeType.LIST, - false, - TemplateAttributeOption().apply{ + label = TemplateField.LABEL_TYPE, + type = TemplateAttributeType.LIST, + protected = false, + options = TemplateAttributeOption().apply{ setListItems("WPA3", "WPA2", "WPA", "WEP") default = "WPA2" - }) - private val tokenAttribute = TemplateAttribute(TemplateField.LABEL_TOKEN, TemplateAttributeType.TEXT) - private val publicKeyAttribute = TemplateAttribute(TemplateField.LABEL_PUBLIC_KEY, TemplateAttributeType.TEXT) - private val privateKeyAttribute = TemplateAttribute(TemplateField.LABEL_PRIVATE_KEY, TemplateAttributeType.TEXT, true) - private val seedAttribute = TemplateAttribute(TemplateField.LABEL_SEED, TemplateAttributeType.TEXT, true) - private val bicAttribute = TemplateAttribute(TemplateField.LABEL_BIC, TemplateAttributeType.TEXT) - private val ibanAttribute = TemplateAttribute(TemplateField.LABEL_IBAN, TemplateAttributeType.TEXT) + } + ) + private val tokenAttribute = TemplateAttribute( + label = TemplateField.LABEL_TOKEN, + type = TemplateAttributeType.TEXT + ) + private val publicKeyAttribute = TemplateAttribute( + label = TemplateField.LABEL_PUBLIC_KEY, + type = TemplateAttributeType.TEXT + ) + private val privateKeyAttribute = TemplateAttribute( + label = TemplateField.LABEL_PRIVATE_KEY, + type = TemplateAttributeType.TEXT, + protected = true + ) + private val seedAttribute = TemplateAttribute( + label = TemplateField.LABEL_SEED, + type = TemplateAttributeType.TEXT, + protected = true + ) + private val bicAttribute = TemplateAttribute( + label = TemplateField.LABEL_BIC, + type = TemplateAttributeType.TEXT + ) + private val ibanAttribute = TemplateAttribute( + label = TemplateField.LABEL_IBAN, + type = TemplateAttributeType.TEXT + ) val email: Template get() { diff --git a/fastlane/metadata/android/en-US/changelogs/135.txt b/fastlane/metadata/android/en-US/changelogs/135.txt index 4e08c9697..f8fff9e8b 100644 --- a/fastlane/metadata/android/en-US/changelogs/135.txt +++ b/fastlane/metadata/android/en-US/changelogs/135.txt @@ -1,3 +1,4 @@ * Fix Autofill Registration #2089 * Fix Biometric errors #2081 - * Fixed timestamp in copy file #1981 #1983 \ No newline at end of file + * Fixed timestamp in copy file #1981 #1983 + * Fix Template Email #1986 \ No newline at end of file diff --git a/fastlane/metadata/android/fr-FR/changelogs/135.txt b/fastlane/metadata/android/fr-FR/changelogs/135.txt index 386f2bfd7..0995b995d 100644 --- a/fastlane/metadata/android/fr-FR/changelogs/135.txt +++ b/fastlane/metadata/android/fr-FR/changelogs/135.txt @@ -1,3 +1,4 @@ * Correction de l'enregistrement pour le remplissage automatique #2089 * Correction des erreurs biométriques #2081 - * Correction du timestamp dans le fichier de copie #1981 #1983 \ No newline at end of file + * Correction du timestamp dans le fichier de copie #1981 #1983 + * Correction des gabaris Email #1986 \ No newline at end of file From a1b1338d67c76cb70ca2821330a5c1791c8fb82d Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Thu, 24 Jul 2025 19:12:25 +0200 Subject: [PATCH 11/13] fix: Biometric after orientation change #2081 --- .../activities/MainCredentialActivity.kt | 2 +- .../biometric/AdvancedUnlockFragment.kt | 18 +++---- .../viewmodels/AdvancedUnlockViewModel.kt | 51 ++++++++----------- 3 files changed, 29 insertions(+), 42 deletions(-) diff --git a/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt b/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt index eed24be68..7aa2550ae 100644 --- a/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt +++ b/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt @@ -313,7 +313,7 @@ class MainCredentialActivity : DatabaseModeActivity() { when (actionTask) { ACTION_DATABASE_LOAD_TASK -> { // Recheck advanced unlock if error - mAdvancedUnlockViewModel.initAdvancedUnlockMode() + mAdvancedUnlockViewModel.checkUnlockAvailability() if (result.isSuccess) { launchGroupActivityIfLoaded(database) diff --git a/app/src/main/java/com/kunzisoft/keepass/biometric/AdvancedUnlockFragment.kt b/app/src/main/java/com/kunzisoft/keepass/biometric/AdvancedUnlockFragment.kt index 2165ae8fa..c7c9ae237 100644 --- a/app/src/main/java/com/kunzisoft/keepass/biometric/AdvancedUnlockFragment.kt +++ b/app/src/main/java/com/kunzisoft/keepass/biometric/AdvancedUnlockFragment.kt @@ -128,13 +128,6 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa super.onCreate(savedInstanceState) cipherDatabaseAction = CipherDatabaseAction.getInstance(requireContext().applicationContext) - - mAdvancedUnlockViewModel.onInitAdvancedUnlockModeRequested.observe(this) { - initAdvancedUnlockMode() - } - mAdvancedUnlockViewModel.onDatabaseFileLoaded.observe(this) { - onDatabaseLoaded(it) - } } override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { @@ -155,6 +148,11 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa viewLifecycleOwner.lifecycleScope.launch { viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { mAdvancedUnlockViewModel.uiState.collect { uiState -> + // Database loaded + uiState.databaseFileLoaded?.let { databaseLoaded -> + onDatabaseLoaded(databaseLoaded) + mAdvancedUnlockViewModel.consumeDatabaseFileLoaded() + } // New credential value received uiState.credential?.let { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { @@ -188,10 +186,9 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa // To get device credential unlock result, only if same database uri if (databaseUri != null && mAdvancedUnlockEnabled) { - val deviceCredentialAuthSucceeded = mAdvancedUnlockViewModel.deviceCredentialAuthSucceeded - deviceCredentialAuthSucceeded?.let { + mAdvancedUnlockViewModel.deviceCredentialAuthSucceeded?.let { authSucceeded -> if (databaseUri == databaseFileUri) { - if (deviceCredentialAuthSucceeded == true) { + if (authSucceeded) { advancedUnlockManager?.advancedUnlockCallback?.onAuthenticationSucceeded() } else { advancedUnlockManager?.advancedUnlockCallback?.onAuthenticationFailed() @@ -664,7 +661,6 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa disconnect() advancedUnlockManager = null } - mAdvancedUnlockViewModel.deleteData() super.onDestroy() } diff --git a/app/src/main/java/com/kunzisoft/keepass/viewmodels/AdvancedUnlockViewModel.kt b/app/src/main/java/com/kunzisoft/keepass/viewmodels/AdvancedUnlockViewModel.kt index af22142e6..35b1d6b4f 100644 --- a/app/src/main/java/com/kunzisoft/keepass/viewmodels/AdvancedUnlockViewModel.kt +++ b/app/src/main/java/com/kunzisoft/keepass/viewmodels/AdvancedUnlockViewModel.kt @@ -1,7 +1,6 @@ package com.kunzisoft.keepass.viewmodels import android.net.Uri -import androidx.lifecycle.LiveData import androidx.lifecycle.ViewModel import com.kunzisoft.keepass.model.CipherDecryptDatabase import com.kunzisoft.keepass.model.CipherEncryptDatabase @@ -17,21 +16,12 @@ class AdvancedUnlockViewModel : ViewModel() { private val _uiState = MutableStateFlow(DeviceUnlockUiStates()) val uiState: StateFlow = _uiState - val onInitAdvancedUnlockModeRequested : LiveData get() = _onInitAdvancedUnlockModeRequested - private val _onInitAdvancedUnlockModeRequested = SingleLiveEvent() - - val onDatabaseFileLoaded : LiveData get() = _onDatabaseFileLoaded - private val _onDatabaseFileLoaded = SingleLiveEvent() - - fun initAdvancedUnlockMode() { - _onInitAdvancedUnlockModeRequested.call() - } - - fun checkUnlockAvailability(conditionToStoreCredentialVerified: Boolean) { + fun checkUnlockAvailability(conditionToStoreCredentialVerified: Boolean? = null) { _uiState.update { currentState -> currentState.copy( onUnlockAvailabilityCheckRequested = true, isConditionToStoreCredentialVerified = conditionToStoreCredentialVerified + ?: _uiState.value.isConditionToStoreCredentialVerified ) } } @@ -45,7 +35,19 @@ class AdvancedUnlockViewModel : ViewModel() { } fun databaseFileLoaded(databaseUri: Uri?) { - _onDatabaseFileLoaded.value = databaseUri + _uiState.update { currentState -> + currentState.copy( + databaseFileLoaded = databaseUri + ) + } + } + + fun consumeDatabaseFileLoaded() { + _uiState.update { currentState -> + currentState.copy( + databaseFileLoaded = null + ) + } } fun retrieveCredentialForEncryption() { @@ -106,26 +108,11 @@ class AdvancedUnlockViewModel : ViewModel() { ) } } - - fun deleteData() { - _uiState.update { currentState -> - currentState.copy( - initAdvancedUnlockMode = false, - databaseFileUri = null, - isCredentialRequired = false, - credential = null, - isConditionToStoreCredentialVerified = false, - onUnlockAvailabilityCheckRequested = false, - cipherEncryptDatabase = null, - cipherDecryptDatabase = null - ) - } - } } data class DeviceUnlockUiStates( val initAdvancedUnlockMode: Boolean = false, - val databaseFileUri: Uri? = null, + val databaseFileLoaded: Uri? = null, val isCredentialRequired: Boolean = false, val credential: ByteArray? = null, val isConditionToStoreCredentialVerified: Boolean = false, @@ -139,9 +126,11 @@ data class DeviceUnlockUiStates( other as DeviceUnlockUiStates + if (initAdvancedUnlockMode != other.initAdvancedUnlockMode) return false if (isCredentialRequired != other.isCredentialRequired) return false if (isConditionToStoreCredentialVerified != other.isConditionToStoreCredentialVerified) return false if (onUnlockAvailabilityCheckRequested != other.onUnlockAvailabilityCheckRequested) return false + if (databaseFileLoaded != other.databaseFileLoaded) return false if (!credential.contentEquals(other.credential)) return false if (cipherEncryptDatabase != other.cipherEncryptDatabase) return false if (cipherDecryptDatabase != other.cipherDecryptDatabase) return false @@ -150,9 +139,11 @@ data class DeviceUnlockUiStates( } override fun hashCode(): Int { - var result = isCredentialRequired.hashCode() + var result = initAdvancedUnlockMode.hashCode() + result = 31 * result + isCredentialRequired.hashCode() result = 31 * result + isConditionToStoreCredentialVerified.hashCode() result = 31 * result + onUnlockAvailabilityCheckRequested.hashCode() + result = 31 * result + (databaseFileLoaded?.hashCode() ?: 0) result = 31 * result + (credential?.contentHashCode() ?: 0) result = 31 * result + (cipherEncryptDatabase?.hashCode() ?: 0) result = 31 * result + (cipherDecryptDatabase?.hashCode() ?: 0) From 809e1929e5967a74606ef2c10ad8d19a37de772e Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Thu, 24 Jul 2025 19:21:29 +0200 Subject: [PATCH 12/13] fix: Biometric error #2081 --- .../com/kunzisoft/keepass/activities/MainCredentialActivity.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt b/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt index 7aa2550ae..a3287d521 100644 --- a/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt +++ b/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt @@ -312,9 +312,6 @@ class MainCredentialActivity : DatabaseModeActivity() { super.onDatabaseActionFinished(database, actionTask, result) when (actionTask) { ACTION_DATABASE_LOAD_TASK -> { - // Recheck advanced unlock if error - mAdvancedUnlockViewModel.checkUnlockAvailability() - if (result.isSuccess) { launchGroupActivityIfLoaded(database) } else { From ac9bb9b6667993ba2fc97582563e246c2badfe7b Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Thu, 24 Jul 2025 19:41:28 +0200 Subject: [PATCH 13/13] fix: Biometric error #2081 --- .../keepass/biometric/AdvancedUnlockFragment.kt | 15 ++++++--------- .../keepass/viewmodels/AdvancedUnlockViewModel.kt | 8 ++++---- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/kunzisoft/keepass/biometric/AdvancedUnlockFragment.kt b/app/src/main/java/com/kunzisoft/keepass/biometric/AdvancedUnlockFragment.kt index c7c9ae237..7b35c67f7 100644 --- a/app/src/main/java/com/kunzisoft/keepass/biometric/AdvancedUnlockFragment.kt +++ b/app/src/main/java/com/kunzisoft/keepass/biometric/AdvancedUnlockFragment.kt @@ -20,14 +20,18 @@ package com.kunzisoft.keepass.biometric import android.app.Activity -import android.content.Context import android.content.Intent import android.net.Uri import android.os.Build import android.os.Bundle import android.provider.Settings import android.util.Log -import android.view.* +import android.view.LayoutInflater +import android.view.Menu +import android.view.MenuInflater +import android.view.MenuItem +import android.view.View +import android.view.ViewGroup import androidx.activity.result.contract.ActivityResultContracts import androidx.annotation.RequiresApi import androidx.biometric.BiometricManager @@ -117,13 +121,6 @@ class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCa } } - override fun onAttach(context: Context) { - super.onAttach(context) - - mAdvancedUnlockEnabled = PreferencesUtil.isAdvancedUnlockEnable(context) - mAutoOpenPromptEnabled = PreferencesUtil.isAdvancedUnlockPromptAutoOpenEnable(context) - } - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/app/src/main/java/com/kunzisoft/keepass/viewmodels/AdvancedUnlockViewModel.kt b/app/src/main/java/com/kunzisoft/keepass/viewmodels/AdvancedUnlockViewModel.kt index 35b1d6b4f..e3e174e50 100644 --- a/app/src/main/java/com/kunzisoft/keepass/viewmodels/AdvancedUnlockViewModel.kt +++ b/app/src/main/java/com/kunzisoft/keepass/viewmodels/AdvancedUnlockViewModel.kt @@ -13,8 +13,8 @@ class AdvancedUnlockViewModel : ViewModel() { var allowAutoOpenBiometricPrompt : Boolean = true var deviceCredentialAuthSucceeded: Boolean? = null - private val _uiState = MutableStateFlow(DeviceUnlockUiStates()) - val uiState: StateFlow = _uiState + private val _uiState = MutableStateFlow(DeviceUnlockState()) + val uiState: StateFlow = _uiState fun checkUnlockAvailability(conditionToStoreCredentialVerified: Boolean? = null) { _uiState.update { currentState -> @@ -110,7 +110,7 @@ class AdvancedUnlockViewModel : ViewModel() { } } -data class DeviceUnlockUiStates( +data class DeviceUnlockState( val initAdvancedUnlockMode: Boolean = false, val databaseFileLoaded: Uri? = null, val isCredentialRequired: Boolean = false, @@ -124,7 +124,7 @@ data class DeviceUnlockUiStates( if (this === other) return true if (javaClass != other?.javaClass) return false - other as DeviceUnlockUiStates + other as DeviceUnlockState if (initAdvancedUnlockMode != other.initAdvancedUnlockMode) return false if (isCredentialRequired != other.isCredentialRequired) return false