Java – how to use graduates to delete specific permissions when building Android applications?

Recently, Google automatically merged licenses from Google services to the final version of APK

My problem is that some permissions are not needed, and I don't want some sensitive permissions in my application So how to delete permissions like Android permission. ACCESS_ COARSE_ LOCATION? With the gradle build, I don't want to disable manifest merge I read some permissions that can configure merge to delete external libraries, but I can't find how to do this

Solution

Add attribute tool: remove the value to the node of the manifest:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" tools:node="remove"/>

see http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger#TOC -tools:node-markers

Don't forget to add the tool namespace to the root element of the manifest

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>