forcedotcom / SalesforceMobileSDK-Android

Android SDK for Salesforce
Other
341 stars 388 forks source link

Android 15 Support - Part 1 #2617

Closed brandonpage closed 1 month ago

brandonpage commented 1 month ago

This PR covers supporting Android 15 devices prior to apps updating to API 35. I will follow up with a Part 2 that fixes issues and makes necessary improvements for apps targeting API 35.

Changes:

All aspects of the SDK seem to work fine in Private Spaces and I have found no indication we have Android for Work logic that needs to be updated take this into account. The only thing left to test here is IDP within a Private Space, which I am setting up now. Edit: Working!

I tested Support for 16 KB page size with somewhat confusing results on an emulator. My concern was SQLCipher, but it was updated to support 16 KB page size in the version we are currently using (4.6.1). Login an sync worked fine but it crashed with an error that didn't make much sense not long after. I will test again on a physical Pixel 8 Pro after I upgrade it to Android 15. However, this is still an experimental feature and I don't think we necessarily need to support it now.

mobilesdk-bot commented 1 month ago
3 Warnings
:warning: libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginActivity.kt#L192 - Using setJavaScriptEnabled can introduce XSS vulnerabilities into your application, review carefully
:warning: libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/OAuthWebviewHelper.kt#L209 - Using setJavaScriptEnabled can introduce XSS vulnerabilities into your application, review carefully
:warning: libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/ServerPickerActivity.java#L238 - The indentation string here is different from on the previous line (" " vs \t)

Tests results for SalesforceSDK

Generated by :no_entry_sign: Danger

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 14.28571% with 6 lines in your changes missing coverage. Please review.

Please upload report for BASE (dev@f8f6289). Learn more about missing BASE report. Report is 2275 commits behind head on dev.

Files with missing lines Patch % Lines
...com/salesforce/androidsdk/ui/OAuthWebviewHelper.kt 0.00% 3 Missing :warning:
.../src/com/salesforce/androidsdk/ui/LoginActivity.kt 33.33% 1 Missing and 1 partial :warning:
...salesforce/androidsdk/ui/ServerPickerActivity.java 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #2617 +/- ## ====================================== Coverage ? 57.28% Complexity ? 2421 ====================================== Files ? 187 Lines ? 15159 Branches ? 2131 ====================================== Hits ? 8684 Misses ? 5572 Partials ? 903 ``` | [Flag](https://app.codecov.io/gh/forcedotcom/SalesforceMobileSDK-Android/pull/2617/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=forcedotcom) | Coverage Δ | | |---|---|---| | [MobileSync](https://app.codecov.io/gh/forcedotcom/SalesforceMobileSDK-Android/pull/2617/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=forcedotcom) | `81.68% <ø> (?)` | | | [SalesforceHybrid](https://app.codecov.io/gh/forcedotcom/SalesforceMobileSDK-Android/pull/2617/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=forcedotcom) | `55.56% <ø> (?)` | | | [SalesforceReact](https://app.codecov.io/gh/forcedotcom/SalesforceMobileSDK-Android/pull/2617/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=forcedotcom) | `52.36% <ø> (?)` | | | [SalesforceSDK](https://app.codecov.io/gh/forcedotcom/SalesforceMobileSDK-Android/pull/2617/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=forcedotcom) | `42.52% <14.28%> (?)` | | | [SmartStore](https://app.codecov.io/gh/forcedotcom/SalesforceMobileSDK-Android/pull/2617/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=forcedotcom) | `78.30% <ø> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=forcedotcom#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/forcedotcom/SalesforceMobileSDK-Android/pull/2617?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=forcedotcom) | Coverage Δ | | |---|---|---| | [...salesforce/androidsdk/ui/ServerPickerActivity.java](https://app.codecov.io/gh/forcedotcom/SalesforceMobileSDK-Android/pull/2617?src=pr&el=tree&filepath=libs%2FSalesforceSDK%2Fsrc%2Fcom%2Fsalesforce%2Fandroidsdk%2Fui%2FServerPickerActivity.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=forcedotcom#diff-bGlicy9TYWxlc2ZvcmNlU0RLL3NyYy9jb20vc2FsZXNmb3JjZS9hbmRyb2lkc2RrL3VpL1NlcnZlclBpY2tlckFjdGl2aXR5LmphdmE=) | `0.00% <0.00%> (ø)` | | | [.../src/com/salesforce/androidsdk/ui/LoginActivity.kt](https://app.codecov.io/gh/forcedotcom/SalesforceMobileSDK-Android/pull/2617?src=pr&el=tree&filepath=libs%2FSalesforceSDK%2Fsrc%2Fcom%2Fsalesforce%2Fandroidsdk%2Fui%2FLoginActivity.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=forcedotcom#diff-bGlicy9TYWxlc2ZvcmNlU0RLL3NyYy9jb20vc2FsZXNmb3JjZS9hbmRyb2lkc2RrL3VpL0xvZ2luQWN0aXZpdHkua3Q=) | `27.35% <33.33%> (ø)` | | | [...com/salesforce/androidsdk/ui/OAuthWebviewHelper.kt](https://app.codecov.io/gh/forcedotcom/SalesforceMobileSDK-Android/pull/2617?src=pr&el=tree&filepath=libs%2FSalesforceSDK%2Fsrc%2Fcom%2Fsalesforce%2Fandroidsdk%2Fui%2FOAuthWebviewHelper.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=forcedotcom#diff-bGlicy9TYWxlc2ZvcmNlU0RLL3NyYy9jb20vc2FsZXNmb3JjZS9hbmRyb2lkc2RrL3VpL09BdXRoV2Vidmlld0hlbHBlci5rdA==) | `10.36% <0.00%> (ø)` | |
brandonpage commented 1 month ago

IDP flows work on Android 15 and even (when both apps are within a) Private Space. I did notice an error when doing the flows inside a Private Space:

 E  Failed to retrieve application info (Ask Gemini)
    android.content.pm.PackageManager$NameNotFoundException: Package com.salesforce.samples.restexplorer not found for user 10
        at android.content.pm.LauncherApps.getApplicationInfo(LauncherApps.java:1315)
        at com.google.android.gms.internal.wear_companion.zzfzj.zzc(com.google.android.libraries.wear.companion:wear-companion-android@@2.29.0:13)
        at com.google.android.gms.internal.wear_companion.zzevw.zza(com.google.android.libraries.wear.companion:wear-companion-android@@2.29.0:255)
        at com.google.android.gms.internal.wear_companion.zzepo.zzz(com.google.android.libraries.wear.companion:wear-companion-android@@2.29.0:61)
        at com.google.android.gms.internal.wear_companion.zzepo.zzB(com.google.android.libraries.wear.companion:wear-companion-android@@2.29.0:74)
        at com.google.android.gms.internal.wear_companion.zzepo.zzg(com.google.android.libraries.wear.companion:wear-companion-android@@2.29.0:27)
        at com.google.android.gms.internal.wear_companion.zzeox.run(com.google.android.libraries.wear.companion:wear-companion-android@@2.29.0:9)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
        at java.lang.Thread.run(Thread.java:1012)

Maybe this is because the Pixel Watch App is installed in (and can't be removed from ?!?) the Private Space? Figured it was worth mentioning.