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

Marshmallow always request permissions when accessing files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.4.1
    • None
    • cordova-plugin-file
    • Android 6.0, cordova-cli 5.4.1, cordova-plugin-file 4.1.0, cordova-android 5.0.0

    Description

      Hi guys is there any sense in this code in FileUtils.java:

      if(dirname.contains(cordova.getActivity().getPackageName()) ||
                                  hasReadPermission()) {
          ....
      }
      

      dirname is always look like 'cdvfile://localhost...' this is why it never contains package name. So marshmallow will always request permissions to write to the external storage.

      I'm trying to write to the cordova.file.dataDirectory folder.

      Attachments

        Activity

          People

            rakatyal Raghav Katyal
            kanoshin Kirill Anoshin
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: