1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-29 14:43:50 +00:00

fdroid builds without Google and Hockey services

This commit is contained in:
Kyle Spearrin
2018-01-10 09:28:30 -05:00
parent 5521892736
commit 98d4fef0ee
15 changed files with 122 additions and 8 deletions

View File

@@ -876,15 +876,17 @@
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat">
<Version>25.4.0.2</Version>
</PackageReference>
<PackageReference Include="XLabs.IoC.SimpleInjector" Version="2.0.5782" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.1.3" />
<PackageReference Include="Plugin.CurrentActivity" Version="1.0.1" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)|$(Platform)' != 'FDroid|AnyCPU'">
<PackageReference Include="Xamarin.Firebase.Messaging">
<Version>42.1021.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.GooglePlayServices.Analytics">
<Version>42.1021.1</Version>
</PackageReference>
<PackageReference Include="XLabs.IoC.SimpleInjector" Version="2.0.5782" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.1.3" />
<PackageReference Include="Plugin.CurrentActivity" Version="1.0.1" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\bottom_nav_bg.xml" />

View File

@@ -1,3 +1,4 @@
#if !FDROID
using System;
using Android.App;
using Android.Content;
@@ -21,3 +22,4 @@ namespace Bit.Android
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if !FDROID
using System;
using Android.App;
using Android.Content;
@@ -40,3 +41,4 @@ namespace Bit.Android
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if !FDROID
using HockeyApp.Android;
using Bit.App.Abstractions;
using Newtonsoft.Json;
@@ -51,4 +52,5 @@ namespace Bit.Android
return true;
}
}
}
}
#endif

View File

@@ -61,8 +61,10 @@ namespace Bit.Android
var appIdService = Resolver.Resolve<IAppIdService>();
var authService = Resolver.Resolve<IAuthService>();
#if !FDROID
HockeyApp.Android.CrashManager.Register(this, HockeyAppId,
new HockeyAppCrashManagerListener(appIdService, authService));
#endif
Forms.Init(this, bundle);

View File

@@ -128,7 +128,11 @@ namespace Bit.Android
container.RegisterSingleton<IPasswordGenerationService, PasswordGenerationService>();
container.RegisterSingleton<ILockService, LockService>();
container.RegisterSingleton<IAppInfoService, AppInfoService>();
#if FDROID
container.RegisterSingleton<IGoogleAnalyticsService, NoopGoogleAnalyticsService>();
#else
container.RegisterSingleton<IGoogleAnalyticsService, GoogleAnalyticsService>();
#endif
container.RegisterSingleton<IDeviceInfoService, DeviceInfoService>();
container.RegisterSingleton<ILocalizeService, LocalizeService>();
container.RegisterSingleton<ILogService, LogService>();
@@ -159,8 +163,13 @@ namespace Bit.Android
container.RegisterSingleton(CrossFingerprint.Current);
// Push
#if FDROID
container.RegisterSingleton<IPushNotificationListener, NoopPushNotificationListener>();
container.RegisterSingleton<IPushNotificationService, NoopPushNotificationService>();
#else
container.RegisterSingleton<IPushNotificationListener, PushNotificationListener>();
container.RegisterSingleton<IPushNotificationService, AndroidPushNotificationService>();
#endif
container.Verify();
Resolver.SetResolver(new SimpleInjectorResolver(container));

View File

@@ -1,4 +1,5 @@
using System;
#if !FDROID
using System;
using Bit.App;
using Bit.App.Abstractions;
using Plugin.Settings.Abstractions;
@@ -40,3 +41,4 @@ namespace Bit.Android.Services
}
}
}
#endif

View File

@@ -1,4 +1,5 @@
using System;
#if !FDROID
using System;
using Bit.App;
using Bit.App.Abstractions;
using Plugin.Settings.Abstractions;
@@ -80,3 +81,4 @@ namespace Bit.Android.Services
}
}
}
#endif