Repository navigation
Commit 4759fcb
[Android] Refuse external setters of engine entrypoint and cached engine arguments via
> [!WARNING]
> This is a breaking change. Though the motivation for this change is
the security of our users and migration to accommodate this change is
critical, I looked at some top plugins that _might_ have been impacted
to ensure they won't be broken: All 1P plugins,
[`firebase_messaging`](https://pub.dev/packages/firebase_messaging)
v16.5.0,
[`flutter_local_notifications`](https://pub.dev/packages/flutter_local_notifications)
v22.3.0,
[`awesome_notifications`](https://pub.dev/packages/awesome_notifications)
v0.12.1,
[`android_alarm_manager_plus`](https://pub.dev/packages/android_alarm_manager_plus)
v5.1.1,
[`receive_sharing_intent`](https://pub.dev/packages/receive_sharing_intent)
v1.9.0,
[`onesignal_flutter`](https://pub.dev/packages/onesignal_flutter),
[`workmanager`](https://pub.dev/packages/workmanager) v0.10.7
[`flutter_background_service`](https://pub.dev/packages/flutter_background_service)
v5.1.0, [`app_links`](https://pub.dev/packages/app_links) v7.2.1,
[`uni_links`](https://pub.dev/packages/uni_links) v0.5.1
Changes the embedding to only allow setting app launch entry-point and
cached engine related arguments via `Intent`s in debug/profile mode or
when the `Intent` sender is verifiably the app itself. This hardens the
embedding against arbitrary argument injection by a malicious actor,
preventing unauthorized access to sensitive app routes and engine
controls. Below Android 13, it is impossible to verify the `Intent`
sender is verifiably the app itself in all cases, so apps/plugins that
do not migrate and run on those versions will be impacted.
In debug/profile modes, if an unverified `Intent` attempts to set these
arguments, the embedding now logs a detailed warning containing the
target component, the intent details, and the specific `Intent` extra
keys that triggered the verification failure. It also links to the
breaking changes migration guide for help on migrating:
flutter/website#13645
For deep links, the `Intent` is compared against the app's `Intent`
filters to ensure the app should allow that link. This is standard for
the OS; see [Android's Intents and Intent Filters
documentation](https://developer.android.com/guide/components/intents-filters)
for more information on that.
Fixes flutter#190452 and fixes
flutter#190450.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
If this change needs to override an active code freeze, provide a
comment explaining why. The code freeze workflow can be overridden by
code reviewers. See pinned issues for any active code freezes with
guidance.
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>Intents (flutter#190249)1 parent c11ae55 commit 4759fcb
17 files changed
Lines changed: 1875 additions & 86 deletions
File tree
- dev/devicelab
- bin/tasks
- lib/tasks
- engine/src/flutter
- shell/platform/android
- io/flutter/embedding
- android
- engine
- test/io/flutter/embedding/android
- tools/android_lint/bin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3169 | 3169 | | |
3170 | 3170 | | |
3171 | 3171 | | |
| 3172 | + | |
| 3173 | + | |
| 3174 | + | |
| 3175 | + | |
| 3176 | + | |
| 3177 | + | |
| 3178 | + | |
| 3179 | + | |
| 3180 | + | |
3172 | 3181 | | |
3173 | 3182 | | |
3174 | 3183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
119 | | - | |
120 | | - | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments