卸下清单安卓额外的不必要的权限 [英] Remove extra unwanted permissions from manifest android
问题描述
我的Android应用程序,我想检查清单中提到的每一个权限是必需的或不?
I have android app, I want to check that every permissions mentioned in Manifest is required or not?
基本上我想删除不需要的权限。
Basically I want remove unwanted permissions.
我该怎么办?
在此先感谢
推荐答案
由user370305给出的答案通常是正确的。第三方code应充分记录什么权限是需要 - 结合起来,与权限自己的code需求,而且你应该设置
The answer given by user370305 is generally the correct one. Your third-party code should adequately document what permissions it needs -- combine that with the permissions your own code needs, and you should be set.
如果你觉得这还不够的话:
If you feel that this is insufficient, then:
步骤#1:写单元测试套件
Step #1: Write a unit test suite.
第二步:添加测试套件,直到你有完整的语句覆盖
Step #2: Add tests to the suite until you have complete statement coverage.
第三步:获取通过在单元测试套件中的所有测试
Step #3: Get all tests passing in the unit test suite.
第四步:删除权限,看看测试失败。恢复导致测试套件失败的权限。重复所有你是不确定的权限。
Step #4: Remove a permission and see if tests fail. Restore the permissions that cause test suite failure. Repeat for all permissions you are uncertain of.
这篇关于卸下清单安卓额外的不必要的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!