'Phonegap Android permissions, config.xml and plugins

I have a Phonegap app that I'm currently developing and testing for Android. Problem is, when I publish to device, the Android Manifest is full of permission requests that I did not ask for.

I have already figured out that the Phonegap Plugins (see this docs page under "Add features") have something to do with it. If you install a plugin like Camera, then PhoneGap will automatically add the related permission to AndroidManifest. So I've uninstalled all Phonegap Plugins that I didn't need, and those permissions went away.

So far so good.

Trouble is, my Android Manifest (and a file called "android.json" in the project's /Plugins directory) still contain a number of unwanted features:

<uses-permission android:name="android.permission.RECORD_VIDEO" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Since my app is about budgeting, a "Record video" permission would suggest to any sane user that this is an evil sneaky app trying to destroy their privacy.

How do I get rid of these feature requests? I already tried...

  1. Adding <preference name="permissions" value="none" /> to config.xml.
  2. Uninstalling all related Phonegap Plugins. I even uninstalled a plugin AudioHandler that seems to have come preinstalled when I created the project.

Of course I can remove the stuff manually from AndroidManifest.xml before I publish my final version. But I would like a more structural solution, since I use "cordova run android" to test on device, and this overwrites all changes to AndroidManifest.xml and android.json.



Solution 1:[1]

Are you sure you removed all plugins? (use phonegap plugin list) to see what plugins there are.

I Am not sure whether there is any difference, but I use

phonegap run android

in stead of

cordova run android

according to the docs the run command do both clean and build... so cleaning should be done.. (actually I use the -V command to get some extra debug info)

I also had a lot of troubles by the way, see: Upgrade to phonegap 3.3.0

And starting with an empty platforms folder is one of my tries.... than you should be sure it completely rebuild your manifest file....

Edit 29-1-2014

By the way, the best explanation of this CLI and phonegap 3.x issues can be found here: http://devgirl.org/2013/09/05/phonegap-3-0-stuff-you-should-know/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Community