mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
handle intent exceptions to prevent denial of service (#1458)
This commit is contained in:
parent
d8e68a266c
commit
172a857604
1 changed files with 29 additions and 22 deletions
|
@ -155,33 +155,40 @@ namespace Bit.Droid
|
||||||
protected override void OnNewIntent(Intent intent)
|
protected override void OnNewIntent(Intent intent)
|
||||||
{
|
{
|
||||||
base.OnNewIntent(intent);
|
base.OnNewIntent(intent);
|
||||||
if (intent.GetBooleanExtra("generatorTile", false))
|
try
|
||||||
{
|
{
|
||||||
_messagingService.Send("popAllAndGoToTabGenerator");
|
if (intent.GetBooleanExtra("generatorTile", false))
|
||||||
if (_appOptions != null)
|
|
||||||
{
|
{
|
||||||
_appOptions.GeneratorTile = true;
|
_messagingService.Send("popAllAndGoToTabGenerator");
|
||||||
|
if (_appOptions != null)
|
||||||
|
{
|
||||||
|
_appOptions.GeneratorTile = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (intent.GetBooleanExtra("myVaultTile", false))
|
||||||
|
{
|
||||||
|
_messagingService.Send("popAllAndGoToTabMyVault");
|
||||||
|
if (_appOptions != null)
|
||||||
|
{
|
||||||
|
_appOptions.MyVaultTile = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (intent.Action == Intent.ActionSend && intent.Type != null)
|
||||||
|
{
|
||||||
|
if (_appOptions != null)
|
||||||
|
{
|
||||||
|
_appOptions.CreateSend = GetCreateSendRequest(intent);
|
||||||
|
}
|
||||||
|
_messagingService.Send("popAllAndGoToTabSend");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ParseYubiKey(intent.DataString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (intent.GetBooleanExtra("myVaultTile", false))
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_messagingService.Send("popAllAndGoToTabMyVault");
|
System.Diagnostics.Debug.WriteLine(">>> {0}: {1}", e.GetType(), e.StackTrace);
|
||||||
if (_appOptions != null)
|
|
||||||
{
|
|
||||||
_appOptions.MyVaultTile = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (intent.Action == Intent.ActionSend && intent.Type != null)
|
|
||||||
{
|
|
||||||
if (_appOptions != null)
|
|
||||||
{
|
|
||||||
_appOptions.CreateSend = GetCreateSendRequest(intent);
|
|
||||||
}
|
|
||||||
_messagingService.Send("popAllAndGoToTabSend");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ParseYubiKey(intent.DataString);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue