Allow permission in a sophos apk silently

JE
Jose, Echeverria
TECNIPESA IDENTIFICACIÓN, S.L.

Good morning,

We have to deploy a new application on some devices and we have a problem accepting permissions silently.

We are going to deploy the application using the policies/apps method because we have to configure some information (Device ID & connection code) it works fine, and the app connect to the Sophos console automatically and the device appears with the name of our soti console what was the goal. But the problem is that we have to grant some permissions manually before the process ends.

We are trying to grant these permissions remotely via scripts and we have tested these scripts with no result:

afw_set_permission_grant_state com.sophos.smsec android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS allow

afw_set_permission_grant_state com.sophos.smsec android.permission.PACKAGE_USAGE_STATS allow

We have tested this script too:

request_appops_permission android.permission.PACKAGE_USAGE_STATS

We are running Versión: 15.5.1.1010 of Soti Mobicontrol .

The device I am using to test is a Samsung SM-T510 with android 9 and agent version 15.2.0.1025.

Is it possible to silently deploy these permissions?

Is there any other test or way to silently grant these permissions on these devices?

Thank you for your help!

3 years ago
SOTI MobiControl
ANSWERS
H
HOMOD@SOTI
3 years ago

Hello Jose,
Thank you for posting on our SOTI Central.
I happened to notice that the scripts you mentioned above seems OK, however, the format might be wrong.
The correct format should be like below.

afw_set_permission_grant_state [packageName] [permission] [grantState<allow| deny | default>]

In your scripts, after the packageName and permisson you put the dot "." insted of a space. This might confuse the system to run it.
Can you try the below to see if it works ?

afw_set_permission_grant_state com.sophos.smsec android permission REQUEST_IGNORE_BATTERY_OPTIMIZATIONS allow
afw_set_permission_grant_state com.sophos.smsec android permission PACKAGE_USAGE_STATS allow

FYI, our mobicontrol help portal site:

https://soti.net/mc/help/v15.5/en/scriptcmds/reference/androidplus_enterprise_do.html?hl=afw_set_permission

JE
Jose, Echeverria
3 years ago

Thank you Homod for your help!

As far i understand the [permission] is the full name of the permission:

android.permission.PACKAGE_USAGE_STATS

Anywway i have try with your script and doesnt work for me, thank you!

H
HOMOD@SOTI
3 years ago

OK, understood. 

Then may I ask some questions so I can do more investigation for you?

1.What is the device kind of your devices? Is it Android Enterprise or Android Plus ?

2.What is the device agent version ?

3.What is the script type you are using? Is it legacy ?

JE
Jose, Echeverria
3 years ago

1. Android Enterprise

2. 15.2.0.1025 with a Soti 15.5.1.1010

3. Im using legacy script, yes

Thanks for your help Homod!

RS
Rafael Schäfer
3 years ago

This script wont work as you think. Take a quick look into the documentation:

Grants specified permissions to specified applications. You cannot grant special permissions such as Draw Over or Usage Access, to third party applications.

So, you can only use it like this:

afw_set_permission_grant_state com.sophos.smsec allow

H
HOMOD@SOTI
3 years ago

Hi Jose,

Sorry I haven't found any helpful info yet, but have you had any chance to try what Rafael suggests here ?

Please let us know if it works or not.

JE
Jose, Echeverria
3 years ago

Hi! i opened a case with soti support and told me that it could not be done with samsung devices.

Thank you for your help!