3

I would like to know if there is a way to lock (prevent) an application from starting.

And i also would like to know if there is a way to prevent a service(application) from starting at boot of the device

...i would like to know because i would like to create an anti-malware app.

Marek Szanyi
  • 2,348
  • 2
  • 22
  • 28

2 Answers2

2

I know this question is old, but for others stumbling over it:

Autostarts is an application that can disable apps from starting at boot time. It's the best I've found to do that (it isn't resident and doesn't kill processes like a task manager, it actually parses apk packages and reads registered actions and blocks the actions you tell it to). BUT it needs root and hasn't been updated for a while (december 2011). It works on Android 2.3 on which I tested it. Because it was discontinued, I don't know if it works on newer OS versions.

It's commercial now, but that's not the point, you need a peek at the source code.

If you search a bit, you'll be able to find the source code for an older version and see how it implements the blocking system.

I would be very interested in an application that could block certain services. NOT kill, but prevent them from starting in the first place. And the list is quite big: Facebook (OrcaService, MqttPushService, MediaUploadService, BackgroundDetectionService), Twitter, Maps (NetworkInitiatedService), Yahoo Mail Sync, etc. I don't use the features that the services provide, I even disabled some of them in the app interface where possible, but they still pop up and remain resident after exiting the application.

binar
  • 1,197
  • 1
  • 11
  • 24
1

I would like to know if there is a way to lock (prevent) an application from starting.

Not in any supported fashion. Anything that does this is malware, and the techniques for doing it are security holes.

And i also would like to know if there is a way to prevent a service(application) from starting at boot of the device

The user can boot their phone in safe mode (I forget the exact process, but it's something like holding down the HOME key while turning the phone on).

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • thanks for your answer...just a side note: such application could be also viewed as anti-malware :) – Marek Szanyi Sep 14 '10 at 04:53
  • 2
    I don't like how G+ messenger, facebook, twitter, Qik, etc, all start background processes automatically. In GO Launcher, they all show running. When I kill the processes, they come back. That is why I'd want to stop apps from starting. Any ideas?? – trusktr Oct 20 '11 at 22:27
  • CommonsWare, then how do you explain https://play.google.com/store/apps/details?id=com.focuslock.zee&hl=en – Rohit Tigga Aug 19 '14 at 01:13
  • @XiJiaopin: Whatever it is doing is not supported and, as such, should not be possible for security reasons. There's a decent chance that this app does not work on the L Developer Preview. If Google adds APIs for this sort of thing to the device administration APIs, that would be wonderful, offering up a middle ground between "unsupported" and "insecure". Perhaps they will offer those as part of Android Work. – CommonsWare Aug 19 '14 at 11:57
  • Perhaps they will. I'm not sure if this falls into the category you are describing, but how do you explain apps that allow the user to lock installed applications with a password or pin-code? Like the following: https://play.google.com/store/apps/details?id=com.domobile.applock&hl=en "AppLock can lock SMS, Contacts, Gmail, Facebook, Gallery, Market, Settings, Calls and any app you choose, with abundant options, protecting your privacy." What do you have to say about this? And more importantly, how would one go about programming this? Been stuck in a rut aha :( Thanks for the response. – Rohit Tigga Aug 21 '14 at 04:02