From 7f17f1fafaf61a17c46c5dac327228a9f18e18e6 Mon Sep 17 00:00:00 2001 From: Avently <7953703+avently@users.noreply.github.com> Date: Thu, 20 Mar 2025 01:45:32 +0700 Subject: [PATCH] specific exception --- .../kotlin/chat/simplex/common/platform/Cryptor.android.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/platform/Cryptor.android.kt b/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/platform/Cryptor.android.kt index 07264c6f6b..e59df2f4b0 100644 --- a/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/platform/Cryptor.android.kt +++ b/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/platform/Cryptor.android.kt @@ -2,8 +2,7 @@ package chat.simplex.common.platform import android.annotation.SuppressLint import android.os.Build -import android.security.keystore.KeyGenParameterSpec -import android.security.keystore.KeyProperties +import android.security.keystore.* import chat.simplex.common.views.helpers.AlertManager import chat.simplex.common.views.helpers.generalGetString import chat.simplex.res.MR @@ -81,7 +80,7 @@ internal class Cryptor: CryptorInterface { val key = keyGenerator.generateKey() Log.w(TAG, "StrongBox support is present") key - } catch (e: Exception) { + } catch (e: StrongBoxUnavailableException) { Log.w(TAG, "No StrongBox support") keyGenerator.init(builder.setIsStrongBoxBacked(false).build()) keyGenerator.generateKey()