安卓dumpsys权限拒绝 [英] android dumpsys permission denial

查看:2341
本文介绍了安卓dumpsys权限拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的地方创建一个进程,并调用 dumpsys telephony.registry 命令来获得移动网络状态信息的应用程序。

 的String [] CMDS = {dumpsys telephony.registry};
。进程p =调用Runtime.getRuntime()EXEC(CMDS [0] +\ N);
 

和在那之后我解析命令的结果。对于LS或其他命令,它工作正常。对于dupmsys我得到权限拒绝:不能从PID-953自卸telephony.registry,UID = 10090 。我得到了同样的错误结果 dumpsys功率或其它dumpsys命令。

我在Android清单设置DUMP权限 android.permission.DUMP 象建议的这里

我想,我这样做是正确的,因为Android提供了此功能这里

我也做了一步描述这里强制日食让我给在清单中我的应用程序DUMP许可。

当我执行dumpsys命令我总是得到相同的结果。

权限拒绝:不能从转储telephony.registry PID-953,UID = 10090

我是不是做错了什么?为什么Android操作系统仍然拒绝我进入转储服务?

PS我已经设置分API 8,我在测试设备​​上运行的应用程序(ICS) API 15

解决方案
  

为什么Android操作系统仍然拒绝我进入转储服务?

|系统|发展签署(或 signatureOrSystem 使用的ProtectionLevel =:

安卓由于权限被标记为旧的语法)在Android 2.3+,因此不能用普通的Andr​​oid SDK应用程序举行。

I have an application where I create a process and call the dumpsys telephony.registry command to get information about the mobile network status.

String[] cmds={"dumpsys telephony.registry"};
Process p = Runtime.getRuntime().exec(cmds [0]+"\n");

and then after that I parse the result of the command. For "ls" or other commands it works fine. For dupmsys I get Permission Denial: can't dump telephony.registry from pid-953, uid=10090. I get the same error results for dumpsys power or other dumpsys commands.

I have set DUMP permissions android.permission.DUMP in the android Manifest like suggested here

I think that I am doing this right since Android offers this feature here

I have also done the step described here to force eclipse to allow me to give my application DUMP permission in the manifest.

When I execute the dumpsys command I always get the same result

Permission Denial: can't dump telephony.registry from pid-953, uid=10090

Am I doing something wrong? Why does android OS still deny me access to the dump service ?

PS I have set min API 8 and I am testing the application on device running (ICS) API 15

解决方案

Why does android OS still deny me access to the dump service ?

Because that permission is flagged as android:protectionLevel="signature|system|development" (or signatureOrSystem using the old syntax) on Android 2.3+, and therefore cannot be held by ordinary Android SDK applications.

这篇关于安卓dumpsys权限拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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