I need to play sounds in my game, so I added org.apache.cordova.media plugin to my application. Now platforms/android/AndroidManifest.xml contains 2 entries I don't need:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
If I remove those lines, this file regenerated and permissions are added again. What is correct way to remove these permissions? I use apache cordova 3.5.0
You have to open plugins/android.json
, locate in that file part which looks like
"AndroidManifest.xml": {
"parents": {
"/*": [
......
{
"xml": "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\" />",
"count": 1
},
......
{
"xml": "<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />",
"count": 1
},
......
],
and remove these files. After removal of that lines, make sure that android.json
still be valid JSON file.
Also please notice the count
property which indicates how many plugins use the permissions. If you have value more then 1 you should find which other plugins could use that permission. Also I don't sure that Cordova plugins was tested to be workable without proper permissions, so you on your own when removing permissions from that file.
If you put your system in the broken state, you always could remove all content of platforms and plugins folders and recreate your project by running
cordova create ...
cordova platform add ...
cordova plugin add ...