Skip to content

Conversation

@brandonpage
Copy link
Contributor

@brandonpage brandonpage commented Jan 16, 2026

This PR adds the new AuthFlowTester App, which is almost identical to its iOS counterpart except for a few details:

  • Fields missing on Android:
    • Client Configuration
      • Redirect Uri - not stored on Android (unused on iOS)
      • Protocol - included in Domain on Android
      • Identifier
    • Tokens
      • JWT - unused on iOS
      • Auth Code - unused on iOS
      • Challenge - unused on iOS
      • Issued At
    • URLs
      • API Url- iOS uses this as the SFAP URL.
  • Data row (label + value) is arranged horizontally instead of the typical vertical list.
  • Added long press data row to copy value.
  • TopAppBar and BottomAppBar hide on scroll.
  • "Material You" Dynamic color scheme (trivial to add).

Fallback (MSDK) color scheme for API < 31

Screenshot_20260115_160108 Screenshot_20260115_160122 Screenshot_20260115_160200

Dynamic OS Provided Color Scheme Examples

Screenshot_20260115-154115 Screenshot_20260115_161228 Screenshot_20260115_161154

Screenshot_20260115_161728

This PR is almost entirely sample app code and includes a new UI test that utilizes code from our UITests repo. Additional test be added in a subsequent PR.

I have also held back on including the "Migrate to New App" feature as that feature requires new SDK code. I have that code fully functional but will hold it for a follow-up to make this PR easier to consume.

@github-actions
Copy link

1 Warning
⚠️ Big PR, try to keep changes smaller if you can.

Generated by 🚫 Danger

/**
* String extension to convert to [ScopeParser].
*/
fun String?.toScopeParser(): ScopeParser = ScopeParser(scopeString = this)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

One of only a few SDK changes. This (and Array<String>?.toScopeParameter() below) seemed like they maybe convenient for customers so I created them as public API but I could move them to the sample app if we want.

Comment on lines +335 to +340
showDevSupport?.let {
MenuItem(stringResource(sf__dev_support_title_menu_item)) {
it.invoke()
showMenu = false
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The equivalent of this iOS PR.

@github-actions
Copy link

Job Summary for Gradle

Pull Request :: test-android
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
SalesforceMobileSDK-Android libs:SalesforceSDK:convertCodeCoverage 8.14.3 Build Scan not published
SalesforceMobileSDK-Android libs:SalesforceSDK:lint 8.14.3 Build Scan not published
SalesforceMobileSDK-Android libs:SalesforceSDK:assembleAndroidTest 8.14.3 Build Scan not published

Comment on lines +169 to +170
// UserAccount's equals() function only compares userId and orgId.
policy = neverEqualPolicy(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It took me longer than I care to admit to figure out this is why the UI wasn't updating when the user's token was updated. 😅

Comment on lines +175 to +189
// Set current user when it changes to update UI.
DisposableEffect(Unit) {
val receiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
currentUser.value = UserAccountManager.getInstance().currentUser
}
}
val filter = IntentFilter(UserAccountManager.USER_SWITCH_INTENT_ACTION)
filter.addAction(ClientManager.ACCESS_TOKEN_REFRESH_INTENT)
filter.addAction(ClientManager.INSTANCE_URL_UPDATE_INTENT)
ContextCompat.registerReceiver(context, receiver, filter, ContextCompat.RECEIVER_NOT_EXPORTED)
onDispose {
context.unregisterReceiver(receiver)
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I liked this a bit more than the UUID refreshTrigger on iOS.

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 35.00000% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.32%. Comparing base (482f724) to head (8630461).
⚠️ Report is 11 commits behind head on dev.

Files with missing lines Patch % Lines
...m/salesforce/androidsdk/ui/components/LoginView.kt 27.77% 11 Missing and 2 partials ⚠️

❌ Your patch check has failed because the patch coverage (35.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #2821      +/-   ##
============================================
+ Coverage     62.10%   62.32%   +0.22%     
  Complexity     2789     2789              
============================================
  Files           215      215              
  Lines         16993    16950      -43     
  Branches       2474     2423      -51     
============================================
+ Hits          10553    10564      +11     
+ Misses         5263     5208      -55     
- Partials       1177     1178       +1     
Components Coverage Δ
Analytics 47.92% <ø> (ø)
SalesforceSDK 54.54% <35.00%> (+0.38%) ⬆️
Hybrid 59.05% <ø> (ø)
SmartStore 78.20% <ø> (ø)
MobileSync 81.71% <ø> (ø)
React 52.36% <ø> (ø)
Files with missing lines Coverage Δ
.../src/com/salesforce/androidsdk/auth/ScopeParser.kt 81.48% <100.00%> (+1.48%) ⬆️
...ce/androidsdk/ui/components/LoginServerListItem.kt 61.48% <ø> (+2.39%) ⬆️
...orce/androidsdk/ui/components/PickerBottomSheet.kt 59.21% <ø> (+3.09%) ⬆️
...ce/androidsdk/ui/components/UserAccountListItem.kt 54.28% <ø> (+2.93%) ⬆️
...m/salesforce/androidsdk/ui/components/LoginView.kt 43.56% <27.77%> (+4.64%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@brandonpage
Copy link
Contributor Author

The missing code coverage seems to be entirely UI code I can't reasonably get to 😞.

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.

1 participant