将权限放入Android .aar库项目的清单 [英] Putting permissions to manifest of Android .aar library project

查看:364
本文介绍了将权限放入Android .aar库项目的清单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Android项目,其中包括两个模块,其中一个是用于生成.aar文件的库模块,另一个是利用所生成的.aar文件的示例应用程序.

I am developing an Android project which includes two modules where one is a library module for producing .aar files and another is a sample app utilising the produced .aar file.

因此,此项目中有两个AndroidManifest.xml文件.说我正在开发一个蓝牙库,所以我在库的清单文件中放入了蓝牙权限.通过将此库.aar作为依赖项包括在内,我可以在应用程序的清单文件中省略<uses-permission>标签吗?换句话说,Android应用程序是否会合并"(从字面上而是从语义上)其依赖的.aar库的权限?

Thus, there are two AndroidManifest.xml files in this project. Say I am developing a Bluetooth library, so I put permissions for bluetooth in library's manifest file. By including this library .aar as dependency, can I omit the <uses-permission> tag in the app's manifest file? In other words, does Android app "merge" (may be not literally but semantically) its dependent .aar libraries' permissions?

我的经验表明,尽管某些权限的行为如上所述,但其他权限要求在应用程序的AndroidManifest.xml中进行显式声明.我想知道我的假设是否正确,是否有任何资源或文档明确区分可以驻留在.aar库清单中的权限和需要在应用程序自己的清单文件中声明的权限.

My experience suggests that while some permissions tend to behave as above, others demand explicit declaration in application's AndroidManifest.xml. I would like to know if my assumption is true, if there are any resources or documentations clearly distinguishing permissions those can reside in .aar library's manifest and those required to be declared in application's own manifest file.

谢谢!

推荐答案

据我所知,库的清单已合并到主清单中.根据此文档的所有权限也应该合并.

As far as I know libraries' manifests are merged into the main manifest. According to this document all permissions should be merged as well.

这篇关于将权限放入Android .aar库项目的清单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆