您的位置:首页 > 移动开发

Is-there-any-way-to-prevent-an-android-app-from-being-removed

2011-06-01 10:54 507 查看
http://stackoverflow.com/questions/495734/is-there-any-way-to-prevent-an-android-app-from-being-removed

Reference: http://www.textecution.com/
Does anyone know if there's a way to either keep the
user from uninstalling an app from an Android phone or reinstall it on
removal? Before you flame me, please know that I have an app that's
intended to be installed on the phone by a parent/employer/etc. and has a
password-protected settings screen; the user would need to enter the
password to remove the app.



android
g1

link
|
edit
|
flag

edited Jan 30 '09 at 20:47

asked Jan 30 '09 at 14:46



Jarett

849
4

15

75% accept rate

5 Answers

active
oldest
votes

up vote
3
down vote
accepted

On the topic of email notification when your service is uninstalled--

A lot of security software runs multiple processes which monitor each
other, so that it's more difficult to shut the system down. You could
do something similar with two services installed, each monitoring to see
if the other is installed. If something goes wrong, they can send off
the e-mail.

link
|
edit
|
flag

answered Feb 10 '09 at 0:52



tsellon

641
6

19

up vote
5
down vote

What if you have it send an email alert to a registered email address on uninstall?

link
|
edit
|
flag

answered Jan 30 '09 at 14:51



EBGreen

7,253
1

15

36

Do you know if there's a broadcast sent on uninstall that the app can grab?
Jarett
Jan 30 '09 at 20:39

From the way you wrote the question I thought it was your app.
EBGreen
Jan 31 '09 at 3:45

It isn't mine, per se, but I did write it.
Jarett
Feb 2 '09 at 14:22

So doesn't that mean that you control the uninstall code?
EBGreen
Feb 2 '09 at 14:31

2
A
(pretty crappy) workaround might be to have your app send a 'heartbeat'
e-mail every day. When the parent stops getting the e-mails, they know
something's up.
Outlaw Programmer
Feb 27 '09 at 19:55

show 3
more comments
up vote
2
down vote

Not without modifying the kernel,
or reducing the user priviledges on the device. Think of it as a Linux
computer, where the cell phone user has root.

Can you prevent them from removing your app? No.

But you can
make it painful and difficult enough that it's not worth it, and include alerts that indicate it has been removed.

First, I would modify the software so it requests and successfully
answers a cryptographic challenge/response periodically from a remote
server - daily should be enough, and wouldn't impact battery use. This
way your server knows when it has been disabled (could be sold as an
additional $10/yr service charge) and you can alert the purchaser.

Second, I would tie the software into the system at the driver level
so that removal also removes text services. There are drivers or
services that the texting application uses that could be replaced with
your custom versions, and on removal would render the texting app
useless. Chances are good that you already tie into the system in a
similar way to block the texting app (and other apps) while traveling
too fast.

Third, I would consider installing a monitoring program that runs as a
separate process (check out how the latest viruses operate for clues).
It would check to make sure that not only is the app still running, but
it's running the latest version, and there isn't a GPS simulator or
other program that prevents your app from getting correct GPS data.

I'm curious how you differentiate between the driver texting and a
friend in the passenger seat texting on the driver's cell, though.

link
|
edit
|
flag

answered Jan 30 '09 at 20:58



Adam Davis

29.9k
13

85

169

Wow,
thanks for the very thorough reply. Having the app install another app
that watches for uninstall might be feasible, but also might be draining
on the battery depending on how it worked; I'd have to look into it a
bit. As for differentiating passengers, see textecution.com/faqs.php
.
Jarett
Jan 30 '09 at 22:36

You
wouldn't need the side program running all the time - in fact it might
be harder to notice if it isn't running constantly. Run it
periodically, and on startup to see if it's still in cron (or similar)
and installed. You might also be able to attach it to charging or other
events.
Adam Davis
Jan 30 '09 at 23:18

up vote
2
down vote

I'd highly doubt that's possible.
The permission structure of Android is going to give the user full
control over what's happening on their phone (to some degree) and not
being able to uninstall an app would be a pretty large security risk.

If you modified the Android core, it would probably be possible, but
if you're trying to force something onto an end-user, that's a bad idea.

Maybe there's a better approach to what you're doing? If there's some
required functionality in the app to keep the user from uninstalling
it, that would be a small incentive to keep the app, but there's no way
to keep a user from removing something they really don't want. You could
have the app report uptime to a seperate server so you could be
notified if the app was removed, but I think that's as far as you're
going to get.

link
|
edit
|
flag

edited Feb 27 '09 at 19:42



GEOCHET

9,088
8

27

49

answered Jan 30 '09 at 14:50



Alex Fort

6,772
19

40

Here's a link to the site for app: textecution.com
.
It's kind of a "Big Brother"-type app; it's really supposed to be
installed on the phone by a parent or employer, and the phone user might
not want it on there.
Jarett
Jan 30 '09 at 20:42

I would sure like to see the reaction when the teenager installs it on Dad's phone :)
gbarry
Feb 1 '09 at 6:15

up vote
0
down vote

Well, solution would be to mount /system/apps/ to be writable and put your app there once.

When you restart the phone it would automaticly install it and
prevent a user from uninstalling (as every app in that folder, list it
to see it). That's how mobile providers force user to have they app.

However, user could always delete this app by rooting + mounting
/system/app/ to writable and then to delete. But "normal parents" can't
do that :)

Regards

P.S. This question is two years old, I've notice it just now... :S

link
|
edit
|
flag

answered Feb 12 at 10:40



confiq

316
9

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐