diff --git a/account/src/iosMain/kotlin/com/privateinternetaccess/account/internals/persistency/secureSettings/SecureSettingsProvider.kt b/account/src/iosMain/kotlin/com/privateinternetaccess/account/internals/persistency/secureSettings/SecureSettingsProvider.kt index 17fb7bd..4ecd1eb 100644 --- a/account/src/iosMain/kotlin/com/privateinternetaccess/account/internals/persistency/secureSettings/SecureSettingsProvider.kt +++ b/account/src/iosMain/kotlin/com/privateinternetaccess/account/internals/persistency/secureSettings/SecureSettingsProvider.kt @@ -1,12 +1,22 @@ package com.privateinternetaccess.account.internals.persistency.secureSettings +import com.russhwolf.settings.ExperimentalSettingsImplementation import com.russhwolf.settings.KeychainSettings import com.russhwolf.settings.Settings +import kotlinx.cinterop.ExperimentalForeignApi +import platform.Foundation.CFBridgingRetain +import platform.Security.kSecAttrAccessible +import platform.Security.kSecAttrAccessibleAlways +import platform.Security.kSecAttrService internal actual object SecureSettingsProvider { private const val KEYCHAIN_NAME = "account_keychain" + @OptIn(ExperimentalSettingsImplementation::class, ExperimentalForeignApi::class) actual val settings: Settings? - get() = KeychainSettings(KEYCHAIN_NAME) + get() = KeychainSettings( + kSecAttrService to CFBridgingRetain(KEYCHAIN_NAME), + kSecAttrAccessible to kSecAttrAccessibleAlways + ) } \ No newline at end of file