Skip to content

Cover the UI with the boot splash when the app is backgrounded to prevent sensitive data exposure - #100590

Draft
OlGierd03 wants to merge 6 commits into
Expensify:mainfrom
software-mansion-labs:@OlGierd03/BootSplash-Covers-UI-When-App-Backgrounded-v2
Draft

OlGierd03 wants to merge 6 commits into
Expensify:mainfrom
software-mansion-labs:@OlGierd03/BootSplash-Covers-UI-When-App-Backgrounded-v2

Conversation

@OlGierd03

@OlGierd03 OlGierd03 commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Mobile-Expensify repo counterpart: https://github.com/Expensify/Mobile-Expensify/pull/14105

Remediation of an audit finding (screenshots of the app UI persisted on disk by the OS). This PR covers the UI with the boot splash whenever the app is backgrounded, so the app-switcher snapshot the OS stores on disk only ever contains the splash or green screen as a fallback.

iOS: a BootSplash storyboard overlay is added in sceneWillResignActive (after dismissing the keyboard, so it never appears in the snapshot) and removed in sceneDidBecomeActive.

Android: setRecentsScreenshotEnabled(false) on every activity (including third-party ones like Plaid) guarantees nothing is written to disk, and the TaskDescription background color keeps the fallback recents card consistent with the splash. On top of that, a BootSplashDialog covers our activity on window focus loss when leaving the app (tracked via onTopResumedActivityChanged, so in-app dialogs don't trigger it) and isn't shown when we start another activity ourselves (Plaid, camera, pickers) or in multi-window. Third-party activities (e.g. Plaid) don't get the dialog, because their focus loss can't be told apart from their own popups or translucent screens, so their recents card is the plain green one.

Important

On Android by design changes only apply to API levels of 33 or higher as discussed here

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/633485

Tests

  1. Open the app.
  2. Go to app switcher and verify the card is covered by bootspash or it's version without the logo (on Android). Same after going Home first.
  3. Return to the app and verify the content is restored and the app is interactive.
  4. With the keyboard open, background the app and verify the switcher card shows no content or keyboard.
  5. In the foreground, take a regular screenshot and verify it still captures the content.
  6. Android: open an in-app dialog and verify the splash doesn't cover the app.
  7. Android: start the Plaid bank connection flow (Workspace > More features > enable Workflows > navigate back > Workflows > Add bank account), background the app during the bank login screen and verify the app switcher card is the plain green one with no bank UI content. Going Home or switching to another app first and then opening recents shows the plain green card, while swiping straight from Plaid into recents shows the live Plaid screen on its card.

Note

When opening recents straight from a Plaid screen, its content stays visible while the screen animates into recents, but it's never written to disk, so the audit finding is still addressed. We can't do better because Android offers no reliable "leaving the app" signal for third-party activities: their focus loss looks the same as their own popups or translucent screens, so a cover would also flash over the country-code list and Plaid's next screens. Additionally, verify the splash isn't displayed when entering the flow, moving between Plaid screens or opening the country-code list.

Offline tests

N/A

QA Steps

Same as tests

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Screen.Recording.2026-10-16.at.12.16.28.mov
iOS: Native
Screen.Recording.2026-10-16.at.12.10.50.mov

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. ⚠️

@daledah

daledah commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

@OlGierd03 please assign me when the PR is ready to review

@daledah daledah self-assigned this Oct 8, 2026
@daledah
daledah self-requested a review October 8, 2026 09:34
@OlGierd03
OlGierd03 force-pushed the @OlGierd03/BootSplash-Covers-UI-When-App-Backgrounded-v2 branch from ebcc04a to ce784a3 Compare October 12, 2026 11:15
@OlGierd03

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T10:57:44.198916Z e9e4cf4 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: e9e4cf4777

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

// Covers the UI with the boot splash while the app is leaving the foreground
public final class PrivacyCover {

private static final Map<Activity, BootSplashDialog> covers = new HashMap<>();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why do we need multiple covers?

Comment on lines +135 to +136
@Deprecated("Deprecated in Java")
override fun startActivityForResult(intent: Intent, requestCode: Int, options: Bundle?) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it safe to use the deprecated method?

This branch has not been deployed

No deployments
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