从清单 android 中删除多余的不需要的权限 [英] Remove extra unwanted permissions from manifest android

查看:22
本文介绍了从清单 android 中删除多余的不需要的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 Android 应用,我想检查 Manifest 中提到的每个权限是否都需要?

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 给出的答案通常是正确的.您的第三方代码应该充分记录它需要哪些权限——将其与您自己的代码需要的权限结合起来,您应该进行设置.

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.

第 2 步:向套件添加测试,直到您拥有完整的语句覆盖率.

Step #2: Add tests to the suite until you have complete statement coverage.

第 3 步:让所有测试通过单元测试套件.

Step #3: Get all tests passing in the unit test suite.

第 4 步:删除权限并查看测试是否失败.恢复导致测试套件失败的权限.对您不确定的所有权限重复此操作.

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.

这篇关于从清单 android 中删除多余的不需要的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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