I am trying make security app for keeping tracking your lost phone.I made app as device admin app so it can't uninstall directly but using unregister app to device admin we can un- installed it.so i wants make password protected app at un-installation time.when user try to un-install the app one dialog box appear to ask password.i know some apps do that functionality.can anyone knows about it?
You can't do this on a stock device. If you want to prevent people from uninstalling your app you have to make it a system app (part of the ROM). Even so, on recent Android versions users can choose to disable it. On Android 4.3 you have the option of marking the device admin (system app) as a 'device owner' so that users cannot deactivate it. This is obviously not available on earlier versions.
Related
I have a question about admin apps on Android that I can't find the answer to. I followed the guide on creating an admin app from here:
https://developer.android.com/guide/topics/admin/device-admin#java
I successfully created an admin app but there's something that's confusing me. I have a fresh device (Moto G6) and when I go into Settings->Security&Location->DeviceAdminApps I see a list of admin apps on the device. Right now it lists my app and a Google Play Services app titled "Find My Device". The only difference, though, is that the google app was on by default. Normally, and including in my app, when I try to use an admin feature (through DevicePolicyManager), an android page pops up asking me to enable it as an admin app. Since the Google app is already enabled, that pop up doesn't need to appear.
So, my question is how do I make an app an admin app by default (without needing the pop up page)? I assume something needs to be done on boot up but I have no idea what that Google app does. Does anyone out there have any idea?
So, my question is how do I make an app an admin app by default (without needing the pop up page)?
Build your own firmware with your own custom build of Android, where you pre-install your device admin app and set things up for it to be pre-enabled.
Alternatively, I think if you create a device owner app, it will be enabled upon installation, but that installation happens when the device is being first set up.
Ordinary device admin apps require users to agree to enable them, for blindingly obvious security reasons.
I developed one parent and child communication Android application in which I wanted to restrict the child from uninstalling application. I have one solution that uses DevicePolicyManager. But still the application can be uninstalled without asking for password. If I remove the Device Administrator permission from the settings, then application is uninstalled from device?
Can anyone provide the valid solution for this cause?
You cannot prevent a user from uninstalling an app, from within the app code itself.
There is suggestions here How to prevent an application from being uninstalled?, but they are not foolproof.
The way around this is to use an android device with lollipop and upwards, so you can create a user account.
On the admin account, install an app that requires a password to uninstall apps. They are on the market (and free) I've used them. Or write one yourself.
Then on the child's account allow them whatever privileges you want them to have. They will be unable to touch the apps and uninstall them, unless on the admin account and with the password required for that app to uninstall other apps.
I have tried and tested this and it works.
I'm making an android anti-thief app. I want to prevent a thief to uninstall the anti-thief app.
The app is a device administrator. So I used DeviceAdminReceiver.onDisabled
to start a “always on top” password prompt Activity (the password is setup by the user during the app configuration). This works fine.
But, Google Play rejected the app. Email extract:
Read through the Device and Network Abuse policy and make the
appropriate changes to your app. You’ll need to remove any
functionality that prevents a user from removing or uninstalling the
app from their device.
My Question:
What other ways can I use to prevent unauthorized user to:
uninstall my device administrator app ?
disable the device administrator permission ?
Thanks
EDIT: reformulate the question to clarify that the question is not about google play policy, but about alternative implementation.
I am working on anti theft Application.I want only authorized users to uninstall my app.Like, when they try to uninstall my app they must enter a valid password and proceed.I dont wanna block uninstallation of other apps that user have installed..is there a specific way to do that..?
If you're on an un-rooted device without a custom version of Android the only way that could be possible is making your app a device-admin app:
To uninstall an existing device admin application, users need to first unregister the application as an administrator.
You wanna protect apps from unauthorised access right? First, you need to download APPLOCK from play store. Setup the applock app after you download it by registering it with your email and create a pin password, then on the app you can lock the apps you want to lock. The applock app will b useless as at this point because any smart person can simply just uninstall the applock app and then all the locks you put on your apps will disappear with the applick app thereby rendering complete unauthorised access to all your apps.
What you to do then is to go to your phone's administrative setting and make the applock app an administrator.
Is is possible to make an android app non deletable.. What i mean is, I want to install a app, but I cant remove/ uninstall it. If I want to uninstall it then it should prompt me for password which I would have set during installation of the app.
When I read the docs they tell it can be done using Device Admin, but it doesnt provide security, interms of it doesn't ask the user for the password and deletes if its correct..
Is it possible to make an app such that even if there is a factory reset the app will still be there on the phone ?
Is is possible to make an android app non deletable
No, unless you want to create your own ROM and preload it with your app, just like some manufactures preload their devices with their own software and other bloatware.
No it is possible to restrict any user to delete the app from android device.
As google already maintaining this scenario by using the concept known as Device Management System.
Google Eyeing on apps which are published by the developer / installed or deleted by the user.
Although you can make your own app which will notify your admin that user is trying to delete the app or deleted the app, using Service Intent concept.