Android Device Admin app enabled by default - android

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.

Related

Flutter App - Preventing Google Prompts from Taking Over The Screen

I have a flutter app that is designed to be placed as a fixed camera and based on what it sees give commands for IOT purposes.
To prevent it from sleeping, I am using a library called wakelock. (https://pub.dev/packages/wakelock)
Unfortunately, this doesn't prevent another issue, Google Prompts. When I log into my developer account on my laptop, the development phone is taken over by the prompt asking "Are you trying to sign in?"
I don't really want to have the solution be to log out of google on the phone, since the app is downloaded and updated via the play store.
I also don't want to disable 2F authentication, just don't want it to take over this developer phone, it's fine if it does so on my personal phone.
So a google settings solution, or a flutter code solution would be really helpful, have been able to find neither.
TLDR: I tried having the android phone as a 24/7 IOT camera with my flutter app, and was expecting it to stay on, but it was interrupted by the Google Prompt.
The easiest solution seem to me to set up a separate google account; this way the app could continue to be updated from the Play Store without being tied to your personal account, so you shouldn't receive 2fa prompts.
Another thing that might help is "Pinning" the app, which doesn't allow the app to be exited without authentication.
If neither of those work, a more advanced option could be to set up the phone with device management and use the lock task mode, but the work involved with setting that up is probably prohibitive for your use-case.

How to enable auto start automatically just after installing app from play store

As we know when we are installing app like WhatsApp , Facebook etc. from play store then it automatically listed in a list of autostart application on boot.
As shown in below screenshot we can see how these application are listed in autostart application which automatically turned on after installing.
So my question is how can I list my app in the auto-launch apps list. After installing my app, its showing in list but its not enabled. But I want that after installing it should automatically enable.
I know there is a way to achieve this. Please help I didn't found any articles about this.
From my understanding, this can't be achieved by every app. The apps you see, which are automatically auto-launching after installation are white-listed by manufacturers or Google themselves. All you can do is send the user to the specific settings to enable the auto-launch after installing the app. This is also described here:
Add my app to AutoStart apps list in android programmatically

Make android app non erasable

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.

Silent autoupdate running Android application

From what I read on SO, it seems that I want the impossible (?)
I have a kiosk-like app that is supposed to run 24/24, 7/7, 365/365. This makes it hard/impossible to update the app. As far as I know, Google Play will not start the update (even if Autoupdate is set for my app) while my app is running.
I read across SO and several forums an found a lot of NO's and CON's. My current answer is that is not possible without rooting the device or without some system certificates and so on.
But still, I have the following scenario:
I created a google account myGoogleAccount#gmail.com
On my device I add this account and install my application from Google Play store.
On my desktop machine I log into GPlay with the same account and I go to my application and I see that my app is Installed. If I click on the Installed button I can see my device.
I publish a new version of the app, when the app becomes available, from my application's page open on desktop I can send a command to update the app.
I get the prompt to accept the terms bla-bla, and once I accept it, the app is automatically updated even if it is currently running.
Basically this is the behavior I am interested in. My question is: can I run this scenario from my device [invoking some GPlay api's] given the fact that I can provide the google account credentials to the app, so that no user intervention is required to update the app and to accept whatever unchanged permissions?

Password Protected at Un installation time

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.

Categories

Resources