1package com.peachpasswords.vault23import kotlinx.serialization.Serializable45@Serializable6data class VaultSettings(7 val accentColor: String = "peach",8 val breachMonitoring: Boolean = true,9 val autoLockMinutes: Int? = null,10 val reduceMotion: Boolean = false,11 12 val textSize: String = "medium",13 14 val uiScale: String = "auto",15 16 val faviconsEnabled: Boolean = false,17 18 val faviconConsentVersion: Int = 0,19 val biometricsEnabled: Boolean = false,20 val trashRetentionDays: Int? = null,21 val sortOrder: String = "url-first",22 23 val hideAutofillPreviews: Boolean = false,24 25 26 27 28 val passkeyProviderEnabled: Boolean = true,29 val shortcuts: Map<String, ShortcutBinding> = emptyMap(),30 val allowScreenshots: Boolean = false,31)3233internal const val CURRENT_FAVICON_CONSENT_VERSION = 1343536fun faviconsAllowed(settings: VaultSettings): Boolean =37 settings.faviconsEnabled && settings.faviconConsentVersion >= CURRENT_FAVICON_CONSENT_VERSION383940fun grantCurrentFaviconConsent(settings: VaultSettings): VaultSettings = settings.copy(41 faviconsEnabled = true,42 faviconConsentVersion = CURRENT_FAVICON_CONSENT_VERSION,43)4445internal val IMPORT_PRESENTATION_FIELDS = listOf(46 "accentColor", "textSize", "uiScale", "sortOrder", "reduceMotion",47 "shortcuts", "hideAutofillPreviews",48)495051internal val IMPORT_SECURITY_POLICY_FIELDS = listOf(52 "allowScreenshots", "faviconsEnabled", "faviconConsentVersion", "breachMonitoring",53 "autoLockMinutes", "biometricsEnabled", "passkeyProviderEnabled", "trashRetentionDays",54)5556internal fun applyImportedPresentationSettings(57 current: VaultSettings,58 imported: VaultSettings,59): VaultSettings = current.copy(60 accentColor = imported.accentColor,61 textSize = imported.textSize,62 uiScale = imported.uiScale,63 sortOrder = imported.sortOrder,64 reduceMotion = imported.reduceMotion,65 shortcuts = imported.shortcuts,66 hideAutofillPreviews = imported.hideAutofillPreviews,67)6869@Serializable70data class ShortcutBinding(71 val key: String,72 val ctrl: Boolean = false,73 val meta: Boolean = false,74 val shift: Boolean = false,75 val alt: Boolean = false,76)