mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-11-27 04:16:42 -08:00
fix: Refactoring database actions
This commit is contained in:
1 parent
939b319563
commit
4bd12b8a95
16 files changed
+215
-194
No files matched your search
@@ -21,7 +21,9 @@ package com.kunzisoft.keepass.utils
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.ContentResolver
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.util.Log
|
||||
import java.io.*
|
||||
import java.util.*
|
||||
@@ -37,6 +39,14 @@ object UriHelper {
|
||||
return Uri.decode(this) ?: ""
|
||||
}
|
||||
|
||||
fun Context.getBinaryDir(): File {
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
this.applicationContext.noBackupFilesDir
|
||||
} else {
|
||||
this.applicationContext.filesDir
|
||||
}
|
||||
}
|
||||
|
||||
@Throws(FileNotFoundException::class)
|
||||
fun ContentResolver.getUriInputStream(fileUri: Uri?): InputStream? {
|
||||
if (fileUri == null)
|
||||
|
||||
Reference in new issue
Block a user