In this example, I'll show how to remove the RECORD_AUDIO permission.
-
Navigate to the
pluginsdirectory in your Cordova folder. -
Open the
plugin.xmlfile of each plugin and search for something like:
<uses-permission android:name="android.permission.RECORD_AUDIO"/>-
If you don't find anything like it, that plugin doesn't use the permission. If you do find it, remove it.
-
Navigate to:
yourCordovaFolder\platforms\android
-
Open a file, called
android.json. -
Search for code that looks like this:
"AndroidManifest.xml": {
"parents": {
"/*": [
{
"xml": "<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />",
"count": 1
},
{
"xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
"count": 1
}
]
}
}- Remove the
RECORD_AUDIOpart so that you're left with this:
"AndroidManifest.xml": {
"parents": {
"/*": [
{
"xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
"count": 1
}
]
}
}Note: Be careful to preserve proper JSON syntax!
- Go to:
yourCordovaFolder\platforms\android
-
Open a file, called
AndroidManifest.xml. -
Remove something that looks like this:
<uses-permission android:name="android.permission.RECORD_AUDIO" />When you build your app, the permission should be gone. You can always check the AndroidManifest.xml file. If it's there, your app uses it. The reason you have to remove it from the plugin.xml files and android.json is because if it's there, Cordova automatically adds it to AndroidManifest.xml upon building.
Thanks! Helped me a ton!!