-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
uses-permissions in AndroidManifest.xml are not exported to App #5411
Comments
It's mostly because changing the permissions of your app prevents auto-updating on the play store. If you have a code base where there are many apps that are independently owned by different teams, and you have many libraries that are similarly independently owned by other teams, and if you inherit permissions from your dependencies, then it means that other teams can change the permissions of your app without your permission or noticing. Another way to put it is that app owners should own the permissions their app asks for. If a new permission gets by and ends up in a release, then your app can't be auto-updated. One possible response is that this could instead be taken care of in a test where the test asserts the set of permissions that the app has. But this results in basically the same situation: a flat list somewhere of the permissions the app is allowed, just in a test rather than the top-level manifest. That said, it should be possible to add an attribute to |
I'm closing this as the rationale makes sense. |
Adding support for conditionally merging `uses-permissions`. bazelbuild#10628 bazelbuild#5411 Closes bazelbuild#13445. RELNOTES: Enable merging permissions during Android manifest merging with the --merge_android_manifest_permissions flag. PiperOrigin-RevId: 439613035
Adding support for conditionally merging `uses-permissions`. bazelbuild#10628 bazelbuild#5411 Closes bazelbuild#13445. RELNOTES: Enable merging permissions during Android manifest merging with the --merge_android_manifest_permissions flag. PiperOrigin-RevId: 439613035
Adding support for conditionally merging `uses-permissions`. bazelbuild#10628 bazelbuild#5411 Closes bazelbuild#13445. RELNOTES: Enable merging permissions during Android manifest merging with the --merge_android_manifest_permissions flag. PiperOrigin-RevId: 439613035
* Support uses-permission merging in manifest merger Adding support for conditionally merging `uses-permissions`. #10628 #5411 Closes #13445. RELNOTES: Enable merging permissions during Android manifest merging with the --merge_android_manifest_permissions flag. PiperOrigin-RevId: 439613035 * Make ManifestMergerAction worker compatible Calling `System#exit` kills the worker during the build. Passing the exception up to the worker should be enough for it to end up in the worker or local execution output. Closes #14427. PiperOrigin-RevId: 447808701 * Fix ManifestMergerAction test case on windows `manifest.toString().replaceFirst("^/", "")` silently fails on windows machines causing `removePermissions` to write to the original test file. This pull request creates a new temp file that `removePermissions` can write the modified manifest to. Pulling this change out of another PR so that it's easier to merge. Original PR here https://github.com/bazelbuild/bazel/pull/13445/files#r631575251 Closes #13760. PiperOrigin-RevId: 438643774 Co-authored-by: Ben Lee <[email protected]>
Description of the problem / feature request:
As per the documentation,
uses-permissions
attributes are never exported to the main app. What is the rationale behind this decision?Is there any way to have an
android_library
export its permissions to an app that includes it ?Thanks!
What operating system are you running Bazel on?
macOS
What's the output of
bazel info release
?Have you found anything relevant by searching the web?
They are manually removed here:
bazel/src/tools/android/java/com/google/devtools/build/android/ManifestMergerAction.java
Lines 157 to 185 in bb4ffd6
The text was updated successfully, but these errors were encountered: