-
-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove not needed permissions from cordova config / Split plugin #181
Comments
The options are pretty limited since Cordova provides no means of adding conditional logic to the
But they can't :-( So currently, the options are:
Neither is ideal, but given the current Cordova CLI tooling, I don't have a better solution. |
Thanks for the swift response. I really like the micro-plugins in the It could actually work like that the main plugin still provides the shared functionality and the functional plugins just hook into that. First I need to check which functions are actually shared. |
Having a main plugin containing common code then additional plugins which hook into it is probably the way forward. Thinking about it, it should be possible to share the native and JS code, so long as it's namespaced. The micro-plugins will need access to things like native permission requests on Android (which is common) and both native and JS constants that are defined for permission statuses, for example. It's entirely doable, but will need some reworking, such as exposing currently private functions in the main plugin so the micro-plugins can access them. |
Yeah at first glance quickly at the code now I saw a bunch of private functions that would need to be made public. Do you see any other pitfalls? |
Not off the top of my head, but there probably are some :-) |
You know what? The confusion raised by the security audit that my app supposedly is using the mic, raised from the fact that the auditing software just scanned the plist of the ios app and saw the How about you remove all those default strings from the What you think? |
I deliberately didn't allow the plugin to add But the reason I added the default iOS usage descriptions is a side effect on having to include every core framework in the The default usage descriptions are not actually used unless you actually request the permission at runtime. But if they are not present and the app includes the relevant framework, you app will get rejected by Apple. For every core framework included in the iOS app, there must be a corresponding usage description, otherwise your uploaded app will get rejected once you upload it to iTunes Connect. For example, if I remove
This requirement was introduced with iOS10/XCode 8. You can find plenty of related Q's on SO, e.g. this one. I'd say the security audit software is being overzealous because unless there is a call to request permission at runtime, both the related framework and usage description message are never used. |
Ah ok, understand now. Well then the original proposal still stands to split up the various sections of the plugin into sep. plugins. With them would go the framework. Or we really need a pre-processor for cordova plugin.xml parsing ;) After figuring out why the security audit software complained about mic access I was underwhelmed how bad its detection algo actually is. |
Hi! I have tried to comment out, in plugin.xml, the framworks and plist entries I don't use / need. Cheers |
Yeah I think too the split would be helpful. If only to ship less code, reduce bundle sizes. |
I feel more confident to work on the split now. I'll fork this repo and create a PR. |
Hello @pke
I am having the same problem here. Have you a workaround for this? I have tried removing the info.plist key and the related framework from Linked Frameworks and Libraries, as you can see in this SO Question, but not worked. Any suggestion? Thanks! |
Has anyone created a version that allows for selective permissions? I'm also running into this problem where iOS asks me why I want all these permissions even though I only need one.. |
@spinninghamster not yet. But it's still on my list of todos for this year. |
FYI I've started work on a major rework of the plugin which will divide up the plugin into logical areas of functionality (e.g Location, Bluetooth) which will be specified using plugin variables at install time. My current strategy will be to retain a single plugin structure, but with the optional parts being included/excluded via plugin hook scripts at plugin install time based on the plugin variable settings in the config.xml |
I've pushed a proof-of-concept modules branch which demonstrates my proposed approach of using an npm post-install script to apply module preferences in a You can try it out by installing direct from the branch:
There is currently only one optional module, Location, which implements modularity for Android, iOS and Windows 10. So in your Also note that the preference must be present in Any feedback/suggestions/bug reports on the |
This is resolved now that |
That was quick. Will give it a try probably tomorrow. Thanks! |
This plugin drags in a lot of permissions that our app does not need. We just use this plugin for checking and requesting camera permissions.
However, location (back & foreground), calendar, microphone permissions are all in the apps manifest without justification.
Is there a way to remove those permissions from the resulting
config.xml
and the links to the frameworks to bundle the app with:I think a better approach to a finer grained permission and code usage would be to split this plugin into separate plugins for each domain: camera, photolib, addressbook, contacts, bluetooth.
cordova-plugin-diagnostic-camera
etcThe text was updated successfully, but these errors were encountered: