Skip to content

Conversation

@zhouxl
Copy link
Collaborator

@zhouxl zhouxl commented Jan 12, 2026

Related Issue

Summary of Changes

Need Regression Testing

  • Yes
  • No

Risk Assessment

  • Low
  • Medium
  • High

Additional Notes

Screenshots (if applicable)

@zhouxl zhouxl requested a review from a team as a code owner January 12, 2026 13:51
@github-actions
Copy link

github-actions bot commented Jan 12, 2026

PR Summary

Implemented a key rotation workflow for Blocto accounts on iOS. Added a new BloctoDetectorService to detect Blocto keys by checking for specific signature algorithm and weight patterns. When a Blocto account requiring key rotation is detected, a React Native backup tip screen is presented. Introduced new bridge methods (signRotationRequest, removeOldKey, createSeedKey, saveNewKey, setScreenSecurityLevel) to support the key rotation process from React Native. Updated login view models to filter account keys by weight and revocation status. Bumped the app version to 3.0.12 and fixed a UI issue on iOS 26.

Changes

File Summary
.gitignore Added /assets/__packages to the .gitignore file.
FRW.xcodeproj/project.pbxproj Added BloctoDetectorService.swift to the project build phases. Bumped MARKETING_VERSION from 3.0.11 to 3.0.12 across all targets. Added empty inputPaths and outputPaths arrays to CocoaPods build phases.
FRW/App/AppDelegate.swift Renamed method call from KeyChainAccessibilityUpdate.udpate() to KeyChainAccessibilityUpdate.update(). Removed a trailing blank line in cleanup.
FRW/Foundation/Bridge/BridgeModels.swift Renamed ScreenType.tokenDetail to backupTip. Added new AccountKeySignature struct containing public_key, hash_algo, sign_algo, signature, sign_message, and weight fields for key rotation signing.
FRW/Foundation/Bridge/RCTNativeFRWBridge.mm Added Objective-C bridge methods: signRotationRequest, removeOldKey, createSeedKey, saveNewKey, and setScreenSecurityLevel to expose Swift key rotation functionality to React Native.
FRW/Foundation/Bridge/TurboModuleSwift.swift Added createSeedKey to generate a new seed phrase and derive a public key. Added saveNewKey to persist the seed phrase securely. Added signRotationRequest to sign rotation data with the current account key. Added removeOldKey to delete an old key from the keychain. Added setScreenSecurityLevel stub and a private hash helper on Flow.HashAlgorithm.
FRW/Foundation/Model/Error.swift Renamed invaildPublicKey to invalidPublicKey. Added new error case invalidSignData to WalletError.
FRW/Modules/Login/ViewModel/KeyStoreLoginViewModel.swift Added filtering of account keys to only include those with weight >= 1000 and not revoked before selecting the first key for login.
FRW/Modules/Login/ViewModel/PrivateKeyLoginViewModel.swift Added filtering of account keys to only include those with weight >= 1000 and not revoked before selecting the first key for login.
FRW/Modules/Login/ViewModel/SeedPhraseLoginViewModel.swift Added filtering of account keys to only include those with weight >= 1000 and not revoked before selecting the first key for login.
FRW/Modules/MultiRestore/ViewModel/RestoreMultiConnectViewModel.swift Updated error reference from WalletError.invaildPublicKey to WalletError.invalidPublicKey.
FRW/Modules/PushAlert/PushAlertView.swift Added isNavigationBarHidden property returning true to hide the navigation bar for this view.
FRW/Modules/ReactNative/ReactNativeViewController.swift Added keyRotationTip route case. Added initialRouteOverride parameter to the initializer. Updated route computed property to handle backupTip screen type. Changed top constraint from safe area to view top. Hides navigation bar on appear.
FRW/Modules/Wallet/FlowWalletKit/KeyChainAccessibilityUpdate.swift Renamed method from udpate() to update().
FRW/Services/Manager/Wallet/BloctoDetectorService.swift New file. Implements BloctoDetectorService with detectBloctoKey(address:) method that checks for Blocto accounts by looking for keys with ECDSA_SECP256k1/SHA3_256 and weights of 999 and 1. Returns BloctoDetectionResult indicating if rotation is needed.
FRW/Services/Manager/Wallet/WalletManager.swift Added checkBloctoKeyAndPresentBackupTip(address:) method that calls BloctoDetectorService and routes to the backup tip screen if key rotation is needed. Called when selecting a main account or on initial account load.
FRW/Services/Router/RouteMap+React.swift Added backupTip case to RouteMap.ReactNative. Presents ReactNativeViewController with backupTip screen type in full-screen modal presentation style.
FRW/Services/Router/RouteableUIHostingController.swift Moved back button assignment to viewWillAppear. Conditionally sets leftBarButtonItem to nil when isNavigationBarHidden is true, otherwise shows the back button.
Podfile.lock Updated checksums for various React Native and related pods reflecting dependency updates.
main.jsbundle Updated the main JavaScript bundle for React Native.

autogenerated by presubmit.ai

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 Pull request needs attention.

Review Summary

Commits Considered (12)
  • 6869aed: feat: first filter valid key
  • 8635905: feat: empty setScreenSecurityLevel
  • 6a8c657: feat: dump version 3.0.12
  • 31fde79: fix: UI error on iOS 26
  • b89f9d7: feat: update sign param
  • fdc4c5a: feat: update route name
  • 182f80e: feat: check blocto each time when switch profile
  • c77db01: feat: update Model from RN
  • 43bbd60: feat: blocto rotation logic
  • 9cc225f: feat: check blocto keys
  • 277a035: feat: remove event bus pattern
  • 83d68fc: feat: add headless rn on app launch
Files Processed (20)
  • .gitignore (1 hunk)
  • FRW.xcodeproj/project.pbxproj (23 hunks)
  • FRW/App/AppDelegate.swift (2 hunks)
  • FRW/Foundation/Bridge/BridgeModels.swift (2 hunks)
  • FRW/Foundation/Bridge/RCTNativeFRWBridge.mm (2 hunks)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift (4 hunks)
  • FRW/Foundation/Model/Error.swift (1 hunk)
  • FRW/Modules/Login/ViewModel/KeyStoreLoginViewModel.swift (1 hunk)
  • FRW/Modules/Login/ViewModel/PrivateKeyLoginViewModel.swift (1 hunk)
  • FRW/Modules/Login/ViewModel/SeedPhraseLoginViewModel.swift (1 hunk)
  • FRW/Modules/MultiRestore/ViewModel/RestoreMultiConnectViewModel.swift (1 hunk)
  • FRW/Modules/PushAlert/PushAlertView.swift (1 hunk)
  • FRW/Modules/ReactNative/ReactNativeViewController.swift (7 hunks)
  • FRW/Modules/Wallet/FlowWalletKit/KeyChainAccessibilityUpdate.swift (1 hunk)
  • FRW/Services/Manager/Wallet/BloctoDetectorService.swift (1 hunk)
  • FRW/Services/Manager/Wallet/WalletManager.swift (3 hunks)
  • FRW/Services/Router/RouteMap+React.swift (2 hunks)
  • FRW/Services/Router/RouteableUIHostingController.swift (4 hunks)
  • Podfile.lock (2 hunks)
  • main.jsbundle (0 hunks)
Actionable Comments (1)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift [205-207]

    possible bug: "Method implementation is incomplete and has no effect."

Skipped Comments (4)
  • FRW/Foundation/Bridge/TurboModuleSwift.swift [143-145]

    maintainability: "Incomplete error handling with TODO comment."

  • FRW/Services/Manager/Wallet/BloctoDetectorService.swift [22-51]

    performance: "Asymmetric caching may cause unnecessary network requests."

  • FRW/Services/Manager/Wallet/WalletManager.swift [440-452]

    possible issue: "Fire-and-forget task may present UI for stale account."

  • FRW/Foundation/Bridge/TurboModuleSwift.swift [479-489]

    maintainability: "Unused private extension method."

Comment on lines +205 to +207
static func setScreenSecurityLevel(level: String) {
let secure = level.lowercased() == "secure"
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setScreenSecurityLevel method is implemented but the body does nothing with the secure variable. The computed value is assigned but never used, making this a no-op function.

@zhouxl zhouxl changed the base branch from hotfix/ios-3.0.11 to hotfix/3.0.12 January 12, 2026 13:53
@zhouxl zhouxl merged commit 5e4cde3 into hotfix/3.0.12 Jan 12, 2026
3 checks passed
@zhouxl zhouxl deleted the hotfix/1064-ios-integration-implement-key-rotation-workflow-integration branch January 12, 2026 13:54
@github-actions github-actions bot mentioned this pull request Jan 14, 2026
5 tasks
zhouxl added a commit that referenced this pull request Jan 14, 2026
* fix: logout issue when key is available but no profile

* Bump version 3.0.11

* feat: revert podfile.lock

* feat: replace coinbase url (#1989)

* Hotfix/1064 ios integration implement key rotation workflow integration (#2265)

* feat: add headless rn on app launch

* feat: remove event bus pattern

* feat: check blocto keys

* feat: blocto rotation logic

* feat: update Model from RN

* feat: check blocto each time when switch profile

* feat: update route name

* feat: update sign param

* fix: UI error on iOS 26

* feat: dump version 3.0.12

* feat: empty setScreenSecurityLevel

* feat: first filter valid key

---------

Co-authored-by: lmcmz <[email protected]>

* feat: update RN

* feat: filter valid key

* feat: format

---------

Co-authored-by: lmcmz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants