更新时间:2022-10-23 17:34:59
|系统|发展签署(或为什么Android操作系统仍然拒绝我进入转储服务?
signatureOrSystem
使用的ProtectionLevel =:安卓由于权限被标记为旧的语法)在Android 2.3+,因此不能用普通的Android 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.