From 6e436b5c8c291a9e9fef21f353252aff97615bca Mon Sep 17 00:00:00 2001 From: TheJoKlLa Date: Sun, 29 Jan 2023 16:55:07 +0100 Subject: [PATCH 01/22] Start with NFCService --- Borepin.sln | 26 +++++++++++++++ .../Borepin.Android/Borepin.Android.csproj | 5 +++ .../Borepin.Android/PlatformInitializer.cs | 2 ++ .../Borepin.Android/Services/NFCService.cs | 33 +++++++++++++++++++ Borepin/Borepin.UWP/Borepin.UWP.csproj | 5 +++ Borepin/Borepin.UWP/PlatformInitializer.cs | 2 ++ Borepin/Borepin.UWP/Services/NFCService.cs | 28 ++++++++++++++++ Borepin/Borepin.iOS/Borepin.iOS.csproj | 5 +++ Borepin/Borepin.iOS/PlatformInitializer.cs | 2 ++ Borepin/Borepin.iOS/Services/NFCService.cs | 29 ++++++++++++++++ Borepin/Borepin/Borepin.csproj | 1 + Borepin/Borepin/Service/NFC/INFCService.cs | 17 ++++++++++ 12 files changed, 155 insertions(+) create mode 100644 Borepin/Borepin.Android/Services/NFCService.cs create mode 100644 Borepin/Borepin.UWP/Services/NFCService.cs create mode 100644 Borepin/Borepin.iOS/Services/NFCService.cs create mode 100644 Borepin/Borepin/Service/NFC/INFCService.cs diff --git a/Borepin.sln b/Borepin.sln index 6019848..bd8951a 100644 --- a/Borepin.sln +++ b/Borepin.sln @@ -32,6 +32,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Borepin.GTK", "Borepin\Borepin.GTK\Borepin.GTK.csproj", "{61D956D2-5819-4736-BBD8-AD8208DE6A62}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NFC_PCSC", "external\NFC\NFC_PCSC\NFC_PCSC.csproj", "{75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -360,6 +362,30 @@ Global {61D956D2-5819-4736-BBD8-AD8208DE6A62}.Release|x64.Build.0 = Release|Any CPU {61D956D2-5819-4736-BBD8-AD8208DE6A62}.Release|x86.ActiveCfg = Release|Any CPU {61D956D2-5819-4736-BBD8-AD8208DE6A62}.Release|x86.Build.0 = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|Any CPU.Build.0 = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|ARM.ActiveCfg = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|ARM.Build.0 = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|iPhone.Build.0 = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|x64.ActiveCfg = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|x64.Build.0 = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|x86.ActiveCfg = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|x86.Build.0 = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|Any CPU.ActiveCfg = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|Any CPU.Build.0 = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|ARM.ActiveCfg = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|ARM.Build.0 = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|iPhone.ActiveCfg = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|iPhone.Build.0 = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|x64.ActiveCfg = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|x64.Build.0 = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|x86.ActiveCfg = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Borepin/Borepin.Android/Borepin.Android.csproj b/Borepin/Borepin.Android/Borepin.Android.csproj index 9b97e58..6792bec 100644 --- a/Borepin/Borepin.Android/Borepin.Android.csproj +++ b/Borepin/Borepin.Android/Borepin.Android.csproj @@ -82,6 +82,7 @@ + @@ -93,6 +94,10 @@ + + {D53A98E8-48B5-4DCE-A98E-4623EE746E16} + NFC + {3251FCE9-FEA3-4662-8BEB-636BE6732D48} FabAccessAPI diff --git a/Borepin/Borepin.Android/PlatformInitializer.cs b/Borepin/Borepin.Android/PlatformInitializer.cs index 540b18b..419f107 100644 --- a/Borepin/Borepin.Android/PlatformInitializer.cs +++ b/Borepin/Borepin.Android/PlatformInitializer.cs @@ -1,6 +1,7 @@ using Borepin.Droid.Services; using Borepin.Service; using Borepin.Service.Browser; +using Borepin.Service.NFC; using Borepin.Service.Storage; using Borepin.Service.Versioning; using Prism; @@ -16,6 +17,7 @@ namespace Borepin.Droid containerRegistry.Register(); containerRegistry.Register(); containerRegistry.Register(); + containerRegistry.Register(); containerRegistry.RegisterSingleton(); } diff --git a/Borepin/Borepin.Android/Services/NFCService.cs b/Borepin/Borepin.Android/Services/NFCService.cs new file mode 100644 index 0000000..8fbc343 --- /dev/null +++ b/Borepin/Borepin.Android/Services/NFCService.cs @@ -0,0 +1,33 @@ +using Android.App; +using Android.Content; +using Android.OS; +using Android.Runtime; +using Android.Views; +using Android.Widget; +using Borepin.Service.NFC; +using NFC.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Borepin.Droid.Services +{ + public class NFCService : INFCService + { + public ICard GetCard() + { + throw new NotImplementedException(); + } + + public IHardware GetHardware() + { + throw new NotImplementedException(); + } + + public IReader GetReader() + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/Borepin/Borepin.UWP/Borepin.UWP.csproj b/Borepin/Borepin.UWP/Borepin.UWP.csproj index 52680ed..aaf1abf 100644 --- a/Borepin/Borepin.UWP/Borepin.UWP.csproj +++ b/Borepin/Borepin.UWP/Borepin.UWP.csproj @@ -100,6 +100,7 @@ + @@ -190,6 +191,10 @@ {c587aac3-50a7-4871-a50d-7880b6f24ef6} Capnp.Net.Runtime + + {D53A98E8-48B5-4DCE-A98E-4623EE746E16} + NFC + {3251FCE9-FEA3-4662-8BEB-636BE6732D48} FabAccessAPI diff --git a/Borepin/Borepin.UWP/PlatformInitializer.cs b/Borepin/Borepin.UWP/PlatformInitializer.cs index 0818906..ba259ff 100644 --- a/Borepin/Borepin.UWP/PlatformInitializer.cs +++ b/Borepin/Borepin.UWP/PlatformInitializer.cs @@ -5,6 +5,7 @@ using Borepin.Service.Storage; using Borepin.Service.Versioning; using Borepin.Service; using Borepin.Service.Browser; +using Borepin.Service.NFC; namespace Borepin.UWP { @@ -16,6 +17,7 @@ namespace Borepin.UWP containerRegistry.Register(); containerRegistry.Register(); containerRegistry.Register(); + containerRegistry.Register(); containerRegistry.RegisterSingleton(); } diff --git a/Borepin/Borepin.UWP/Services/NFCService.cs b/Borepin/Borepin.UWP/Services/NFCService.cs new file mode 100644 index 0000000..3c651d2 --- /dev/null +++ b/Borepin/Borepin.UWP/Services/NFCService.cs @@ -0,0 +1,28 @@ +using Borepin.Service.NFC; +using NFC.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Borepin.UWP.Services +{ + public class NFCService : INFCService + { + public ICard GetCard() + { + throw new NotImplementedException(); + } + + public IHardware GetHardware() + { + throw new NotImplementedException(); + } + + public IReader GetReader() + { + throw new NotImplementedException(); + } + } +} diff --git a/Borepin/Borepin.iOS/Borepin.iOS.csproj b/Borepin/Borepin.iOS/Borepin.iOS.csproj index ba7a226..1e669f1 100644 --- a/Borepin/Borepin.iOS/Borepin.iOS.csproj +++ b/Borepin/Borepin.iOS/Borepin.iOS.csproj @@ -83,6 +83,7 @@ + @@ -194,6 +195,10 @@ + + {D53A98E8-48B5-4DCE-A98E-4623EE746E16} + NFC + {3251FCE9-FEA3-4662-8BEB-636BE6732D48} FabAccessAPI diff --git a/Borepin/Borepin.iOS/PlatformInitializer.cs b/Borepin/Borepin.iOS/PlatformInitializer.cs index ade1f95..8b4c5e8 100644 --- a/Borepin/Borepin.iOS/PlatformInitializer.cs +++ b/Borepin/Borepin.iOS/PlatformInitializer.cs @@ -1,6 +1,7 @@ using Borepin.iOS.Services; using Borepin.Service; using Borepin.Service.Browser; +using Borepin.Service.NFC; using Borepin.Service.Storage; using Borepin.Service.Versioning; using Prism; @@ -16,6 +17,7 @@ namespace Borepin.iOS containerRegistry.Register(); containerRegistry.Register(); containerRegistry.Register(); + containerRegistry.Register(); containerRegistry.RegisterSingleton(); } diff --git a/Borepin/Borepin.iOS/Services/NFCService.cs b/Borepin/Borepin.iOS/Services/NFCService.cs new file mode 100644 index 0000000..29f8224 --- /dev/null +++ b/Borepin/Borepin.iOS/Services/NFCService.cs @@ -0,0 +1,29 @@ +using Borepin.Service.NFC; +using Foundation; +using NFC.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UIKit; + +namespace Borepin.iOS.Services +{ + public class NFCService : INFCService + { + public ICard GetCard() + { + throw new NotImplementedException(); + } + + public IHardware GetHardware() + { + throw new NotImplementedException(); + } + + public IReader GetReader() + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/Borepin/Borepin/Borepin.csproj b/Borepin/Borepin/Borepin.csproj index a5f7eac..f8cce68 100644 --- a/Borepin/Borepin/Borepin.csproj +++ b/Borepin/Borepin/Borepin.csproj @@ -159,6 +159,7 @@ + diff --git a/Borepin/Borepin/Service/NFC/INFCService.cs b/Borepin/Borepin/Service/NFC/INFCService.cs new file mode 100644 index 0000000..e863c38 --- /dev/null +++ b/Borepin/Borepin/Service/NFC/INFCService.cs @@ -0,0 +1,17 @@ +using NFC.Interfaces; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Borepin.Service.NFC +{ + /// + /// Service to provide hardware specific NFC Interfaces + /// + public interface INFCService + { + IHardware GetHardware(); + IReader GetReader(); + ICard GetCard(); + } +} From 446dd850a3b1893bff858389b403b7b03a4922f6 Mon Sep 17 00:00:00 2001 From: TheJoKlLa Date: Sun, 29 Jan 2023 22:14:39 +0100 Subject: [PATCH 02/22] More NFCService --- Borepin/Borepin.UWP/Services/NFCService.cs | 60 ++++++++++++++++++++-- Borepin/Borepin/Service/NFC/INFCService.cs | 41 +++++++++++++-- external/NFC | 2 +- 3 files changed, 95 insertions(+), 8 deletions(-) diff --git a/Borepin/Borepin.UWP/Services/NFCService.cs b/Borepin/Borepin.UWP/Services/NFCService.cs index 3c651d2..2571955 100644 --- a/Borepin/Borepin.UWP/Services/NFCService.cs +++ b/Borepin/Borepin.UWP/Services/NFCService.cs @@ -1,5 +1,7 @@ using Borepin.Service.NFC; +using NFC; using NFC.Interfaces; +using NFC_PCSC; using System; using System.Collections.Generic; using System.Linq; @@ -10,17 +12,69 @@ namespace Borepin.UWP.Services { public class NFCService : INFCService { - public ICard GetCard() + #region Private Members + IHardware _Hardware; + IReader _Reader; + ICard _Card; + #endregion + + #region Constructors + public NFCService(IHardware hardware = null) + { + if(hardware == null) + { + _Hardware = new Hardware_PCSC(); + } + else + { + _Hardware = hardware; + } + } + #endregion + + #region Members + public bool IsAvailable + { + get + { + return true; + } + } + public bool IsEnabled + { + get + { + return true; + } + } + + public bool IsConnected + { + get + { + return _Reader != null && _Card != null; + } + } + #endregion + + #region Methods + public IList GetReaderIDs() + { + return new List(_Hardware.GetReaders()); + } + #endregion + + public void Connect(string readerID) { throw new NotImplementedException(); } - public IHardware GetHardware() + public void Disconnect() { throw new NotImplementedException(); } - public IReader GetReader() + public APDUResponse Transmit(APDUCommand command) { throw new NotImplementedException(); } diff --git a/Borepin/Borepin/Service/NFC/INFCService.cs b/Borepin/Borepin/Service/NFC/INFCService.cs index e863c38..f099455 100644 --- a/Borepin/Borepin/Service/NFC/INFCService.cs +++ b/Borepin/Borepin/Service/NFC/INFCService.cs @@ -1,4 +1,5 @@ -using NFC.Interfaces; +using NFC; +using NFC.Interfaces; using System; using System.Collections.Generic; using System.Text; @@ -10,8 +11,40 @@ namespace Borepin.Service.NFC /// public interface INFCService { - IHardware GetHardware(); - IReader GetReader(); - ICard GetCard(); + /// + /// Indicates if NFC Hardware is available + /// + bool IsAvailable { get; } + + /// + /// Indicates if NFC Hardware is enabled + /// + bool IsEnabled { get; } + + /// + /// Indicates if NFC Card is connected + /// + bool IsConnected { get; } + + /// + /// Get a list of availible NFC ReaderIDs + /// + IList GetReaderIDs(); + + /// + /// Connect with ReaderID to NFC Card + /// + /// ReaderID from GetReaderIDs + void Connect(string readerID); + + /// + /// Disconnects Reader from NFC Card + /// + void Disconnect(); + + /// + /// Transmit APDUCommand to Card if connected + /// + APDUResponse Transmit(APDUCommand command); } } diff --git a/external/NFC b/external/NFC index 4420dbf..327472b 160000 --- a/external/NFC +++ b/external/NFC @@ -1 +1 @@ -Subproject commit 4420dbf1b1e820d94d6adaa2b65a851ac582be8f +Subproject commit 327472bea06316a6d439b6b0224ffedd2c6f1bbc From df07210c7ec65702d2391ccd3eb95b86bc016049 Mon Sep 17 00:00:00 2001 From: TheJoKlLa Date: Tue, 31 Jan 2023 00:30:15 +0100 Subject: [PATCH 03/22] Imported NFCService --- Borepin.sln | 154 +++++++++--------- .../Borepin.Android/Borepin.Android.csproj | 4 - Borepin/Borepin.UWP/Borepin.UWP.csproj | 9 +- Borepin/Borepin.UWP/Package.appxmanifest | 2 +- Borepin/Borepin.UWP/PlatformInitializer.cs | 3 +- Borepin/Borepin.UWP/Services/NFCService.cs | 82 ---------- Borepin/Borepin.iOS/Borepin.iOS.csproj | 4 - Borepin/Borepin/Borepin.csproj | 1 - Borepin/Borepin/Service/NFC/INFCService.cs | 50 ------ external/NFC | 2 +- external/capnproto-dotnetcore | 2 +- 11 files changed, 86 insertions(+), 227 deletions(-) delete mode 100644 Borepin/Borepin.UWP/Services/NFCService.cs delete mode 100644 Borepin/Borepin/Service/NFC/INFCService.cs diff --git a/Borepin.sln b/Borepin.sln index bd8951a..86ac32a 100644 --- a/Borepin.sln +++ b/Borepin.sln @@ -17,10 +17,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "S22.Sasl", "external\SASL\S EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FabAccessAPI_Test", "FabAccessAPI_Test\FabAccessAPI_Test.csproj", "{1C85978A-9FC0-4064-8399-FA2455C5EC2A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NFC", "external\NFC\NFC\NFC.csproj", "{D53A98E8-48B5-4DCE-A98E-4623EE746E16}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Capnp.Net.Runtime", "external\capnproto-dotnetcore\Capnp.Net.Runtime\Capnp.Net.Runtime.csproj", "{C587AAC3-50A7-4871-A50D-7880B6F24EF6}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Borepin_Test", "Borepin_Test\Borepin_Test.csproj", "{A959A406-91A5-4D81-B90D-EF022812D97D}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0EA0AA4A-A814-45A0-9EA7-E9147CCCCB6A}" @@ -32,7 +28,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Borepin.GTK", "Borepin\Borepin.GTK\Borepin.GTK.csproj", "{61D956D2-5819-4736-BBD8-AD8208DE6A62}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NFC_PCSC", "external\NFC\NFC_PCSC\NFC_PCSC.csproj", "{75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NFC", "external\NFC\NFC\NFC.csproj", "{AC068302-655B-46B8-BC8A-971A3D685437}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NFC.PCSC", "external\NFC\NFC.PCSC\NFC.PCSC.csproj", "{6E2927DD-791F-48FA-96E1-696611FB38EB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Capnp.Net.Runtime", "external\capnproto-dotnetcore\Capnp.Net.Runtime\Capnp.Net.Runtime.csproj", "{6CC49E97-4F07-43DE-A2AF-50914498A276}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -266,54 +266,6 @@ Global {1C85978A-9FC0-4064-8399-FA2455C5EC2A}.Release|x64.Build.0 = Release|Any CPU {1C85978A-9FC0-4064-8399-FA2455C5EC2A}.Release|x86.ActiveCfg = Release|Any CPU {1C85978A-9FC0-4064-8399-FA2455C5EC2A}.Release|x86.Build.0 = Release|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Debug|ARM.ActiveCfg = Debug|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Debug|ARM.Build.0 = Debug|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Debug|iPhone.Build.0 = Debug|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Debug|x64.ActiveCfg = Debug|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Debug|x64.Build.0 = Debug|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Debug|x86.ActiveCfg = Debug|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Debug|x86.Build.0 = Debug|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|Any CPU.Build.0 = Release|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|ARM.ActiveCfg = Release|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|ARM.Build.0 = Release|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|iPhone.ActiveCfg = Release|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|iPhone.Build.0 = Release|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|x64.ActiveCfg = Release|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|x64.Build.0 = Release|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|x86.ActiveCfg = Release|Any CPU - {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|x86.Build.0 = Release|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|ARM.ActiveCfg = Debug|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|ARM.Build.0 = Debug|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|iPhone.Build.0 = Debug|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|x64.ActiveCfg = Debug|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|x64.Build.0 = Debug|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|x86.ActiveCfg = Debug|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|x86.Build.0 = Debug|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|Any CPU.Build.0 = Release|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|ARM.ActiveCfg = Release|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|ARM.Build.0 = Release|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|iPhone.ActiveCfg = Release|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|iPhone.Build.0 = Release|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|x64.ActiveCfg = Release|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|x64.Build.0 = Release|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|x86.ActiveCfg = Release|Any CPU - {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|x86.Build.0 = Release|Any CPU {A959A406-91A5-4D81-B90D-EF022812D97D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A959A406-91A5-4D81-B90D-EF022812D97D}.Debug|Any CPU.Build.0 = Debug|Any CPU {A959A406-91A5-4D81-B90D-EF022812D97D}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -362,30 +314,78 @@ Global {61D956D2-5819-4736-BBD8-AD8208DE6A62}.Release|x64.Build.0 = Release|Any CPU {61D956D2-5819-4736-BBD8-AD8208DE6A62}.Release|x86.ActiveCfg = Release|Any CPU {61D956D2-5819-4736-BBD8-AD8208DE6A62}.Release|x86.Build.0 = Release|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|Any CPU.Build.0 = Debug|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|ARM.ActiveCfg = Debug|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|ARM.Build.0 = Debug|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|iPhone.Build.0 = Debug|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|x64.ActiveCfg = Debug|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|x64.Build.0 = Debug|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|x86.ActiveCfg = Debug|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|x86.Build.0 = Debug|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|Any CPU.ActiveCfg = Release|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|Any CPU.Build.0 = Release|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|ARM.ActiveCfg = Release|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|ARM.Build.0 = Release|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|iPhone.ActiveCfg = Release|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|iPhone.Build.0 = Release|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|x64.ActiveCfg = Release|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|x64.Build.0 = Release|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|x86.ActiveCfg = Release|Any CPU - {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|x86.Build.0 = Release|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Debug|ARM.ActiveCfg = Debug|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Debug|ARM.Build.0 = Debug|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Debug|iPhone.Build.0 = Debug|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Debug|x64.ActiveCfg = Debug|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Debug|x64.Build.0 = Debug|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Debug|x86.ActiveCfg = Debug|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Debug|x86.Build.0 = Debug|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Release|Any CPU.Build.0 = Release|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Release|ARM.ActiveCfg = Release|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Release|ARM.Build.0 = Release|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Release|iPhone.ActiveCfg = Release|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Release|iPhone.Build.0 = Release|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Release|x64.ActiveCfg = Release|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Release|x64.Build.0 = Release|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Release|x86.ActiveCfg = Release|Any CPU + {AC068302-655B-46B8-BC8A-971A3D685437}.Release|x86.Build.0 = Release|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Debug|ARM.ActiveCfg = Debug|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Debug|ARM.Build.0 = Debug|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Debug|iPhone.Build.0 = Debug|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Debug|x64.ActiveCfg = Debug|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Debug|x64.Build.0 = Debug|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Debug|x86.ActiveCfg = Debug|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Debug|x86.Build.0 = Debug|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Release|Any CPU.Build.0 = Release|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Release|ARM.ActiveCfg = Release|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Release|ARM.Build.0 = Release|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Release|iPhone.ActiveCfg = Release|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Release|iPhone.Build.0 = Release|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Release|x64.ActiveCfg = Release|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Release|x64.Build.0 = Release|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Release|x86.ActiveCfg = Release|Any CPU + {6E2927DD-791F-48FA-96E1-696611FB38EB}.Release|x86.Build.0 = Release|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Debug|ARM.ActiveCfg = Debug|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Debug|ARM.Build.0 = Debug|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Debug|iPhone.Build.0 = Debug|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Debug|x64.ActiveCfg = Debug|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Debug|x64.Build.0 = Debug|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Debug|x86.ActiveCfg = Debug|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Debug|x86.Build.0 = Debug|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Release|Any CPU.Build.0 = Release|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Release|ARM.ActiveCfg = Release|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Release|ARM.Build.0 = Release|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Release|iPhone.ActiveCfg = Release|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Release|iPhone.Build.0 = Release|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Release|x64.ActiveCfg = Release|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Release|x64.Build.0 = Release|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Release|x86.ActiveCfg = Release|Any CPU + {6CC49E97-4F07-43DE-A2AF-50914498A276}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Borepin/Borepin.Android/Borepin.Android.csproj b/Borepin/Borepin.Android/Borepin.Android.csproj index 6792bec..7237065 100644 --- a/Borepin/Borepin.Android/Borepin.Android.csproj +++ b/Borepin/Borepin.Android/Borepin.Android.csproj @@ -94,10 +94,6 @@ - - {D53A98E8-48B5-4DCE-A98E-4623EE746E16} - NFC - {3251FCE9-FEA3-4662-8BEB-636BE6732D48} FabAccessAPI diff --git a/Borepin/Borepin.UWP/Borepin.UWP.csproj b/Borepin/Borepin.UWP/Borepin.UWP.csproj index aaf1abf..d3b27dc 100644 --- a/Borepin/Borepin.UWP/Borepin.UWP.csproj +++ b/Borepin/Borepin.UWP/Borepin.UWP.csproj @@ -100,7 +100,6 @@ - @@ -187,12 +186,12 @@ - - {c587aac3-50a7-4871-a50d-7880b6f24ef6} - Capnp.Net.Runtime + + {6e2927dd-791f-48fa-96e1-696611fb38eb} + NFC.PCSC - {D53A98E8-48B5-4DCE-A98E-4623EE746E16} + {ac068302-655b-46b8-bc8a-971a3d685437} NFC diff --git a/Borepin/Borepin.UWP/Package.appxmanifest b/Borepin/Borepin.UWP/Package.appxmanifest index f509582..b945646 100644 --- a/Borepin/Borepin.UWP/Package.appxmanifest +++ b/Borepin/Borepin.UWP/Package.appxmanifest @@ -54,6 +54,6 @@ - + \ No newline at end of file diff --git a/Borepin/Borepin.UWP/PlatformInitializer.cs b/Borepin/Borepin.UWP/PlatformInitializer.cs index ba259ff..b43322a 100644 --- a/Borepin/Borepin.UWP/PlatformInitializer.cs +++ b/Borepin/Borepin.UWP/PlatformInitializer.cs @@ -5,7 +5,8 @@ using Borepin.Service.Storage; using Borepin.Service.Versioning; using Borepin.Service; using Borepin.Service.Browser; -using Borepin.Service.NFC; +using NFC.PCSC; +using NFC.Interfaces; namespace Borepin.UWP { diff --git a/Borepin/Borepin.UWP/Services/NFCService.cs b/Borepin/Borepin.UWP/Services/NFCService.cs deleted file mode 100644 index 2571955..0000000 --- a/Borepin/Borepin.UWP/Services/NFCService.cs +++ /dev/null @@ -1,82 +0,0 @@ -using Borepin.Service.NFC; -using NFC; -using NFC.Interfaces; -using NFC_PCSC; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Borepin.UWP.Services -{ - public class NFCService : INFCService - { - #region Private Members - IHardware _Hardware; - IReader _Reader; - ICard _Card; - #endregion - - #region Constructors - public NFCService(IHardware hardware = null) - { - if(hardware == null) - { - _Hardware = new Hardware_PCSC(); - } - else - { - _Hardware = hardware; - } - } - #endregion - - #region Members - public bool IsAvailable - { - get - { - return true; - } - } - public bool IsEnabled - { - get - { - return true; - } - } - - public bool IsConnected - { - get - { - return _Reader != null && _Card != null; - } - } - #endregion - - #region Methods - public IList GetReaderIDs() - { - return new List(_Hardware.GetReaders()); - } - #endregion - - public void Connect(string readerID) - { - throw new NotImplementedException(); - } - - public void Disconnect() - { - throw new NotImplementedException(); - } - - public APDUResponse Transmit(APDUCommand command) - { - throw new NotImplementedException(); - } - } -} diff --git a/Borepin/Borepin.iOS/Borepin.iOS.csproj b/Borepin/Borepin.iOS/Borepin.iOS.csproj index 1e669f1..24865a0 100644 --- a/Borepin/Borepin.iOS/Borepin.iOS.csproj +++ b/Borepin/Borepin.iOS/Borepin.iOS.csproj @@ -195,10 +195,6 @@ - - {D53A98E8-48B5-4DCE-A98E-4623EE746E16} - NFC - {3251FCE9-FEA3-4662-8BEB-636BE6732D48} FabAccessAPI diff --git a/Borepin/Borepin/Borepin.csproj b/Borepin/Borepin/Borepin.csproj index f8cce68..a5f7eac 100644 --- a/Borepin/Borepin/Borepin.csproj +++ b/Borepin/Borepin/Borepin.csproj @@ -159,7 +159,6 @@ - diff --git a/Borepin/Borepin/Service/NFC/INFCService.cs b/Borepin/Borepin/Service/NFC/INFCService.cs deleted file mode 100644 index f099455..0000000 --- a/Borepin/Borepin/Service/NFC/INFCService.cs +++ /dev/null @@ -1,50 +0,0 @@ -using NFC; -using NFC.Interfaces; -using System; -using System.Collections.Generic; -using System.Text; - -namespace Borepin.Service.NFC -{ - /// - /// Service to provide hardware specific NFC Interfaces - /// - public interface INFCService - { - /// - /// Indicates if NFC Hardware is available - /// - bool IsAvailable { get; } - - /// - /// Indicates if NFC Hardware is enabled - /// - bool IsEnabled { get; } - - /// - /// Indicates if NFC Card is connected - /// - bool IsConnected { get; } - - /// - /// Get a list of availible NFC ReaderIDs - /// - IList GetReaderIDs(); - - /// - /// Connect with ReaderID to NFC Card - /// - /// ReaderID from GetReaderIDs - void Connect(string readerID); - - /// - /// Disconnects Reader from NFC Card - /// - void Disconnect(); - - /// - /// Transmit APDUCommand to Card if connected - /// - APDUResponse Transmit(APDUCommand command); - } -} diff --git a/external/NFC b/external/NFC index 327472b..e79b6aa 160000 --- a/external/NFC +++ b/external/NFC @@ -1 +1 @@ -Subproject commit 327472bea06316a6d439b6b0224ffedd2c6f1bbc +Subproject commit e79b6aace26c8b362a5f450345a67ba700f06805 diff --git a/external/capnproto-dotnetcore b/external/capnproto-dotnetcore index 63e6385..cf07455 160000 --- a/external/capnproto-dotnetcore +++ b/external/capnproto-dotnetcore @@ -1 +1 @@ -Subproject commit 63e63853c1d5ca9f223aa3627ad391ce434a0683 +Subproject commit cf0745589b1ca10083bdcdaa6bf99fd24c72a535 From 0f8f42428868a61fab3ea97ccaef6764efcd6c15 Mon Sep 17 00:00:00 2001 From: TheJoKlLa Date: Tue, 31 Jan 2023 00:46:33 +0100 Subject: [PATCH 04/22] Fixed: NFCService --- .../Borepin.Android/Borepin.Android.csproj | 1 - .../Borepin.Android/PlatformInitializer.cs | 3 +- .../Borepin.Android/Services/NFCService.cs | 33 ------------------- Borepin/Borepin.iOS/Borepin.iOS.csproj | 1 - Borepin/Borepin.iOS/PlatformInitializer.cs | 3 +- Borepin/Borepin.iOS/Services/NFCService.cs | 29 ---------------- 6 files changed, 2 insertions(+), 68 deletions(-) delete mode 100644 Borepin/Borepin.Android/Services/NFCService.cs delete mode 100644 Borepin/Borepin.iOS/Services/NFCService.cs diff --git a/Borepin/Borepin.Android/Borepin.Android.csproj b/Borepin/Borepin.Android/Borepin.Android.csproj index 7237065..9b97e58 100644 --- a/Borepin/Borepin.Android/Borepin.Android.csproj +++ b/Borepin/Borepin.Android/Borepin.Android.csproj @@ -82,7 +82,6 @@ - diff --git a/Borepin/Borepin.Android/PlatformInitializer.cs b/Borepin/Borepin.Android/PlatformInitializer.cs index 419f107..c482a3b 100644 --- a/Borepin/Borepin.Android/PlatformInitializer.cs +++ b/Borepin/Borepin.Android/PlatformInitializer.cs @@ -1,7 +1,6 @@ using Borepin.Droid.Services; using Borepin.Service; using Borepin.Service.Browser; -using Borepin.Service.NFC; using Borepin.Service.Storage; using Borepin.Service.Versioning; using Prism; @@ -17,7 +16,7 @@ namespace Borepin.Droid containerRegistry.Register(); containerRegistry.Register(); containerRegistry.Register(); - containerRegistry.Register(); + // TODO containerRegistry.Register(); containerRegistry.RegisterSingleton(); } diff --git a/Borepin/Borepin.Android/Services/NFCService.cs b/Borepin/Borepin.Android/Services/NFCService.cs deleted file mode 100644 index 8fbc343..0000000 --- a/Borepin/Borepin.Android/Services/NFCService.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Android.App; -using Android.Content; -using Android.OS; -using Android.Runtime; -using Android.Views; -using Android.Widget; -using Borepin.Service.NFC; -using NFC.Interfaces; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Borepin.Droid.Services -{ - public class NFCService : INFCService - { - public ICard GetCard() - { - throw new NotImplementedException(); - } - - public IHardware GetHardware() - { - throw new NotImplementedException(); - } - - public IReader GetReader() - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/Borepin/Borepin.iOS/Borepin.iOS.csproj b/Borepin/Borepin.iOS/Borepin.iOS.csproj index 24865a0..ba7a226 100644 --- a/Borepin/Borepin.iOS/Borepin.iOS.csproj +++ b/Borepin/Borepin.iOS/Borepin.iOS.csproj @@ -83,7 +83,6 @@ - diff --git a/Borepin/Borepin.iOS/PlatformInitializer.cs b/Borepin/Borepin.iOS/PlatformInitializer.cs index 8b4c5e8..dc885eb 100644 --- a/Borepin/Borepin.iOS/PlatformInitializer.cs +++ b/Borepin/Borepin.iOS/PlatformInitializer.cs @@ -1,7 +1,6 @@ using Borepin.iOS.Services; using Borepin.Service; using Borepin.Service.Browser; -using Borepin.Service.NFC; using Borepin.Service.Storage; using Borepin.Service.Versioning; using Prism; @@ -17,7 +16,7 @@ namespace Borepin.iOS containerRegistry.Register(); containerRegistry.Register(); containerRegistry.Register(); - containerRegistry.Register(); + // TODO containerRegistry.Register(); containerRegistry.RegisterSingleton(); } diff --git a/Borepin/Borepin.iOS/Services/NFCService.cs b/Borepin/Borepin.iOS/Services/NFCService.cs deleted file mode 100644 index 29f8224..0000000 --- a/Borepin/Borepin.iOS/Services/NFCService.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Borepin.Service.NFC; -using Foundation; -using NFC.Interfaces; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using UIKit; - -namespace Borepin.iOS.Services -{ - public class NFCService : INFCService - { - public ICard GetCard() - { - throw new NotImplementedException(); - } - - public IHardware GetHardware() - { - throw new NotImplementedException(); - } - - public IReader GetReader() - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file From 7886fba5c71e7310474b3b0ea83129badef905ed Mon Sep 17 00:00:00 2001 From: TheJoKlLa Date: Tue, 31 Jan 2023 01:20:59 +0100 Subject: [PATCH 05/22] Fixed: CapnProto Runtime --- Borepin/Borepin.UWP/Borepin.UWP.csproj | 4 ++++ external/capnproto-dotnetcore | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Borepin/Borepin.UWP/Borepin.UWP.csproj b/Borepin/Borepin.UWP/Borepin.UWP.csproj index d3b27dc..bf2f6aa 100644 --- a/Borepin/Borepin.UWP/Borepin.UWP.csproj +++ b/Borepin/Borepin.UWP/Borepin.UWP.csproj @@ -186,6 +186,10 @@ + + {6cc49e97-4f07-43de-a2af-50914498a276} + Capnp.Net.Runtime + {6e2927dd-791f-48fa-96e1-696611fb38eb} NFC.PCSC diff --git a/external/capnproto-dotnetcore b/external/capnproto-dotnetcore index cf07455..a70eecd 160000 --- a/external/capnproto-dotnetcore +++ b/external/capnproto-dotnetcore @@ -1 +1 @@ -Subproject commit cf0745589b1ca10083bdcdaa6bf99fd24c72a535 +Subproject commit a70eecd99112b16902128b8b4b2c95b2721fdf0e From c425e05e8b8ceecccb79893d26755df1b5956ae1 Mon Sep 17 00:00:00 2001 From: TheJoKlLa Date: Wed, 1 Feb 2023 02:39:59 +0100 Subject: [PATCH 06/22] Added: Create Card Page --- Borepin/Borepin.UWP/Package.appxmanifest | 3 +- Borepin/Borepin/App.xaml.cs | 1 + Borepin/Borepin/Borepin.csproj | 4 + Borepin/Borepin/Model/CardConfig.cs | 63 +++++ Borepin/Borepin/Model/FabFireCard.cs | 34 +++ Borepin/Borepin/Page/CreateCardPage.xaml | 65 +++++ Borepin/Borepin/Page/CreateCardPage.xaml.cs | 20 ++ Borepin/Borepin/Page/UserPage.xaml | 6 +- .../Borepin/PageModel/CreateCardPageModel.cs | 259 ++++++++++++++++++ .../Borepin/PageModel/MachineListPageModel.cs | 9 - .../Borepin/PageModel/UserListPageModel.cs | 9 - Borepin/Borepin/PageModel/UserPageModel.cs | 65 +++++ 12 files changed, 518 insertions(+), 20 deletions(-) create mode 100644 Borepin/Borepin/Model/CardConfig.cs create mode 100644 Borepin/Borepin/Model/FabFireCard.cs create mode 100644 Borepin/Borepin/Page/CreateCardPage.xaml create mode 100644 Borepin/Borepin/Page/CreateCardPage.xaml.cs create mode 100644 Borepin/Borepin/PageModel/CreateCardPageModel.cs diff --git a/Borepin/Borepin.UWP/Package.appxmanifest b/Borepin/Borepin.UWP/Package.appxmanifest index b945646..82b7c23 100644 --- a/Borepin/Borepin.UWP/Package.appxmanifest +++ b/Borepin/Borepin.UWP/Package.appxmanifest @@ -54,6 +54,7 @@ - + + \ No newline at end of file diff --git a/Borepin/Borepin/App.xaml.cs b/Borepin/Borepin/App.xaml.cs index 0398942..b3effeb 100644 --- a/Borepin/Borepin/App.xaml.cs +++ b/Borepin/Borepin/App.xaml.cs @@ -51,6 +51,7 @@ namespace Borepin containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); #endregion diff --git a/Borepin/Borepin/Borepin.csproj b/Borepin/Borepin/Borepin.csproj index 69ae925..32ed436 100644 --- a/Borepin/Borepin/Borepin.csproj +++ b/Borepin/Borepin/Borepin.csproj @@ -111,6 +111,9 @@ MSBuild:UpdateDesignTimeXaml + + MSBuild:UpdateDesignTimeXaml + MSBuild:UpdateDesignTimeXaml @@ -156,6 +159,7 @@ + diff --git a/Borepin/Borepin/Model/CardConfig.cs b/Borepin/Borepin/Model/CardConfig.cs new file mode 100644 index 0000000..51c9524 --- /dev/null +++ b/Borepin/Borepin/Model/CardConfig.cs @@ -0,0 +1,63 @@ +using NFC.Helper; +using System; +using System.Globalization; + +namespace Borepin.Model +{ + public class CardConfig + { + #region Constructors + public CardConfig() + { + PICCKey = ByteOperation.GenerateEmptyArray(16); + APPKey = ByteOperation.GenerateEmptyArray(16); + } + #endregion + + #region Fields + public string UserID; + + public byte[] PICCKey; + public byte[] APPKey; + + public bool DoFormat; + + public byte[] CardToken; + public byte[] MetaInfo; + public byte[] SpaceInfo; + #endregion + + #region Mehtods + public string ConvertToString(byte[] array) + { + string data = HexConverter.ConvertToHexString(array); + data = data.ToUpper(CultureInfo.InvariantCulture); + + for(int i = 2; i < data.Length; i += 3) + { + data = data.Insert(i, " "); + } + + return data; + } + + public byte[] ConvertFromString(string data) + { + data = data.Trim(); + data = data.Replace(" ", ""); + + byte[] array = HexConverter.ConvertFromHexString(data); + return array; + } + + public byte[] GenerateRandomKey() + { + byte[] key = ByteOperation.GenerateEmptyArray(16); + Random random= new Random(); + + random.NextBytes(key); + return key; + } + #endregion + } +} diff --git a/Borepin/Borepin/Model/FabFireCard.cs b/Borepin/Borepin/Model/FabFireCard.cs new file mode 100644 index 0000000..d4c2c94 --- /dev/null +++ b/Borepin/Borepin/Model/FabFireCard.cs @@ -0,0 +1,34 @@ +using Borepin.Service.ErrorMessage; +using NFC.Interfaces; +using System; + +namespace Borepin.Model +{ + public class FabFireCard + { + #region Private Fields + INFCService _NFCService; + IErrorMessageService _ErrorMessageService; + #endregion + + #region Constructors + public FabFireCard(INFCService nfcService, IErrorMessageService errorMessageService) + { + _NFCService = nfcService; + _ErrorMessageService = errorMessageService; + } + #endregion + + #region Methods + public void FormatCard(string readerID, CardConfig cardConfig) + { + throw new NotImplementedException(); + } + + public void CreateCard(string readerID, CardConfig cardConfig) + { + throw new NotImplementedException(); + } + #endregion + } +} diff --git a/Borepin/Borepin/Page/CreateCardPage.xaml b/Borepin/Borepin/Page/CreateCardPage.xaml new file mode 100644 index 0000000..7e2df60 --- /dev/null +++ b/Borepin/Borepin/Page/CreateCardPage.xaml @@ -0,0 +1,65 @@ + + + +