From 6938f2f5a2420928eae0d5722699a2330d234b9f Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 13 Dec 2022 11:11:22 +0100 Subject: [PATCH] @7.0.0 resolveLocalFileSystemURL a content uri get a FileError #525 --- src/android/ContentFilesystem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/android/ContentFilesystem.java b/src/android/ContentFilesystem.java index f4df440d..62c034d9 100644 --- a/src/android/ContentFilesystem.java +++ b/src/android/ContentFilesystem.java @@ -45,7 +45,8 @@ public ContentFilesystem(Context context, CordovaResourceApi resourceApi, Cordov @Override public Uri toNativeUri(LocalFilesystemURL inputURL) { - String authorityAndPath = inputURL.uri.getEncodedPath().substring(this.name.length() + 2); + String encodedPath = inputURL.uri.getEncodedPath(); + String authorityAndPath = encodedPath.substring(encodedPath.indexOf(this.name) + 1 + this.name.length() + 2); if (authorityAndPath.length() < 2) { return null; }