[ 
https://issues.apache.org/jira/browse/CB-11305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15297678#comment-15297678
 ] 

zhuisui edited comment on CB-11305 at 5/24/16 5:46 AM:
-------------------------------------------------------

I just debug in src code.Find these two things:

1. I change code in 
org.apache.cordova.file.AssetFilesystem.filesystemPathForURL(LocalFilesystemURL 
url) method, which was "return null" and is "return new File(rootUri.getPath(), 
url.path).toString()". Now "resourceApi.remapUri(origUri)" in 
SystemWebViewClient.shouldInterceptRequest() can return correct value of 
"cdvfile://localhost/assets/path" as "file:///android_asset/path", and script 
tag reads right content.

2.I use "cdvfile://localhost/temporary/path" which is related to correct path, 
but a IOException is thrown and message is "permission deny". I have set 
permission of storage to open. If I use 
"cdvfile://localhost/cache-external/path", it could be access. That means app 
has no permission to access applicationStorageDirectory as 
"root/data/user/0/app-id/cache".


was (Author: zyf0330):
I just debug in src code.Find these two things:

1. I change code in 
org.apache.cordova.file.AssetFilesystem.filesystemPathForURL(LocalFilesystemURL 
url) method, which was "return null" and is "return new File(rootUri.getPath(), 
url.path).toString()". Now "resourceApi.remapUri(origUri)" in 
SystemWebViewClient.shouldInterceptRequest() can return correct value of 
"cdvfile://localhost/assets/path" as "file:///android_asset/path", and script 
tag reads right content.

2.I use "cdvfile://localhost/temporary/path" which is related to correct path, 
but a IOException is thrown and message is "permission deny". I have set 
permission of storage to open. If I use 
"cdvfile://localhost/cache-external/path", it could be access.

> use cdvfile: cannot import image or js
> --------------------------------------
>
>                 Key: CB-11305
>                 URL: https://issues.apache.org/jira/browse/CB-11305
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File
>    Affects Versions: 6.2.0
>         Environment: cordova 6.6.1
> android 5.1.1
>            Reporter: zhuisui
>
> I use cdvfile://localhost/assets/path to show img and import js, and it 
> doesn't work. I haven't seen anything about using with assets, but 
> window.resolveLocalFileSystemURL can handle it to native URL 
> file:///android_asset/path, so I think it should be normal as expected.
> And I didn't test about cdvfile://localhost/temporary|persistent.
> And, I use cordova-cli 6.6.1, but it is not in "Affects Version/s".



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to