From 3a5163061d6030bb30d5fd15ede0bb2e78db663c Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 5 Aug 2025 13:15:49 +0700 Subject: [PATCH 1/6] Updated on 2026-08-14 --- core/res/src/main/java/com/tangem/core/res/Resources.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/res/src/main/java/com/tangem/core/res/Resources.kt b/core/res/src/main/java/com/tangem/core/res/Resources.kt index 46ceaa8b3a..aea235e3ae 100644 --- a/core/res/src/main/java/com/tangem/core/res/Resources.kt +++ b/core/res/src/main/java/com/tangem/core/res/Resources.kt @@ -29,7 +29,7 @@ fun Resources.getStringSafe(@StringRes id: Int, vararg formatArgs: Any): String // If something goes wrong, returns the resource without arguments val string = getString(id) - reportIssue(resources = this, id, *formatArgs) + reportIssue(it, resources = this, id, *formatArgs) string } @@ -61,19 +61,20 @@ fun Resources.getPluralStringSafe(@PluralsRes id: Int, count: Int, vararg format private fun Result.getOrResourceName(resources: Resources, id: Int, vararg formatArgs: Any): String { return getOrElse { - reportIssue(resources, id, formatArgs) + reportIssue(it, resources, id, formatArgs) // If something still goes wrong, returns the resource name resources.getResourceEntryName(id) } } -private fun reportIssue(resources: Resources, id: Int, vararg formatArgs: Any) { +private fun reportIssue(throwable: Throwable, resources: Resources, id: Int, vararg formatArgs: Any) { val exception = IllegalStateException( "An error occurred while parsing the string:\n" + "\tname: R.string.${resources.getResourceEntryName(id)}\n" + "\targs: ${formatArgs.joinToString(prefix = "[", postfix = "]") { it.toString() }}\n" + - "\tlocale: ${SupportedLanguages.getCurrentSupportedLanguageCode()}\n", + "\tlocale: ${SupportedLanguages.getCurrentSupportedLanguageCode()}\n" + + "\terror message: ${throwable.message.orEmpty()}\n", ) Timber.tag("Resources").e(exception) From 60e1f52f94fc6b58c2becb74309a05631fe53908 Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 5 Aug 2025 19:21:53 +0700 Subject: [PATCH 2/6] Updated on 2026-08-14 --- .../main/java/com/tangem/core/ui/utils/DecimalFormatterExt.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/ui/src/main/java/com/tangem/core/ui/utils/DecimalFormatterExt.kt b/core/ui/src/main/java/com/tangem/core/ui/utils/DecimalFormatterExt.kt index a251b0c9ed..ebce7baf36 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/utils/DecimalFormatterExt.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/utils/DecimalFormatterExt.kt @@ -17,7 +17,8 @@ const val DECIMAL_SEPARATOR_LIMIT = 1 @Composable fun rememberDecimalFormat(): DecimalFormat { - val locale = LocalConfiguration.current.locale + val locales = LocalConfiguration.current.locales + val locale = if (locales.isEmpty) Locale.getDefault() else locales[0] val decimalSymbols = remember { DecimalFormatSymbols.getInstance(locale) } return remember { From 203738f16063305f433ffff590725cc09c91090f Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 5 Aug 2025 16:24:56 +0300 Subject: [PATCH 3/6] Updated on 2026-08-14 --- .../features/staking/impl/presentation/ui/StakingTosText.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/ui/StakingTosText.kt b/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/ui/StakingTosText.kt index b5a6372037..c7e67f5415 100644 --- a/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/ui/StakingTosText.kt +++ b/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/ui/StakingTosText.kt @@ -12,8 +12,8 @@ import com.tangem.features.staking.impl.R private const val TERMS_OF_USE_KEY = "termsOfUse" private const val PRIVACY_POLICY_KEY = "privacyPolicy" -private const val TERMS_OF_USE_URL = "https://docs.stakek.it/docs/terms-of-use" -private const val PRIVACY_POLICY_URL = "https://docs.stakek.it/docs/privacy-policy" +private const val TERMS_OF_USE_URL = "https://docs.yield.xyz/docs/terms-of-use#/" +private const val PRIVACY_POLICY_URL = "https://docs.yield.xyz/docs/privacy-policy#/" @Composable internal fun StakingTosText(onTextClick: (String) -> Unit) { From fee007627f37116a7f69621bdff71b749a7557b9 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 6 Aug 2025 19:06:05 +0300 Subject: [PATCH 4/6] Updated on 2026-08-14 --- .../walletconnect2/data/DefaultLegacyWalletConnectRepository.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/tangem/tap/domain/walletconnect2/data/DefaultLegacyWalletConnectRepository.kt b/app/src/main/java/com/tangem/tap/domain/walletconnect2/data/DefaultLegacyWalletConnectRepository.kt index 2d1295d3b6..6031478847 100644 --- a/app/src/main/java/com/tangem/tap/domain/walletconnect2/data/DefaultLegacyWalletConnectRepository.kt +++ b/app/src/main/java/com/tangem/tap/domain/walletconnect2/data/DefaultLegacyWalletConnectRepository.kt @@ -460,7 +460,7 @@ internal class DefaultLegacyWalletConnectRepository( proposerPublicKey = sessionProposal.proposerPublicKey, namespaces = preparedRequiredNamespaces.ifEmpty { sessionProposal.createPreparedOptionalNamespaces(userChains) - }, + }.filterValues { it.accounts.isNotEmpty() && it.chains?.isNotEmpty() == true }, ) Timber.i("Session approval is prepared for sending: $sessionApproval") From 4a42bcf07c9d1593323f01a60389598df358e62e Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 30 Jul 2025 15:58:43 +0500 Subject: [PATCH 5/6] Updated on 2026-08-14 --- .../tap/common/url/CustomTabsUrlOpener.kt | 41 +++++++++++-------- .../core/navigation/url/DummyUrlOpener.kt | 4 ++ .../tangem/core/navigation/url/UrlOpener.kt | 2 + .../redirect/model/OnrampRedirectModel.kt | 12 +++++- 4 files changed, 41 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/common/url/CustomTabsUrlOpener.kt b/app/src/main/java/com/tangem/tap/common/url/CustomTabsUrlOpener.kt index 965d6caacd..de65ad7aa7 100644 --- a/app/src/main/java/com/tangem/tap/common/url/CustomTabsUrlOpener.kt +++ b/app/src/main/java/com/tangem/tap/common/url/CustomTabsUrlOpener.kt @@ -3,12 +3,12 @@ package com.tangem.tap.common.url import android.content.Context import android.content.Intent import android.content.pm.PackageManager -import android.net.Uri import androidx.browser.customtabs.CustomTabColorSchemeParams import androidx.browser.customtabs.CustomTabsClient import androidx.browser.customtabs.CustomTabsIntent import androidx.browser.customtabs.CustomTabsIntent.COLOR_SCHEME_DARK import androidx.browser.customtabs.CustomTabsIntent.COLOR_SCHEME_LIGHT +import androidx.core.net.toUri import com.tangem.core.navigation.url.UrlOpener import com.tangem.tap.common.apptheme.MutableAppThemeModeHolder import com.tangem.tap.common.extensions.getColorCompat @@ -25,30 +25,37 @@ internal class CustomTabsUrlOpener : UrlOpener { } } + override fun openUrlExternalBrowser(url: String) { + foregroundActivityObserver.withForegroundActivity { context -> + if (url.isEmpty()) return@withForegroundActivity + val browserIntent = Intent(Intent.ACTION_VIEW, url.toUri()) + context.startActivity(browserIntent) + } + } + private fun openUrl(url: String, context: Context) { if (url.isEmpty()) return - val customTabsIntent = CustomTabsIntent.Builder() - .setDefaultColorSchemeParams( - CustomTabColorSchemeParams.Builder() - .setNavigationBarColor(context.getColorCompat(R.color.toolbarColor)) - .build(), - ) - .setColorScheme( - if (MutableAppThemeModeHolder.isDarkThemeActive) COLOR_SCHEME_DARK else COLOR_SCHEME_LIGHT, - ) - .build() - - customTabsIntent.intent.flags = Intent.FLAG_ACTIVITY_SINGLE_TOP - - val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) + val browserIntent = Intent(Intent.ACTION_VIEW, url.toUri()) runCatching { if (checkCustomTabsAvailability(context, browserIntent)) { context.startActivity(browserIntent) } else { - customTabsIntent.launchUrl(context, Uri.parse(url)) + val customTabsIntent = CustomTabsIntent.Builder() + .setDefaultColorSchemeParams( + CustomTabColorSchemeParams.Builder() + .setNavigationBarColor(context.getColorCompat(R.color.toolbarColor)) + .build(), + ) + .setColorScheme( + if (MutableAppThemeModeHolder.isDarkThemeActive) COLOR_SCHEME_DARK else COLOR_SCHEME_LIGHT, + ) + .build() + + customTabsIntent.intent.flags = Intent.FLAG_ACTIVITY_SINGLE_TOP + customTabsIntent.launchUrl(context, url.toUri()) } }.onFailure { - Timber.e(it.message) + Timber.e(it) } } diff --git a/core/navigation/src/main/java/com/tangem/core/navigation/url/DummyUrlOpener.kt b/core/navigation/src/main/java/com/tangem/core/navigation/url/DummyUrlOpener.kt index cff4946b40..d47667b064 100644 --- a/core/navigation/src/main/java/com/tangem/core/navigation/url/DummyUrlOpener.kt +++ b/core/navigation/src/main/java/com/tangem/core/navigation/url/DummyUrlOpener.kt @@ -5,4 +5,8 @@ class DummyUrlOpener : UrlOpener { override fun openUrl(url: String) { /* no-op */ } + + override fun openUrlExternalBrowser(url: String) { + /* no-op */ + } } \ No newline at end of file diff --git a/core/navigation/src/main/java/com/tangem/core/navigation/url/UrlOpener.kt b/core/navigation/src/main/java/com/tangem/core/navigation/url/UrlOpener.kt index d78ba1b1eb..df94cdfacf 100644 --- a/core/navigation/src/main/java/com/tangem/core/navigation/url/UrlOpener.kt +++ b/core/navigation/src/main/java/com/tangem/core/navigation/url/UrlOpener.kt @@ -3,4 +3,6 @@ package com.tangem.core.navigation.url interface UrlOpener { fun openUrl(url: String) + + fun openUrlExternalBrowser(url: String) } \ No newline at end of file diff --git a/features/onramp/impl/src/main/kotlin/com/tangem/features/onramp/redirect/model/OnrampRedirectModel.kt b/features/onramp/impl/src/main/kotlin/com/tangem/features/onramp/redirect/model/OnrampRedirectModel.kt index ce08252b7b..fec988b9d6 100644 --- a/features/onramp/impl/src/main/kotlin/com/tangem/features/onramp/redirect/model/OnrampRedirectModel.kt +++ b/features/onramp/impl/src/main/kotlin/com/tangem/features/onramp/redirect/model/OnrampRedirectModel.kt @@ -86,7 +86,13 @@ internal class OnrampRedirectModel @Inject constructor( .onLeft(::handleError) .onRight { latestOnrampTransaction = it - urlOpener.openUrl(it.redirectUrl) + + // Workaround to open Unlimit provider in external browser instead of chrome custom tabs + if (params.onrampProviderWithQuote.provider.id.equals(UNLIMIT_PROVIDER_ID, ignoreCase = true)) { + urlOpener.openUrlExternalBrowser(it.redirectUrl) + } else { + urlOpener.openUrl(it.redirectUrl) + } } } } @@ -127,4 +133,8 @@ internal class OnrampRedirectModel @Inject constructor( messageSender.send(message) } + + private companion object { + const val UNLIMIT_PROVIDER_ID = "unlimit" + } } \ No newline at end of file From 9b41230fa95aab957735d9a77cd5473414edb3da Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 13 Aug 2025 09:19:15 +0000 Subject: [PATCH 6/6] Updated on 2026-08-14 --- gradle/tangem_dependencies.toml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gradle/tangem_dependencies.toml b/gradle/tangem_dependencies.toml index 7250e5eb0c..1018ab6255 100644 --- a/gradle/tangem_dependencies.toml +++ b/gradle/tangem_dependencies.toml @@ -5,12 +5,14 @@ # https://github.com/tangem/tangem-sdk-android/ # https://github.com/tangem/vico -tangemBlockchainSdk = "releases-5.26.0-1123" +tangemBlockchainSdk = "releases-5.27.0-1142" #tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds -tangemCardSdk = "releases-5.26.0-508" +tangemCardSdk = "releases-5.27.0-513" #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 ^ +tangemHotSdk = "develop-454" +#tangemHotSdk = "0.0.1" # Keep it! - used for local builds ^ @@ -18,6 +20,8 @@ tangemVico = "2.0.0-alpha.25-tangem12" blockchain = { module = "com.tangem:blockchain", version.ref = "tangemBlockchainSdk" } card-android = { module = "com.tangem.tangem-sdk-kotlin:android", version.ref = "tangemCardSdk" } card-core = { module = "com.tangem.tangem-sdk-kotlin:core", version.ref = "tangemCardSdk" } +hot-core = { module = "com.tangem.tangem-hot-sdk-kotlin:core", version.ref = "tangemHotSdk" } +hot-android = { module = "com.tangem.tangem-hot-sdk-kotlin:android", version.ref = "tangemHotSdk" } vico-compose = { group = "com.tangem.vico", name = "compose", version.ref = "tangemVico" } vico-compose-m3 = { group = "com.tangem.vico", name = "compose-m3", version.ref = "tangemVico" }