mirror of
https://github.com/bitwarden/mobile
synced 2026-01-08 03:23:23 +00:00
[EC-770] Implement MessagePack on Watch sync (#2264)
* EC-770 Started implementing MessagePack for the iPhone -> Watch communication * EC-770 Removed Pods and installed MessagePack through SPM * EC-770 Implemented MessagePack + Lzfse compression when syncing iPhone -> Watch * EC-770 Added MessagePack as submodule and updated the build to checkout the submodule as well. Also added MessagePack files as reference in the watch project * EC-770 Updated build Updated build.yml to checkout submodules on iOS
This commit is contained in:
committed by
GitHub
parent
a18f74a72a
commit
9f8307a4ff
@@ -21,6 +21,7 @@
|
||||
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2515" />
|
||||
<PackageReference Include="ZXing.Net.Mobile" Version="2.4.1" />
|
||||
<PackageReference Include="ZXing.Net.Mobile.Forms" Version="2.4.1" />
|
||||
<PackageReference Include="MessagePack" Version="2.4.59" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -436,6 +437,8 @@
|
||||
<None Remove="Utilities\AccountManagement\" />
|
||||
<None Remove="Controls\DateTime\" />
|
||||
<None Remove="Controls\IconLabelButton\" />
|
||||
<None Remove="MessagePack" />
|
||||
<None Remove="MessagePack.MSBuild.Tasks" />
|
||||
<None Remove="Controls\PasswordStrengthProgressBar\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.Core.Abstractions;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models;
|
||||
using Bit.Core.Models.View;
|
||||
using Xamarin.Forms;
|
||||
using MessagePack;
|
||||
using MessagePack.Resolvers;
|
||||
|
||||
namespace Bit.App.Services
|
||||
{
|
||||
@@ -124,7 +124,18 @@ namespace Bit.App.Services
|
||||
await SyncDataToWatchAsync();
|
||||
}
|
||||
|
||||
protected abstract Task SendDataToWatchAsync(WatchDTO watchDto);
|
||||
protected async Task SendDataToWatchAsync(WatchDTO watchDto)
|
||||
{
|
||||
var options = MessagePackSerializerOptions.Standard
|
||||
.WithResolver(CompositeResolver.Create(
|
||||
GeneratedResolver.Instance,
|
||||
StandardResolver.Instance
|
||||
));
|
||||
|
||||
await SendDataToWatchAsync(MessagePackSerializer.Serialize(watchDto, options));
|
||||
}
|
||||
|
||||
protected abstract Task SendDataToWatchAsync(byte[] rawData);
|
||||
|
||||
protected abstract void ConnectToWatch();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user