yiharng opened a new issue, #650:
URL: https://github.com/apache/cordova-plugin-file/issues/650

   # Bug Report
   
   ## Problem
   
   The following code will cause an error in Android 15 when using an external 
SD Card
   
   ```javascript
   window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function()
   {
     
window.resolveLocalFileSystemURL("file:///storage/0000-0000/Android/data/xxx.xxx.xxx.xxx/files",function(d)
     {
       d.createReader().readEntries(function(ok)
       {
          console.log("ok");
       },function(err)
       {
          console.log("err");
       });
     },errfunc);
   },errfunc);
   
   ```
   
   I modified FileUtils.java in the source code as shown below. After adding 
annotations, the program can run normally. However, this modification method is 
not ideal.
   
   ```javascript
   
           } else if (action.equals("readEntries")) {
               threadhelper(new FileOp() {
                   public void run(JSONArray args) throws 
FileNotFoundException, JSONException, MalformedURLException, IOException {
                       String directory = args.getString(0);
                       String nativeURL = 
resolveLocalFileSystemURI(directory).getString("nativeURL");
   /*                    
                       if (needPermission(nativeURL, READ)) {
                           getReadPermission(rawArgs, ACTION_READ_ENTRIES, 
callbackContext);
                       } else {
   */                    
                           JSONArray entries = readEntries(directory);
                           callbackContext.success(entries);
   //                    }
                   }
               }, rawArgs, callbackContext);
   
   ```
   
   


-- 
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-unsubscr...@cordova.apache.org.apache.org

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


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

Reply via email to