diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/evmnetwork/addrpc/AddRpcViewModel.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/evmnetwork/addrpc/AddRpcViewModel.kt index 5be0dbabfd..cfa3837fde 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/evmnetwork/addrpc/AddRpcViewModel.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/evmnetwork/addrpc/AddRpcViewModel.kt @@ -14,6 +14,7 @@ import io.horizontalsystems.bankwallet.core.stats.stat import io.horizontalsystems.marketkit.models.Blockchain import java.net.MalformedURLException import java.net.URI +import java.net.URISyntaxException class AddRpcViewModel( private val blockchain: Blockchain, @@ -50,7 +51,7 @@ class AddRpcViewModel( if (!hasRequiredProtocol) { throw MalformedURLException() } - } catch (e: MalformedURLException) { + } catch (e: Throwable) { urlCaution = Caution(Translator.getString(R.string.AddEvmSyncSource_Error_InvalidUrl), Caution.Type.Error) syncState() return diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainActivity.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainActivity.kt index 529675bab5..800c42a943 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainActivity.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainActivity.kt @@ -1,11 +1,13 @@ package io.horizontalsystems.bankwallet.modules.main import android.os.Bundle +import android.widget.Toast import androidx.activity.viewModels import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen import androidx.navigation.fragment.NavHostFragment import com.walletconnect.web3.wallet.client.Wallet import io.horizontalsystems.bankwallet.R +import io.horizontalsystems.bankwallet.core.App import io.horizontalsystems.bankwallet.core.BaseActivity import io.horizontalsystems.bankwallet.core.slideFromBottom import io.horizontalsystems.bankwallet.modules.intro.IntroActivity @@ -92,5 +94,8 @@ class MainActivity : BaseActivity() { finish() } catch (e: MainScreenValidationError.Unlock) { LockScreenActivity.start(this) + } catch (e: MainScreenValidationError.KeystoreRuntimeException) { + Toast.makeText(App.instance, "Issue with Keystore", Toast.LENGTH_SHORT).show() + finish() } } diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainActivityViewModel.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainActivityViewModel.kt index 4756eea1d2..f0e7ea4221 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainActivityViewModel.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainActivityViewModel.kt @@ -80,6 +80,8 @@ class MainActivityViewModel( throw MainScreenValidationError.UserAuthentication() } catch (e: KeyStoreValidationError.KeyIsInvalid) { throw MainScreenValidationError.KeyInvalidated() + } catch (e: RuntimeException) { + throw MainScreenValidationError.KeystoreRuntimeException() } if (accountManager.isAccountsEmpty && !localStorage.mainShowedOnce) { @@ -117,4 +119,5 @@ sealed class MainScreenValidationError : Exception() { class NoSystemLock : MainScreenValidationError() class KeyInvalidated : MainScreenValidationError() class UserAuthentication : MainScreenValidationError() + class KeystoreRuntimeException : MainScreenValidationError() }