breautek commented on issue #561:
URL: 
https://github.com/apache/cordova-plugin-file/issues/561#issuecomment-1462174507

   > shared storage cannot be accessed even if MANAGE_EXTERNAL_STORAGE 
permission is granted.
   
   This could be a bug in the android platform, as `MANAGE_EXTERNAL_STORAGE` is 
suppose to provide [All Files 
Access](https://developer.android.com/about/versions/11/privacy/storage#all-files-access).
 So if this is not providing you access, a bug maybe should be raised with 
Android, if not already.
   
   However, `MANAGE_EXTERNAL_STORAGE` external access requires justification to 
use if you intend to deploy through the google play store, so unless if you 
absolutely have a need for the permission (such as a File manager kind of app), 
you should be using the granular permissions.
   
   I've added this to the 8.x milestone as it will require a breaking change 
(we need the cordova-android@12 which is currently in development for SDK 33.
   
   > Are there any known workarounds / alternatives ?
   
   I don't think there is an easy way. At minimum, you'll need to fork and get 
your hands dirty to monkey patch in requesting the appropriate permissions.
   
   A workaround would require:
   1. cordova-android@11 (as it has API 31+ support)
   2. `android-buildToolsVersion` preference set to `33.0.0` (or the latest 
patch available, ideally). Android SDK Manager also needs to be used to install 
the build tools version.
   3. `android-compileSdkVesion` set to `33`
   4. `android-targetSdkVersion` set to `33`
   5. Potentially updates to additional androidx dependencies if any of them 
has a max sdk version set that is less than `33`
   6. Update to 
https://github.com/apache/cordova-plugin-file/blob/b32be30e4bd012f9d9568a9cc11926b2ad6c14f7/src/android/FileUtils.java#L106
 to add the new permissions. Note that `READ_EXTERNAL_STORAGE` I think is still 
required if your app can run on devices pre-API 33. `WRITE_EXTERNAL_STORAGE` I 
believe is still required if your app can run on devices pre-API 29.
   7. 
https://github.com/apache/cordova-plugin-file/blob/b32be30e4bd012f9d9568a9cc11926b2ad6c14f7/src/android/FileUtils.java#L580
 will need to be updated to use the one of the new read permissions if the API 
is >= 33, and falback to `READ_EXTERNAL_STORAGE` otherwise.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to