[PR #3733] [MERGED] [PM-10884] Catch ProviderException when generating a secure key #4381

Closed
opened 2025-11-26 23:43:42 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/3733
Author: @SaintPatrck
Created: 8/14/2024
Status: Merged
Merged: 8/16/2024
Merged by: @SaintPatrck

Base: mainHead: PM-10884/catch-providerexception


📝 Commits (10+)

  • f6e17b9 [PM-10884] Catch ProviderException when generating a secure key
  • 1cbde53 Remove unnecessary @Throws annotation
  • 6214a70 Merge remote-tracking branch 'origin/main' into PM-10884/catch-providerexception
  • c319628 Refactor generateKey to return a nullable value on exception
  • 9dd9977 Merge remote-tracking branch 'origin/main' into PM-10884/catch-providerexception
  • d7f02fa Intercept all the exceptions
  • a86e1f9 Remove NPE catch
  • 285a8f5 Changes
  • 287193c Handle exceptions when instantiating Cipher
  • 055269a Merge remote-tracking branch 'origin/main' into PM-10884/catch-providerexception

📊 Changes

10 files changed (+340 additions, -47 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/BiometricsEncryptionManager.kt (+2 -2)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/BiometricsEncryptionManagerImpl.kt (+88 -29)
📝 app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupUnlockScreen.kt (+17 -1)
📝 app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupUnlockViewModel.kt (+41 -6)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/AccountSecurityScreen.kt (+8 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/AccountSecurityViewModel.kt (+29 -8)
📝 app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupUnlockScreenTest.kt (+34 -0)
📝 app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupUnlockViewModelTest.kt (+51 -0)
📝 app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/AccountSecurityScreenTest.kt (+49 -0)
📝 app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/AccountSecurityViewModelTest.kt (+21 -1)

📄 Description

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-10884

📔 Objective

Prevent the application from crashing when secret keys cannot be created due to an exception within the device KeyStore.

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/3733 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 8/14/2024 **Status:** ✅ Merged **Merged:** 8/16/2024 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `PM-10884/catch-providerexception` --- ### 📝 Commits (10+) - [`f6e17b9`](https://github.com/bitwarden/android/commit/f6e17b9c7f8c5a2cd017e318741338783f38f3dd) [PM-10884] Catch ProviderException when generating a secure key - [`1cbde53`](https://github.com/bitwarden/android/commit/1cbde536762499a19738e0da09b3b20bb4f64dcc) Remove unnecessary `@Throws` annotation - [`6214a70`](https://github.com/bitwarden/android/commit/6214a70734975ea21aa8a6d6b0febab4f08257ec) Merge remote-tracking branch 'origin/main' into PM-10884/catch-providerexception - [`c319628`](https://github.com/bitwarden/android/commit/c319628022a2c6288da313a9110c024901da89ef) Refactor `generateKey` to return a nullable value on exception - [`9dd9977`](https://github.com/bitwarden/android/commit/9dd9977b6dd5ffb11830b5f57701422c1578b073) Merge remote-tracking branch 'origin/main' into PM-10884/catch-providerexception - [`d7f02fa`](https://github.com/bitwarden/android/commit/d7f02fa71e7ad1753f3efcc03752edd36a91fc44) Intercept all the exceptions - [`a86e1f9`](https://github.com/bitwarden/android/commit/a86e1f9d3ce93eae14342801f3976540ac18e026) Remove NPE catch - [`285a8f5`](https://github.com/bitwarden/android/commit/285a8f551404110c95c77321aa8058bacc070b6c) Changes - [`287193c`](https://github.com/bitwarden/android/commit/287193c37300cb3901000808563c11f6227355a3) Handle exceptions when instantiating Cipher - [`055269a`](https://github.com/bitwarden/android/commit/055269a6706a9561d2b62b2a9e3eb7d005a66e12) Merge remote-tracking branch 'origin/main' into PM-10884/catch-providerexception ### 📊 Changes **10 files changed** (+340 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/BiometricsEncryptionManager.kt` (+2 -2) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/BiometricsEncryptionManagerImpl.kt` (+88 -29) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupUnlockScreen.kt` (+17 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupUnlockViewModel.kt` (+41 -6) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/AccountSecurityScreen.kt` (+8 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/AccountSecurityViewModel.kt` (+29 -8) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupUnlockScreenTest.kt` (+34 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupUnlockViewModelTest.kt` (+51 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/AccountSecurityScreenTest.kt` (+49 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/AccountSecurityViewModelTest.kt` (+21 -1) </details> ### 📄 Description ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-10884 ## 📔 Objective Prevent the application from crashing when secret keys cannot be created due to an exception within the device KeyStore. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:43:42 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#4381