1. Home
  2. Knowledge Base
  3. How to enable or disable microphone permissions for a specific application using a Run Script

How to enable or disable microphone permissions for a specific application using a Run Script

Admins can enable or disable microphone permissions for specific or third-party applications on Samsung Knox devices and platform-signed devices by applying the Run Script.

Purpose

The purpose of this article is to provide a guide on how to grant or deny “microphone permissions” remotely on Android devices.

Prerequisites

  • The OS must range from Android 6 to 13 with Device Owner Mode enrollment.
  • SureMDM version 27.25.08 is supported.

Steps 

The Run Script job allows admins to run customized scripts on the enrolled devices remotely.

To create a job to run customized scripts and deploy them to the enrolled device(s) or group(s) remotely, follow these steps:

1. On the SureMDM Web Console, navigate to Jobs > New Job > Android > Run Script.

2. In the Run Script prompt, enter a Job Name and the Script.

3. Create a Run script job to disable microphone permissions for a specific application by applying the following run script:

#suremdm
denyRuntimePermission(pkg_name, android.permission.RECORD_AUDIO)

4. Create a Run script job to enable microphone permissions for a specific application for Samsung Knox devices and platform-signed devices by applying the following run script.

!#suremdm

grantRuntimePermission(pkgname,android.permission.RECORD_AUDIO)

5. Once done, click on Save.

The newly created job will be listed in the Jobs List section.

6.  Go back to the Home tab and select the Android device(s) or group(s).

7.  Click Apply to launch the Apply Job/Profile To Device prompt.

8.  In the Apply Job/Profile To Device prompt, select the job and click Apply.

Need more help? Here’s how to get help from our experts. 

CONTACT US 

Was this helpful?
YesNo
Updated on July 2023