You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "hrp03 (via GitHub)" <gi...@apache.org> on 2023/10/30 02:51:20 UTC

[PR] Android : Added write permission check for Android devices of platfor… [cordova-plugin-file]

hrp03 opened a new pull request, #611:
URL: https://github.com/apache/cordova-plugin-file/pull/611

   
   ### Platforms affected
   
   Android
   
   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   <!-- If it fixes an open issue, please link to the issue here. -->
   
   When writing a file on Android devices where version is >= 13 getting false as permission while checking runtime write permission. 
   
   
   ### Description
   <!-- Describe your changes in detail -->
   
   On Android devices >= 13 the write permission has not been checked and it always returns as false. This is happening in FileUtils.java file in getWritePermission method.
   
   The same issue also has been raised and it this pull request will solve that
   
   https://github.com/apache/cordova-plugin-file/issues/610
   
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   
   Tested the code on real devices where android versions are 11, 12, and 13 respectively. Able to write files now.
   
   ### Checklist
   
   - [X ] I've run the tests to see all new and existing tests pass
   - [ ] I added automated test coverage as appropriate for this change
   - [ X] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   - [ X] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [ ] I've updated the documentation if necessary
   


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [PR] Android : Added write permission check for Android devices of platfor… [cordova-plugin-file]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek closed pull request #611: Android : Added write permission check for Android devices of platfor…
URL: https://github.com/apache/cordova-plugin-file/pull/611


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [PR] Android : Added write permission check for Android devices of platfor… [cordova-plugin-file]

Posted by "erisu (via GitHub)" <gi...@apache.org>.
erisu commented on PR #611:
URL: https://github.com/apache/cordova-plugin-file/pull/611#issuecomment-1784609093

   Those are read permissions and has nothing to do with write.
   
   https://developer.android.com/reference/android/Manifest.permission#READ_MEDIA_AUDIO
   
   https://developer.android.com/reference/android/Manifest.permission#READ_MEDIA_IMAGES
   
   https://developer.android.com/reference/android/Manifest.permission#READ_MEDIA_VIDEO
   
   Doc for each permission say:
   
   > Allows an application to read <...> files from external storage.


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [PR] Android : Added write permission check for Android devices of platfor… [cordova-plugin-file]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on PR #611:
URL: https://github.com/apache/cordova-plugin-file/pull/611#issuecomment-1785084186

   With scoped storage you don't need permissions to write to external storage, however it's forbidden to modify files that isn't owned by you. Android offers no permission to allow modifying other app's external files. (e.g. there is no `WRITE_MEDIA_IMAGES`).  This is documented [here](https://github.com/apache/cordova-plugin-file/tree/master#androids-external-storage-quirks), in short if you want to modify another app's external file, you'll need a plugin that interfaces with the `MediaStore` API.
   
   The [hasWritePermission](https://github.com/apache/cordova-plugin-file/blob/265a932f3b5d11739fd08c0437477f441f6212c7/src/android/FileUtils.java#L573) will always return true to allow you to write to your own external files.
   
   This change isn't in a stable release yet, but a release that contains this patch is being voted on and assuming there are no objections, we should have a release soon and it should address the concern that you're attempting to address.


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org