如何记录查询哪个引用发出ACTION_PACKAGE_ADDED这个广播

子君X 2011-08-29 03:51:52
最近手机上常被偷偷安装一些垃圾程序,就想写个小工具来记录一下是哪个程序安装的,搜了一圈,发现程序安装后会广播

消息:ACTION_PACKAGE_ADDED,不过这个消息好像是系统发出的,能不能查询到触发这个消息的应用程序名称呢?或者大家有啥

其他好的监视程序安装的方法呢
...全文
372 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
fishmen26 2011-08-29
  • 打赏
  • 举报
回复
就是分少了点,嘿嘿
fishmen26 2011-08-29
  • 打赏
  • 举报
回复
这个问题很nice, 可以好好研究研究,ACTION_PACKAGE_ADDED只能得到安装的 package name 和UID ,但是没有哪个安装滴信息记录,可以好好研究研究
fontlose 2011-08-29
  • 打赏
  • 举报
回复
这个广播新装的包自己不会收到,广播内也没说明是安装了什么,可以看手册。

每次收到广播记录查询一次安装程序比较一次
获取Android系统中已安装程序的名字、包名等信息
http://mm.10086.cn/buluo/topic.php?tid=867

手册说明:
public static final String ACTION_PACKAGE_ADDED
Since: API Level 1

Broadcast Action: A new application package has been installed on the device. The data contains the name of the package. Note that the newly installed package does not receive this broadcast.
My include the following extras:
* EXTRA_UID containing the integer uid assigned to the new package.
* EXTRA_REPLACING is set to true if this is following an ACTION_PACKAGE_REMOVED broadcast for the same package.
This is a protected intent that can only be sent by the system.
Constant Value: "android.intent.action.PACKAGE_ADDED"

念茜 2011-08-29
  • 打赏
  • 举报
回复
程序安装完会系统自己发出ACTION_PACKAGE_ADDED, 但是从这里并不能为我们提供任何线索,到底是谁安装的应用程序。 可以从 ACTION_PACKAGE_FIRST_LAUNCH 或者 ACTION_PACKAGE_INSTALL 下手,会容易些。

看你的描述,好像拿不到系统源码修改不了系统log,现在可以从现有的logcat里得到什么信息吗 ?

80,354

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧