Skip to content

Commit

Permalink
FileUtils: Fixed cannot add external storage as wine drive.
Browse files Browse the repository at this point in the history
  • Loading branch information
longjunyu2 committed Aug 27, 2024
1 parent 4118b8a commit 5fa0dcb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/main/java/com/winlator/core/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Stack;
import java.util.UUID;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -268,6 +266,9 @@ public static String getFilePathFromUri(Uri uri) {
String[] parts = uri.getLastPathSegment().split(":");
if (parts[0].equalsIgnoreCase("primary"))
path = Environment.getExternalStorageDirectory() + "/" + parts[1];
else
// FIXME: may won't work on future Android System.
path = "/storage/" + parts[0] + '/' + parts[1];
}
return path;
}
Expand Down

0 comments on commit 5fa0dcb

Please sign in to comment.