views:

54

answers:

1

I am wondering if it is possible to intercept an open application call, for any(most of the) installed application. Or at least for opening the Activity having the intent-filter's action set to Main (if it exists for an app).

+1  A: 

No, sorry, this is not possible. The startActivity() calls are targeted to specific components and cannot be intercepted. After all, this would be a massive security hole otherwise.

CommonsWare
Ok thanks. I thought it might be possible with high privileges. Than is it possible to block an application(any of those installed) to start (an alert can be shown)? As I see it, this would be similar from the security point of view with killing the app.
ilarele
@ilarele: Not really. There's a known approach to do this, one that I have reported as a security vulnerability already, but one that has yet been addressed by the core Android team. Since the technique has "malware" written all over it, I am not going to disclose it. Suffice it to say, there is no official and supported way to do what you see, and I really really really really really wish you would pursue some other direction in your Android application development. For example, you could write your own home screen app, and secure access to apps that way.
CommonsWare
Thank you very much for your answers. I didn't know that you can do so many thinks by adding a custom luncher. I took a look over a couple sources of luncher apps and I will definitely try to write one. About my coding direction, I am at the beginning, but I am on the good side. Though I think it is important to know what can or can't be done (also what should or shouldn't be done :)).
ilarele