Automated code cleanup.

This commit is contained in:
Andrey Shabarshov 2022-03-15 17:09:54 +00:00
parent 621f36e223
commit 316800c8d7
33 changed files with 71 additions and 119 deletions

View File

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace QRBee.Core.Data
namespace QRBee.Core.Data
{
public record RegistrationResponse
{

View File

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace QRBee.Core.Security
namespace QRBee.Core.Security
{
public class ReadableCertificateRequest
{

View File

@ -1,9 +1,8 @@
using System;
using Android;
using Android;
using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.OS;
using Android.Runtime;
using Android.Support.V4.Content;
using AndroidX.Core.App;
using Microsoft.Extensions.DependencyInjection;
@ -11,6 +10,7 @@ using Plugin.Fingerprint;
using QRBee.Core.Security;
using QRBee.Droid.Services;
using QRBee.Services;
using System;
namespace QRBee.Droid
{

View File

@ -1,7 +1,6 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using Android.App;
using System.Reflection;
using System.Runtime.InteropServices;
using Android.App;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information

View File

@ -1,10 +1,9 @@
using System;
using QRBee.Core.Security;
using System;
using System.IO;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using Javax.Xml.Transform;
using QRBee.Core.Security;
namespace QRBee.Droid.Services
{

View File

@ -1,8 +1,8 @@
using System;
using QRBee.Core.Security;
using System;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.IO;
using QRBee.Core.Security;
namespace QRBee.Droid.Services
{

View File

@ -13,7 +13,7 @@ namespace QRBee.Droid.Services
//password based encryption, it's probably safe enough as long as
//it is truly uncommon. Also too much work to alter this answer otherwise.
// Never use salt like this
private static byte[] _salt = System.Text.Encoding.UTF8.GetBytes("wÑÏU4)MÓvcvsª");
private static readonly byte[] _salt = System.Text.Encoding.UTF8.GetBytes("wÑÏU4)MÓvcvsª");
/// <summary>
/// Encrypt the given string using AES. The string can be decrypted using

View File

@ -1,6 +1,6 @@
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json;
using QRBee.Services;
using System.Threading.Tasks;
using Xamarin.Forms;
[assembly: Dependency(typeof(QRBee.Droid.Services.LocalSettings))]

View File

@ -1,5 +1,5 @@
using System.Threading.Tasks;
using QRBee.Services;
using QRBee.Services;
using System.Threading.Tasks;
using Xamarin.Forms;
using ZXing.Mobile;

View File

@ -1,9 +1,7 @@
using QRBee.Services;
using QRBee.Views;
using System;
using Microsoft.Extensions.DependencyInjection;
using QRBee.Core.Security;
using Microsoft.Extensions.DependencyInjection;
using QRBee.Services;
using QRBee.ViewModels;
using System;
using Xamarin.Forms;
namespace QRBee
@ -22,7 +20,7 @@ namespace QRBee
}
protected static IServiceProvider ServiceProvider { get; set; }
void SetupServices(Action<IServiceCollection> addPlatformServices = null)
private void SetupServices(Action<IServiceCollection> addPlatformServices = null)
{
var services = new ServiceCollection();

View File

@ -1,7 +1,4 @@
using QRBee.ViewModels;
using QRBee.Views;
using System;
using System.Collections.Generic;
using QRBee.Views;
using Xamarin.Forms;
namespace QRBee

View File

@ -1,6 +1,4 @@
using System;
namespace QRBee.Models
namespace QRBee.Models
{
public class Item
{

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace QRBee.Services

View File

@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace QRBee.Services

View File

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Threading.Tasks;
namespace QRBee.Services
{

View File

@ -8,7 +8,7 @@ namespace QRBee.Services
{
public class MockDataStore : IDataStore<Item>
{
readonly List<Item> items;
private readonly List<Item> items;
public MockDataStore()
{

View File

@ -12,14 +12,14 @@ namespace QRBee.ViewModels
{
public IDataStore<Item> DataStore => DependencyService.Get<IDataStore<Item>>();
bool isBusy = false;
private bool isBusy = false;
public bool IsBusy
{
get { return isBusy; }
set { SetProperty(ref isBusy, value); }
}
string title = string.Empty;
private string title = string.Empty;
public string Title
{
get { return title; }

View File

@ -1,9 +1,8 @@
using System;
using System.Text;
using QRBee.Core.Data;
using QRBee.Core.Data;
using QRBee.Core.Security;
using QRBee.Services;
using QRBee.Views;
using System;
using System.Text;
using Xamarin.Forms;
namespace QRBee.ViewModels

View File

@ -1,8 +1,7 @@
using System.Linq;
using QRBee.Views;
using Plugin.Fingerprint;
using Plugin.Fingerprint;
using Plugin.Fingerprint.Abstractions;
using QRBee.Services;
using QRBee.Views;
using Xamarin.Forms;
namespace QRBee.ViewModels

View File

@ -1,10 +1,9 @@
using System;
using System.Linq;
using System.Net.Http;
using System.Text;
using QRBee.Core.Data;
using QRBee.Core.Data;
using QRBee.Core.Security;
using QRBee.Services;
using System;
using System.Net.Http;
using System.Text;
using Xamarin.Forms;
namespace QRBee.ViewModels
@ -85,12 +84,14 @@ namespace QRBee.ViewModels
// the HttpClient object is constructed in a shared project.
public HttpClientHandler GetInsecureHandler()
{
var handler = new HttpClientHandler();
handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) =>
var handler = new HttpClientHandler
{
if (cert.Issuer.Equals("CN=localhost"))
return true;
return errors == System.Net.Security.SslPolicyErrors.None;
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) =>
{
if (cert.Issuer.Equals("CN=localhost"))
return true;
return errors == System.Net.Security.SslPolicyErrors.None;
}
};
return handler;
}

View File

@ -1,12 +1,11 @@
using System;
using System.Linq;
using System.Net.Http;
using System.Text.RegularExpressions;
using QRBee.Core;
using QRBee.Core.Data;
using QRBee.Core.Data;
using QRBee.Core.Security;
using QRBee.Services;
using QRBee.Views;
using System;
using System.Linq;
using System.Net.Http;
using System.Text.RegularExpressions;
using Xamarin.Forms;
namespace QRBee.ViewModels
@ -192,12 +191,14 @@ namespace QRBee.ViewModels
// the HttpClient object is constructed in a shared project.
public HttpClientHandler GetInsecureHandler()
{
var handler = new HttpClientHandler();
handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) =>
var handler = new HttpClientHandler
{
if (cert.Issuer.Equals("CN=localhost"))
return true;
return errors == System.Net.Security.SslPolicyErrors.None;
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) =>
{
if (cert.Issuer.Equals("CN=localhost"))
return true;
return errors == System.Net.Security.SslPolicyErrors.None;
}
};
return handler;
}

View File

@ -1,6 +1,4 @@
using System;
using QRBee.Services;
using QRBee.ViewModels;
using QRBee.ViewModels;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View File

@ -1,9 +1,4 @@
using QRBee.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View File

@ -1,5 +1,5 @@
using Xamarin.Forms.Xaml;
using QRBee.ViewModels;
using QRBee.ViewModels;
using Xamarin.Forms.Xaml;
namespace QRBee.Views
{

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using QRBee.ViewModels;
using QRBee.ViewModels;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View File

@ -1,7 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using MongoDB.Driver;
using QRBee.Api.Services;
using QRBee.Core;
using QRBee.Core.Data;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

View File

@ -1,5 +1,4 @@
using System.Security.Cryptography.X509Certificates;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Attributes;
namespace QRBee.Api.Services.Database
{

View File

@ -1,7 +1,5 @@
using System.Security.Cryptography.X509Certificates;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Options;
using MongoDB.Driver;
using QRBee.Api.Controllers;
namespace QRBee.Api.Services.Database
{

View File

@ -1,5 +1,4 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Attributes;
using QRBee.Core.Data;
namespace QRBee.Api.Services.Database

View File

@ -1,7 +1,4 @@
using System.Security.Cryptography.X509Certificates;
using Microsoft.AspNetCore.Mvc;
using QRBee.Core;
using QRBee.Core.Data;
using QRBee.Core.Data;
namespace QRBee.Api.Services
{

View File

@ -1,13 +1,11 @@
using System.Globalization;
using System.Runtime.CompilerServices;
using QRBee.Api.Services.Database;
using QRBee.Core.Data;
using QRBee.Core.Security;
using System.Globalization;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Text.RegularExpressions;
using QRBee.Api.Services.Database;
using QRBee.Core;
using QRBee.Core.Data;
using QRBee.Core.Security;
namespace QRBee.Api.Services
{

View File

@ -1,9 +1,7 @@
using System;
using QRBee.Core.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Text.RegularExpressions;
using QRBee.Core.Security;
namespace QRBee.Api.Services
{

View File

@ -1,7 +1,7 @@
using System.Security.Cryptography;
using QRBee.Core.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using QRBee.Core.Security;
namespace QRBee.Api.Services
{