阅读ActivityManager原木一个果冻豆的设备上? [英] Reading ActivityManager-logs on a Jelly Bean device?

查看:152
本文介绍了阅读ActivityManager原木一个果冻豆的设备上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

果冻豆已经删除(按照借此读取其他应用程序的日志的能力 I / O谈话),这是一个合理的安全改进。不过,我需要阅读 ActivityManager -logs我的应用程序的工作(见哪些应用程序正在启动)。要做到这一点,我是用

Jelly Bean has removed the ability to read the logs of other apps (according to this I/O talk), which is a sensible security improvement. However, I need to read ActivityManager-logs for my app to work (to see which app is currently starting). To do this, I was using

private static final String clearLogcat = "logcat -c";
private static final String logcatCommand = "logcat ActivityManager:I *:S";
//...

这不再起作用,因为我只能读果冻豆我自己的应用程序的日志。是否有其他的解决方案,以找出当另一个应用程序是(除了根)开始?我明白了为什么我们不应该能够读取其他应用程序的日志(一种 - 它应该是其他开发人员的责任心由是从阅读日志pvented $ P $,以确保没有任何个人信息被记录,不是我的) ,但我不明白为什么 ActivityManager ,一个框架类,包含在政策...

which no longer works, as I can only read my own application's logs in Jelly Bean. Is there an alternative solution to finding out when another app is starting (apart from root)? I understand why we shouldn't be able to read other applications' logs (kind of - it should be the other developers' resposibility to make sure that no personal information is logged, not mine by being prevented from reading the log), but I don't understand why the ActivityManager, a framework class, is included in that policy...

谢谢,
尼克

推荐答案

还有就是这个问题正在进行的此处。不幸的是,它的预期的行为,因此将不会被固定。当前唯一的解决方案(从上JB及以上的应用程序中读取日志)是亚行手动授予权限到应用程序:

There is an extensive discussion of this issue going on here. Unfortunately, it's "expected behavior" and as such won't be fixed. The only current solution (for reading the logs from within an application on JB and above) is to manually grant the permission to the app through adb:

亚行外壳时授予< PKG> android.permission.READ_LOGS

一个此类授予的权限:

  • 生存重启
  • 在生存应用程序更新(即亚行安装-r)
  • 在撑不下去了,如果应用程序卸载,然后安装 再次
  • survives reboots
  • survives application updates (i.e. "adb install -r")
  • does not survive if the application was uninstalled and then installed again

很明显,这不是一个正常的用户可以预期的事。一个GUI-解决方案(其中用户可以授予从设置他们的设备的菜单此权限)由Android团队承诺,但遗憾的是功能是之前的修复删除实施

It's obvious that this isn't something that a normal user can be expected to do. A GUI-solution (where users can grant this permission from the Settingsmenu of their device) is promised by the Android team, but unfortunately the functionality was removed before the "fix" was implemented.

这篇关于阅读ActivityManager原木一个果冻豆的设备上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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