Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing pending intents mutability for Android 12+ #1139

Merged
merged 7 commits into from
Nov 16, 2021
Merged

fix: missing pending intents mutability for Android 12+ #1139

merged 7 commits into from
Nov 16, 2021

Conversation

azlekov
Copy link
Contributor

@azlekov azlekov commented Nov 3, 2021

New Pull Request Checklist

Issue Description

Pending intents mutability

If your app targets Android 12, you must specify the mutability of each PendingIntent object that your app creates. This additional requirement improves your app's security.

https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability

Related issue: #1137
Closes #1137

Approach

Freeze version of the compile and target to the newest version 31 and on Android 12 versions set PendingIntent immutability flags when receiving Parse notifications.

TODOs before merging

  • Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)
  • A changelog entry is created automatically using the pull request title (do not manually add a changelog entry)

@parse-github-assistant
Copy link

parse-github-assistant bot commented Nov 3, 2021

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@codecov
Copy link

codecov bot commented Nov 3, 2021

Codecov Report

Merging #1139 (c1a9958) into master (ac6d9e0) will increase coverage by 0.80%.
The diff coverage is 40.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1139      +/-   ##
============================================
+ Coverage     65.30%   66.11%   +0.80%     
- Complexity     2218     2241      +23     
============================================
  Files           122      122              
  Lines          9961     9965       +4     
  Branches       1338     1339       +1     
============================================
+ Hits           6505     6588      +83     
+ Misses         2943     2860      -83     
- Partials        513      517       +4     
Impacted Files Coverage Δ
...rse/src/main/java/com/parse/ParseCommandCache.java 8.12% <0.00%> (+5.93%) ⬆️
...ain/java/com/parse/ParsePushBroadcastReceiver.java 43.41% <66.66%> (+43.41%) ⬆️
...arse/src/main/java/com/parse/ParseCorePlugins.java 67.39% <0.00%> (+0.54%) ⬆️
...se/src/main/java/com/parse/ParseKeyValueCache.java 46.93% <0.00%> (+2.04%) ⬆️
parse/src/main/java/com/parse/Parse.java 59.90% <0.00%> (+2.41%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d9691e...c1a9958. Read the comment docs.

@azlekov
Copy link
Contributor Author

azlekov commented Nov 9, 2021

@mtrezza I cannot understand the failing CI/CD task. This PR should be done.

@mtrezza
Copy link
Member

mtrezza commented Nov 9, 2021

The CI fails because this PR decreases code coverage. We require PRs to at least cover their own added code.

@azlekov
Copy link
Contributor Author

azlekov commented Nov 16, 2021

@mtrezza I have add some tests for building the notifications but and I patched the ParseCommandCache as there ware some null pointer exceptions when there's no internet permissions on the tests. Please ignore if possible codecov/patch

@azlekov azlekov requested a review from mtrezza November 16, 2021 08:44
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Looks good!

@mtrezza mtrezza merged commit fbe8d87 into parse-community:master Nov 16, 2021
parseplatformorg pushed a commit that referenced this pull request Nov 16, 2021
## [2.0.6](2.0.5...2.0.6) (2021-11-16)

### Bug Fixes

* missing pending intents mutability for Android 12+ ([#1139](#1139)) ([fbe8d87](fbe8d87))
@parseplatformorg
Copy link

🎉 This change has been released in version 2.0.6

@parseplatformorg parseplatformorg added the state:released Released as stable version label Nov 16, 2021
@azlekov azlekov deleted the flag-immutable-android-12 branch November 16, 2021 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android12 raises a Exception with onPushReceive
3 participants