mirror of
https://github.com/bitwarden/android.git
synced 2024-11-01 07:35:52 +03:00
catch EnableForegroundDispatch exception. disable
back button on yubikey 2fa.
This commit is contained in:
parent
7c781b60c5
commit
58aa37bf8e
2 changed files with 17 additions and 2 deletions
|
@ -233,9 +233,13 @@ namespace Bit.Android
|
||||||
ndef.AddDataScheme("https");
|
ndef.AddDataScheme("https");
|
||||||
var filters = new IntentFilter[] { ndef };
|
var filters = new IntentFilter[] { ndef };
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
// register for foreground dispatch so we'll receive tags according to our intent filters
|
// register for foreground dispatch so we'll receive tags according to our intent filters
|
||||||
adapter.EnableForegroundDispatch(this, pendingIntent, filters, null);
|
adapter.EnableForegroundDispatch(this, pendingIntent, filters, null);
|
||||||
}
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
adapter.DisableForegroundDispatch(this);
|
adapter.DisableForegroundDispatch(this);
|
||||||
|
|
|
@ -335,6 +335,17 @@ namespace Bit.App.Pages
|
||||||
MessagingCenter.Unsubscribe<Application>(Application.Current, "ResumeYubiKey");
|
MessagingCenter.Unsubscribe<Application>(Application.Current, "ResumeYubiKey");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnBackButtonPressed()
|
||||||
|
{
|
||||||
|
// ref: https://github.com/bitwarden/mobile/issues/350
|
||||||
|
if(Device.RuntimePlatform == Device.Android && _providerType.HasValue &&
|
||||||
|
_providerType.Value == TwoFactorProviderType.YubiKey)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return base.OnBackButtonPressed();
|
||||||
|
}
|
||||||
|
|
||||||
private async void AnotherMethodAsync()
|
private async void AnotherMethodAsync()
|
||||||
{
|
{
|
||||||
var beforeProviderType = _providerType;
|
var beforeProviderType = _providerType;
|
||||||
|
|
Loading…
Reference in a new issue