Compare commits
2 Commits
719faa31ee
...
f4e47c1827
Author | SHA1 | Date |
---|---|---|
Matéo Duparc | f4e47c1827 | |
Matéo Duparc | 5474d6eea5 |
|
@ -21,7 +21,7 @@ if (hasProperty("nosplits")) {
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 34
|
compileSdk 34
|
||||||
ndkVersion "25.2.9519653"
|
ndkVersion "26.1.10909125"
|
||||||
namespace "sushi.hardcore.droidfs"
|
namespace "sushi.hardcore.droidfs"
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
@ -58,6 +58,7 @@ android {
|
||||||
splits {
|
splits {
|
||||||
abi {
|
abi {
|
||||||
enable true
|
enable true
|
||||||
|
reset() // fix unknown bug (https://ru.stackoverflow.com/questions/1557805/abis-armeabi-mips-mips64-riscv64-are-not-supported-for-platform)
|
||||||
universalApk true
|
universalApk true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ object FileTypes {
|
||||||
private val FILE_EXTENSIONS = mapOf(
|
private val FILE_EXTENSIONS = mapOf(
|
||||||
Pair("image", listOf("png", "jpg", "jpeg", "gif", "webp", "bmp", "heic")),
|
Pair("image", listOf("png", "jpg", "jpeg", "gif", "webp", "bmp", "heic")),
|
||||||
Pair("video", listOf("mp4", "webm", "mkv", "mov")),
|
Pair("video", listOf("mp4", "webm", "mkv", "mov")),
|
||||||
Pair("audio", listOf("mp3", "ogg", "m4a", "wav", "flac")),
|
Pair("audio", listOf("mp3", "ogg", "m4a", "wav", "flac", "opus")),
|
||||||
Pair("pdf", listOf("pdf")),
|
Pair("pdf", listOf("pdf")),
|
||||||
Pair("text", listOf(
|
Pair("text", listOf(
|
||||||
"asc",
|
"asc",
|
||||||
|
|
|
@ -236,14 +236,21 @@ class VolumeProvider: DocumentsProvider() {
|
||||||
): String? {
|
): String? {
|
||||||
if (!usfExpose || !usfSafWrite) return null
|
if (!usfExpose || !usfSafWrite) return null
|
||||||
val document = parseDocumentId(parentDocumentId) ?: return null
|
val document = parseDocumentId(parentDocumentId) ?: return null
|
||||||
val newFile = PathUtils.pathJoin(document.path, displayName)
|
val path = PathUtils.pathJoin(document.path, displayName)
|
||||||
val f = document.encryptedVolume.openFileWriteMode(newFile)
|
var success = false
|
||||||
return if (f == -1L) {
|
if (mimeType == DocumentsContract.Document.MIME_TYPE_DIR) {
|
||||||
Log.e(TAG, "Failed to create file: $document")
|
success = document.encryptedVolume.mkdir(path)
|
||||||
null
|
|
||||||
} else {
|
} else {
|
||||||
document.encryptedVolume.closeFile(f)
|
val f = document.encryptedVolume.openFileWriteMode(path)
|
||||||
document.rootId+newFile
|
if (f != -1L) {
|
||||||
|
document.encryptedVolume.closeFile(f)
|
||||||
|
success = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return if (success) {
|
||||||
|
document.rootId+path
|
||||||
|
} else {
|
||||||
|
null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.9.0'
|
ext.kotlin_version = '1.9.22'
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:8.1.1'
|
classpath 'com.android.tools.build:gradle:8.2.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,4 +15,5 @@ android.useAndroidX=true
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
|
|
||||||
android.native.buildOutput=verbose
|
android.native.buildOutput=verbose
|
||||||
android.nonTransitiveRClass=false
|
android.nonTransitiveRClass=false
|
||||||
|
org.gradle.configuration-cache=true
|
Loading…
Reference in New Issue