mirror of
https://github.com/bitwarden/android.git
synced 2024-12-20 08:12:26 +03:00
Log service. Linker adjustments.
This commit is contained in:
parent
548132ce7e
commit
62cef0d141
9 changed files with 48 additions and 1 deletions
|
@ -36,7 +36,7 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
<AndroidLinkSkip>Xamarin.GooglePlayServices.Gcm;BitwardenAndroid;BitwardenApp;Microsoft.Practices.Unity;SQLite-net;Xamarin.Android.Net</AndroidLinkSkip>
|
||||
<AndroidLinkSkip>PushNotification.Plugin;PushNotification.Plugin.Abstractions;Xamarin.GooglePlayServices.Base;Xamarin.GooglePlayServices.Basement;Xamarin.GooglePlayServices.Measurement;Xamarin.GooglePlayServices.Gcm;BitwardenAndroid;BitwardenApp;Microsoft.Practices.Unity;SQLite-net;Xamarin.Android.Net</AndroidLinkSkip>
|
||||
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
|
||||
<BundleAssemblies>False</BundleAssemblies>
|
||||
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
|
||||
|
@ -68,6 +68,7 @@
|
|||
<DebugSymbols>False</DebugSymbols>
|
||||
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
|
||||
<AndroidLinkSkip>PushNotification.Plugin;PushNotification.Plugin.Abstractions;Xamarin.GooglePlayServices.Base;Xamarin.GooglePlayServices.Basement;Xamarin.GooglePlayServices.Measurement;Xamarin.GooglePlayServices.Gcm;BitwardenAndroid;BitwardenApp;Microsoft.Practices.Unity;SQLite-net;Xamarin.Android.Net</AndroidLinkSkip>
|
||||
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Acr.Support.Android, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
|
@ -321,6 +322,7 @@
|
|||
<Compile Include="Services\KeyStoreStorageService.cs" />
|
||||
<Compile Include="MainActivity.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\LogService.cs" />
|
||||
<Compile Include="Services\ReflectionService.cs" />
|
||||
<Compile Include="Services\SqlService.cs" />
|
||||
<Compile Include="SplashActivity.cs" />
|
||||
|
|
|
@ -19,6 +19,7 @@ using XLabs.Ioc;
|
|||
using XLabs.Ioc.Unity;
|
||||
using System.Threading.Tasks;
|
||||
using Plugin.Settings.Abstractions;
|
||||
using Xamarin.Android.Net;
|
||||
|
||||
namespace Bit.Android
|
||||
{
|
||||
|
@ -37,6 +38,9 @@ namespace Bit.Android
|
|||
public MainApplication(IntPtr handle, JniHandleOwnership transer)
|
||||
: base(handle, transer)
|
||||
{
|
||||
// NOTE: This is just here to stop the linker from removing AndroidClientHandler references
|
||||
var handler = new AndroidClientHandler();
|
||||
|
||||
if(!Resolver.IsSet)
|
||||
{
|
||||
SetIoc();
|
||||
|
@ -204,6 +208,7 @@ namespace Bit.Android
|
|||
.RegisterType<IGoogleAnalyticsService, GoogleAnalyticsService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IDeviceInfoService, DeviceInfoService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ILocalizeService, LocalizeService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ILogService, LogService>(new ContainerControlledLifetimeManager())
|
||||
// Repositories
|
||||
.RegisterType<IFolderRepository, FolderRepository>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IFolderApiRepository, FolderApiRepository>(new ContainerControlledLifetimeManager())
|
||||
|
|
13
src/Android/Services/LogService.cs
Normal file
13
src/Android/Services/LogService.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using Bit.App.Abstractions;
|
||||
|
||||
namespace Bit.Android.Services
|
||||
{
|
||||
public class LogService : ILogService
|
||||
{
|
||||
public void WriteLine(string message)
|
||||
{
|
||||
Console.WriteLine(message);
|
||||
}
|
||||
}
|
||||
}
|
7
src/App/Abstractions/Services/ILogService.cs
Normal file
7
src/App/Abstractions/Services/ILogService.cs
Normal file
|
@ -0,0 +1,7 @@
|
|||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ILogService
|
||||
{
|
||||
void WriteLine(string message);
|
||||
}
|
||||
}
|
|
@ -44,6 +44,7 @@
|
|||
<Compile Include="Abstractions\Services\IAuthService.cs" />
|
||||
<Compile Include="Abstractions\Services\IClipboardService.cs" />
|
||||
<Compile Include="Abstractions\Services\IKeyDerivationService.cs" />
|
||||
<Compile Include="Abstractions\Services\ILogService.cs" />
|
||||
<Compile Include="Abstractions\Services\IReflectionService.cs" />
|
||||
<Compile Include="Abstractions\Services\ISiteService.cs" />
|
||||
<Compile Include="Abstractions\Services\IFolderService.cs" />
|
||||
|
@ -229,6 +230,9 @@
|
|||
<HintPath>..\..\packages\Unity.3.5.1405-prerelease\lib\portable-net45+wp80+win8+wpa81+MonoAndroid10+MonoTouch10\Microsoft.Practices.Unity.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Mono.Android">
|
||||
<HintPath>..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v6.0\Mono.Android.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
|
|
13
src/iOS.Core/Services/LogService.cs
Normal file
13
src/iOS.Core/Services/LogService.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using Bit.App.Abstractions;
|
||||
|
||||
namespace Bit.iOS.Core.Services
|
||||
{
|
||||
public class LogService : ILogService
|
||||
{
|
||||
public void WriteLine(string message)
|
||||
{
|
||||
Console.WriteLine(message);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -106,6 +106,7 @@
|
|||
<Compile Include="Services\DeviceInfoService.cs" />
|
||||
<Compile Include="Services\KeyChainStorageService.cs" />
|
||||
<Compile Include="Services\CommonCryptoKeyDerivationService.cs" />
|
||||
<Compile Include="Services\LogService.cs" />
|
||||
<Compile Include="Services\Settings.cs" />
|
||||
<Compile Include="Services\GoogleAnalyticsService.cs" />
|
||||
<Compile Include="Services\LocalizeService.cs" />
|
||||
|
|
|
@ -278,6 +278,7 @@ namespace Bit.iOS.Extension
|
|||
.RegisterType<ILockService, LockService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IGoogleAnalyticsService, GoogleAnalyticsService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ILocalizeService, LocalizeService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ILogService, LogService>(new ContainerControlledLifetimeManager())
|
||||
// Repositories
|
||||
.RegisterType<IFolderRepository, FolderRepository>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IFolderApiRepository, FolderApiRepository>(new ContainerControlledLifetimeManager())
|
||||
|
|
|
@ -261,6 +261,7 @@ namespace Bit.iOS
|
|||
.RegisterType<IGoogleAnalyticsService, GoogleAnalyticsService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<IDeviceInfoService, DeviceInfoService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ILocalizeService, LocalizeService>(new ContainerControlledLifetimeManager())
|
||||
.RegisterType<ILogService, LogService>(new ContainerControlledLifetimeManager())
|
||||
// Repositories
|
||||
// Repositories
|
||||
.RegisterType<IFolderRepository, FolderRepository>(new ContainerControlledLifetimeManager())
|
||||
|
|
Loading…
Reference in a new issue