Skip to content

Commit

Permalink
[Android] Fix passing through content:// URLs with certain escapes
Browse files Browse the repository at this point in the history
Apparently Android checks for equivalence of the passed URLs at a string level
when looking up URI grants. It has to be fully encoded to match properly.

Fixes #256
  • Loading branch information
Vogtinator committed Mar 28, 2022
1 parent d2974f4 commit 285f15d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qmlbridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,9 @@ QUrl QMLBridge::dir(QString path)

QString QMLBridge::toLocalFile(QUrl url)
{
// Pass through Android content url, see fopen_utf8
if(url.scheme() == QStringLiteral("content"))
return url.toString(); // Pass through Android content url
return url.toString(QUrl::FullyEncoded);

return url.toLocalFile();
}
Expand Down

0 comments on commit 285f15d

Please sign in to comment.