Remove Android permissions that plugins inject; bump serious_python to 4.5.1 - #6742
Merged
Merged
Conversation
…o 4.5.1
Setting an Android permission to `false` had no effect on permissions that
arrive from somewhere other than the app's own configuration. The template
only skipped emitting the <uses-permission> entry, so anything contributed by
Gradle's manifest merger -- which folds in the manifest of every Flutter
plugin, and also synthesises permissions on its own -- passed straight through
with no way to stop it.
Flet Studio hit this after removing every storage permission from its
pyproject.toml: READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE still shipped
to Google Play. The merger report explains why:
uses-permission#android.permission.WRITE_EXTERNAL_STORAGE
ADDED from [:camera_android_camerax] .../AndroidManifest.xml:11:5-13:38
uses-permission#android.permission.READ_EXTERNAL_STORAGE
IMPLIED from .../AndroidManifest.xml reason: io.flutter.plugins.camerax
requested WRITE_EXTERNAL_STORAGE
flet-camera pulls in camera_android_camerax, which declares
WRITE_EXTERNAL_STORAGE bounded to maxSdkVersion="28" -- correct on its part.
The merger then implies READ_EXTERNAL_STORAGE from it, because write access
implied read access before API 19. The implied entry carries no
maxSdkVersion, so a properly bounded permission quietly produces an unbounded
one, which is the shape Google Play's storage policy objects to.
Permissions set to `false` now render as
<uses-permission android:name="..." tools:node="remove" />
and the template's <manifest> gained the tools namespace. This strips them
during the merge rather than merely declining to add them. Removing a
permission nothing declares is a no-op, so `false` stays safe for names no
plugin contributes.
`false` never had another meaning to change: no permission is set to False by
flet's own defaults or by any cross-platform permission bundle (only
android_features uses False, via a separate loop), so it can only come from an
explicit user declaration, where removal is the evident intent. Both entry
points agree -- `--android-permissions X=false` parses through
parse_cli_bool_value to a real bool.
Verified against the real plugin set: Flet Studio's release APK goes from 11
permissions to 9, with both storage entries absent from `aapt2 dump
permissions` and from the merged manifest, and every other permission intact.
Also bumps serious_python 4.4.2 -> 4.5.1 in the build template and re-pins the
bundled python-build snapshot 20260727 -> 20260730 (dart_bridge 1.7.1).
serious_python 4.5.1 tracks the same python-build release, so
PYTHON_BUILD_RELEASE_DATE stays in sync with its pythonReleaseDate as the
comment on that constant requires.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setting an Android permission to
falsehad no effect on permissions that arrive from somewhere other than the app's own configuration. The template only skipped emitting the<uses-permission>entry, so anything contributed by Gradle's manifest merger — which folds in the manifest of every Flutter plugin, and also synthesises permissions on its own — passed straight through with no way to stop it.The bug in practice
Flet Studio removed every storage permission from its
pyproject.tomlin #6740, andREAD_EXTERNAL_STORAGE/WRITE_EXTERNAL_STORAGEstill shipped to Google Play. The merger report explains why:flet-camerapulls incamera_android_camerax, which declaresWRITE_EXTERNAL_STORAGEbounded tomaxSdkVersion="28"— correct on its part. The merger then impliesREAD_EXTERNAL_STORAGEfrom it, because write access implied read access before API 19.The implied entry carries no
maxSdkVersion. So a properly bounded permission quietly produces an unbounded one — precisely the shape Google Play's storage policy objects to, and neither name appears anywhere in the app's config.The fix
Permissions set to
falsenow render as:and the template's
<manifest>gained thetoolsnamespace. This strips them during the merge rather than merely declining to add them.Why changing
falseis safefalsenever had another meaning to change. No permission is set toFalseby flet's own defaults (android_permissionsdefaults to justINTERNET: True) or by any cross-platform permission bundle — onlyandroid_featuresusesFalse, through a separate template loop. Sofalsecan only come from an explicit user declaration, where removal is the evident intent.Removing a permission that nothing declares is a no-op, so
falsestays safe for names no plugin contributes. Both entry points agree:--android-permissions X=falseparses throughparse_cli_bool_valueto a real bool.Verification
Against the real plugin set, on Flet Studio's release APK:
Confirmed in
aapt2 dump permissionson the built APK and in the merged manifest; every other permission intact.Also in this PR
serious_python4.4.2 → 4.5.1 in the build template.dart_bridge1.7.1).serious_python 4.5.1 tracks the same python-build release (
pythonReleaseDate = "20260730"), soPYTHON_BUILD_RELEASE_DATEstays in sync as the comment on that constant requires. 4.5.1 is published on pub.dev.Docs
New section: Removing a permission a plugin adds, covering the camerax example, how to read
manifest-merger-release-report.txtto find where any permission came from, and a caution that removing one a plugin genuinely needs turns a build-time concern into a runtime failure.78 flet-cli tests pass.
Summary by Sourcery
Actively remove Android permissions disabled in configuration during manifest merge and align bundled Python tooling versions.
Bug Fixes:
Enhancements:
Build:
Documentation: