Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13481

file:///android_asset/ shouldn't require READ_EXTERNAL_STORAGE permission

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Master
    • None
    • cordova-plugin-file
    • None
    • cordova-android 6.3.0.
      Running on Android 6.0.

    Description

      On Android 6+, trying to read a file from cordova.file.applicationDirectory (file:///android_asset/) opens the runtime permissions window and asks the user "Allow AppName to access photos, media, and files on your device?". This is obviously incorrect as the app always has the permission to read its own assets.

      Sample code that shows the issue:

      function log(a) {console.log(a);};
      resolveLocalFileSystemURL(cordova.file.applicationDirectory, function(applicationDirectory) {
        applicationDirectory.getFile('www/index.js', {}, log, log);
      }, log);
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            imgx64 Ibrahim M. Ghazal
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: