在调用Runtime.getRuntime()Android权限。EXEC() [英] Android Permissions on Runtime.getRuntime().exec()

查看:2448
本文介绍了在调用Runtime.getRuntime()Android权限。EXEC()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序与清单以下权限。我的应用程序在Android 4.1.2 JB运行。

I have an App with the following permission on the manifest. My App is running on Android JB 4.1.2.

更新:我想JB上运行应用程序,但它不工作。它适用于早期版本的API。

UPDATE: I'm trying to run the App on JB, but it not works. It works on earlier API versions.

<manifest xmlns...>
   <uses-permission android:name="android.permission.SET_DEBUG_APP"/>

问题是,当我执行这样的命令:

The problem is when I execute a command like this:

Process proc = Runtime.getRuntime().exec("service call activity 42 s16 com.android.systemui");
    BufferedReader bufferedReader = new BufferedReader(
    new InputStreamReader(proc.getInputStream()));

    String line;
    while ((line = bufferedReader.readLine()) != null) {
        Log.e("IDSPlayer", "RESULTAT BARRA:" + line);
    }

的结果如下:

12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:Result: Parcel(
12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:  0x00000000: ffffffff 00000064 00650050 006d0072 '....d...P.e.r.m.'
12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:  0x00000010: 00730069 00690073 006e006f 00440020 'i.s.s.i.o.n. .D.'
12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:  0x00000020: 006e0065 00610069 003a006c 00730020 'e.n.i.a.l.:. .s.'
12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:  0x00000030: 00740065 00650044 00750062 00410067 'e.t.D.e.b.u.g.A.'
12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:  0x00000040: 00700070 00290028 00660020 006f0072 'p.p.(.). .f.r.o.'
12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:  0x00000050: 0020006d 00690070 003d0064 00330032 'm. .p.i.d.=.2.3.'
12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:  0x00000060: 00370038 002c0033 00750020 00640069 '8.7.3.,. .u.i.d.'
12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:  0x00000070: 0031003d 00300030 00320037 00720020 '=.1.0.0.7.2. .r.'
12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:  0x00000080: 00710065 00690075 00650072 00200073 'e.q.u.i.r.e.s. .'
12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:  0x00000090: 006e0061 00720064 0069006f 002e0064 'a.n.d.r.o.i.d...'
12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:  0x000000a0: 00650070 006d0072 00730069 00690073 'p.e.r.m.i.s.s.i.'
12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:  0x000000b0: 006e006f 0053002e 00540045 0044005f 'o.n...S.E.T._.D.'
12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:  0x000000c0: 00420045 00470055 0041005f 00500050 'E.B.U.G._.A.P.P.'
12-20 11:17:50.110: E/IDSPlayer(23840): RESULTAT BARRA:  0x000000d0: 00000000                            '....            ')

这工作完全在ICS设备,它需要有SET_DEBUG_APP权限才能运行preperly。在我的新设备不能正常工作,即使是许可的清单。

This worked perfectly on ICS devices and it needs to have SET_DEBUG_APP permission in order to run preperly. In my new device is not working even if the permission is on the manifest.

在另一方面,命令完美的作品在这个新的设备,如果我通过亚行执行。

In the other hand, the command works perfectly in this new device if I execute through ADB.

我该如何解决权限问题?可能是设备的一个bug?

How can I solve the permission issue? Could be a bug of the device?

推荐答案

至少, SET_DEBUG_APP 无法通过或者与固件的签署应用程序举行,除了签名密钥或安装在系统分区。普通SDK应用程序不能持有此权限。

At least in Jelly Bean, SET_DEBUG_APP cannot be held except by apps that are either signed with the firmware's signing key or are installed on the system partition. Ordinary SDK applications cannot hold this permission.

这篇关于在调用Runtime.getRuntime()Android权限。EXEC()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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