android runtime.exec 权限,Android Permissions on Runtime.getRuntime().exec()

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

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

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);

}

The result is as follows:

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 '.... ')

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.

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值