From eec880ca815b65235d5eafb923bab53fdd263bcf Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 18 Aug 2023 15:32:17 +0400 Subject: [PATCH] Updated on 2026-08-14 --- .../data/WalletConnectSessionsRepositoryImpl.kt | 2 +- .../handlers/WalletConnectLinkIntentHandler.kt | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/domain/walletconnect2/data/WalletConnectSessionsRepositoryImpl.kt b/app/src/main/java/com/tangem/tap/domain/walletconnect2/data/WalletConnectSessionsRepositoryImpl.kt index fe3aab634c..99f4351a93 100644 --- a/app/src/main/java/com/tangem/tap/domain/walletconnect2/data/WalletConnectSessionsRepositoryImpl.kt +++ b/app/src/main/java/com/tangem/tap/domain/walletconnect2/data/WalletConnectSessionsRepositoryImpl.kt @@ -25,7 +25,7 @@ class WalletConnectSessionsRepositoryImpl @Inject constructor( val fileContent = fileReader.readFile(getFileNameForUserWallet(userWallet)) sessionsAdapter.fromJson(fileContent) ?: emptyList() } catch (exception: Exception) { - Timber.e(exception) + Timber.d(exception) emptyList() } } diff --git a/app/src/main/java/com/tangem/tap/features/intentHandler/handlers/WalletConnectLinkIntentHandler.kt b/app/src/main/java/com/tangem/tap/features/intentHandler/handlers/WalletConnectLinkIntentHandler.kt index 79e4774682..95d2e3abe7 100644 --- a/app/src/main/java/com/tangem/tap/features/intentHandler/handlers/WalletConnectLinkIntentHandler.kt +++ b/app/src/main/java/com/tangem/tap/features/intentHandler/handlers/WalletConnectLinkIntentHandler.kt @@ -7,6 +7,8 @@ import com.tangem.tap.domain.walletconnect.WalletConnectManager import com.tangem.tap.features.details.redux.walletconnect.WalletConnectAction import com.tangem.tap.features.intentHandler.IntentHandler import com.tangem.tap.store +import timber.log.Timber +import java.net.URLDecoder /** [REDACTED_AUTHOR] @@ -23,10 +25,16 @@ class WalletConnectLinkIntentHandler : IntentHandler { else -> null } - return if (wcUri == null) { + return if (wcUri.isNullOrBlank()) { false } else { - store.dispatchWithMain(WalletConnectAction.HandleDeepLink(wcUri)) + val decodedWcUri = try { + URLDecoder.decode(wcUri, DEFAULT_CHARSET_NAME) + } catch (e: Exception) { + Timber.e(e) + return false + } + store.dispatchWithMain(WalletConnectAction.HandleDeepLink(decodedWcUri)) true } } @@ -34,5 +42,6 @@ class WalletConnectLinkIntentHandler : IntentHandler { private companion object { private const val TANGEM_SCHEME = "tangem" private const val TANGEM_WC_PREFIX = "tangem://wc?uri=" + private const val DEFAULT_CHARSET_NAME = "UTF-8" } } \ No newline at end of file