[PR #2164] [MERGED] [EC-585] Added data, encryption and some helpers and structure to the Watch app #3399

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2164
Author: @fedemkr
Created: 11/3/2022
Status: Merged
Merged: 11/8/2022
Merged by: @fedemkr

Base: feature/apple-watch-mvpHead: feature/EC-585-apple-watch-mvp-data


📝 Commits (10+)

  • 031bf19 Merge branch 'master' into feature/apple-watch-mvp-data
  • e6d0760 [EC-585] Added foundation classes on the watch to handle CoreData and some fixes on the communication of the ciphers, also some helper classes to store in keychain and encrypt data
  • d5517a1 Merge branch 'master' into feature/apple-watch-mvp-data
  • d84396e Merge branch 'master' into feature/apple-watch-mvp-data
  • 3620cb2 Merge branch 'master' into feature/apple-watch-mvp-data
  • 180043f EC-585 Added keychain helper, encryption helpers and added data storage using CoreData configuring it appropiately. View and ViewModel are here only to test that the fetching/saving works but it's not the actual UI of the watch app. Also removed all the places where the automatic file signature was added by XCode
  • 86c74e3 Merge branch 'master' into feature/apple-watch-mvp-data
  • aa4d36a Merge branch 'feature/apple-watch-mvp' into feature/EC-585-apple-watch-mvp-data
  • c4315f3 EC-585 Fixed CipherServiceMock to implement protocol
  • fae7aef EC-585 Fixed DeviceActionService duplicated services

📊 Changes

38 files changed (+1278 additions, -206 deletions)

View changed files

📝 src/Android/Services/DeviceActionService.cs (+2 -0)
📝 src/App/Abstractions/IDeviceActionService.cs (+5 -1)
📝 src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs (+32 -1)
📝 src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs (+14 -0)
src/Core/Models/View/SimpleCipherView.cs (+37 -0)
📝 src/iOS.Core/Services/DeviceActionService.cs (+24 -8)
📝 src/iOS.Core/Utilities/WCSessionManager.cs (+56 -21)
📝 src/iOS/iOS.csproj (+1 -1)
src/watchOS/bitwarden/bitwarden WatchKit Extension/Cipher.swift (+0 -32)
📝 src/watchOS/bitwarden/bitwarden WatchKit Extension/ComplicationController.swift (+0 -7)
src/watchOS/bitwarden/bitwarden WatchKit Extension/ContentView.swift (+0 -39)
src/watchOS/bitwarden/bitwarden WatchKit Extension/DataStorage/CoreDataHelper.swift (+120 -0)
src/watchOS/bitwarden/bitwarden WatchKit Extension/DataStorage/DBHelperProtocol.swift (+20 -0)
src/watchOS/bitwarden/bitwarden WatchKit Extension/Entities/BitwardenDB.xcdatamodeld/BitwardenDB.xcdatamodel/contents (+16 -0)
src/watchOS/bitwarden/bitwarden WatchKit Extension/Entities/CipherEntity+CoreDataClass.swift (+41 -0)
src/watchOS/bitwarden/bitwarden WatchKit Extension/Entities/CipherEntity+CoreDataProperties.swift (+27 -0)
src/watchOS/bitwarden/bitwarden WatchKit Extension/Entities/StringEncryptionTransformer.swift (+48 -0)
src/watchOS/bitwarden/bitwarden WatchKit Extension/Helpers/KeychainHelper.swift (+89 -0)
src/watchOS/bitwarden/bitwarden WatchKit Extension/Helpers/LoggerHelper.swift (+54 -0)
src/watchOS/bitwarden/bitwarden WatchKit Extension/Models/Cipher.swift (+30 -0)

...and 18 more files

📄 Description

Type of change

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

Objective

Add data part, encryption and structure to the Watch application

Code changes

  • SimpleCipherView.cs: Cipher model view to be sent to the Watch.
  • WCSessionManager.cs: Improved code and added some logic for testing
  • iOS.csproj: Updated reference to the watch app name
  • src/iOS.Core/Services/DeviceActionService.cs, src/iOS.Core/Utilities/iOSCoreHelpers.cs: Added some logic to help testing some things on the communication with the watch.
  • src/App/ViewModels/SettingsViewModel.cs: Added some logic to help sending some dtos for testing communication with the watch.

WATCH

  • Extension/DataStorage/CoreDataHelper.swift: Helper to communicate with CoreData easily
  • Entities/BitwardenDB.xcdatamodeld/BitwardenDB.xcdatamodel/contents Added DB and CipherEntity
  • Extension/Entities/CipherEntity+CoreDataClass.swift: Configuration of the cipher entity NSManagedObject to be Codable
  • Extension/Entities/CipherEntity+CoreDataProperties.swift: Further configuration of the cipher entity and some extension helping methods
  • Extension/Entities/StringEncryptionTransformer.swift: ValueTransformer to be used to encrypt/decrypt cipher attributes before being saved/fetched
  • Extension/Helpers/KeychainHelper.swift: Helper to use for storing/fetching to/from the keychain
  • Extension/Helpers/LoggerHelper.swift: Basic logging helper that for now it's only configured to print in the console (only on DEBUG)
  • Extension/Models/Cipher.swift: Model of the Cipher (this is really simpler than the one of the iOS app)
  • Extension/Services/CipherService.swift: Service that has to do with the Ciphers
  • Extension/Services/CryptoService.swift: Service to be used to encrypt/decrypt
  • Extension/Services/Mocks/CipherServiceMock.swift: Mock used in the views previews
  • Extension/Utilities/EmptyStateViewModifier.swift: Modifier created to easily add empty state handling on views
  • Extension/WatchConnectivityManager.swift: Improved the handling when receiving the ciphers to save them into the database
  • Extension/ViewModels/CipherListViewModel.swift: ViewModel for the cipher list (this is just a dummy VM now that doesn't do much, only done for testing the load from the database) - DON'T REVIEW cause it will change
  • Extension/Views/CipherListView.swift: View of the list of the ciphers (this is just a dummy list now that doesn't show much, only done for testing the load from the database) - DON'T REVIEW cause it will change
  • Other files: Mostly config or removed the automatic header from files done by XCode

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/2164 **Author:** [@fedemkr](https://github.com/fedemkr) **Created:** 11/3/2022 **Status:** ✅ Merged **Merged:** 11/8/2022 **Merged by:** [@fedemkr](https://github.com/fedemkr) **Base:** `feature/apple-watch-mvp` ← **Head:** `feature/EC-585-apple-watch-mvp-data` --- ### 📝 Commits (10+) - [`031bf19`](https://github.com/bitwarden/android/commit/031bf199d8d043953149be4bf1c1b34f13e7a5e3) Merge branch 'master' into feature/apple-watch-mvp-data - [`e6d0760`](https://github.com/bitwarden/android/commit/e6d076013e287117900262b7f7c985b8ebb0a324) [EC-585] Added foundation classes on the watch to handle CoreData and some fixes on the communication of the ciphers, also some helper classes to store in keychain and encrypt data - [`d5517a1`](https://github.com/bitwarden/android/commit/d5517a1a83270ac0713f47f34902ae5cee591fa1) Merge branch 'master' into feature/apple-watch-mvp-data - [`d84396e`](https://github.com/bitwarden/android/commit/d84396ec9b2237991273c78373e946aeb56efbc7) Merge branch 'master' into feature/apple-watch-mvp-data - [`3620cb2`](https://github.com/bitwarden/android/commit/3620cb2afe03ad9e675e93a945e543171d996321) Merge branch 'master' into feature/apple-watch-mvp-data - [`180043f`](https://github.com/bitwarden/android/commit/180043fac098e80a4588f2b2b7b3888e41a0b5c6) EC-585 Added keychain helper, encryption helpers and added data storage using CoreData configuring it appropiately. View and ViewModel are here only to test that the fetching/saving works but it's not the actual UI of the watch app. Also removed all the places where the automatic file signature was added by XCode - [`86c74e3`](https://github.com/bitwarden/android/commit/86c74e3131e2a457b90542817eb700dadca7c73a) Merge branch 'master' into feature/apple-watch-mvp-data - [`aa4d36a`](https://github.com/bitwarden/android/commit/aa4d36aefb0902b51bf96a4dfebecdf5b490ec6b) Merge branch 'feature/apple-watch-mvp' into feature/EC-585-apple-watch-mvp-data - [`c4315f3`](https://github.com/bitwarden/android/commit/c4315f3644a8f0603976b4844751a6f590bb4861) EC-585 Fixed CipherServiceMock to implement protocol - [`fae7aef`](https://github.com/bitwarden/android/commit/fae7aef41f9f989c8635510083be25623d0fbb68) EC-585 Fixed DeviceActionService duplicated services ### 📊 Changes **38 files changed** (+1278 additions, -206 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/Services/DeviceActionService.cs` (+2 -0) 📝 `src/App/Abstractions/IDeviceActionService.cs` (+5 -1) 📝 `src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs` (+32 -1) 📝 `src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs` (+14 -0) ➕ `src/Core/Models/View/SimpleCipherView.cs` (+37 -0) 📝 `src/iOS.Core/Services/DeviceActionService.cs` (+24 -8) 📝 `src/iOS.Core/Utilities/WCSessionManager.cs` (+56 -21) 📝 `src/iOS/iOS.csproj` (+1 -1) ➖ `src/watchOS/bitwarden/bitwarden WatchKit Extension/Cipher.swift` (+0 -32) 📝 `src/watchOS/bitwarden/bitwarden WatchKit Extension/ComplicationController.swift` (+0 -7) ➖ `src/watchOS/bitwarden/bitwarden WatchKit Extension/ContentView.swift` (+0 -39) ➕ `src/watchOS/bitwarden/bitwarden WatchKit Extension/DataStorage/CoreDataHelper.swift` (+120 -0) ➕ `src/watchOS/bitwarden/bitwarden WatchKit Extension/DataStorage/DBHelperProtocol.swift` (+20 -0) ➕ `src/watchOS/bitwarden/bitwarden WatchKit Extension/Entities/BitwardenDB.xcdatamodeld/BitwardenDB.xcdatamodel/contents` (+16 -0) ➕ `src/watchOS/bitwarden/bitwarden WatchKit Extension/Entities/CipherEntity+CoreDataClass.swift` (+41 -0) ➕ `src/watchOS/bitwarden/bitwarden WatchKit Extension/Entities/CipherEntity+CoreDataProperties.swift` (+27 -0) ➕ `src/watchOS/bitwarden/bitwarden WatchKit Extension/Entities/StringEncryptionTransformer.swift` (+48 -0) ➕ `src/watchOS/bitwarden/bitwarden WatchKit Extension/Helpers/KeychainHelper.swift` (+89 -0) ➕ `src/watchOS/bitwarden/bitwarden WatchKit Extension/Helpers/LoggerHelper.swift` (+54 -0) ➕ `src/watchOS/bitwarden/bitwarden WatchKit Extension/Models/Cipher.swift` (+30 -0) _...and 18 more files_ </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--> Add data part, encryption and structure to the Watch application ## 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--> * **SimpleCipherView.cs:** Cipher model view to be sent to the Watch. * **WCSessionManager.cs:** Improved code and added some logic for testing * **iOS.csproj:** Updated reference to the watch app name * **src/iOS.Core/Services/DeviceActionService.cs, src/iOS.Core/Utilities/iOSCoreHelpers.cs:** Added some logic to help testing some things on the communication with the watch. * **src/App/ViewModels/SettingsViewModel.cs:** Added some logic to help sending some dtos for testing communication with the watch. **WATCH** * **Extension/DataStorage/CoreDataHelper.swift:** Helper to communicate with CoreData easily * **Entities/BitwardenDB.xcdatamodeld/BitwardenDB.xcdatamodel/contents** Added DB and `CipherEntity` * **Extension/Entities/CipherEntity+CoreDataClass.swift:** Configuration of the cipher entity `NSManagedObject` to be `Codable` * **Extension/Entities/CipherEntity+CoreDataProperties.swift:** Further configuration of the cipher entity and some extension helping methods * **Extension/Entities/StringEncryptionTransformer.swift:** `ValueTransformer` to be used to encrypt/decrypt cipher attributes before being saved/fetched * **Extension/Helpers/KeychainHelper.swift:** Helper to use for storing/fetching to/from the keychain * **Extension/Helpers/LoggerHelper.swift:** Basic logging helper that for now it's only configured to print in the console (only on DEBUG) * **Extension/Models/Cipher.swift:** Model of the Cipher (this is really simpler than the one of the iOS app) * **Extension/Services/CipherService.swift:** Service that has to do with the Ciphers * **Extension/Services/CryptoService.swift:** Service to be used to encrypt/decrypt * **Extension/Services/Mocks/CipherServiceMock.swift:** Mock used in the views previews * **Extension/Utilities/EmptyStateViewModifier.swift:** Modifier created to easily add empty state handling on views * **Extension/WatchConnectivityManager.swift:** Improved the handling when receiving the ciphers to save them into the database * **Extension/ViewModels/CipherListViewModel.swift:** ViewModel for the cipher list (this is just a dummy VM now that doesn't do much, only done for testing the load from the database) - DON'T REVIEW cause it will change * **Extension/Views/CipherListView.swift:** View of the list of the ciphers (this is just a dummy list now that doesn't show much, only done for testing the load from the database) - DON'T REVIEW cause it will change * **Other files:** Mostly config or removed the automatic header from files done by XCode ## 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 2025-11-26 23:32:13 -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#3399