diff --git a/README.md b/README.md index e666dcb..afdb150 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ repositories { ```kotlin dependencies { - implementation("io.github.lumkit:lint-file:1.0.2") + implementation("io.github.lumkit:lint-file:1.0.3") } ``` diff --git a/file-android/src/main/java/io/github/lumkit/io/impl/StorageAccessFrameworkFile.kt b/file-android/src/main/java/io/github/lumkit/io/impl/StorageAccessFrameworkFile.kt index ef8be89..5481d1d 100644 --- a/file-android/src/main/java/io/github/lumkit/io/impl/StorageAccessFrameworkFile.kt +++ b/file-android/src/main/java/io/github/lumkit/io/impl/StorageAccessFrameworkFile.kt @@ -5,9 +5,14 @@ import androidx.documentfile.provider.DocumentFile import io.github.lumkit.io.LintFile import io.github.lumkit.io.LintFileConfiguration import io.github.lumkit.io.absolutePath +import io.github.lumkit.io.androidPath +import io.github.lumkit.io.documentFileUri import io.github.lumkit.io.documentReallyUri +import io.github.lumkit.io.primaryChildPath +import io.github.lumkit.io.uri import java.io.File import java.io.FileNotFoundException +import java.io.IOException class StorageAccessFrameworkFile : LintFile { diff --git a/file-android/src/main/java/io/github/lumkit/io/impl/SuFile.kt b/file-android/src/main/java/io/github/lumkit/io/impl/SuFile.kt index d2fe9a9..e2bc699 100644 --- a/file-android/src/main/java/io/github/lumkit/io/impl/SuFile.kt +++ b/file-android/src/main/java/io/github/lumkit/io/impl/SuFile.kt @@ -1,6 +1,7 @@ package io.github.lumkit.io.impl import io.github.lumkit.io.LintFile +import io.github.lumkit.io.pathHandle import java.io.File class SuFile: LintFile { @@ -29,7 +30,7 @@ class SuFile: LintFile { constructor(file: LintFile, child: String): super(file, child) internal val suFile by lazy { - com.topjohnwu.superuser.io.SuFile(path) + com.topjohnwu.superuser.io.SuFile(path.pathHandle(false)) } override fun exists(): Boolean = suFile.exists() diff --git a/file-android/src/main/java/io/github/lumkit/io/io.kt b/file-android/src/main/java/io/github/lumkit/io/io.kt index 18dfe7e..a55e157 100644 --- a/file-android/src/main/java/io/github/lumkit/io/io.kt +++ b/file-android/src/main/java/io/github/lumkit/io/io.kt @@ -82,7 +82,7 @@ fun String.pathHandle(hide: Boolean = true): String = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && hide) { this.replace("Android", "Android\u200d") } else { - this + this.replace("\u200d", "") } @Throws(IOException::class) diff --git a/file-android/src/main/java/io/github/lumkit/io/saf.kt b/file-android/src/main/java/io/github/lumkit/io/saf.kt index 042ebbf..ec9866a 100644 --- a/file-android/src/main/java/io/github/lumkit/io/saf.kt +++ b/file-android/src/main/java/io/github/lumkit/io/saf.kt @@ -70,7 +70,7 @@ fun String.getPrivateRootPath(): String { val builder = StringBuilder() for (i in 0 until if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) 6 else 5) { builder.append("/") - .append(list[i]) + .append(list[i].replace("\u200d", "")) } return builder.toString() } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index efa05de..7d5183c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ composeBom = "2023.08.00" vanniktech = "0.28.0" appcompat = "1.6.1" material = "1.10.0" -lint-file = "1.0.2" +lint-file = "1.0.3" kotlinx-serialization = "1.6.3" lifecycle-runtime = "2.7.0" runtimeLivedata = "1.5.4"