Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fun String.parent(): String {
}
val parentPath = folderTree.take(folderTree.size - 1).joinToString("/", "/")
return if (parentPath.startsWith(SimpleStorage.externalStoragePath)
|| parentPath.matches(Regex("/storage/[A-Z0-9]{4}-[A-Z0-9]{4}(.*?)"))
|| parentPath.matches(Regex("/storage/[A-Z0-9-]+(.*?)"))
|| Build.VERSION.SDK_INT < 21 && parentPath.startsWith(SimpleStorage.KITKAT_SD_CARD_PATH)
) {
parentPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ object DocumentFileCompat {
val FILE_NAME_DUPLICATION_REGEX_WITHOUT_EXTENSION = Regex("(.*?) \\(\\d+\\)")

@RestrictTo(RestrictTo.Scope.LIBRARY)
val SD_CARD_STORAGE_ID_REGEX = Regex("[A-Z0-9]{4}-[A-Z0-9]{4}")
val SD_CARD_STORAGE_ID_REGEX = Regex("[A-Z0-9-]+")

@RestrictTo(RestrictTo.Scope.LIBRARY)
val SD_CARD_STORAGE_PATH_REGEX = Regex("/storage/$SD_CARD_STORAGE_ID_REGEX(.*?)")
Expand Down