Prevent android apps from being uninstalled? - android

so I'm developing an application locker. Ive developed the core locking functionality. i want to add the functionality of preventing an unauthorized user from uninstalling any locked apps on the device. What i want to do is when a particular app is locked and someone tries to uninstall it,i want to show my locking screen first.If the user enters the right password then he /she should be able to uninstall the application. Ive seen other applications like AppLock and McAfee Antivirus having this functionality. can anybody advice me on how to achieve this functionality. Thank you in advance

You can track the uninstallation of app by implementing Device Admin API

you can use wipedata() method of device admin api

Related

Is it possible to lock the complete device from a flutter app?

I want to lock my android device as soon as a particular event happens in an application. The application will keep running in the background and lock the device as soon as the event happens. I tried plugins like flutter_screen_lock but they only provide locking within the particular app while I want the complete device to get locked.
Quick answer to your question this is not possible. If it would be possible both App Distribution Providers (App- and Play Store) would not accept your App because it would be against those Rules.

How can I stop one app in my app

I need to create a app which is responsible for closing the other apps which are currently running in background , is it possible ? Can I want close the other apps ? if it is possible then how ? plz help
Unless the other apps are signed by the same certificate, you cannot do this. The system apps (like Settings, with which you can "force stop" any app) have special privileges that are not allowed for apps written by developers.
I hesitate to ask, but why would you want to do such a thing?

How to prevent an application from being uninstalled ?

How to prevent an application from being uninstalled. How to stop it using code when user want to delete the application ? How can we do that using programming ?
One possible way may be android os customization. Otherwise I think you can't do this. You can see this Stop uninstallation of application
Without customization, you can get a message(using intent) when user try to uninstall a package.
Device Administrator
Once the application is registered as a Device Administrator, it can't be uninstalled unless its unregistered. This will prevent the app from being uninstalled
You should look at Device Administration .
Once the application is registered as a Device Administrator, it can't be uninstalled unless its unregistered. This will prevent the app from being uninstalled.
You can password protect your application to prevent someone from tampering with the Device Admin features in the app.
Please read this example. It is explaining all the details with sample tutorial.

Close android service with a password

I'm working on android application which have one service runs in background,
I need to make sure that the user will close the app/service only upon inserting password (like app lock on the market only for the service and the app).
Any ideas suggestion of how to implement such a feature?
On android 2.3 isn't possible the user will kill your app, but starting with Android 4.0 and Device Administrator it is: reasonable. Take a look at Kaspersky's parental control app.

Android App Locker Code needed

I am developing an app where I have to lock some android default Apps such as messaging, email, gtalk, etc .
How to do it, i have no idea. Please help me with some relevant code or link .
What do you mean by lock? If you mean "prevent access unless user types a PIN/password" then you simply cannot do it without root.
The only non-root idea I can come up with is to write a custom launcher, that will hide the target applications, but this doesn't stop other ways to access them [recent apps, intents...].
What is your theat model?

Categories

Resources