How to allow app permissions via legacy scripts?

Solved
DP
Daniel P
Abetech - Managed Services

Good Morning!

I am wanting to allow certain permissions for several apps without having to go into the device settings. 

Permissions I am wanting to allow include

Location, storage, camera, draw over other apps, modify system settings, install unknown apps. 

I would like to be able to grant these permissions through a script using the bundle ID if possible? 

3 years ago
SOTI MobiControl
ANSWERS
JK
Jason Klotz
3 years ago

Are you enrolled enterprise?  If so something like this would be what I believe you are looking for:

batteryoptimize disable com.trucesoftware.trucemobile
afw_set_permission_grant_state com.trucesoftware.trucemobile android.permission.ACCESS_FINE_LOCATION allow
afw_set_permission_grant_state com.trucesoftware.trucemobile android.permission.ACCESS_BACKGROUND_LOCATION allow
afw_set_permission_grant_state com.trucesoftware.trucemobile android.permission.SEND_SMS allow
afw_set_permission_grant_state com.trucesoftware.trucemobile android.permission.RECEIVE_SMS allow
afw_set_permission_grant_state com.trucesoftware.trucemobile android.permission.RECEIVE_MMS allow
afw_set_permission_grant_state com.trucesoftware.trucemobile android.permission.android.permission.CAMERA allow
afw_set_permission_grant_state com.trucesoftware.trucemobile android.permission.READ_PHONE_STATE allow
afw_set_permission_grant_state com.trucesoftware.trucemobile android.permission.CALL_PHONE allow
afw_set_permission_grant_state com.trucesoftware.trucemobile android.permission.ANSWER_PHONE_CALLS allow
afw_set_permission_grant_state com.trucesoftware.trucemobile android.permission.READ_CALL_LOG allow
afw_set_permission_grant_state com.trucesoftware.trucemobile android.permission.READ_CONTACTS allow
afw_set_permission_grant_state com.trucesoftware.trucemobile com.google.android.gms.permission.ACTIVITY_RECOGNITION allow
afw_set_permission_grant_state com.trucesoftware.trucemobile android.permission.ACCESS_NOTIFICATION_POLICY allow

Just swap in the program you want and what perms you want and this should do it for you.

Solution
D
DJMOD@SOTI
3 years ago

Hi Daniel,

Thanks for requesting a response from SOTI Support Staff, Thank you very much Jason for providing the inputs on the query. Please try the solution provided and let us know if it resolved issue.