How to remove unnecessary cordova permissions?

Is there a convenient way to remove unnecessary cordova permissions? For example I am using the Media plugin for cordova, but i only want to play a sound, not record it. So i’d like to get rid of the RECORD_AUDIO permission, because users might get suspicious.
I have tried to use this block in the config.xml to no avail:

<gap:config-file mode="delete" parent="/manifest" platform="android">
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</gap:config-file>

Any help would be much appreciated.

3 Likes

Have you found a solution to this? I have the exact same issue.
There’s this thread that suggests an approach, but seems a little overhead.

No, I haven’t found anything else yet. Indeed the solution you linked seems overhead, but at least it is something. I will try it out later - and continue looking for a simpler solution.
Cheers!

I found a way, that sadly is not automated.
After platform:add and before build:android you edit /plugins/android.json and /plugins/org.apache.cordova.media/plugin.xml and delete the lines including the permissions you don’t want.

2 Likes