Remove specific cordova mobile permissions?

Anybody know if it’s possible to configure (within the Meteor ecosystem) the forcing off of mobile permissions that have been enabled by cordova packages?

For example, if you include org.apache.cordova.media to enable audio playback, it also includes Record_Audio permissions which you may not need.

I’ve found that you can change the cordova config.xml to do this, but how to do it from within Meteor? Is there something I can put in the mobile-config.js?


config.xml

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

http://community.phonegap.com/nitobi/topics/turn-off-permissions-media-plugin

1 Like

To answer my own question…

I think the config.xml can be over-ridden thus https://github.com/meteor/meteor/wiki/Meteor-Cordova-integration#advanced-build-customization

And you’d put something like this to remove permissions:

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

I’ll try this when I get a chance!