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

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.

link | edit | flag

75% accept rate
 
  

5 Answers

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
 
  

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

link | edit | flag
 
 
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

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
 
 
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

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
 
 
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

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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Uni-app是一款跨平台的开发框架,可以使用Vue.js语法来开发微信小程序、H5、Android、iOS等多个平台的应用程序。下面是编写登录页面的步骤: 1. 创建一个新的uni-app项目,可以使用HBuilderX等工具进行创建。 2. 在项目的`pages`目录下创建一个新的页面,例如`login.vue`。 3. 在`login.vue`中编写页面布局和样式,例如: ```html <template> <div class="login"> <form> <input type="text" placeholder="请输入用户名" v-model="username"> <input type="password" placeholder="请输入密码" v-model="password"> <button type="submit" @click.prevent="login">登录</button> </form> </div> </template> <style> .login { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; } form { display: flex; flex-direction: column; align-items: center; justify-content: center; } input { width: 300px; height: 40px; margin-bottom: 10px; padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 16px; } button { width: 300px; height: 40px; background-color: #007aff; color: #fff; border: none; border-radius: 5px; font-size: 16px; cursor: pointer; } </style> ``` 4. 在`login.vue`中编写登录逻辑,例如: ```javascript <script> export default { data() { return { username: '', password: '' } }, methods: { login() { // 进行登录操作 console.log('username:', this.username) console.log('password:', this.password) } } } </script> ``` 在`login`方法中可以编写向服务器发送登录请求的代码,例如使用`uni.request`方法发送POST请求。 5. 在`pages.json`文件中添加`login`页面的配置,例如: ```json { "pages": [ { "path": "pages/login/login", "style": { "navigationBarTitleText": "登录" } } ] } ``` 6. 运行uni-app项目,即可在应用程序中查看到登录页面。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值