MauriceFrank commented on issue #577:
URL: 
https://github.com/apache/cordova-plugin-file/issues/577#issuecomment-1636185944

   > > I Can access files with the READ-permission but it seems like removing 
and writing files is a problem on Android 13.
   > 
   > PR #581 really only fixes the plugin by removing the request attempt on 
API 33+ for the obsolete `WRITE_EXTERNAL_STORAGE` permission which on API 33 is 
an auto rejection.
   > 
   > It assumes `true` which is not necessarily the case. With the scoped 
storage system that Android has, you no longer need permission to write to 
external storage, however cannot modify files owned by other apps, which is not 
possible at all using any file-system APIs. There is no permission grant that 
the app itself can request to gain permission to modify other app's files.
   > 
   > Instead, apps is suppose to use the `MediaStore` API which allows the app 
to request permission to write to a specific file (assuming that the owning app 
has a content provider implemented), allowing a temporary write grant to your 
app owned by a third-party app.
   > 
   > I've wrote a pretty large 
[comment](https://github.com/apache/cordova-plugin-file/issues/568#issuecomment-1635875461)
 elsewhere that explains the nuances with interfacing the file plugin with the 
MediaStore API. TL;DR; I don't think it's feasible and if you require write 
access to third-party files, then you'll probably need a separate plugin that 
interfaces with the MediaStore API.
   
   Thanks for the detailed calrifications! I was part of this Androdi 13 
conversation here too some weeks ago when I created a PR to fix Read 
permissions. This solved it at least for reading images in the gallery for me. 
I saw that it got merged. Still I noticed it is not the full solution and at 
this time I knew you were all waiting for cordova-android 12 which is finally 
here! I Just saw today that there is cordova-android 12 and the update on this 
plugin and im happy that it is still maintained by the community and you.
   
   Unfortunately as I see now, Android is only allowing read-permissions to 
external storage with the normal file-system as you described in your post.
   So I really have to try alternative cordova plugisn using the MediaStore. I 
did not have success in the past with some of them but there might be updates 
and since the cordova-android 12 release, it might have changed too,
   
   I will give  this plugin another try 
https://github.com/apache/cordova-plugin-file/issues/cordova-plugin-saf-mediastore.
   At least only for the parts, where I have to remove images from the gallery.
   
   Thank you for all the research!


-- 
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