Skip to content

Conversation

@lealobanov
Copy link
Collaborator

@lealobanov lealobanov commented Oct 9, 2025

Related Issue

Closes onflow/FRW-monorepo#373

Summary of Changes

Need Regression Testing

  • Yes
  • No

Risk Assessment

  • Low
  • Medium
  • High

Additional Notes

Screenshots (if applicable)

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Analyzing changes in this PR...

This might take a few minutes, please wait

📥 Commits

Analyzing changes from base (d696e7b) to latest commit (acd4a61):

  • acd4a61: fix: save mnemonic

  • a3d3fab: fix: save mnemonic

  • 561e02f: fix: feedback

  • c40407a: fix: feedback

  • 47bc372: fix: feedback

  • 4cd3556: fix: feedback

  • 911d807: fix: feedback

  • b2c29b7: fix: merge conflicts

  • c7a8c25: fix: add missing entry point and bridge methods

  • 6baab43: fix: add missing entry point and bridge methods

  • 68d7451: chore: pull from dev

  • b07d564: fix: add missing entry point and bridge methods

  • f6dc181: feat: add entrypoint for onboarding flow

  • 7045625: feat: add entrypoint for onboarding flow

  • a682720: feat: add entrypoint for onboarding flow

  • 9199ff1: feat: add entrypoint for onboarding flow

  • 0225369: Merge dev branch and resolve conflicts

  • Resolved import conflicts in NativeFRWBridge.kt

  • Updated build.gradle to read GitHub credentials from local.properties

  • c1a9461: feat: add entrypoint for onboarding flow

  • 542ea8e: feat: add entrypoint for onboarding flow

  • e06ee29: feat: add entrypoint for onboarding flow

  • 0a58b2e: chore: remove unused bridge methods

  • Remove generateRecoveryPhrase() (using TypeScript implementation)

  • Remove createEOAAccount() stub (replaced by saveMnemonic)

  • Clean up unused code per code review feedback

  • f36e286: feat(android): add saveMnemonic bridge method for EOA accounts

  • Saves mnemonic to secure storage using Wallet.store()

  • Creates EOA Account in AccountManager (no Firebase UID)

  • Initializes WalletManager with new account

  • Returns success/error response

  • ab02a54: feat: bump wallet kit

  • 991dea6: feat: onboarding ui entrypoint

  • 0e4cb3f: feat: onboarding ui entrypoint

  • f821df9: feat: onboarding ui

  • 8a7649d: feat: onboarding ui

  • 27b7188: pull from dev

  • e9f8b25: feat: extending bridge for existing onboarding flow

  • f8ccfdb: test: add entry point for testing onboarding flow

📁 Files being considered (30)

🔄 app/build.gradle (1 hunk)
🔄 app/src/main/AndroidManifest.xml (1 hunk)
🔄 app/src/main/java/com/flowfoundation/wallet/cache/AccountCacheManager.kt (1 hunk)
🔄 app/src/main/java/com/flowfoundation/wallet/firebase/auth/FirebaseAuth.kt (4 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/manager/account/AccountManager.kt (5 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/manager/emoji/model/WalletEmojiInfo.kt (1 hunk)
🔄 app/src/main/java/com/flowfoundation/wallet/manager/evm/EVMWalletManager.kt (2 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/manager/evm/Utils.kt (2 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/manager/flowjvm/CadenceExecutor.kt (4 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/manager/wallet/WalletManager.kt (1 hunk)
🔄 app/src/main/java/com/flowfoundation/wallet/network/UserRegisterUtils.kt (5 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/network/model/UserInfoResponse.kt (2 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/network/model/WalletListResponse.kt (4 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/page/backup/WalletBackupActivity.kt (1 hunk)
🔄 app/src/main/java/com/flowfoundation/wallet/page/dialog/accounts/AccountSwitchDialog.kt (2 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/page/main/MainActivity.kt (1 hunk)
🔄 app/src/main/java/com/flowfoundation/wallet/page/main/Utils.kt (5 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/page/main/presenter/MainContentPresenter.kt (2 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/page/profile/subpage/wallet/WalletListActivity.kt (2 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/page/restore/WalletRestoreActivity.kt (2 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/page/wallet/fragment/WalletUnregisteredFragment.kt (2 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/page/wallet/presenter/WalletHeaderPresenter.kt (1 hunk)
🔄 app/src/main/java/com/flowfoundation/wallet/page/walletcreate/fragments/username/WalletCreateUsernameViewModel.kt (2 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/reactnative/ReactNativeActivity.kt (6 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/BridgeModels.kt (3 hunks)
🔄 app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt (2 hunks)
➕ app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeScreen.kt (1 hunk)
➕ app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/handlers/AccountBridgeHandler.kt (1 hunk)
➕ app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/handlers/AuthBridgeHandler.kt (1 hunk)
➕ app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/handlers/UIBridgeHandler.kt (1 hunk)


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 (1)
  • f8ccfdb: test: add entry point for testing onboarding flow
Files Processed (3)
  • app/src/main/java/com/flowfoundation/wallet/page/wallet/presenter/WalletHeaderPresenter.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/ReactNativeActivity.kt (3 hunks)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/BridgeModels.kt (2 hunks)
Actionable Comments (3)
  • app/src/main/java/com/flowfoundation/wallet/page/wallet/presenter/WalletHeaderPresenter.kt [79-84]

    best practice: "Temporary test code should not be committed"

  • app/src/main/java/com/flowfoundation/wallet/reactnative/ReactNativeActivity.kt [169-173]

    possible bug: "Missing null check in screen type handling"

  • app/src/main/java/com/flowfoundation/wallet/reactnative/ReactNativeActivity.kt [206-210]

    possible bug: "Missing null check in screen type handling"

Skipped Comments (0)

Comment on lines 79 to 84
cvReceive.setOnClickListener {
// TEMPORARY: Launch onboarding flow for testing
// TODO: Remove this and restore original receive functionality
ReactNativeActivity.launch(view.context, RNBridge.ScreenType.ONBOARDING)
// Original code: ReceiveActivity.launch(view.context)
}
Copy link

Choose a reason for hiding this comment

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

The code contains a temporary modification of the receive button functionality for testing purposes. This should not be committed to the codebase as it overrides the actual receive functionality. Consider using feature flags or test configurations instead of modifying production code for testing.

Comment on lines 169 to 173
val screenString = when (it) {
RNBridge.ScreenType.SEND_ASSET -> "send-asset"
RNBridge.ScreenType.TOKEN_DETAIL -> "token-detail"
RNBridge.ScreenType.ONBOARDING -> "onboarding"
}
Copy link

Choose a reason for hiding this comment

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

The when expression doesn't handle the case where screenType might be null. Consider adding an else branch or making the when expression exhaustive by handling all possible cases to prevent potential runtime errors.

Comment on lines 206 to 210
val screenString = when (screenType) {
RNBridge.ScreenType.SEND_ASSET -> "send-asset"
RNBridge.ScreenType.TOKEN_DETAIL -> "token-detail"
RNBridge.ScreenType.ONBOARDING -> "onboarding"
}
Copy link

Choose a reason for hiding this comment

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

Similar to the previous issue, this when expression doesn't handle the case where screenType might be null. Add an else branch or make the expression exhaustive to prevent potential runtime errors.

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 (1)
  • e9f8b25: feat: extending bridge for existing onboarding flow
Files Processed (2)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/BridgeModels.kt (3 hunks)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt (1 hunk)
Actionable Comments (1)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [742-767]

    security: "Remove debug logging of sensitive information"

Skipped Comments (2)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [779-780]

    possible issue: "Potential username collision in account creation"

  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [868-874]

    enhancement: "Missing activity state handling"

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 (1)
Files Processed (1)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt (1 hunk)
Actionable Comments (1)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [775-775]

    possible bug: "Potential null pointer exception in string operation"

Skipped Comments (2)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [803-803]

    possible issue: "Username generation could cause collisions"

  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [900-900]

    maintainability: "Hard-coded Android version check"

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 (1)
Files Processed (2)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/BridgeModels.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt (2 hunks)
Actionable Comments (2)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [850-850]

    security: "Potential security issue with username generation"

  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [1019-1038]

    possible issue: "Missing default case handling in screen security level switch"

Skipped Comments (1)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [877-877]

    possible bug: "Potential null pointer exception in mnemonic handling"

ioScope {
try {
// Auto-generate username using timestamp
val username = "user_${System.currentTimeMillis()}"

Choose a reason for hiding this comment

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

The username generation using raw timestamp (user_${System.currentTimeMillis()}) could be predictable and potentially create collisions. Consider adding randomization and validation to ensure uniqueness and safety of generated usernames.

Comment on lines 1019 to 1038
when (level) {
"secure" -> {
// Prevent screenshots and screen recording
currentActivity.window.setFlags(
android.view.WindowManager.LayoutParams.FLAG_SECURE,
android.view.WindowManager.LayoutParams.FLAG_SECURE
)
android.util.Log.d(TAG, "setScreenSecurityLevel() - FLAG_SECURE enabled")
}
"normal" -> {
// Allow screenshots again
currentActivity.window.clearFlags(
android.view.WindowManager.LayoutParams.FLAG_SECURE
)
android.util.Log.d(TAG, "setScreenSecurityLevel() - FLAG_SECURE disabled")
}
else -> {
android.util.Log.w(TAG, "setScreenSecurityLevel() - unknown level: $level")
}
}

Choose a reason for hiding this comment

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

The when statement for handling screen security levels silently logs unknown levels without any error handling. Consider throwing an exception or setting a default security level to ensure the application maintains a known security state.

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 (1)
Files Processed (1)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt (3 hunks)
Actionable Comments (2)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [798-802]

    security: "Unimplemented critical security feature marked as TODO"

  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [867-872]

    security: "Error handling could expose sensitive data"

Skipped Comments (1)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [847-847]

    possible issue: "Potential username collision risk"

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 (1)
  • 0e4cb3f: feat: onboarding ui entrypoint
Files Processed (3)
  • app/src/main/java/com/flowfoundation/wallet/page/profile/subpage/wallet/WalletListActivity.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/wallet/fragment/WalletUnregisteredFragment.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/wallet/presenter/WalletHeaderPresenter.kt (1 hunk)
Actionable Comments (1)
  • app/src/main/java/com/flowfoundation/wallet/page/wallet/fragment/WalletUnregisteredFragment.kt [47-48]

    maintainability: "Inconsistent onboarding launch implementation"

Skipped Comments (1)
  • app/src/main/java/com/flowfoundation/wallet/page/profile/subpage/wallet/WalletListActivity.kt [174-178]

    best practice: "Intent flags should be set after all extras"

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 (1)
  • 991dea6: feat: onboarding ui entrypoint
Files Processed (1)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt (3 hunks)
Actionable Comments (3)
  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [772-772]

    security: "Missing validation for recovery phrase word count"

  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [847-847]

    security: "Weak username generation mechanism"

  • app/src/main/java/com/flowfoundation/wallet/reactnative/bridge/NativeFRWBridge.kt [1015-1036]

    security: "Improper handling of unknown screen security levels"

Skipped Comments (0)

Comment on lines 1015 to 1036
currentActivity.runOnUiThread {
when (level) {
"secure" -> {
// Prevent screenshots and screen recording
currentActivity.window.setFlags(
android.view.WindowManager.LayoutParams.FLAG_SECURE,
android.view.WindowManager.LayoutParams.FLAG_SECURE
)
android.util.Log.d(TAG, "setScreenSecurityLevel() - FLAG_SECURE enabled")
}
"normal" -> {
// Allow screenshots again
currentActivity.window.clearFlags(
android.view.WindowManager.LayoutParams.FLAG_SECURE
)
android.util.Log.d(TAG, "setScreenSecurityLevel() - FLAG_SECURE disabled")
}
else -> {
android.util.Log.w(TAG, "setScreenSecurityLevel() - unknown level: $level")
}
}
}

Choose a reason for hiding this comment

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

The screen security level handling should throw an exception for unknown levels rather than just logging a warning. This ensures the app maintains a known security state:

else -> {
    throw IllegalArgumentException("Unknown security level: $level")
}

- Saves mnemonic to secure storage using Wallet.store()
- Creates EOA Account in AccountManager (no Firebase UID)
- Initializes WalletManager with new account
- Returns success/error response
- Remove generateRecoveryPhrase() (using TypeScript implementation)
- Remove createEOAAccount() stub (replaced by saveMnemonic)
- Clean up unused code per code review feedback
- Resolved import conflicts in NativeFRWBridge.kt
- Updated build.gradle to read GitHub credentials from local.properties
@lealobanov lealobanov marked this pull request as ready for review November 10, 2025 02:09
@lealobanov lealobanov requested a review from a team as a code owner November 10, 2025 02:09
@lealobanov lealobanov changed the title test: add entry point for testing onboarding flow 373 - add entry point for testing onboarding flow Nov 10, 2025
}
}

override fun createCOAAccount(promise: Promise) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Try to split this bridge into multiple file, it's over 1400 lines+, not good

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@lmcmz I have moved these out into separate handlers to break up the bridge functionality across different files

lealobanov and others added 24 commits November 10, 2025 22:55
Secure Enclave/COA accounts should NOT have a mnemonic or seed phrase.
They use hardware-backed keys only, distinct from EOA accounts.

Changes:
- Removed BIP39 mnemonic generation from registerServer()
- Removed global mnemonic storage (storeWalletPassword)
- Added comments clarifying this is for Secure Type/COA accounts only
- EOA accounts with seed phrase use the RN flow with saveMnemonic()

This fixes the issue where Secure Enclave profile users were seeing
EOA addresses in their account.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Secure Enclave accounts created with hardware-backed keys should NOT
display an EOA chip in the sidebar. They only have:
- Flow Cadence address (main account)
- EVM/COA address (with purple EVM chip)

Changes:
- Removed getEOAAddressCached() check from setupLinkedAccountForHardwareBackedKey()
- Added comment explaining that COA accounts don't have EOA addresses
- EOA addresses are only for seed phrase-based accounts

Fixes issue where Secure Enclave profile showed incorrect EOA chip
in Android sidebar.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Recovery Phrase flow now creates a linked COA child account instead of
a separate main account.

Changes:
- Added createLinkedCOAAccount() bridge method
- Calls cadenceCreateCOAAccount() to create linked COA via Cadence transaction
- Returns transaction ID for tracking

This fixes the architecture where Recovery Phrase accounts should have:
1. Main Flow account (created via saveMnemonic)
2. EOA address (derived from mnemonic)
3. Linked COA child account (created via Cadence transaction)

Secure Enclave accounts remain as main COA accounts (no linked child).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[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.

[MOB] Onboarding UI Redesign for EOA Wallet Creation

3 participants