2017-07-29 00:21:39 +03:00
|
|
|
|
using Android.App;
|
|
|
|
|
using Android.Content;
|
|
|
|
|
using Bit.App.Abstractions;
|
|
|
|
|
using Bit.App.Utilities;
|
|
|
|
|
using Plugin.Settings.Abstractions;
|
2017-11-10 04:33:01 +03:00
|
|
|
|
using System;
|
2017-07-29 00:21:39 +03:00
|
|
|
|
using XLabs.Ioc;
|
|
|
|
|
|
|
|
|
|
namespace Bit.Android
|
|
|
|
|
{
|
2017-11-10 04:33:01 +03:00
|
|
|
|
[BroadcastReceiver(Name = "com.x8bit.bitwarden.PackageReplacedReceiver", Exported = false)]
|
2017-07-29 00:21:39 +03:00
|
|
|
|
[IntentFilter(new[] { Intent.ActionMyPackageReplaced })]
|
|
|
|
|
public class PackageReplacedReceiver : BroadcastReceiver
|
|
|
|
|
{
|
|
|
|
|
public override void OnReceive(Context context, Intent intent)
|
|
|
|
|
{
|
2017-11-10 04:33:01 +03:00
|
|
|
|
Console.WriteLine("Bitwarden App Updated!");
|
2017-10-29 04:36:27 +03:00
|
|
|
|
Helpers.PerformUpdateTasks(Resolver.Resolve<ISettings>(),
|
2017-11-10 04:33:01 +03:00
|
|
|
|
Resolver.Resolve<IAppInfoService>(), Resolver.Resolve<IDatabaseService>(),
|
2017-10-29 04:36:27 +03:00
|
|
|
|
Resolver.Resolve<ISyncService>());
|
2017-07-29 00:21:39 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|