Updated on 2026-08-14
This commit is contained in:
commit
4f3457cec3
11 changed files with 36 additions and 17 deletions
|
|
@ -221,8 +221,9 @@ dependencies {
|
|||
implementation(projects.features.usedesk.impl)
|
||||
implementation(projects.features.hotWallet.api)
|
||||
implementation(projects.features.hotWallet.impl)
|
||||
implementation(projects.features.kyc.api)
|
||||
implementation(projects.features.kyc.impl)
|
||||
//TODO disable for release because of the permissions
|
||||
// implementation(projects.features.kyc.api)
|
||||
// implementation(projects.features.kyc.impl)
|
||||
implementation(projects.features.welcome.api)
|
||||
implementation(projects.features.welcome.impl)
|
||||
implementation(projects.features.createWalletSelection.api)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ internal class DefaultVisaAuthTokenStorage @Inject constructor(
|
|||
private val secureStorage by lazy {
|
||||
AndroidSecureStorageV2(
|
||||
appContext = applicationContext,
|
||||
useStrongBox = false,
|
||||
name = "visa_auth_storage",
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ class DefaultVisaOTPStorage @Inject constructor(
|
|||
private val secureStorage by lazy {
|
||||
AndroidSecureStorageV2(
|
||||
appContext = applicationContext,
|
||||
useStrongBox = false,
|
||||
name = "visa_otp_storage",
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,8 +49,9 @@ internal object UserWalletsListManagerModule {
|
|||
return GeneralUserWalletsListManager(
|
||||
runtimeUserWalletsListManager = RuntimeUserWalletsListManager(),
|
||||
biometricUserWalletsListManager = createBiometricUserWalletsListManager(
|
||||
applicationContext,
|
||||
analyticsEventHandler,
|
||||
applicationContext = applicationContext,
|
||||
analyticsEventHandler = analyticsEventHandler,
|
||||
dispatchers = dispatchers,
|
||||
),
|
||||
appPreferencesStore = appPreferencesStore,
|
||||
dispatchers = dispatchers,
|
||||
|
|
@ -60,6 +61,7 @@ internal object UserWalletsListManagerModule {
|
|||
private fun createBiometricUserWalletsListManager(
|
||||
applicationContext: Context,
|
||||
analyticsEventHandler: AnalyticsEventHandler,
|
||||
dispatchers: CoroutineDispatcherProvider,
|
||||
): UserWalletsListManager {
|
||||
val moshi = Moshi.Builder()
|
||||
.add(WalletDerivedKeysMapAdapter())
|
||||
|
|
@ -83,8 +85,14 @@ internal object UserWalletsListManagerModule {
|
|||
),
|
||||
androidSecureStorageV2 = AndroidSecureStorageV2(
|
||||
appContext = applicationContext,
|
||||
useStrongBox = true,
|
||||
name = "user_wallets_storage2",
|
||||
),
|
||||
androidSecureStorageV3 = AndroidSecureStorageV2(
|
||||
appContext = applicationContext,
|
||||
useStrongBox = false,
|
||||
name = "user_wallets_storage3",
|
||||
),
|
||||
)
|
||||
|
||||
val authenticatedStorage = AuthenticatedStorage(
|
||||
|
|
@ -114,7 +122,10 @@ internal object UserWalletsListManagerModule {
|
|||
secureStorage = secureStorage,
|
||||
)
|
||||
|
||||
val selectedUserWalletRepository = DefaultSelectedUserWalletRepository(secureStorage = secureStorage)
|
||||
val selectedUserWalletRepository = DefaultSelectedUserWalletRepository(
|
||||
secureStorage = secureStorage,
|
||||
dispatchers = dispatchers,
|
||||
)
|
||||
|
||||
return BiometricUserWalletsListManager(
|
||||
keysRepository = keysRepository,
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ internal class BiometricUserWalletsListManager(
|
|||
}
|
||||
}
|
||||
|
||||
private fun findOrSetSelectedWallet(
|
||||
private suspend fun findOrSetSelectedWallet(
|
||||
prevSelectedWalletId: UserWalletId?,
|
||||
prevSelectedWalletIndex: Int,
|
||||
userWallets: List<UserWallet>,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@ package com.tangem.tap.domain.userWalletList.repository
|
|||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
|
||||
internal interface SelectedUserWalletRepository {
|
||||
fun get(): UserWalletId?
|
||||
fun set(walletId: UserWalletId?)
|
||||
suspend fun get(): UserWalletId?
|
||||
suspend fun set(walletId: UserWalletId?)
|
||||
}
|
||||
|
|
@ -3,17 +3,20 @@ package com.tangem.tap.domain.userWalletList.repository.implementation
|
|||
import com.tangem.common.services.secure.SecureStorage
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.tap.domain.userWalletList.repository.SelectedUserWalletRepository
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
internal class DefaultSelectedUserWalletRepository(
|
||||
private val secureStorage: SecureStorage,
|
||||
private val dispatchers: CoroutineDispatcherProvider,
|
||||
) : SelectedUserWalletRepository {
|
||||
override fun get(): UserWalletId? {
|
||||
return secureStorage.get(StorageKey.SelectedWalletId.name)
|
||||
override suspend fun get(): UserWalletId? = withContext(dispatchers.io) {
|
||||
secureStorage.get(StorageKey.SelectedWalletId.name)
|
||||
?.decodeToString(throwOnInvalidSequence = true)
|
||||
?.let { UserWalletId(it) }
|
||||
}
|
||||
|
||||
override fun set(walletId: UserWalletId?) {
|
||||
override suspend fun set(walletId: UserWalletId?) = withContext(dispatchers.io) {
|
||||
if (walletId == null) {
|
||||
secureStorage.delete(StorageKey.SelectedWalletId.name)
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
},
|
||||
{
|
||||
"name": "PUSH_NOTIFICATIONS_ENABLED",
|
||||
"version": "undefined"
|
||||
"version": "5.26.2"
|
||||
},
|
||||
{
|
||||
"name": "USEDESK_ENABLED",
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ android {
|
|||
|
||||
dependencies {
|
||||
/** Api */
|
||||
implementation(projects.features.kyc.api)
|
||||
//TODO disable for release because of the permissions
|
||||
// implementation(projects.features.kyc.api)
|
||||
|
||||
/** Domain */
|
||||
implementation(projects.domain.visa)
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
# https://github.com/tangem/tangem-sdk-android/
|
||||
# https://github.com/tangem/vico
|
||||
|
||||
tangemBlockchainSdk = "develop-1121"
|
||||
tangemBlockchainSdk = "develop-1124"
|
||||
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
|
||||
tangemCardSdk = "develop-501"
|
||||
tangemCardSdk = "develop-505"
|
||||
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^
|
||||
tangemVico = "2.0.0-alpha.25-tangem12"
|
||||
#tangemVico = "0.0.1" # Keep it! - used for local builds ^
|
||||
|
|
|
|||
|
|
@ -257,8 +257,9 @@ include(":features:walletconnect:impl")
|
|||
include(":features:hot-wallet:api")
|
||||
include(":features:hot-wallet:impl")
|
||||
|
||||
include(":features:kyc:api")
|
||||
include(":features:kyc:impl")
|
||||
//TODO disable for release because of the permissions
|
||||
// include(":features:kyc:api")
|
||||
// include(":features:kyc:impl")
|
||||
|
||||
include(":features:create-wallet-selection:api")
|
||||
include(":features:create-wallet-selection:impl")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue