├── publish.cmd ├── src └── LpacFibocomWrapper │ ├── Properties │ └── launchSettings.json │ ├── ApduDevice │ ├── IApduDevice.cs │ ├── BaseAtDevice.cs │ ├── ApduAtDevice.cs │ └── ApduAtKnDevice.cs │ ├── LpacFibocomWrapper.csproj │ └── Program.cs ├── LICENSE ├── LpacFibocomWrapper.sln ├── README.md ├── .gitignore └── .editorconfig /publish.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | dotnet publish -r win-x64 -c Release -p:PublishAOT=true -o dist src/LpacFibocomWrapper/LpacFibocomWrapper.csproj 3 | -------------------------------------------------------------------------------- /src/LpacFibocomWrapper/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Develop": { 4 | "commandName": "Project", 5 | "workingDirectory": "$(MSBuildProjectDirectory)/../../../EasyLPAC", 6 | "commandLineArgs": "version", 7 | "environmentVariables": { 8 | "AT_DEVICE": "COM10" 9 | } 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/LpacFibocomWrapper/ApduDevice/IApduDevice.cs: -------------------------------------------------------------------------------- 1 | namespace LpacFibocomWrapper.ApduDevice; 2 | 3 | public record ApduItem(string Env, string Name); 4 | 5 | public interface IApduDevice : IDisposable 6 | { 7 | Task> GetDriverApduList(); 8 | Task Connect(); 9 | Task Disconnect(); 10 | 11 | Task LogicChannelOpen(string param); 12 | Task LogicChannelClose(); 13 | 14 | Task Transmit(string param); 15 | } 16 | -------------------------------------------------------------------------------- /src/LpacFibocomWrapper/LpacFibocomWrapper.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | lpac-fibocom-wrapper 7 | enable 8 | enable 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Prusa 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LpacFibocomWrapper.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.10.35122.118 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LpacFibocomWrapper", "src\LpacFibocomWrapper\LpacFibocomWrapper.csproj", "{F5F40984-BD4F-4333-BD57-3E11AC320493}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{6D257089-D60A-4257-B451-A052462F42F1}" 9 | ProjectSection(SolutionItems) = preProject 10 | .editorconfig = .editorconfig 11 | .gitignore = .gitignore 12 | LICENSE = LICENSE 13 | README.md = README.md 14 | EndProjectSection 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Any CPU = Debug|Any CPU 19 | Release|Any CPU = Release|Any CPU 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {F5F40984-BD4F-4333-BD57-3E11AC320493}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {F5F40984-BD4F-4333-BD57-3E11AC320493}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {F5F40984-BD4F-4333-BD57-3E11AC320493}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {F5F40984-BD4F-4333-BD57-3E11AC320493}.Release|Any CPU.Build.0 = Release|Any CPU 26 | EndGlobalSection 27 | GlobalSection(SolutionProperties) = preSolution 28 | HideSolutionNode = FALSE 29 | EndGlobalSection 30 | GlobalSection(ExtensibilityGlobals) = postSolution 31 | SolutionGuid = {839A461D-D6A6-4A35-AD78-62AC7733CFB1} 32 | EndGlobalSection 33 | EndGlobal 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # lpac-fibocom-wrapper 2 | This is a wrapper for the [LPAC](https://github.com/estkme-group/lpac) client that uses serial port to manage eUICC (eSIM) on Fibocom FM350. 3 | 4 | # Usage 5 | - Download and extract [LPAC](https://github.com/estkme-group/lpac/releases) 6 | - Download and extract [lpac-fibocom-wrapper](https://github.com/prusa-dev/lpac-fibocom-wrapper/releases) 7 | - Copy `lpac.exe` to lpac-fibocom-wrapper folder 8 | - Rename `lpac.exe` to `lpac.orig.exe` 9 | - Connect modem to PC via USB 10 | - Set environment variable `AT_DEVICE` to modem serial port. (Ex: `SET AT_DEVICE=COM10`) 11 | - Run `lpac-fibocom-wrapper.exe chip info` 12 | 13 | # Usage with EasyLPAC 14 | - Download and extract [EasyLPAC](https://github.com/creamlike1024/EasyLPAC/releases) 15 | - Rename `lpac.exe` to `lpac.orig.exe` 16 | - Copy `lpac-fibocom-wrapper.exe` from lpac-fibocom-wrapper to EasyLPAC 17 | - Rename `lpac-fibocom-wrapper.exe` to `lpac.exe` 18 | - Connect modem to PC via USB 19 | - Execute EasyLPAC 20 | - Select serial port in `Card Reader` menu 21 | - Press `refresh` button 22 | 23 | # Information 24 | When using Fibocom FM350 select the correct slot based on type of eSIM you are using (slot 0=Physical SIM, slot 1=Embedded eSIM) 25 | ``` 26 | AT+GTDUALSIM=1 27 | ``` 28 | 29 | For AT provisioning, the modem needs these commands to interact with the eUICC: 30 | 31 | - `AT+CCHO` to open logical channel 32 | - `AT+CCHC` to close logical channel 33 | - `AT+CGLA` to use logical channel access 34 | 35 | # Keenetic Rest API 36 | Wrapper support Keenetic Rest API. 37 | 38 | ## Usage 39 | - Create text file `lpak-kn.env` near wrapper exe file 40 | - Write your router address, login and password: 41 | ``` 42 | AT_KN_ADDRESS=http://192.168.1.1 43 | AT_KN_LOGIN=admin 44 | AT_KN_PASSWORD=admin 45 | ``` -------------------------------------------------------------------------------- /src/LpacFibocomWrapper/ApduDevice/BaseAtDevice.cs: -------------------------------------------------------------------------------- 1 | using System.Text.RegularExpressions; 2 | 3 | namespace LpacFibocomWrapper.ApduDevice; 4 | public abstract partial class BaseAtDevice : IApduDevice 5 | { 6 | [GeneratedRegex("\\+CGLA:\\s?(?\\d+),(?[\\S]+)")] 7 | protected static partial Regex RegExCgla(); 8 | 9 | [GeneratedRegex("\\+CCHO:\\s?(?\\d+)")] 10 | protected static partial Regex RegExCcho(); 11 | 12 | protected int LogicChannelId = -1; 13 | 14 | protected abstract Task SendAtCommand(string atCommand); 15 | 16 | public void Dispose() 17 | { 18 | Dispose(true); 19 | } 20 | 21 | protected abstract void Dispose(bool disposing); 22 | 23 | 24 | public abstract Task> GetDriverApduList(); 25 | 26 | public abstract Task Connect(); 27 | 28 | public abstract Task Disconnect(); 29 | 30 | public async Task LogicChannelOpen(string param) 31 | { 32 | var lines = await SendAtCommand($"AT+CCHO=\"{param}\""); 33 | 34 | for (var lineIndex = 0; lineIndex < lines.Length; lineIndex++) 35 | { 36 | var line = lines[lineIndex]; 37 | 38 | var m = RegExCcho().Match(line); 39 | if (m.Success && int.TryParse(m.Groups["channelId"].Value, out LogicChannelId)) 40 | { 41 | return LogicChannelId; 42 | } 43 | 44 | if (line == "OK" && lineIndex > 0 && int.TryParse(lines[lineIndex - 1], out LogicChannelId)) 45 | { 46 | return LogicChannelId; 47 | } 48 | } 49 | 50 | LogicChannelId = -1; 51 | 52 | return LogicChannelId; 53 | } 54 | 55 | public async Task LogicChannelClose() 56 | { 57 | await SendAtCommand($"AT+CCHC={LogicChannelId}"); 58 | return true; 59 | } 60 | 61 | public async Task Transmit(string param) 62 | { 63 | var lines = await SendAtCommand($"AT+CGLA={LogicChannelId},{param.Length},\"{param}\""); 64 | foreach (var line in lines) 65 | { 66 | var m = RegExCgla().Match(line); 67 | if (m.Success) 68 | { 69 | return m.Groups["data"].Value.Trim('"'); 70 | } 71 | } 72 | 73 | return null; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/LpacFibocomWrapper/ApduDevice/ApduAtDevice.cs: -------------------------------------------------------------------------------- 1 | using RJCP.IO.Ports; 2 | using System.Text; 3 | using System.Text.RegularExpressions; 4 | 5 | namespace LpacFibocomWrapper.ApduDevice; 6 | public partial class ApduAtDevice : BaseAtDevice 7 | { 8 | private SerialPortStream? _portStream; 9 | 10 | public ApduAtDevice(string? atDevice) 11 | { 12 | if (atDevice is null) 13 | { 14 | return; 15 | } 16 | 17 | _portStream = new SerialPortStream(atDevice) 18 | { 19 | BaudRate = 115200, 20 | DataBits = 8, 21 | Parity = Parity.None, 22 | StopBits = StopBits.One, 23 | ReadBufferSize = 8192, 24 | WriteBufferSize = 8192, 25 | ReadTimeout = 10000, 26 | WriteTimeout = 1000, 27 | }; 28 | } 29 | 30 | [GeneratedRegex("\r\n(OK|ERROR|\\+CME ERROR|\\+CMS ERROR)")] 31 | protected static partial Regex RegExEndOfResponse(); 32 | 33 | protected override Task SendAtCommand(string atCommand) 34 | { 35 | if (_portStream is null) 36 | { 37 | throw new NullReferenceException(); 38 | } 39 | 40 | var data = new StringBuilder(); 41 | 42 | _portStream.DiscardInBuffer(); 43 | _portStream.DiscardOutBuffer(); 44 | 45 | _portStream.WriteLine(atCommand); 46 | while (true) 47 | { 48 | var intermediateData = _portStream.ReadExisting(); 49 | data.Append(intermediateData); 50 | if (RegExEndOfResponse().IsMatch(intermediateData)) 51 | { 52 | break; 53 | } 54 | } 55 | var lines = data.ToString() 56 | .Split("\r\n", StringSplitOptions.RemoveEmptyEntries); 57 | 58 | return Task.FromResult(lines); 59 | } 60 | 61 | protected override void Dispose(bool disposing) 62 | { 63 | if (_portStream is not null) 64 | { 65 | _portStream.Dispose(); 66 | _portStream = null; 67 | } 68 | } 69 | 70 | public override async Task> GetDriverApduList() 71 | { 72 | await using var portStream = new SerialPortStream(); 73 | var ports = portStream.GetPortDescriptions(); 74 | return ports 75 | .Select(p => new ApduItem(p.Port, p.Description)) 76 | .ToList(); 77 | } 78 | 79 | public override Task Connect() 80 | { 81 | if (_portStream is null) 82 | { 83 | throw new NullReferenceException(); 84 | } 85 | 86 | var port = _portStream.PortName; 87 | 88 | if (!_portStream.GetPortNames() 89 | .Contains(port, StringComparer.OrdinalIgnoreCase)) 90 | { 91 | throw new Exception($"Serial Port {port} not found"); 92 | } 93 | 94 | _portStream.Open(); 95 | return Task.FromResult(true); 96 | } 97 | 98 | public override Task Disconnect() 99 | { 100 | _portStream?.Close(); 101 | return Task.FromResult(true); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/LpacFibocomWrapper/ApduDevice/ApduAtKnDevice.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Security.Cryptography; 3 | using System.Text; 4 | using System.Text.Json.Nodes; 5 | 6 | namespace LpacFibocomWrapper.ApduDevice; 7 | public class ApduAtKnDevice : BaseAtDevice 8 | { 9 | private readonly HttpClient _httpClient; 10 | private readonly string? _atDevice; 11 | private readonly string _login; 12 | private readonly string _password; 13 | 14 | public ApduAtKnDevice(string? atDevice, string address, string login, string password) 15 | { 16 | var cookieContainer = new CookieContainer(); 17 | var httpClientHandler = new HttpClientHandler { CookieContainer = cookieContainer, UseCookies = true }; 18 | _httpClient = new HttpClient(httpClientHandler, true); 19 | _httpClient.BaseAddress = new Uri(address); 20 | _atDevice = atDevice; 21 | _login = login; 22 | _password = password; 23 | } 24 | 25 | protected override void Dispose(bool disposing) 26 | { 27 | _httpClient.Dispose(); 28 | } 29 | 30 | private async Task KeeneticRequest(string requestUri, string? json = null) 31 | { 32 | if (json is null) 33 | { 34 | return await _httpClient.GetAsync(requestUri); 35 | } 36 | 37 | return await _httpClient.PostAsync(requestUri, new StringContent(json, Encoding.UTF8, "application/json")); 38 | } 39 | 40 | private async Task KeeneticAuth() 41 | { 42 | var response = await KeeneticRequest("auth"); 43 | if (response.StatusCode == HttpStatusCode.Unauthorized) 44 | { 45 | var realm = response.Headers.GetValues("X-NDM-Realm").FirstOrDefault(); 46 | var md5 = MD5.HashData(Encoding.UTF8.GetBytes($"{_login}:{realm}:{_password}")); 47 | var md5HexDigest = string.Concat(md5.Select(x => x.ToString("x2"))); 48 | 49 | var challenge = response.Headers.GetValues("X-NDM-Challenge").FirstOrDefault(); 50 | var sha = SHA256.HashData(Encoding.UTF8.GetBytes(challenge + md5HexDigest)); 51 | var shaHexDigest = string.Concat(sha.Select(x => x.ToString("x2"))); 52 | 53 | response = await KeeneticRequest("auth", $$"""{"login":"{{_login}}","password":"{{shaHexDigest}}"}"""); 54 | } 55 | 56 | return response.StatusCode == HttpStatusCode.OK; 57 | } 58 | 59 | public override async Task> GetDriverApduList() 60 | { 61 | if (await KeeneticAuth()) 62 | { 63 | var response = await KeeneticRequest("rci/show/interface"); 64 | if (response.StatusCode == HttpStatusCode.OK) 65 | { 66 | var data = JsonNode.Parse(await response.Content.ReadAsStringAsync())!.AsObject(); 67 | return data 68 | .Where(x => (string)x.Value!["type"]! == "UsbLte") 69 | .Select(x => new ApduItem(x.Key, (string)x.Value!["description"]!)) 70 | .ToList(); 71 | } 72 | } 73 | return []; 74 | } 75 | 76 | public override async Task Connect() 77 | { 78 | return await KeeneticAuth(); 79 | } 80 | 81 | public override Task Disconnect() 82 | { 83 | return Task.FromResult(true); 84 | } 85 | 86 | protected override async Task SendAtCommand(string atCommand) 87 | { 88 | if (await KeeneticAuth()) 89 | { 90 | atCommand = atCommand.Replace("\"", "\\\""); 91 | var response = await KeeneticRequest($"rci/interface/{_atDevice}/tty/send", $$"""{"command":"{{atCommand}}"}"""); 92 | if (response.StatusCode == HttpStatusCode.OK) 93 | { 94 | var data = JsonNode.Parse(await response.Content.ReadAsStringAsync())!.AsObject(); 95 | 96 | var ttyOut = data["tty-out"]; 97 | if (ttyOut is not null) 98 | { 99 | return ttyOut 100 | .AsArray() 101 | .Select(x => (string)x!) 102 | .ToArray(); 103 | } 104 | } 105 | } 106 | 107 | return []; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/LpacFibocomWrapper/Program.cs: -------------------------------------------------------------------------------- 1 | using CliWrap; 2 | using CliWrap.EventStream; 3 | using LpacFibocomWrapper.ApduDevice; 4 | using System.Text; 5 | using System.Text.Json.Nodes; 6 | 7 | namespace LpacFibocomWrapper; 8 | 9 | public static class Program 10 | { 11 | #region InputPipe 12 | private static readonly SemaphoreSlim _inputPipeSemaphore = new(0, 1); 13 | private static readonly StringBuilder _inputBuffer = new(); 14 | private static PipeSource CreateInputPipe() 15 | { 16 | return PipeSource.Create(async (destination, cancellationToken) => 17 | { 18 | while (!cancellationToken.IsCancellationRequested) 19 | { 20 | await _inputPipeSemaphore.WaitAsync(cancellationToken); 21 | var data = Encoding.UTF8.GetBytes(_inputBuffer.ToString()); 22 | await destination.WriteAsync(data, cancellationToken); 23 | } 24 | }); 25 | } 26 | private static void InputWriteLine(string value) 27 | { 28 | _inputBuffer.Clear(); 29 | _inputBuffer.AppendLine(value); 30 | _inputPipeSemaphore.Release(); 31 | } 32 | #endregion 33 | 34 | private static void LoadEnvFile(string filePath) 35 | { 36 | if (!File.Exists(filePath)) 37 | return; 38 | 39 | foreach (var line in File.ReadAllLines(filePath)) 40 | { 41 | var parts = line.Split( 42 | '=', 43 | 2, 44 | StringSplitOptions.RemoveEmptyEntries); 45 | 46 | if (parts.Length != 2) 47 | continue; 48 | 49 | Environment.SetEnvironmentVariable(parts[0], parts[1]); 50 | } 51 | } 52 | 53 | private static IApduDevice GetApduDevice() 54 | { 55 | var atDevice = Environment.GetEnvironmentVariable("DRIVER_IFID") ?? Environment.GetEnvironmentVariable("AT_DEVICE"); 56 | if (string.IsNullOrWhiteSpace(atDevice)) 57 | { 58 | atDevice = null; 59 | } 60 | 61 | LoadEnvFile("lpac-kn.env"); 62 | 63 | var atKnAddress = Environment.GetEnvironmentVariable("AT_KN_ADDRESS"); 64 | if (!string.IsNullOrWhiteSpace(atKnAddress)) 65 | { 66 | var atKnLogin = Environment.GetEnvironmentVariable("AT_KN_LOGIN") ?? throw new Exception("AT_KN_LOGIN is empty"); 67 | var atKnPassword = Environment.GetEnvironmentVariable("AT_KN_PASSWORD") ?? throw new Exception("AT_KN_PASSWORD is empty"); 68 | return new ApduAtKnDevice(atDevice, atKnAddress, atKnLogin, atKnPassword); 69 | } 70 | 71 | return new ApduAtDevice(atDevice); 72 | } 73 | 74 | private static async Task HandleDriverApduList(IApduDevice apduDevice) 75 | { 76 | var apduItems = await apduDevice.GetDriverApduList(); 77 | 78 | var data = string.Join(",", 79 | apduItems 80 | .Select(a => $$"""{"env":"{{a.Env}}","name":"{{a.Name}}"}""") 81 | .ToArray() 82 | ); 83 | 84 | return $$$"""{"type":"lpa","payload":{"data":[{{{data}}}]}}"""; 85 | } 86 | 87 | private static async Task HandleTypeApdu(IApduDevice apduDevice, string func, string? param) 88 | { 89 | const string okResponse = """{"ecode":0}"""; 90 | const string errorResponse = """{"ecode":-1}"""; 91 | 92 | if (func == "connect") 93 | { 94 | if (await apduDevice.Connect()) 95 | { 96 | return okResponse; 97 | } 98 | return errorResponse; 99 | } 100 | 101 | if (func == "disconnect") 102 | { 103 | if (await apduDevice.Disconnect()) 104 | { 105 | return okResponse; 106 | } 107 | return errorResponse; 108 | } 109 | 110 | if (func == "logic_channel_open") 111 | { 112 | if (param is null) 113 | return errorResponse; 114 | 115 | var channelId = await apduDevice.LogicChannelOpen(param); 116 | return $$"""{"ecode":{{channelId}}}"""; 117 | } 118 | 119 | if (func == "logic_channel_close") 120 | { 121 | if (await apduDevice.LogicChannelClose()) 122 | { 123 | return okResponse; 124 | } 125 | return errorResponse; 126 | } 127 | 128 | if (func == "transmit") 129 | { 130 | if (param is null) 131 | return errorResponse; 132 | 133 | var data = await apduDevice.Transmit(param); 134 | if (data is not null) 135 | { 136 | return $$"""{"ecode":0,"data":"{{data}}"}"""; 137 | } 138 | return errorResponse; 139 | } 140 | 141 | return errorResponse; 142 | } 143 | 144 | public static async Task Main(string[] args) 145 | { 146 | try 147 | { 148 | using var apduDevice = GetApduDevice(); 149 | 150 | if (new[] { "driver", "apdu", "list" }.All(a => args.Contains(a, StringComparer.OrdinalIgnoreCase))) 151 | { 152 | var response = await HandleDriverApduList(apduDevice); 153 | Console.WriteLine(response); 154 | return 0; 155 | } 156 | 157 | var procInputPipe = CreateInputPipe(); 158 | 159 | var cmd = Cli.Wrap("lpac.orig.exe") 160 | .WithValidation(CommandResultValidation.None) 161 | .WithArguments(args) 162 | .WithEnvironmentVariables(env => 163 | { 164 | env.Set("LPAC_APDU", "stdio"); 165 | }) 166 | .WithStandardInputPipe(procInputPipe); 167 | 168 | await foreach (var cmdEvent in cmd.ListenAsync()) 169 | { 170 | switch (cmdEvent) 171 | { 172 | case StandardOutputCommandEvent stdOut: 173 | if (string.IsNullOrWhiteSpace(stdOut.Text)) 174 | continue; 175 | 176 | Console.WriteLine(stdOut.Text); 177 | 178 | JsonNode request; 179 | try 180 | { 181 | request = JsonNode.Parse(stdOut.Text)!; 182 | } 183 | catch 184 | { 185 | continue; 186 | } 187 | 188 | var requestType = (string?)request["type"]; 189 | 190 | if (requestType == "apdu") 191 | { 192 | var requestPayload = request["payload"]!; 193 | var func = (string)requestPayload["func"]!; 194 | var param = (string?)requestPayload["param"]; 195 | var payload = await HandleTypeApdu(apduDevice, func, param); 196 | var response = $$"""{"type":"apdu","payload":{{payload}}}"""; 197 | Console.WriteLine(response); 198 | InputWriteLine(response); 199 | } 200 | 201 | break; 202 | case StandardErrorCommandEvent stdErr: 203 | Console.Error.WriteLine(stdErr.Text); 204 | break; 205 | case ExitedCommandEvent exited: 206 | return exited.ExitCode; 207 | } 208 | } 209 | 210 | return 0; 211 | } 212 | catch (Exception ex) 213 | { 214 | Console.Error.WriteLine(ex.Message); 215 | } 216 | 217 | return -1; 218 | } 219 | } 220 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from `dotnet new gitignore` 5 | 6 | # dotenv files 7 | .env 8 | 9 | # User-specific files 10 | *.rsuser 11 | *.suo 12 | *.user 13 | *.userosscache 14 | *.sln.docstates 15 | 16 | # User-specific files (MonoDevelop/Xamarin Studio) 17 | *.userprefs 18 | 19 | # Mono auto generated files 20 | mono_crash.* 21 | 22 | # Build results 23 | [Dd]ebug/ 24 | [Dd]ebugPublic/ 25 | [Rr]elease/ 26 | [Rr]eleases/ 27 | x64/ 28 | x86/ 29 | [Ww][Ii][Nn]32/ 30 | [Aa][Rr][Mm]/ 31 | [Aa][Rr][Mm]64/ 32 | bld/ 33 | [Bb]in/ 34 | [Oo]bj/ 35 | [Ll]og/ 36 | [Ll]ogs/ 37 | 38 | # Visual Studio 2015/2017 cache/options directory 39 | .vs/ 40 | # Uncomment if you have tasks that create the project's static files in wwwroot 41 | #wwwroot/ 42 | 43 | # Visual Studio 2017 auto generated files 44 | Generated\ Files/ 45 | 46 | # MSTest test Results 47 | [Tt]est[Rr]esult*/ 48 | [Bb]uild[Ll]og.* 49 | 50 | # NUnit 51 | *.VisualState.xml 52 | TestResult.xml 53 | nunit-*.xml 54 | 55 | # Build Results of an ATL Project 56 | [Dd]ebugPS/ 57 | [Rr]eleasePS/ 58 | dlldata.c 59 | 60 | # Benchmark Results 61 | BenchmarkDotNet.Artifacts/ 62 | 63 | # .NET 64 | project.lock.json 65 | project.fragment.lock.json 66 | artifacts/ 67 | 68 | # Tye 69 | .tye/ 70 | 71 | # ASP.NET Scaffolding 72 | ScaffoldingReadMe.txt 73 | 74 | # StyleCop 75 | StyleCopReport.xml 76 | 77 | # Files built by Visual Studio 78 | *_i.c 79 | *_p.c 80 | *_h.h 81 | *.ilk 82 | *.meta 83 | *.obj 84 | *.iobj 85 | *.pch 86 | *.pdb 87 | *.ipdb 88 | *.pgc 89 | *.pgd 90 | *.rsp 91 | *.sbr 92 | *.tlb 93 | *.tli 94 | *.tlh 95 | *.tmp 96 | *.tmp_proj 97 | *_wpftmp.csproj 98 | *.log 99 | *.tlog 100 | *.vspscc 101 | *.vssscc 102 | .builds 103 | *.pidb 104 | *.svclog 105 | *.scc 106 | 107 | # Chutzpah Test files 108 | _Chutzpah* 109 | 110 | # Visual C++ cache files 111 | ipch/ 112 | *.aps 113 | *.ncb 114 | *.opendb 115 | *.opensdf 116 | *.sdf 117 | *.cachefile 118 | *.VC.db 119 | *.VC.VC.opendb 120 | 121 | # Visual Studio profiler 122 | *.psess 123 | *.vsp 124 | *.vspx 125 | *.sap 126 | 127 | # Visual Studio Trace Files 128 | *.e2e 129 | 130 | # TFS 2012 Local Workspace 131 | $tf/ 132 | 133 | # Guidance Automation Toolkit 134 | *.gpState 135 | 136 | # ReSharper is a .NET coding add-in 137 | _ReSharper*/ 138 | *.[Rr]e[Ss]harper 139 | *.DotSettings.user 140 | 141 | # TeamCity is a build add-in 142 | _TeamCity* 143 | 144 | # DotCover is a Code Coverage Tool 145 | *.dotCover 146 | 147 | # AxoCover is a Code Coverage Tool 148 | .axoCover/* 149 | !.axoCover/settings.json 150 | 151 | # Coverlet is a free, cross platform Code Coverage Tool 152 | coverage*.json 153 | coverage*.xml 154 | coverage*.info 155 | 156 | # Visual Studio code coverage results 157 | *.coverage 158 | *.coveragexml 159 | 160 | # NCrunch 161 | _NCrunch_* 162 | .*crunch*.local.xml 163 | nCrunchTemp_* 164 | 165 | # MightyMoose 166 | *.mm.* 167 | AutoTest.Net/ 168 | 169 | # Web workbench (sass) 170 | .sass-cache/ 171 | 172 | # Installshield output folder 173 | [Ee]xpress/ 174 | 175 | # DocProject is a documentation generator add-in 176 | DocProject/buildhelp/ 177 | DocProject/Help/*.HxT 178 | DocProject/Help/*.HxC 179 | DocProject/Help/*.hhc 180 | DocProject/Help/*.hhk 181 | DocProject/Help/*.hhp 182 | DocProject/Help/Html2 183 | DocProject/Help/html 184 | 185 | # Click-Once directory 186 | publish/ 187 | 188 | # Publish Web Output 189 | *.[Pp]ublish.xml 190 | *.azurePubxml 191 | # Note: Comment the next line if you want to checkin your web deploy settings, 192 | # but database connection strings (with potential passwords) will be unencrypted 193 | *.pubxml 194 | *.publishproj 195 | 196 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 197 | # checkin your Azure Web App publish settings, but sensitive information contained 198 | # in these scripts will be unencrypted 199 | PublishScripts/ 200 | 201 | # NuGet Packages 202 | *.nupkg 203 | # NuGet Symbol Packages 204 | *.snupkg 205 | # The packages folder can be ignored because of Package Restore 206 | **/[Pp]ackages/* 207 | # except build/, which is used as an MSBuild target. 208 | !**/[Pp]ackages/build/ 209 | # Uncomment if necessary however generally it will be regenerated when needed 210 | #!**/[Pp]ackages/repositories.config 211 | # NuGet v3's project.json files produces more ignorable files 212 | *.nuget.props 213 | *.nuget.targets 214 | 215 | # Microsoft Azure Build Output 216 | csx/ 217 | *.build.csdef 218 | 219 | # Microsoft Azure Emulator 220 | ecf/ 221 | rcf/ 222 | 223 | # Windows Store app package directories and files 224 | AppPackages/ 225 | BundleArtifacts/ 226 | Package.StoreAssociation.xml 227 | _pkginfo.txt 228 | *.appx 229 | *.appxbundle 230 | *.appxupload 231 | 232 | # Visual Studio cache files 233 | # files ending in .cache can be ignored 234 | *.[Cc]ache 235 | # but keep track of directories ending in .cache 236 | !?*.[Cc]ache/ 237 | 238 | # Others 239 | ClientBin/ 240 | ~$* 241 | *~ 242 | *.dbmdl 243 | *.dbproj.schemaview 244 | *.jfm 245 | *.pfx 246 | *.publishsettings 247 | orleans.codegen.cs 248 | 249 | # Including strong name files can present a security risk 250 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 251 | #*.snk 252 | 253 | # Since there are multiple workflows, uncomment next line to ignore bower_components 254 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 255 | #bower_components/ 256 | 257 | # RIA/Silverlight projects 258 | Generated_Code/ 259 | 260 | # Backup & report files from converting an old project file 261 | # to a newer Visual Studio version. Backup files are not needed, 262 | # because we have git ;-) 263 | _UpgradeReport_Files/ 264 | Backup*/ 265 | UpgradeLog*.XML 266 | UpgradeLog*.htm 267 | ServiceFabricBackup/ 268 | *.rptproj.bak 269 | 270 | # SQL Server files 271 | *.mdf 272 | *.ldf 273 | *.ndf 274 | 275 | # Business Intelligence projects 276 | *.rdl.data 277 | *.bim.layout 278 | *.bim_*.settings 279 | *.rptproj.rsuser 280 | *- [Bb]ackup.rdl 281 | *- [Bb]ackup ([0-9]).rdl 282 | *- [Bb]ackup ([0-9][0-9]).rdl 283 | 284 | # Microsoft Fakes 285 | FakesAssemblies/ 286 | 287 | # GhostDoc plugin setting file 288 | *.GhostDoc.xml 289 | 290 | # Node.js Tools for Visual Studio 291 | .ntvs_analysis.dat 292 | node_modules/ 293 | 294 | # Visual Studio 6 build log 295 | *.plg 296 | 297 | # Visual Studio 6 workspace options file 298 | *.opt 299 | 300 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 301 | *.vbw 302 | 303 | # Visual Studio 6 auto-generated project file (contains which files were open etc.) 304 | *.vbp 305 | 306 | # Visual Studio 6 workspace and project file (working project files containing files to include in project) 307 | *.dsw 308 | *.dsp 309 | 310 | # Visual Studio 6 technical files 311 | *.ncb 312 | *.aps 313 | 314 | # Visual Studio LightSwitch build output 315 | **/*.HTMLClient/GeneratedArtifacts 316 | **/*.DesktopClient/GeneratedArtifacts 317 | **/*.DesktopClient/ModelManifest.xml 318 | **/*.Server/GeneratedArtifacts 319 | **/*.Server/ModelManifest.xml 320 | _Pvt_Extensions 321 | 322 | # Paket dependency manager 323 | .paket/paket.exe 324 | paket-files/ 325 | 326 | # FAKE - F# Make 327 | .fake/ 328 | 329 | # CodeRush personal settings 330 | .cr/personal 331 | 332 | # Python Tools for Visual Studio (PTVS) 333 | __pycache__/ 334 | *.pyc 335 | 336 | # Cake - Uncomment if you are using it 337 | # tools/** 338 | # !tools/packages.config 339 | 340 | # Tabs Studio 341 | *.tss 342 | 343 | # Telerik's JustMock configuration file 344 | *.jmconfig 345 | 346 | # BizTalk build output 347 | *.btp.cs 348 | *.btm.cs 349 | *.odx.cs 350 | *.xsd.cs 351 | 352 | # OpenCover UI analysis results 353 | OpenCover/ 354 | 355 | # Azure Stream Analytics local run output 356 | ASALocalRun/ 357 | 358 | # MSBuild Binary and Structured Log 359 | *.binlog 360 | 361 | # NVidia Nsight GPU debugger configuration file 362 | *.nvuser 363 | 364 | # MFractors (Xamarin productivity tool) working folder 365 | .mfractor/ 366 | 367 | # Local History for Visual Studio 368 | .localhistory/ 369 | 370 | # Visual Studio History (VSHistory) files 371 | .vshistory/ 372 | 373 | # BeatPulse healthcheck temp database 374 | healthchecksdb 375 | 376 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 377 | MigrationBackup/ 378 | 379 | # Ionide (cross platform F# VS Code tools) working folder 380 | .ionide/ 381 | 382 | # Fody - auto-generated XML schema 383 | FodyWeavers.xsd 384 | 385 | # VS Code files for those working on multiple tools 386 | .vscode/* 387 | !.vscode/settings.json 388 | !.vscode/tasks.json 389 | !.vscode/launch.json 390 | !.vscode/extensions.json 391 | *.code-workspace 392 | 393 | # Local History for Visual Studio Code 394 | .history/ 395 | 396 | # Windows Installer files from build outputs 397 | *.cab 398 | *.msi 399 | *.msix 400 | *.msm 401 | *.msp 402 | 403 | # JetBrains Rider 404 | *.sln.iml 405 | .idea 406 | 407 | ## 408 | ## Visual studio for Mac 409 | ## 410 | 411 | 412 | # globs 413 | Makefile.in 414 | *.userprefs 415 | *.usertasks 416 | config.make 417 | config.status 418 | aclocal.m4 419 | install-sh 420 | autom4te.cache/ 421 | *.tar.gz 422 | tarballs/ 423 | test-results/ 424 | 425 | # Mac bundle stuff 426 | *.dmg 427 | *.app 428 | 429 | # content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore 430 | # General 431 | .DS_Store 432 | .AppleDouble 433 | .LSOverride 434 | 435 | # Icon must end with two \r 436 | Icon 437 | 438 | 439 | # Thumbnails 440 | ._* 441 | 442 | # Files that might appear in the root of a volume 443 | .DocumentRevisions-V100 444 | .fseventsd 445 | .Spotlight-V100 446 | .TemporaryItems 447 | .Trashes 448 | .VolumeIcon.icns 449 | .com.apple.timemachine.donotpresent 450 | 451 | # Directories potentially created on remote AFP share 452 | .AppleDB 453 | .AppleDesktop 454 | Network Trash Folder 455 | Temporary Items 456 | .apdisk 457 | 458 | # content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore 459 | # Windows thumbnail cache files 460 | Thumbs.db 461 | ehthumbs.db 462 | ehthumbs_vista.db 463 | 464 | # Dump file 465 | *.stackdump 466 | 467 | # Folder config file 468 | [Dd]esktop.ini 469 | 470 | # Recycle Bin used on file shares 471 | $RECYCLE.BIN/ 472 | 473 | # Windows Installer files 474 | *.cab 475 | *.msi 476 | *.msix 477 | *.msm 478 | *.msp 479 | 480 | # Windows shortcuts 481 | *.lnk 482 | 483 | # Vim temporary swap files 484 | *.swp 485 | 486 | dist/ -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Remove the line below if you want to inherit .editorconfig settings from higher directories 2 | root = true 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | insert_final_newline = false 7 | trim_trailing_whitespace = true 8 | 9 | # C# files 10 | [*.cs] 11 | 12 | #### Core EditorConfig Options #### 13 | 14 | # Indentation and spacing 15 | indent_size = 4 16 | indent_style = space 17 | tab_width = 4 18 | 19 | # New line preferences 20 | end_of_line = crlf 21 | insert_final_newline = false 22 | 23 | #### .NET Coding Conventions #### 24 | 25 | # Organize usings 26 | dotnet_separate_import_directive_groups = false 27 | dotnet_sort_system_directives_first = false 28 | file_header_template = unset 29 | 30 | # this. and Me. preferences 31 | dotnet_style_qualification_for_event = false 32 | dotnet_style_qualification_for_field = false 33 | dotnet_style_qualification_for_method = false 34 | dotnet_style_qualification_for_property = false 35 | 36 | # Language keywords vs BCL types preferences 37 | dotnet_style_predefined_type_for_locals_parameters_members = true 38 | dotnet_style_predefined_type_for_member_access = true 39 | 40 | # Parentheses preferences 41 | dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity 42 | dotnet_style_parentheses_in_other_binary_operators = always_for_clarity 43 | dotnet_style_parentheses_in_other_operators = never_if_unnecessary 44 | dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity 45 | 46 | # Modifier preferences 47 | dotnet_style_require_accessibility_modifiers = for_non_interface_members 48 | 49 | # Expression-level preferences 50 | dotnet_style_coalesce_expression = true 51 | dotnet_style_collection_initializer = true 52 | dotnet_style_explicit_tuple_names = true 53 | dotnet_style_namespace_match_folder = true 54 | dotnet_style_null_propagation = true 55 | dotnet_style_object_initializer = true 56 | dotnet_style_operator_placement_when_wrapping = beginning_of_line 57 | dotnet_style_prefer_auto_properties = true 58 | dotnet_style_prefer_collection_expression = when_types_loosely_match 59 | dotnet_style_prefer_compound_assignment = true 60 | dotnet_style_prefer_conditional_expression_over_assignment = true 61 | dotnet_style_prefer_conditional_expression_over_return = true 62 | dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed 63 | dotnet_style_prefer_inferred_anonymous_type_member_names = true 64 | dotnet_style_prefer_inferred_tuple_names = true 65 | dotnet_style_prefer_is_null_check_over_reference_equality_method = true 66 | dotnet_style_prefer_simplified_boolean_expressions = true 67 | dotnet_style_prefer_simplified_interpolation = true 68 | 69 | # Field preferences 70 | dotnet_style_readonly_field = true 71 | 72 | # Parameter preferences 73 | dotnet_code_quality_unused_parameters = all 74 | 75 | # Suppression preferences 76 | dotnet_remove_unnecessary_suppression_exclusions = none 77 | 78 | # New line preferences 79 | dotnet_style_allow_multiple_blank_lines_experimental = true 80 | dotnet_style_allow_statement_immediately_after_block_experimental = true 81 | 82 | #### C# Coding Conventions #### 83 | 84 | # var preferences 85 | csharp_style_var_elsewhere = true:suggestion 86 | csharp_style_var_for_built_in_types = true 87 | csharp_style_var_when_type_is_apparent = true:suggestion 88 | 89 | # Expression-bodied members 90 | csharp_style_expression_bodied_accessors = true:silent 91 | csharp_style_expression_bodied_constructors = false:silent 92 | csharp_style_expression_bodied_indexers = true:silent 93 | csharp_style_expression_bodied_lambdas = true:silent 94 | csharp_style_expression_bodied_local_functions = false:silent 95 | csharp_style_expression_bodied_methods = false:silent 96 | csharp_style_expression_bodied_operators = false:silent 97 | csharp_style_expression_bodied_properties = true:silent 98 | 99 | # Pattern matching preferences 100 | csharp_style_pattern_matching_over_as_with_null_check = true 101 | csharp_style_pattern_matching_over_is_with_cast_check = true 102 | csharp_style_prefer_extended_property_pattern = true 103 | csharp_style_prefer_not_pattern = true 104 | csharp_style_prefer_pattern_matching = true 105 | csharp_style_prefer_switch_expression = true 106 | 107 | # Null-checking preferences 108 | csharp_style_conditional_delegate_call = true 109 | 110 | # Modifier preferences 111 | csharp_prefer_static_local_function = true:silent 112 | csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async 113 | csharp_style_prefer_readonly_struct = true 114 | csharp_style_prefer_readonly_struct_member = true 115 | 116 | # Code-block preferences 117 | csharp_prefer_braces = true:silent 118 | csharp_prefer_simple_using_statement = true:suggestion 119 | csharp_style_namespace_declarations = file_scoped:error 120 | csharp_style_prefer_method_group_conversion = true:silent 121 | csharp_style_prefer_primary_constructors = true:suggestion 122 | csharp_style_prefer_top_level_statements = true:silent 123 | 124 | # Expression-level preferences 125 | csharp_prefer_simple_default_expression = true 126 | csharp_style_deconstructed_variable_declaration = true 127 | csharp_style_implicit_object_creation_when_type_is_apparent = true 128 | csharp_style_inlined_variable_declaration = true 129 | csharp_style_prefer_index_operator = true 130 | csharp_style_prefer_local_over_anonymous_function = true 131 | csharp_style_prefer_null_check_over_type_check = true 132 | csharp_style_prefer_range_operator = true 133 | csharp_style_prefer_tuple_swap = true 134 | csharp_style_prefer_utf8_string_literals = true 135 | csharp_style_throw_expression = true 136 | csharp_style_unused_value_assignment_preference = discard_variable 137 | csharp_style_unused_value_expression_statement_preference = discard_variable 138 | 139 | # 'using' directive preferences 140 | csharp_using_directive_placement = outside_namespace:silent 141 | 142 | # New line preferences 143 | csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true 144 | csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true 145 | csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true 146 | csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true 147 | csharp_style_allow_embedded_statements_on_same_line_experimental = true 148 | 149 | #### C# Formatting Rules #### 150 | 151 | # New line preferences 152 | csharp_new_line_before_catch = true 153 | csharp_new_line_before_else = true 154 | csharp_new_line_before_finally = true 155 | csharp_new_line_before_members_in_anonymous_types = true 156 | csharp_new_line_before_members_in_object_initializers = true 157 | csharp_new_line_before_open_brace = all 158 | csharp_new_line_between_query_expression_clauses = true 159 | 160 | # Indentation preferences 161 | csharp_indent_block_contents = true 162 | csharp_indent_braces = false 163 | csharp_indent_case_contents = true 164 | csharp_indent_case_contents_when_block = true 165 | csharp_indent_labels = flush_left 166 | csharp_indent_switch_labels = true 167 | 168 | # Space preferences 169 | csharp_space_after_cast = false 170 | csharp_space_after_colon_in_inheritance_clause = true 171 | csharp_space_after_comma = true 172 | csharp_space_after_dot = false 173 | csharp_space_after_keywords_in_control_flow_statements = true 174 | csharp_space_after_semicolon_in_for_statement = true 175 | csharp_space_around_binary_operators = before_and_after 176 | csharp_space_around_declaration_statements = false 177 | csharp_space_before_colon_in_inheritance_clause = true 178 | csharp_space_before_comma = false 179 | csharp_space_before_dot = false 180 | csharp_space_before_open_square_brackets = false 181 | csharp_space_before_semicolon_in_for_statement = false 182 | csharp_space_between_empty_square_brackets = false 183 | csharp_space_between_method_call_empty_parameter_list_parentheses = false 184 | csharp_space_between_method_call_name_and_opening_parenthesis = false 185 | csharp_space_between_method_call_parameter_list_parentheses = false 186 | csharp_space_between_method_declaration_empty_parameter_list_parentheses = false 187 | csharp_space_between_method_declaration_name_and_open_parenthesis = false 188 | csharp_space_between_method_declaration_parameter_list_parentheses = false 189 | csharp_space_between_parentheses = false 190 | csharp_space_between_square_brackets = false 191 | 192 | # Wrapping preferences 193 | csharp_preserve_single_line_blocks = true 194 | csharp_preserve_single_line_statements = true 195 | 196 | #### Naming styles #### 197 | 198 | # Naming rules 199 | 200 | dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion 201 | dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface 202 | dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i 203 | 204 | dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion 205 | dotnet_naming_rule.types_should_be_pascal_case.symbols = types 206 | dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case 207 | 208 | dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion 209 | dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members 210 | dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case 211 | 212 | dotnet_naming_rule.private_or_internal_field_should_be_camel_case_with__.severity = suggestion 213 | dotnet_naming_rule.private_or_internal_field_should_be_camel_case_with__.symbols = private_or_internal_field 214 | dotnet_naming_rule.private_or_internal_field_should_be_camel_case_with__.style = camel_case_with__ 215 | 216 | dotnet_naming_rule.private_or_internal_static_field_should_be_camel_case_with__.severity = suggestion 217 | dotnet_naming_rule.private_or_internal_static_field_should_be_camel_case_with__.symbols = private_or_internal_static_field 218 | dotnet_naming_rule.private_or_internal_static_field_should_be_camel_case_with__.style = camel_case_with__ 219 | 220 | # Symbol specifications 221 | 222 | dotnet_naming_symbols.interface.applicable_kinds = interface 223 | dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected 224 | dotnet_naming_symbols.interface.required_modifiers = 225 | 226 | dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field 227 | dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected 228 | dotnet_naming_symbols.private_or_internal_field.required_modifiers = 229 | 230 | dotnet_naming_symbols.private_or_internal_static_field.applicable_kinds = field 231 | dotnet_naming_symbols.private_or_internal_static_field.applicable_accessibilities = internal, private, private_protected 232 | dotnet_naming_symbols.private_or_internal_static_field.required_modifiers = static 233 | 234 | dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum 235 | dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected 236 | dotnet_naming_symbols.types.required_modifiers = 237 | 238 | dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method 239 | dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected 240 | dotnet_naming_symbols.non_field_members.required_modifiers = 241 | 242 | # Naming styles 243 | 244 | dotnet_naming_style.pascal_case.required_prefix = 245 | dotnet_naming_style.pascal_case.required_suffix = 246 | dotnet_naming_style.pascal_case.word_separator = 247 | dotnet_naming_style.pascal_case.capitalization = pascal_case 248 | 249 | dotnet_naming_style.begins_with_i.required_prefix = I 250 | dotnet_naming_style.begins_with_i.required_suffix = 251 | dotnet_naming_style.begins_with_i.word_separator = 252 | dotnet_naming_style.begins_with_i.capitalization = pascal_case 253 | 254 | dotnet_naming_style.camel_case_with__.required_prefix = _ 255 | dotnet_naming_style.camel_case_with__.required_suffix = 256 | dotnet_naming_style.camel_case_with__.word_separator = 257 | dotnet_naming_style.camel_case_with__.capitalization = camel_case 258 | 259 | [*.{cs,vb}] 260 | dotnet_style_operator_placement_when_wrapping = beginning_of_line 261 | tab_width = 4 262 | indent_size = 4 263 | end_of_line = crlf 264 | dotnet_style_coalesce_expression = true:suggestion 265 | dotnet_style_null_propagation = true:suggestion 266 | dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion 267 | dotnet_style_prefer_auto_properties = true:silent 268 | dotnet_style_object_initializer = true:suggestion 269 | dotnet_style_collection_initializer = true:suggestion 270 | dotnet_style_prefer_simplified_boolean_expressions = true:suggestion 271 | dotnet_style_prefer_conditional_expression_over_assignment = true:silent 272 | dotnet_style_prefer_conditional_expression_over_return = true:silent 273 | dotnet_style_explicit_tuple_names = true:suggestion 274 | dotnet_style_prefer_inferred_tuple_names = true:suggestion 275 | dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion 276 | dotnet_style_prefer_compound_assignment = true:suggestion 277 | dotnet_style_prefer_simplified_interpolation = true:suggestion 278 | dotnet_style_namespace_match_folder = true:suggestion --------------------------------------------------------------------------------