简体   繁体   English

如何在Android中获取第三方应用程序的详细信息?

[英]How to get detail of third party app in android?

Is it possible to moniter a third paty application in android means I want to know about all log of the third party app,like app xyz access contact list at 2:30am ,thursday. 是否有可能在android中监控第三个paty应用程序意味着我想知道第三方应用程序的所有日志,例如应用xyz访问联系人列表在凌晨2:30,星期四。

Can we change the framwork code like whenever any app run any query on sqlite framework class will generate one log ? 我们可以更改框架代码,就像任何应用程序在sqlite框架类上运行任何查询时都会生成一个日志吗? I think it should be possible through rooted device but not sure how to implement this. 我认为应该可以通过root设备但不确定如何实现它。

LogCollector安装LOG COLLECTOR应用程序

One way to change the framework to know who accessed any contentProvider would be to change 更改框架以了解访问任何contentProvider的人的一种方法是更改

enforceReadPermission and enforceWritePermission in ContentProvider.java to log the package that is calling the contentProvider, ContentProvider.java中的enforceReadPermissionenforceWritePermission记录调用contentProvider的包,

Log.d(TAG,""+getCallingPackages() +" app called provider "+ uri.getAuthority());

getcallingpackages function getcallingpackages功能

private Collection<String> getCallingPackages() {
     int caller = Binder.getCallingUid();
     if (caller == 0) {
         return null;
     }
     return Lists.newArrayList(mContext.getPackageManager().getPackagesForUid(caller));
 }

this may seem obvious but i'll say it anyway. 这似乎很明显,但无论如何我会说。 You can read the logs of any application in Eclipse's LogCat. 您可以在Eclipse的LogCat中读取任何应用程序的日志。

If you know the Applications name, and it actually creates logs (ie the logs are enabled), you filter them to see the logs specific to that application. 如果您知道应用程序名称,并且它实际上创建了日志(即已启用日志),则会对其进行过滤以查看特定于该应用程序的日志。

Can we change the framwork code like whenever any app run any query on sqlite framework class will generate one log ? 我们可以更改框架代码,就像任何应用程序在sqlite框架类上运行任何查询时都会生成一个日志吗?

By forking Android to add in your changes, creating your own ROM mod that contains your forked copy of Android, and installing that ROM mod on your device. 通过分支Android添加您的更改,创建自己的ROM mod,其中包含Android的分叉副本,并在您的设备上安装该ROM mod。

I think it should be possible through rooted device 我认为应该可以通过root设备实现

At best, you could skip the "creating your own ROM mod" step and attempt to copy the revised framework JAR into your rooted device. 充其量,您可以跳过“创建自己的ROM mod”步骤,并尝试将修订后的框架JAR复制到您的root设备中。 However, if that framework JAR does not line up with the rest of your OS, various things may not work. 但是,如果该框架JAR不与您的其他操作系统对齐,则各种操作可能无效。 That's why the only safe way to do this is via a full ROM mod. 这就是为什么唯一安全的方法是通过完整的ROM mod。

也许你可以为Android推出一个aop框架...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM