Updated on 2026-08-14
This commit is contained in:
parent
3e1f52942c
commit
282cc27cb4
7 changed files with 10 additions and 15 deletions
|
|
@ -246,12 +246,13 @@ class TangemSdkManager(private val cardSdkConfigRepository: CardSdkConfigReposit
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@Deprecated("Use [DefaultCardSdkProvider] instead")
|
||||||
val config = Config(
|
val config = Config(
|
||||||
linkedTerminal = true,
|
linkedTerminal = true,
|
||||||
allowUntrustedCards = true,
|
allowUntrustedCards = true,
|
||||||
filter = CardFilter(
|
filter = CardFilter(
|
||||||
allowedCardTypes = FirmwareVersion.FirmwareType.values().toList(),
|
allowedCardTypes = FirmwareVersion.FirmwareType.values().toList(),
|
||||||
maxFirmwareVersion = FirmwareVersion(major = 6, minor = 21),
|
maxFirmwareVersion = FirmwareVersion(major = 6, minor = 33),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class ScanProductTask(
|
||||||
}
|
}
|
||||||
val cardDto = CardDTO(card)
|
val cardDto = CardDTO(card)
|
||||||
|
|
||||||
val error = getErrorIfExcludedCard(cardDto, card)
|
val error = getErrorIfExcludedCard(cardDto)
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
callback(CompletionResult.Failure(error))
|
callback(CompletionResult.Failure(error))
|
||||||
return
|
return
|
||||||
|
|
@ -81,11 +81,9 @@ class ScanProductTask(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getErrorIfExcludedCard(cardDto: CardDTO, card: Card): TangemError? {
|
private fun getErrorIfExcludedCard(cardDto: CardDTO): TangemError? {
|
||||||
if (cardDto.isExcluded) return TapSdkError.CardForDifferentApp
|
if (cardDto.isExcluded) return TapSdkError.CardForDifferentApp
|
||||||
if (cardDto.isNotSupportedInThatRelease) return TapSdkError.CardNotSupportedByRelease
|
if (cardDto.isNotSupportedInThatRelease) return TapSdkError.CardNotSupportedByRelease
|
||||||
// todo check isImported to prevent using old app with imported wallet, remove before wallet 2.0 enabled ([REDACTED_TASK_KEY])
|
|
||||||
if (card.wallets.any { it.isImported }) return TapSdkError.CardNotSupportedByRelease
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import com.tangem.common.extensions.guard
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
import com.tangem.core.navigation.AppScreen
|
import com.tangem.core.navigation.AppScreen
|
||||||
import com.tangem.core.navigation.NavigationAction
|
import com.tangem.core.navigation.NavigationAction
|
||||||
import com.tangem.domain.common.TapWorkarounds.canSkipBackup
|
|
||||||
import com.tangem.domain.common.util.cardTypesResolver
|
import com.tangem.domain.common.util.cardTypesResolver
|
||||||
import com.tangem.domain.common.util.twinsIsTwinned
|
import com.tangem.domain.common.util.twinsIsTwinned
|
||||||
import com.tangem.domain.models.scan.ProductType
|
import com.tangem.domain.models.scan.ProductType
|
||||||
|
|
@ -38,10 +37,7 @@ object OnboardingHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO for Shiba disabled check wallet 2, and only check canSkipBackup, enable when release wallet 2
|
response.cardTypesResolver.isWallet2() -> {
|
||||||
// ([REDACTED_TASK_KEY])
|
|
||||||
// response.cardTypesResolver.isWallet2() -> {
|
|
||||||
!response.card.canSkipBackup -> {
|
|
||||||
val emptyWallets = response.card.wallets.isEmpty()
|
val emptyWallets = response.card.wallets.isEmpty()
|
||||||
val activationInProgress = cardInfoStorage.isActivationInProgress(cardId)
|
val activationInProgress = cardInfoStorage.isActivationInProgress(cardId)
|
||||||
val backupNotActive = response.card.backupStatus?.isActive != true
|
val backupNotActive = response.card.backupStatus?.isActive != true
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ internal class DefaultCardSdkProvider @Inject constructor() : CardSdkProvider, C
|
||||||
allowUntrustedCards = true,
|
allowUntrustedCards = true,
|
||||||
filter = CardFilter(
|
filter = CardFilter(
|
||||||
allowedCardTypes = FirmwareVersion.FirmwareType.values().toList(),
|
allowedCardTypes = FirmwareVersion.FirmwareType.values().toList(),
|
||||||
maxFirmwareVersion = FirmwareVersion(major = 4, minor = 52),
|
maxFirmwareVersion = FirmwareVersion(major = 6, minor = 33),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,7 @@ internal class TangemCardTypesResolver(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun isWallet2(): Boolean {
|
override fun isWallet2(): Boolean {
|
||||||
// todo for now disabled to prevent Shiba cards using as wallet 2, enable when release wallet 2.0 ([REDACTED_TASK_KEY])
|
return card.firmwareVersion >= FirmwareVersion.Ed25519Slip0010Available && card.settings.isKeysImportAllowed
|
||||||
return false // card.firmwareVersion >= FirmwareVersion.KeysImportAvailable && card.settings.isKeysImportAllowed
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun isTangemTwins(): Boolean = productType == ProductType.Twins
|
override fun isTangemTwins(): Boolean = productType == ProductType.Twins
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ object TapWorkarounds {
|
||||||
private const val START_2_COIN_ISSUER = "start2coin"
|
private const val START_2_COIN_ISSUER = "start2coin"
|
||||||
private const val TEST_CARD_BATCH = "99FF"
|
private const val TEST_CARD_BATCH = "99FF"
|
||||||
private const val TEST_CARD_ID_STARTS_WITH = "FF99"
|
private const val TEST_CARD_ID_STARTS_WITH = "FF99"
|
||||||
|
private val backupRequiredFirmwareVersion = FirmwareVersion(major = 6, minor = 21)
|
||||||
|
|
||||||
val CardDTO.isTangemTwins: Boolean
|
val CardDTO.isTangemTwins: Boolean
|
||||||
get() = TwinsHelper.getTwinCardNumber(cardId) != null
|
get() = TwinsHelper.getTwinCardNumber(cardId) != null
|
||||||
|
|
@ -26,7 +27,7 @@ object TapWorkarounds {
|
||||||
|
|
||||||
// for cards 6.21 and higher backup is not skippable
|
// for cards 6.21 and higher backup is not skippable
|
||||||
val CardDTO.canSkipBackup: Boolean
|
val CardDTO.canSkipBackup: Boolean
|
||||||
get() = this.firmwareVersion < FirmwareVersion.KeysImportAvailable
|
get() = this.firmwareVersion < backupRequiredFirmwareVersion
|
||||||
|
|
||||||
val CardDTO.useOldStyleDerivation: Boolean
|
val CardDTO.useOldStyleDerivation: Boolean
|
||||||
get() = batchId == "AC01" || batchId == "AC02" || batchId == "CB95"
|
get() = batchId == "AC01" || batchId == "AC02" || batchId == "CB95"
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ okHttp-prettyLogging = "3.1.0"
|
||||||
# region Tangem
|
# region Tangem
|
||||||
tangemBlockchainSdk = "develop-306"
|
tangemBlockchainSdk = "develop-306"
|
||||||
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
|
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
|
||||||
tangemCardSdk = "develop-280"
|
tangemCardSdk = "develop-283"
|
||||||
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds
|
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds
|
||||||
# endregion Tangem
|
# endregion Tangem
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue