1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-21 10:43:22 +00:00

Add UWP support (#139)

* Add UWP project, and generate services boilerplate

* SqliteService implementation and sqlite-net-pcl update (#bug https://stackoverflow.com/questions/45418669/xamarin-forms-pcl-assemly-issue)

* Important services implementation

* Create a shared project to host images for UWP (to keep code project clean)

* Add extensions to image names referenced by the pcl project

* Add DismissModalToolBarItem to modal pages

* moving UWP folders inside src folder

* Add DeviceInfoService implementation

* Remove dependency on BouncyCastle, and calculate key derivation using native support

* changes requested by project maintener

* Fix HasCamera property

* DeviceActionService implementation
This commit is contained in:
Hicham Boushaba
2017-10-03 03:15:13 +01:00
committed by Kyle Spearrin
parent 5501ab9083
commit d651606800
104 changed files with 1171 additions and 72 deletions

View File

@@ -0,0 +1,43 @@
using Bit.App.Abstractions;
using Microsoft.Toolkit.Uwp.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Graphics.Display;
using Windows.Devices.SmartCards;
using Windows.Devices.Enumeration;
namespace Bit.UWP.Services
{
public class DeviceInfoService : IDeviceInfoService
{
public string Model => SystemInformation.DeviceModel;
public int Version => SystemInformation.OperatingSystemVersion.Build;
public float Scale => (float)DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
public bool NfcEnabled
{
get
{
if (!Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Devices.SmartCards.SmartCardEmulator"))
return false;
return Task.Run(async () => await SmartCardEmulator.GetDefaultAsync()).Result != null;
}
}
public bool HasCamera
{
get
{
var cameraList = Task.Run(async () => await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture)).Result;
return cameraList?.Any() ?? false;
}
}
}
}