Script to grant Device Admin permission

Script to grant Device Admin permission

Hi,

We are enrolling Android devices (Samsung Xcover4) with Android Enterprise and I need to grant automatically "device admin" permission during installation of the package by using a script .

Below is the screen which require user action to grant device admin permission automatically after installation package.Device admin prompt user

 

Could someone send me the script to allow device admin permission?

 

I tried this one : afw_set_permission_policy grant but it seems to be not working...

 

Many Thanks

 

2 Answers

Order By:   Standard | Newest | Votes
JSMOD@SOTI | posted this 28 October 2020

Hi Farid,

 

Thank you for your post on SOTI Central.

 

The 'Device Admin' permission is considered a 'Special Permission' which the Android Enterprise agent cannot grant to 3rd party applications.

 

Kind regards,

Technical Support | SOTI Inc. | 1.905.624.9828 | support@soti.net | www.soti.net |

  • 0
  • 0
Matt Dermody | posted this 02 October 2020

If there was an option for this it would likely be through the following script structure but I'm honestly not sure this could work. This would be a Device Owner setting another DPC as a Device Administrator which might work but probably shouldnt. 

afw_set_permission_grant_state PACKAGE NAME android.permission.BIND_DEVICE_ADMIN allow

  • 0
  • 0

Give us your feedback
Give us your feedback
Feedback