[PR #4793] [MERGED] [PM-14303] Update Bitwarden SDK and load bitwarden_uniffi on older Android versions #5218

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/4793
Author: @SaintPatrck
Created: 2/26/2025
Status: Merged
Merged: 2/27/2025
Merged by: @SaintPatrck

Base: mainHead: PM-14303/update-bitwarden-sdk


📝 Commits (3)

  • dab06b0 [PM-14303] Update Bitwarden SDK and load bitwarden_uniffi on older Android versions
  • 5c07687 Implement NativeLibraryManager and NativeLibraryManagerImpl for loading native libraries
  • 71cd917 Merge branch 'main' into PM-14303/update-bitwarden-sdk

📊 Changes

6 files changed (+96 additions, -5 deletions)

View changed files

app/src/main/java/com/x8bit/bitwarden/data/platform/manager/NativeLibraryManager.kt (+12 -0)
app/src/main/java/com/x8bit/bitwarden/data/platform/manager/NativeLibraryManagerImpl.kt (+20 -0)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/SdkClientManagerImpl.kt (+12 -0)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/di/PlatformManagerModule.kt (+8 -0)
📝 app/src/test/java/com/x8bit/bitwarden/data/platform/manager/SdkClientManagerTest.kt (+43 -4)
📝 gradle/libs.versions.toml (+1 -1)

📄 Description

🎟️ Tracking

Relates to https://github.com/bitwarden/sdk-internal/pull/155
Resolves #4205
PM-14303

📔 Objective

The Bitwarden SDK dependency was updated to version 1.0.0-20250225.125021-120.

The SDK requires access to Android APIs that were made public in API 31 in order to generate email aliases. To address this limitation for devices with earlier API versions, the bitwarden_uniffi library is now loaded manually before initializing any Client instance.

This commit introduces the NativeLibraryManager interface and its implementation, NativeLibraryManagerImpl.

  • NativeLibraryManager defines a method loadLibrary for loading native libraries.
  • NativeLibraryManagerImpl uses System.loadLibrary to load libraries and handles potential UnsatisfiedLinkError.

📸 Screenshots

android-10-alias-generation.webm

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/4793 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 2/26/2025 **Status:** ✅ Merged **Merged:** 2/27/2025 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `PM-14303/update-bitwarden-sdk` --- ### 📝 Commits (3) - [`dab06b0`](https://github.com/bitwarden/android/commit/dab06b0ed4a3ef12a721b77ed759f986cacc2fa1) [PM-14303] Update Bitwarden SDK and load `bitwarden_uniffi` on older Android versions - [`5c07687`](https://github.com/bitwarden/android/commit/5c076871abaa7e58c37c3088a6bf3ad58b3dabfa) Implement NativeLibraryManager and NativeLibraryManagerImpl for loading native libraries - [`71cd917`](https://github.com/bitwarden/android/commit/71cd917328673e219028a0f7a3114ace0d74d7cd) Merge branch 'main' into PM-14303/update-bitwarden-sdk ### 📊 Changes **6 files changed** (+96 additions, -5 deletions) <details> <summary>View changed files</summary> ➕ `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/NativeLibraryManager.kt` (+12 -0) ➕ `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/NativeLibraryManagerImpl.kt` (+20 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/SdkClientManagerImpl.kt` (+12 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/di/PlatformManagerModule.kt` (+8 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/data/platform/manager/SdkClientManagerTest.kt` (+43 -4) 📝 `gradle/libs.versions.toml` (+1 -1) </details> ### 📄 Description ## 🎟️ Tracking Relates to https://github.com/bitwarden/sdk-internal/pull/155 Resolves #4205 PM-14303 ## 📔 Objective The Bitwarden SDK dependency was updated to version 1.0.0-20250225.125021-120. The SDK requires access to Android APIs that were made public in API 31 in order to generate email aliases. To address this limitation for devices with earlier API versions, the `bitwarden_uniffi` library is now loaded manually before initializing any `Client` instance. This commit introduces the `NativeLibraryManager` interface and its implementation, `NativeLibraryManagerImpl`. - `NativeLibraryManager` defines a method `loadLibrary` for loading native libraries. - `NativeLibraryManagerImpl` uses `System.loadLibrary` to load libraries and handles potential `UnsatisfiedLinkError`. ## 📸 Screenshots [android-10-alias-generation.webm](https://github.com/user-attachments/assets/e1c04630-9722-4344-b652-bba7e8a24003) ## ⏰ 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:55:46 -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#5218