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

Christoph Brosdau commented on CB-11592:
----------------------------------------

As mentioned above - I can confirm that is happens in Camera (somehwere, a 
"file" URI seems to be exposed), the complete File Plugin is based on the Idea 
of returning file:// URLs (mostly), which should be avoided. inAppBrowser is 
not really a bug, I think - if i give it a file:// URI (e.g. for opening a 
PDF), then it will crash. But thats due to the fact, that I give it a file:// 
URI for external purposes, and thats forbidden. I think, in Camera, there is a 
Bug. In File Plugin, there should be a more general approach - how to deal with 
File URIs in future Versions (implement a FileProvider, Content URI, Temporary 
Permissions etc - probably). But thats really a huge amount of work to think 
of. (For our specific needs, I created a new local Plugin, which handles PDF 
Download (still works with Cordova), but the opening (until 6.0  simply via 
inAppBrowser) is now completely different (it uses Changes in Manifest, a local 
FileProvider, Share Intents with temporary Permissions, as outlined by Google). 
So for sure its possible, but far more complicated than before - at least in 
our case.
If the behaviour of inAppBrowser is really a bug - depends on your point of 
View, I would say.


> Crashes due to android 7.0 "file://" Handling 
> "android.os.FileUriExposedException"
> ----------------------------------------------------------------------------------
>
>                 Key: CB-11592
>                 URL: https://issues.apache.org/jira/browse/CB-11592
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Plugin Camera, Plugin File, Plugin InAppBrowser
>         Environment: all Environemnts with android 7.0
>            Reporter: Christoph Brosdau
>            Assignee: Joe Bowser
>            Priority: Blocker
>
> Android 7.0 removes the "file://" Protocol or to be more precise, removes the 
> possibility to share URIs with "file://" Protocol outside the Scope of the 
> own App. If some Code tries this, the result is 
> "android.os.FileUriExposedException".
> This affects a variety of Plugins:
> - inAppBrowser: opening a file:// URI (e.g. to show a downloaded PDF) crasehs 
> the app, 
> - Camera crashes immediately: opening a cached File by 
> "ClipData.Item.getUri()"
> - possible a couple of the File Plugin Methods



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to