[PR #3027] [MERGED] [PM-6428] Implement Legacy Secure Storage #29981

Closed
opened 2026-04-18 13:50:41 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/3027
Author: @fedemkr
Created: 2/23/2024
Status: Merged
Merged: 2/26/2024
Merged by: @fedemkr

Base: mainHead: feature/legacy-secure-storage


📝 Commits (7)

  • 81bc6ee Legacy secure storage implementation
  • d62b569 PM-6428 Added DefaultAccessible SecAccessible for iOS KeyChain secure storage and also fixed some pre-compiler directives so it works on Unit testing as well.
  • 4018f98 PM-6428 Added try catch on legacy secure storage in case we get AEADBadTagException when getting a key.
  • b12aea3 Changed Android LegacySecureStorage from Task.FromResult to Task.Run to mimic the Microsoft.Maui.Storage.SecureStorage implementation which ensures there's always a Task (#3029)
  • dc2f52b Added ConditionedAwaiter to avoid race condition issue where HomePage navigation would execute after the main navigation (#3032)
  • f7d4eb6 Merge branch 'main' into feature/legacy-secure-storage
  • 222ca77 Merge branch 'main' into feature/legacy-secure-storage

📊 Changes

9 files changed (+555 additions, -9 deletions)

View changed files

📝 src/Core/Abstractions/IConditionedAwaiterManager.cs (+2 -1)
📝 src/Core/Pages/Accounts/HomePage.xaml.cs (+4 -0)
📝 src/Core/Pages/AndroidNavigationRedirectPage.xaml.cs (+4 -0)
📝 src/Core/Services/ConditionedAwaiterManager.cs (+2 -1)
src/Core/Services/LegacySecureStorage/AndroidKeyStore.cs (+295 -0)
src/Core/Services/LegacySecureStorage/KeyChain.cs (+128 -0)
src/Core/Services/LegacySecureStorage/LegacySecureStorage.cs (+108 -0)
📝 src/Core/Services/SecureStorageService.cs (+6 -6)
📝 src/Core/Utilities/AccountManagement/AccountsManager.cs (+6 -1)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Implement Legacy Secure Storage.
MAUI has changed how Secure Storage work vs Xamarin.Forms, so to avoid having to do a migration now, we are implementing the former way of Secure Storage so the update to MAUI version of the app is as seamless as possible.

Code changes

  • AndroidKeyStore: Component to get/store keys securely on Android
  • KeyChain: Component to get/store keys securely on iOS
  • SecureStorageService: Updated it to use the Xamarin Essentials (Xamarin Forms)'s components for both platforms.

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

🔄 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/3027 **Author:** [@fedemkr](https://github.com/fedemkr) **Created:** 2/23/2024 **Status:** ✅ Merged **Merged:** 2/26/2024 **Merged by:** [@fedemkr](https://github.com/fedemkr) **Base:** `main` ← **Head:** `feature/legacy-secure-storage` --- ### 📝 Commits (7) - [`81bc6ee`](https://github.com/bitwarden/android/commit/81bc6ee8f3b1b91a48f4c23849d7180c4f5aca7f) Legacy secure storage implementation - [`d62b569`](https://github.com/bitwarden/android/commit/d62b569a65a340cff8fe1305435ef99537446af1) PM-6428 Added DefaultAccessible SecAccessible for iOS KeyChain secure storage and also fixed some pre-compiler directives so it works on Unit testing as well. - [`4018f98`](https://github.com/bitwarden/android/commit/4018f98a162f97cecb3cee226b522a59266e4d1e) PM-6428 Added try catch on legacy secure storage in case we get AEADBadTagException when getting a key. - [`b12aea3`](https://github.com/bitwarden/android/commit/b12aea3c0343957f4065ee90f451e8ffb8b611e6) Changed Android LegacySecureStorage from Task.FromResult to Task.Run to mimic the Microsoft.Maui.Storage.SecureStorage implementation which ensures there's always a Task (#3029) - [`dc2f52b`](https://github.com/bitwarden/android/commit/dc2f52b30028c5dd71decc49c16a09c0fa9f7f8b) Added ConditionedAwaiter to avoid race condition issue where HomePage navigation would execute after the main navigation (#3032) - [`f7d4eb6`](https://github.com/bitwarden/android/commit/f7d4eb6aa43906e3d98934e272723586d0833fa9) Merge branch 'main' into feature/legacy-secure-storage - [`222ca77`](https://github.com/bitwarden/android/commit/222ca77c3daed458ef59c7ce046cf93915fbb7cc) Merge branch 'main' into feature/legacy-secure-storage ### 📊 Changes **9 files changed** (+555 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/Core/Abstractions/IConditionedAwaiterManager.cs` (+2 -1) 📝 `src/Core/Pages/Accounts/HomePage.xaml.cs` (+4 -0) 📝 `src/Core/Pages/AndroidNavigationRedirectPage.xaml.cs` (+4 -0) 📝 `src/Core/Services/ConditionedAwaiterManager.cs` (+2 -1) ➕ `src/Core/Services/LegacySecureStorage/AndroidKeyStore.cs` (+295 -0) ➕ `src/Core/Services/LegacySecureStorage/KeyChain.cs` (+128 -0) ➕ `src/Core/Services/LegacySecureStorage/LegacySecureStorage.cs` (+108 -0) 📝 `src/Core/Services/SecureStorageService.cs` (+6 -6) 📝 `src/Core/Utilities/AccountManagement/AccountsManager.cs` (+6 -1) </details> ### 📄 Description ## Type of change - [ ] Bug fix - [X] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> Implement Legacy Secure Storage. MAUI has changed how Secure Storage work vs Xamarin.Forms, so to avoid having to do a migration now, we are implementing the former way of Secure Storage so the update to MAUI version of the app is as seamless as possible. ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **AndroidKeyStore:** Component to get/store keys securely on Android * **KeyChain:** Component to get/store keys securely on iOS * **SecureStorageService:** Updated it to use the Xamarin Essentials (Xamarin Forms)'s components for both platforms. ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team --- <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 2026-04-18 13:50:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#29981