cordova-plugin-advanced-http icon indicating copy to clipboard operation
cordova-plugin-advanced-http copied to clipboard

[Feature] split up HTTP Communication & file transfer

Open chuchuva opened this issue 6 years ago • 7 comments

Repro:

  1. add cordova-plugin-advanced-http to any Cordova project
  2. Build Android apk
  3. Inspect platforms/android/app/src/main/AndroidManifest.xml

Observe: a line with WRITE_EXTERNAL_STORAGE permission is present

Expected: no WRITE_EXTERNAL_STORAGE

System info

  • affected HTTP plugin version: 2.1.1
  • affected platform(s) and version(s): Android
  • cordova version: 8.0
  • cordova platform version(s): android 8.0.0

Why would you need to write to SD card when making HTTP requests? If the app needs to download a file from Internet to SD card WRITE_EXTERNAL_STORAGE permission should be added by the app and not by plugin.

chuchuva avatar Jul 20 '19 00:07 chuchuva

I think this is because dependant cordova-plugin-file requires that permission: https://github.com/apache/cordova-plugin-file/blob/master/plugin.xml#L137

chuchuva avatar Jul 20 '19 01:07 chuchuva

Hi chuchuva, you're right this behaviour comes from the dependant file plugin. This plugin does not reference this kind of permissions (see https://github.com/silkimen/cordova-plugin-advanced-http/blob/master/plugin.xml#L63). But I don't think this is a bug, because actually we need to have this permission when dealing with files e.g. downloading or uploading files from storage.

silkimen avatar Jul 23 '19 21:07 silkimen

See also https://github.com/apache/cordova-plugin-file/issues/243

chuchuva avatar Aug 16 '19 21:08 chuchuva

@silkimen This is a bug / unexpected behaviour. I need to integrate native http requests into my code, not uploading/downloading any files. It doesn't make sense to request this permissions from the users as @chuchuva mentioned before.

Edit: also, Apple might reject apps requesting this permission, when theres no feature using it.

edento avatar Aug 27 '19 11:08 edento

See also apache/cordova-plugin-file#243

It seems that downgrading cordova-plugin-file to version 3.0.0 gets rid of the problematic permission. Would it be possible to have a mean to specify the version of cordova-plugin-file that we need like you did with OKHTTP one ? Thanks.

Edit : never mind, downgrading to version 3.0.0 of cordova-plugin-file does not seem to work...

Asterodeia avatar Oct 01 '19 13:10 Asterodeia

Hi guys, this might be an unexpected behavior to you, but I can't just remove the dependency, because there is some code integrated in this plugin depending on the cordova file plugin. Removing this code means removing features. Therefore I've marked this as a (breaking) feature request. Maybe we can extract this features into another plugin in a future major release.

silkimen avatar Nov 22 '19 23:11 silkimen

see also related issue cordova-plugin-file#243

russaa avatar Sep 16 '20 18:09 russaa