Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b96c672a8e | |||
| 2a25e9882b | |||
| cb33d8f3e4 | |||
| db8e91eafa |
+2
-2
@@ -18,8 +18,8 @@ android {
|
||||
applicationId "net.syncthing.lite"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 26
|
||||
versionCode 19
|
||||
versionName "0.3.9"
|
||||
versionCode 20
|
||||
versionName "0.3.10"
|
||||
multiDexEnabled true
|
||||
playAccountConfig = playAccountConfigs.defaultAccountConfig
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class FileMenuDialogFragment: BottomSheetDialogFragment() {
|
||||
Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
|
||||
addCategory(Intent.CATEGORY_OPENABLE)
|
||||
|
||||
type = MimeType.getFromUrl(fileSpec.fileName)
|
||||
type = MimeType.getFromFilename(fileSpec.fileName)
|
||||
|
||||
putExtra(Intent.EXTRA_TITLE, fileSpec.fileName)
|
||||
},
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ class DownloadFileDialogFragment : DialogFragment() {
|
||||
dismissAllowingStateLoss()
|
||||
|
||||
if (outputUri == null) {
|
||||
val mimeType = MimeType.getFromUrl(fileSpec.fileName)
|
||||
val mimeType = MimeType.getFromFilename(fileSpec.fileName)
|
||||
|
||||
try {
|
||||
context!!.startActivity(
|
||||
|
||||
@@ -159,7 +159,7 @@ class SyncthingProvider : DocumentsProvider() {
|
||||
if (fileInfo.isDirectory())
|
||||
Document.MIME_TYPE_DIR
|
||||
else
|
||||
MimeType.getFromUrl(fileInfo.fileName)
|
||||
MimeType.getFromFilename(fileInfo.fileName)
|
||||
)
|
||||
add(Document.COLUMN_LAST_MODIFIED, fileInfo.lastModified)
|
||||
add(Document.COLUMN_FLAGS, 0)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.syncthing.lite.utils
|
||||
|
||||
import android.webkit.MimeTypeMap
|
||||
import net.syncthing.java.core.utils.PathUtils
|
||||
|
||||
object MimeType {
|
||||
private const val DEFAULT_MIME_TYPE = "application/octet-stream"
|
||||
@@ -11,7 +12,7 @@ object MimeType {
|
||||
return mimeType ?: DEFAULT_MIME_TYPE
|
||||
}
|
||||
|
||||
fun getFromUrl(url: String) = getFromExtension(
|
||||
MimeTypeMap.getFileExtensionFromUrl(url).toLowerCase()
|
||||
fun getFromFilename(path: String) = getFromExtension(
|
||||
PathUtils.getFileExtensionFromFilename(path).toLowerCase()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,7 +1 @@
|
||||
- update translations
|
||||
- encrypt some temporarily data which is stored on disk
|
||||
- update path validation
|
||||
- fix crash when cleaning the cache
|
||||
- fix crash of the index handler after cleaning the cache
|
||||
- convert file extensions to lower case for detecting Apps to open it
|
||||
- fix crash when accessing (e.g. trying to close) closed connections
|
||||
- fix file type detection for file names with umlauts and/ or spaces
|
||||
|
||||
@@ -59,6 +59,12 @@ fi stocate, dacă vor fi partajate cu terțe entități precum și cum vor fi
|
||||
<string name="settings_shutdown_delay_30_seconds">30 secunde</string>
|
||||
<string name="settings_shutdown_delay_1_minute">1 minut</string>
|
||||
<string name="settings_shutdown_delay_5_minutes">5 minute</string>
|
||||
<string name="dialog_warning_reconnect_problem">
|
||||
Datorită modului în care această aplicație și serverul Syncthing funcționează,
|
||||
nu se poate face reconectarea timp de câteva minute după ce aplicația a fost oprită (ștearsă din lista de aplicații care rulează)
|
||||
sau conexiunea a fost întreruptă.
|
||||
Aceasta limitare nu se aplica la conexiunile descoperite local.
|
||||
</string>
|
||||
<string name="dialog_file_save_as">Salvează ca</string>
|
||||
<string name="pending_index_updates">%d actualizări de index în așteptare</string>
|
||||
<string name="device_status_connecting">Conectare la %s</string>
|
||||
|
||||
@@ -130,4 +130,12 @@ object PathUtils {
|
||||
|
||||
return dir.removeSuffix(PATH_SEPARATOR) + file
|
||||
}
|
||||
|
||||
fun getFileExtensionFromFilename(filename: String): String {
|
||||
assertFilenameValid(filename)
|
||||
|
||||
val dotIndex = filename.lastIndexOf(".")
|
||||
|
||||
return if (dotIndex != 0) filename.substring(dotIndex + 1) else ""
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user