Set an app as device admin with a script

Good morning,

I need to automatically set an app as "device admin":

It is the last one "Retex Poli MSS". Is it possible to do it remotely with a script and/or other methods?

Producer: Zebra

Model: PS20J

OS: Android 8.1.0

Enrollment type: ANDROID ENTERPRISE

MobiControl version: 15.6.0.1018

Agent version: 15.3.0.1006

Thank you

3 years ago
SOTI MobiControl
ANSWERS
AF
Allen Foster
3 years ago

I tried to do this with an app called Data Sweeper from Samsung SDSA team and at the time it was not possible.  Not sure if things have changed or not.

T
TomasB
3 years ago

I'm also stuck with this and it seems that no one in the world knows how to do this.

You need to do it manually on each device.

I do it during the enrollemnt of devices.(Outside kiosk mode)

request_appops_permission android.permission.PACKAGE_USAGE_STATS
request_appops_permission android.permission.SYSTEM_ALERT_WINDOW
request_appops_permission android.permission.BIND_NOTIFICATION_LISTENER_SERVICE
request_appops_permission android.permission.WRITE_SETTINGS
afw_set_permission_grant_state net.soti.mobicontrol.androidwork allow
afw_set_permission_grant_state net.soti.settingsmanager allow

RC
Raymond Chan Diamond Contributor
3 years ago

I am not aware of any mechanism that can silently set an app on an Android 8.x device to be device administrator.

Even Samsung devices with its extensive KNOX api's can only support whitelisting what apps can be added as device administrator, but not allowing and MDM to silently enabling the status remotely for a particular app.

Anyway, "device administrator" is an old concept that is destined to be deprecated gradually from Android 10 onwards.  There seems to be new MDM mechanisms defined by Google to support delegation of some specific administrator roles to one or more applications on more recent Android devices (definitely not for devices running Android 8.x firmware). with a supported device agent.   I myself am still struggling to nail down the details at the moment.

GB
Giuseppe, Brando
3 years ago

Ok, thank you all for the replies. I'll revert to the manual method since it looks like there is no way for these devices, at least with this OS version.

K
KCMOD@SOTI
3 years ago

Hello Brando,

Thank you for posting on SOTI Central!

Based on the internal investigation, it doesn't seem to be something that can be achieved. Device Admin is seen as a 'Special Permission' which we cannot set using MobiControl.

Please let us know if you have any other questions and if this reply or any of the community replies helped to resolve your question/issue, please mark the post as solutined.
 
Regards,
Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net
 
LS

Hi Support,

There is the option for delegated device permissions (https://developer.android.com/reference/android/app/admin/DelegatedAdminReceiver). There are other MDMs that implemented this functionality which i.e. allows you this:

Can you have a look at this with your team again?

Kind regards

Lukas