fix(vault): исправил шифрование, meta Yandex и enc-meta при первом открытии

Remember key после encrypt, мягкий auto-open в UnlockManager,
StorageMetaLoadState без затирания meta на сетевых ошибках,
фильтр storages в YandexVault и создание .enc-meta при FileNotFound.
This commit is contained in:
2026-05-21 11:05:14 +03:00
parent da8b970078
commit 467ed64426
10 changed files with 95 additions and 25 deletions

View File

@@ -0,0 +1,7 @@
package com.github.nullptroma.wallenc.domain.datatypes
enum class StorageMetaLoadState {
Loading,
Ready,
Unavailable,
}

View File

@@ -1,6 +1,7 @@
package com.github.nullptroma.wallenc.domain.interfaces
import com.github.nullptroma.wallenc.domain.datatypes.StorageEncryptionInfo
import com.github.nullptroma.wallenc.domain.datatypes.StorageMetaLoadState
import com.github.nullptroma.wallenc.domain.tasks.TaskProgress
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.StateFlow
@@ -14,6 +15,7 @@ sealed interface IStorageInfo {
val numberOfFiles: StateFlow<Int?>
val isEmpty: Flow<Boolean?>
val metaInfo: StateFlow<IStorageMetaInfo>
val metaLoadState: StateFlow<StorageMetaLoadState>
val isVirtualStorage: Boolean
}

View File

@@ -16,6 +16,8 @@ interface IUnlockManager {
fun getOpenedStorageKey(uuid: UUID): EncryptKey?
suspend fun open(storage: IStorage, key: EncryptKey, rememberPassword: Boolean = true): IStorage
/** Сохранить ключ для auto-open без открытия виртуального storage. */
suspend fun rememberKey(storage: IStorage, key: EncryptKey)
suspend fun close(storage: IStorage)
suspend fun close(uuid: UUID)
}