From c3039f760137a7e4f9509489a5696b9f90450afa Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Tue, 13 Apr 2021 12:17:23 +0200 Subject: [PATCH] #293 fix license screen bypass --- .../presentation/presenter/VaultListPresenter.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/presentation/src/main/java/org/cryptomator/presentation/presenter/VaultListPresenter.kt b/presentation/src/main/java/org/cryptomator/presentation/presenter/VaultListPresenter.kt index e3555a74..fd0ec4f7 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/presenter/VaultListPresenter.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/presenter/VaultListPresenter.kt @@ -7,6 +7,7 @@ import android.content.Context import android.content.Intent import android.net.Uri import android.os.Handler +import android.widget.Toast import androidx.biometric.BiometricManager import org.cryptomator.data.cloud.crypto.CryptoCloud import org.cryptomator.data.util.NetworkConnectionCheck @@ -154,7 +155,13 @@ class VaultListPresenter @Inject constructor( // val intent = Intent(context(), LicenseCheckActivity::class.java) intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK intent.data = Uri.parse(String.format("app://cryptomator/%s", license)) - context().startActivity(intent) + + try { + context().startActivity(intent) + } catch (e: ActivityNotFoundException) { + Toast.makeText(context(), "Please contact the support.", Toast.LENGTH_LONG).show() + finish() + } } }) }