1 Commits
Author SHA1 Message Date
SSimco ab53e98288 Fixed conversion from native paths 2024-09-22 07:18:29 +03:00
@@ -22,11 +22,15 @@ public class FileUtil {
private static String toCppPath(Uri uri) { private static String toCppPath(Uri uri) {
String uriPath = uri.toString(); String uriPath = uri.toString();
int delimiterPos = uriPath.lastIndexOf(COLON_ENCODED); int delimiterPos = uriPath.lastIndexOf(COLON_ENCODED);
if (delimiterPos == -1)
return uriPath;
return uriPath.substring(0, delimiterPos) + uriPath.substring(delimiterPos).replace(PATH_SEPARATOR_ENCODED, PATH_SEPARATOR_DECODED); return uriPath.substring(0, delimiterPos) + uriPath.substring(delimiterPos).replace(PATH_SEPARATOR_ENCODED, PATH_SEPARATOR_DECODED);
} }
private static Uri fromCppPath(String cppPath) { private static Uri fromCppPath(String cppPath) {
int delimiterPos = cppPath.lastIndexOf(COLON_ENCODED); int delimiterPos = cppPath.lastIndexOf(COLON_ENCODED);
if (delimiterPos == -1)
return Uri.parse(cppPath);
return Uri.parse(cppPath.substring(0, delimiterPos) + cppPath.substring(delimiterPos).replace(PATH_SEPARATOR_DECODED, PATH_SEPARATOR_ENCODED)); return Uri.parse(cppPath.substring(0, delimiterPos) + cppPath.substring(delimiterPos).replace(PATH_SEPARATOR_DECODED, PATH_SEPARATOR_ENCODED));
} }