从外部应用程序拦截的意图 [英] Intercepting an intent from an external application

查看:114
本文介绍了从外部应用程序拦截的意图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我想开发一个以某种方式扩展的应用程序(让我说配合)一个的非常流行的应用程序的我显然不具备控制权。让我们也假设,为简单起见,该的非常有名的应用程序的作者将不发布更新来阻止我的申请。

我学的是应用程序的功能,并确定它被广泛用于的BroadcastReceiver 秒。我也知道,从清单中, com.famousvendor.intent.INTENT_NAME 常量我可能会使用。

现在的问题很简单:如果我创建一个应用程序,即 org.zighinetto.tinyapp <​​/ code>与广播接收器意图 com.famousvendor设置。 intent.INTENT_NAME 的小应用程序的赶上直播?或者,可以将这些广播可以由激发他们的过程中只收到?

解决方案
  

将微小的应用程序赶上直播?或者,可以将这些广播可以由激发他们的过程中只收到?

有许多事情控制此

如果广播固定用的许可,你将不能够接收广播,除非您还拥有该权限。它可能无法让你认为权限,根据权限的,它是类型。

此外,如果该广播是一个有序的广播,较高优先级的应用程序将接收的广播,并且可以终止它(消耗的情况下,所以低优先级的接收器没有得到广播)。优先级是通过设置&LT;意向滤光器&gt; (或的IntentFilter ),它可能无法为你有一个是更高的优先级比自己的应用程序,这取决于优先级值的原始显影剂保持

也有其他地方只能方案(例如, LocalBroadcastManager ),虽然你不会看到这些清单中,所以我们可以假设,他们都不是这里正在使用......今天。

  

让我们还假设,为简单起见,这非常有名的应用程序的作者不会发布一个更新来阻止我的申请。

他们并不需要专门阻止你的应用程序。他们只需要决定他们是否真的想你想利用这个API,他们可能会选择将其锁定,如果这是更意外的API。他们可能会做如此回应一个秃顶的家伙例如

Suppose I want to develop an application that extends in some way (let me say "cooperate with") a very popular application I obviously don't have control over. Let us also suppose, for sake of simplicity, that the very famous application author won't release an update to block my application.

I studied the application's functionality and identified that it widely uses BroadcastReceivers. I also know, from manifest, the com.famousvendor.intent.INTENT_NAME constants I might use.

The question is straightforward: if I create an application, namely org.zighinetto.tinyapp with a broadcast receiver set for intent com.famousvendor.intent.INTENT_NAME will the tiny app catch the broadcast? Or can those broadcast be received only by the process that fires them?

解决方案

will the tiny app catch the broadcast? Or can those broadcast be received only by the process that fires them?

There are a number of things that control this.

If the broadcast is secured with a permission, you will not be able to receive that broadcast unless you also hold that permission. It may not be possible for you to hold that permission, depending on the type of permission that it is.

Also, if the broadcast is an ordered broadcast, higher priority apps will receive that broadcast and can abort it (consuming the event, so lower-priority receivers do not get the broadcast). The priority is set via the <intent-filter> (or IntentFilter), and it may not be possible for you to have one that is higher priority than is their own app, depending upon the priority value the original developer held.

There are also other local-only scenarios (e.g., LocalBroadcastManager), though you would not see those in the manifest, and so we can assume that they are not what is being used here... today.

Let us also suppose, for sake of simplicity, that the very famous application author won't release an update to block my application.

They do not need to specifically block your application. They just need to decide whether or not they really want to have the API you are trying to exploit, and they may choose to lock it down if this was more of an accidental API. They might do so in response to a blog post by a balding guy, for example.

这篇关于从外部应用程序拦截的意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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