Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Update pending intent flags #6247

Conversation

ionutbedregeanu
Copy link
Contributor

@ionutbedregeanu ionutbedregeanu commented Jan 18, 2022

For #6244
Since Android 12 we need to set PendingIntent mutability explicitly
This additional requirement improves your app's security.
All pending intents are updated to contain also the flag FLAG_IMMUTABLE when the version of
Android SDK is bigger than 30
FLAG_IMMUTABLE -> Flag indicating that the created PendingIntent should be immutable.

Pixel3a Api 29

api29.mp4

Pixel3a Api 31

api31.mp4

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to build-focus-debug or build-klar-debug for changes targeting Klar,
  3. click View task in Taskcluster,
  4. click the Artifacts row,
  5. click to download any of the apks listed here which use an appropriate name for each CPU architecture.

@ionutbedregeanu
Copy link
Contributor Author

ionutbedregeanu commented Jan 18, 2022

Marked as draft because the app is still crashing

Screenshot 2022-01-18 at 14 32 26

@jonalmeida
Copy link
Contributor

jonalmeida commented Jan 19, 2022

Tried out this patch with mozilla-mobile/android-components#11578 and it runs fine (tested with telemetry enabled too).

EDIT: Added the patch to upgrade to the latest AC nightly and remove the resolutionStrategy work-around.

@ionutbedregeanu ionutbedregeanu added the 🕵️‍♀️ needs review PRs that need to be reviewed label Jan 20, 2022
Copy link
Contributor

@Mugurell Mugurell left a comment

Choose a reason for hiding this comment

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

Thanks @ionutbedregeanu and @jonalmeida for all the testing and work here!

Awesome to also see tests though it seems like we need to standardize an approach for running tests under different SDK_INT and probably should be part of a separate ticket.

Ionut Cristian Bedregeanu and others added 3 commits January 20, 2022 09:27
Since Android 12 we need to set PendingIntent mutability explicitly, but Android 6 can be the
minimum version
This additional requirement improves your app's security.
All pending intents are updated to contain also the flag FLAG_IMMUTABLE when the version of
Android SDK is bigger than 30
FLAG_IMMUTABLE -> Flag indicating that the created PendingIntent should be immutable.
…sion

At this moment WorkManager 2.4.0 doesn't have support for Android 12 so we are
constrained to force import a newer version(2.7.0)
This is a temporary solution until the version of WorkManager will be updated from AC
@ionutbedregeanu ionutbedregeanu force-pushed the ionut.bedregeanu/6244_startup_crash branch from 08c2575 to be219be Compare January 20, 2022 07:30
@ionutbedregeanu ionutbedregeanu added 🛬 needs landing PRs that are ready to land and removed 🕵️‍♀️ needs review PRs that need to be reviewed labels Jan 20, 2022
@mergify mergify bot merged commit 6b278be into mozilla-mobile:main Jan 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🛬 needs landing PRs that are ready to land
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants