csharp_style_namespace_declarations = file_scoped

This commit is contained in:
2dust 2025-04-02 11:44:23 +08:00
parent d92540121f
commit 4d3db56065
186 changed files with 23574 additions and 23759 deletions

View file

@ -1,7 +1,7 @@
namespace AmazTool
namespace AmazTool;
internal static class Program
{
internal static class Program
{
[STAThread]
private static void Main(string[] args)
{
@ -22,5 +22,4 @@ namespace AmazTool
UpgradeApp.Upgrade(argData);
}
}
}

View file

@ -2,10 +2,10 @@ using System.Diagnostics;
using System.IO.Compression;
using System.Text;
namespace AmazTool
namespace AmazTool;
internal class UpgradeApp
{
internal class UpgradeApp
{
public static void Upgrade(string fileName)
{
Console.WriteLine($"{Resx.Resource.StartUnzipping}\n{fileName}");
@ -113,5 +113,4 @@ namespace AmazTool
Utils.StartV2RayN();
}
}
}

View file

@ -1,9 +1,9 @@
using System.Diagnostics;
namespace AmazTool
namespace AmazTool;
internal class Utils
{
internal class Utils
{
public static string GetExePath()
{
return Environment.ProcessPath ?? Process.GetCurrentProcess().MainModule?.FileName ?? string.Empty;
@ -48,5 +48,4 @@ namespace AmazTool
Thread.Sleep(1000);
}
}
}
}

View file

@ -8,7 +8,7 @@
<TargetFramework>net8.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<NoWarn>CA1031;CS1591;NU1507;CA1416</NoWarn>
<NoWarn>CA1031;CS1591;NU1507;CA1416;IDE0058</NoWarn>
<Nullable>annotations</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Authors>2dust</Authors>

View file

@ -1,10 +1,9 @@
using ReactiveUI;
using ReactiveUI;
namespace ServiceLib.Base
namespace ServiceLib.Base;
public class MyReactiveObject : ReactiveObject
{
public class MyReactiveObject : ReactiveObject
{
protected static Config? _config;
protected Func<EViewAction, object?, Task<bool>>? _updateView;
}
}

View file

@ -1,10 +1,10 @@
using System.Security.Cryptography;
using System.Text;
namespace ServiceLib.Common
namespace ServiceLib.Common;
public class AesUtils
{
public class AesUtils
{
private const int KeySize = 256; // AES-256
private const int IvSize = 16; // AES block size
private const int Iterations = 10000;
@ -97,5 +97,4 @@ namespace ServiceLib.Common
rng.GetBytes(randomNumber);
return randomNumber;
}
}
}

View file

@ -1,10 +1,10 @@
using System.Security.Cryptography;
using System.Text;
namespace ServiceLib.Common
namespace ServiceLib.Common;
public class DesUtils
{
public class DesUtils
{
/// <summary>
/// Encrypt
/// </summary>
@ -71,5 +71,4 @@ namespace ServiceLib.Common
{
return Utils.GetMd5(Utils.GetHomePath() + "DesUtils");
}
}
}

View file

@ -1,10 +1,10 @@
using System.Net;
using Downloader;
namespace ServiceLib.Common
namespace ServiceLib.Common;
public class DownloaderHelper
{
public class DownloaderHelper
{
private static readonly Lazy<DownloaderHelper> _instance = new(() => new());
public static DownloaderHelper Instance => _instance.Value;
@ -177,5 +177,4 @@ namespace ServiceLib.Common
downloadOpt = null;
}
}
}

View file

@ -2,10 +2,10 @@ using System.Formats.Tar;
using System.IO.Compression;
using System.Text;
namespace ServiceLib.Common
namespace ServiceLib.Common;
public static class FileManager
{
public static class FileManager
{
private static readonly string _tag = "FileManager";
public static bool ByteArrayToFile(string fileName, byte[] content)
@ -223,5 +223,4 @@ namespace ServiceLib.Common
// ignored
}
}
}
}

View file

@ -2,12 +2,12 @@ using System.Net.Http.Headers;
using System.Net.Mime;
using System.Text;
namespace ServiceLib.Common
namespace ServiceLib.Common;
/// <summary>
/// </summary>
public class HttpClientHelper
{
/// <summary>
/// </summary>
public class HttpClientHelper
{
private static readonly Lazy<HttpClientHelper> _instance = new(() =>
{
SocketsHttpHandler handler = new() { UseCookies = false };
@ -202,5 +202,4 @@ namespace ServiceLib.Common
}
} while (isMoreToRead);
}
}
}

View file

@ -1,8 +1,7 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace ServiceLib.Common
{
namespace ServiceLib.Common;
/*
* See:
* http://stackoverflow.com/questions/6266820/working-example-of-createjobobject-setinformationjobobject-pinvoke-in-net
@ -178,4 +177,4 @@ namespace ServiceLib.Common
}
#endregion Helper classes
}

View file

@ -1,11 +1,11 @@
using System.Text.Json;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
namespace ServiceLib.Common
namespace ServiceLib.Common;
public class JsonUtils
{
public class JsonUtils
{
private static readonly string _tag = "JsonUtils";
/// <summary>
@ -127,5 +127,4 @@ namespace ServiceLib.Common
/// <param name="obj"></param>
/// <returns></returns>
public static JsonNode? SerializeToNode(object? obj) => JsonSerializer.SerializeToNode(obj);
}
}

View file

@ -2,10 +2,13 @@ using NLog;
using NLog.Config;
using NLog.Targets;
namespace ServiceLib.Common
namespace ServiceLib.Common;
public class Logging
{
public class Logging
{
private static readonly Logger _logger1 = LogManager.GetLogger("Log1");
private static readonly Logger _logger2 = LogManager.GetLogger("Log2");
public static void Setup()
{
LoggingConfiguration config = new();
@ -32,7 +35,7 @@ namespace ServiceLib.Common
return;
}
LogManager.GetLogger("Log1").Info(strContent);
_logger1.Info(strContent);
}
public static void SaveLog(string strTitle, Exception ex)
@ -42,13 +45,11 @@ namespace ServiceLib.Common
return;
}
var logger = LogManager.GetLogger("Log2");
logger.Debug($"{strTitle},{ex.Message}");
logger.Debug(ex.StackTrace);
_logger2.Debug($"{strTitle},{ex.Message}");
_logger2.Debug(ex.StackTrace);
if (ex?.InnerException != null)
{
logger.Error(ex.InnerException);
}
_logger2.Error(ex.InnerException);
}
}
}

View file

@ -1,11 +1,11 @@
using QRCoder;
using QRCoder;
using SkiaSharp;
using ZXing.SkiaSharp;
namespace ServiceLib.Common
namespace ServiceLib.Common;
public class QRCodeHelper
{
public class QRCodeHelper
{
public static byte[]? GenQRCode(string? url)
{
using QRCodeGenerator qrGenerator = new();
@ -86,5 +86,4 @@ namespace ServiceLib.Common
canvas.DrawBitmap(bmp, 0, 0);
return flipped;
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Common
namespace ServiceLib.Common;
public class SemanticVersion
{
public class SemanticVersion
{
private readonly int major;
private readonly int minor;
private readonly int patch;
@ -183,5 +183,4 @@ namespace ServiceLib.Common
}
#endregion Private
}
}

View file

@ -1,10 +1,10 @@
using System.Collections;
using SQLite;
namespace ServiceLib.Common
namespace ServiceLib.Common;
public sealed class SQLiteHelper
{
public sealed class SQLiteHelper
{
private static readonly Lazy<SQLiteHelper> _instance = new(() => new());
public static SQLiteHelper Instance => _instance.Value;
private readonly string _connstr;
@ -87,5 +87,4 @@ namespace ServiceLib.Common
_dbAsync = null;
});
}
}
}

View file

@ -1,9 +1,9 @@
using System.Diagnostics.CodeAnalysis;
namespace ServiceLib.Common
namespace ServiceLib.Common;
public static class StringEx
{
public static class StringEx
{
public static bool IsNullOrEmpty([NotNullWhen(false)] this string? value)
{
return string.IsNullOrEmpty(value) || string.IsNullOrWhiteSpace(value);
@ -79,5 +79,4 @@ namespace ServiceLib.Common
{
return int.TryParse(value, out var result) ? result : defaultValue;
}
}
}

View file

@ -11,10 +11,10 @@ using System.Text;
using CliWrap;
using CliWrap.Buffered;
namespace ServiceLib.Common
namespace ServiceLib.Common;
public class Utils
{
public class Utils
{
private static readonly string _tag = "Utils";
#region
@ -862,5 +862,4 @@ namespace ServiceLib.Common
}
#endregion Platform
}
}

View file

@ -2,10 +2,10 @@ using System.Security.Cryptography;
using System.Text;
using Microsoft.Win32;
namespace ServiceLib.Common
namespace ServiceLib.Common;
internal static class WindowsUtils
{
internal static class WindowsUtils
{
private static readonly string _tag = "WindowsUtils";
public static string? RegReadValue(string path, string name, string def)
@ -70,5 +70,4 @@ namespace ServiceLib.Common
Logging.SaveLog(_tag, ex);
}
}
}
}

View file

@ -2,10 +2,10 @@ using YamlDotNet.Core;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;
namespace ServiceLib.Common
namespace ServiceLib.Common;
public class YamlUtils
{
public class YamlUtils
{
private static readonly string _tag = "YamlUtils";
#region YAML
@ -76,5 +76,4 @@ namespace ServiceLib.Common
}
#endregion YAML
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum EConfigType
{
public enum EConfigType
{
VMess = 1,
Custom = 2,
Shadowsocks = 3,
@ -12,5 +12,4 @@
TUIC = 8,
WireGuard = 9,
HTTP = 10
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum ECoreType
{
public enum ECoreType
{
v2fly = 1,
Xray = 2,
v2fly_v5 = 4,
@ -15,5 +15,4 @@ namespace ServiceLib.Enums
brook = 27,
overtls = 28,
v2rayN = 99
}
}

View file

@ -1,9 +1,8 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum EGirdOrientation
{
public enum EGirdOrientation
{
Horizontal,
Vertical,
Tab,
}
}

View file

@ -1,11 +1,10 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum EGlobalHotkey
{
public enum EGlobalHotkey
{
ShowForm = 0,
SystemProxyClear = 1,
SystemProxySet = 2,
SystemProxyUnchanged = 3,
SystemProxyPac = 4,
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum EInboundProtocol
{
public enum EInboundProtocol
{
socks = 0,
socks2,
socks3,
@ -10,5 +10,4 @@
api2,
mixed,
speedtest = 21
}
}

View file

@ -1,11 +1,10 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum EMove
{
public enum EMove
{
Top = 1,
Up = 2,
Down = 3,
Bottom = 4,
Position = 5
}
}

View file

@ -1,11 +1,10 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum EMsgCommand
{
public enum EMsgCommand
{
ClearMsg,
SendMsgView,
SendSnackMsg,
RefreshProfiles,
AppExit
}
}

View file

@ -1,10 +1,9 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum EMultipleLoad
{
public enum EMultipleLoad
{
Random,
RoundRobin,
LeastPing,
LeastLoad
}
}

View file

@ -1,9 +1,8 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum EPresetType
{
public enum EPresetType
{
Default = 0,
Russia = 1,
Iran = 2,
}
}

View file

@ -1,10 +1,9 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum ERuleMode
{
public enum ERuleMode
{
Rule = 0,
Global = 1,
Direct = 2,
Unchanged = 3
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum EServerColName
{
public enum EServerColName
{
Def = 0,
ConfigType,
Remarks,
@ -17,5 +17,4 @@
TodayUp,
TotalDown,
TotalUp
}
}

View file

@ -1,10 +1,9 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum ESpeedActionType
{
public enum ESpeedActionType
{
Tcping,
Realping,
Speedtest,
Mixedtest
}
}

View file

@ -1,10 +1,9 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum ESysProxyType
{
public enum ESysProxyType
{
ForcedClear = 0,
ForcedChange = 1,
Unchanged = 2,
Pac = 3
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum ETheme
{
public enum ETheme
{
FollowSystem,
Dark,
Light,
@ -9,5 +9,4 @@
Desert,
Dusk,
NightSky
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum ETransport
{
public enum ETransport
{
tcp,
kcp,
ws,
@ -11,5 +11,4 @@
http,
quic,
grpc
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Enums
namespace ServiceLib.Enums;
public enum EViewAction
{
public enum EViewAction
{
CloseWindow,
ShowYesNo,
SaveFileDialog,
@ -42,5 +42,4 @@
DispatcherCheckUpdate,
DispatcherCheckUpdateFinished,
DispatcherShowMsg,
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib
namespace ServiceLib;
public class Global
{
public class Global
{
#region const
public const string AppName = "v2rayN";
@ -520,5 +520,4 @@ namespace ServiceLib
];
#endregion const
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler
namespace ServiceLib.Handler;
public sealed class AppHandler
{
public sealed class AppHandler
{
#region Property
private static readonly Lazy<AppHandler> _instance = new(() => new());
@ -240,5 +240,4 @@ namespace ServiceLib.Handler
}
#endregion Core Type
}
}

View file

@ -1,10 +1,10 @@
using System.Security.Principal;
using System.Text.RegularExpressions;
namespace ServiceLib.Handler
namespace ServiceLib.Handler;
public static class AutoStartupHandler
{
public static class AutoStartupHandler
{
private static readonly string _tag = "AutoStartupHandler";
public static async Task<bool> UpdateTask(Config config)
@ -238,5 +238,4 @@ namespace ServiceLib.Handler
}
#endregion macOS
}
}

View file

@ -1,9 +1,9 @@
using static ServiceLib.Models.ClashProxies;
namespace ServiceLib.Handler
namespace ServiceLib.Handler;
public sealed class ClashApiHandler
{
public sealed class ClashApiHandler
{
private static readonly Lazy<ClashApiHandler> instance = new(() => new());
public static ClashApiHandler Instance => instance.Value;
@ -184,5 +184,4 @@ namespace ServiceLib.Handler
{
return $"{Global.HttpProtocol}{Global.Loopback}:{AppHandler.Instance.StatePort2}";
}
}
}

View file

@ -1,13 +1,13 @@
using System.Data;
using System.Text.RegularExpressions;
namespace ServiceLib.Handler
namespace ServiceLib.Handler;
/// <summary>
/// 本软件配置文件处理类
/// </summary>
public class ConfigHandler
{
/// <summary>
/// 本软件配置文件处理类
/// </summary>
public class ConfigHandler
{
private static readonly string _configRes = Global.ConfigFileName;
private static readonly string _tag = "ConfigHandler";
@ -1922,5 +1922,4 @@ namespace ServiceLib.Handler
}
#endregion Regional Presets
}
}

View file

@ -1,14 +1,10 @@
using DynamicData;
using ServiceLib.Enums;
using ServiceLib.Models;
namespace ServiceLib.Handler;
namespace ServiceLib.Handler
/// <summary>
/// Core configuration file processing class
/// </summary>
public class CoreConfigHandler
{
/// <summary>
/// Core configuration file processing class
/// </summary>
public class CoreConfigHandler
{
private static readonly string _tag = "CoreConfigHandler";
public static async Task<RetResult> GenerateClientConfig(ProfileItem node, string? fileName)
@ -156,5 +152,4 @@ namespace ServiceLib.Handler
await File.WriteAllTextAsync(fileName, result.Data.ToString());
return result;
}
}
}

View file

@ -1,13 +1,13 @@
using System.Diagnostics;
using System.Text;
namespace ServiceLib.Handler
namespace ServiceLib.Handler;
/// <summary>
/// Core process processing class
/// </summary>
public class CoreHandler
{
/// <summary>
/// Core process processing class
/// </summary>
public class CoreHandler
{
private static readonly Lazy<CoreHandler> _instance = new(() => new());
public static CoreHandler Instance => _instance.Value;
private Config _config;
@ -406,5 +406,4 @@ namespace ServiceLib.Handler
}
#endregion Linux
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler
namespace ServiceLib.Handler;
public sealed class CoreInfoHandler
{
public sealed class CoreInfoHandler
{
private static readonly Lazy<CoreInfoHandler> _instance = new(() => new());
private List<CoreInfo>? _coreInfo;
public static CoreInfoHandler Instance => _instance.Value;
@ -214,5 +214,4 @@ namespace ServiceLib.Handler
{
return $"{Global.GithubUrl}/{Global.CoreUrls[eCoreType]}/releases";
}
}
}

View file

@ -1,9 +1,9 @@
using System.Collections.Specialized;
namespace ServiceLib.Handler.Fmt
namespace ServiceLib.Handler.Fmt;
public class BaseFmt
{
public class BaseFmt
{
protected static string GetIpv6(string address)
{
if (Utils.IsIpv6(address))
@ -238,5 +238,4 @@ namespace ServiceLib.Handler.Fmt
var url = $"{Utils.UrlEncode(userInfo)}@{GetIpv6(address)}:{port}";
return $"{Global.ProtocolShares[eConfigType]}{url}{query}{remark}";
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.Fmt
namespace ServiceLib.Handler.Fmt;
public class ClashFmt : BaseFmt
{
public class ClashFmt : BaseFmt
{
public static ProfileItem? ResolveFull(string strData, string? subRemarks)
{
if (Contains(strData, "port", "socks-port", "proxies"))
@ -19,5 +19,4 @@
return null;
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.Fmt
namespace ServiceLib.Handler.Fmt;
public class FmtHandler
{
public class FmtHandler
{
private static readonly string _tag = "FmtHandler";
public static string? GetShareUri(ProfileItem item)
@ -88,5 +88,4 @@
return null;
}
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.Fmt
namespace ServiceLib.Handler.Fmt;
public class Hysteria2Fmt : BaseFmt
{
public class Hysteria2Fmt : BaseFmt
{
public static ProfileItem? Resolve(string str, out string msg)
{
msg = ResUI.ConfigurationFormatIncorrect;
@ -98,5 +98,4 @@ namespace ServiceLib.Handler.Fmt
return null;
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.Fmt
namespace ServiceLib.Handler.Fmt;
public class NaiveproxyFmt : BaseFmt
{
public class NaiveproxyFmt : BaseFmt
{
public static ProfileItem? ResolveFull(string strData, string? subRemarks)
{
if (Contains(strData, "listen", "proxy", "<html>", "<body>"))
@ -19,5 +19,4 @@
return null;
}
}
}

View file

@ -1,9 +1,9 @@
using System.Text.RegularExpressions;
namespace ServiceLib.Handler.Fmt
namespace ServiceLib.Handler.Fmt;
public class ShadowsocksFmt : BaseFmt
{
public class ShadowsocksFmt : BaseFmt
{
public static ProfileItem? Resolve(string str, out string msg)
{
msg = ResUI.ConfigurationFormatIncorrect;
@ -176,5 +176,4 @@ namespace ServiceLib.Handler.Fmt
}
return null;
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.Fmt
namespace ServiceLib.Handler.Fmt;
public class SingboxFmt : BaseFmt
{
public class SingboxFmt : BaseFmt
{
public static List<ProfileItem>? ResolveFullArray(string strData, string? subRemarks)
{
var configObjects = JsonUtils.Deserialize<object[]>(strData);
@ -44,5 +44,4 @@ namespace ServiceLib.Handler.Fmt
return profileItem;
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.Fmt
namespace ServiceLib.Handler.Fmt;
public class SocksFmt : BaseFmt
{
public class SocksFmt : BaseFmt
{
public static ProfileItem? Resolve(string str, out string msg)
{
msg = ResUI.ConfigurationFormatIncorrect;
@ -111,5 +111,4 @@ namespace ServiceLib.Handler.Fmt
return item;
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.Fmt
namespace ServiceLib.Handler.Fmt;
public class TrojanFmt : BaseFmt
{
public class TrojanFmt : BaseFmt
{
public static ProfileItem? Resolve(string str, out string msg)
{
msg = ResUI.ConfigurationFormatIncorrect;
@ -44,5 +44,4 @@ namespace ServiceLib.Handler.Fmt
return ToUri(EConfigType.Trojan, item.Address, item.Port, item.Id, dicQuery, remark);
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.Fmt
namespace ServiceLib.Handler.Fmt;
public class TuicFmt : BaseFmt
{
public class TuicFmt : BaseFmt
{
public static ProfileItem? Resolve(string str, out string msg)
{
msg = ResUI.ConfigurationFormatIncorrect;
@ -60,5 +60,4 @@ namespace ServiceLib.Handler.Fmt
return ToUri(EConfigType.TUIC, item.Address, item.Port, $"{item.Id}:{item.Security}", dicQuery, remark);
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.Fmt
namespace ServiceLib.Handler.Fmt;
public class V2rayFmt : BaseFmt
{
public class V2rayFmt : BaseFmt
{
public static List<ProfileItem>? ResolveFullArray(string strData, string? subRemarks)
{
var configObjects = JsonUtils.Deserialize<object[]>(strData);
@ -45,5 +45,4 @@ namespace ServiceLib.Handler.Fmt
return profileItem;
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.Fmt
namespace ServiceLib.Handler.Fmt;
public class VLESSFmt : BaseFmt
{
public class VLESSFmt : BaseFmt
{
public static ProfileItem? Resolve(string str, out string msg)
{
msg = ResUI.ConfigurationFormatIncorrect;
@ -56,5 +56,4 @@ namespace ServiceLib.Handler.Fmt
return ToUri(EConfigType.VLESS, item.Address, item.Port, item.Id, dicQuery, remark);
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.Fmt
namespace ServiceLib.Handler.Fmt;
public class VmessFmt : BaseFmt
{
public class VmessFmt : BaseFmt
{
public static ProfileItem? Resolve(string str, out string msg)
{
msg = ResUI.ConfigurationFormatIncorrect;
@ -122,5 +122,4 @@ namespace ServiceLib.Handler.Fmt
return item;
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.Fmt
namespace ServiceLib.Handler.Fmt;
public class WireguardFmt : BaseFmt
{
public class WireguardFmt : BaseFmt
{
public static ProfileItem? Resolve(string str, out string msg)
{
msg = ResUI.ConfigurationFormatIncorrect;
@ -64,5 +64,4 @@ namespace ServiceLib.Handler.Fmt
}
return ToUri(EConfigType.WireGuard, item.Address, item.Port, item.Id, dicQuery, remark);
}
}
}

View file

@ -1,9 +1,9 @@
using ReactiveUI;
using ReactiveUI;
namespace ServiceLib.Handler
namespace ServiceLib.Handler;
public class NoticeHandler
{
public class NoticeHandler
{
private static readonly Lazy<NoticeHandler> _instance = new(() => new());
public static NoticeHandler Instance => _instance.Value;
@ -40,5 +40,4 @@ namespace ServiceLib.Handler
Enqueue(msg);
SendMessage(msg);
}
}
}

View file

@ -1,10 +1,10 @@
using System.Net.Sockets;
using System.Text;
namespace ServiceLib.Handler
namespace ServiceLib.Handler;
public class PacHandler
{
public class PacHandler
{
private static string _configPath;
private static int _httpPort;
private static int _pacPort;
@ -111,5 +111,4 @@ namespace ServiceLib.Handler
// ignored
}
}
}
}

View file

@ -2,10 +2,10 @@ using System.Collections.Concurrent;
//using System.Reactive.Linq;
namespace ServiceLib.Handler
namespace ServiceLib.Handler;
public class ProfileExHandler
{
public class ProfileExHandler
{
private static readonly Lazy<ProfileExHandler> _instance = new(() => new());
private ConcurrentBag<ProfileExItem> _lstProfileEx = [];
private readonly Queue<string> _queIndexIds = new();
@ -178,5 +178,4 @@ namespace ServiceLib.Handler
}
return _lstProfileEx.Max(t => t == null ? 0 : t.Sort);
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler
namespace ServiceLib.Handler;
public class StatisticsHandler
{
public class StatisticsHandler
{
private static readonly Lazy<StatisticsHandler> instance = new(() => new());
public static StatisticsHandler Instance => instance.Value;
@ -160,5 +160,4 @@
_serverStatItem.DateNow = ticks;
}
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.SysProxy
namespace ServiceLib.Handler.SysProxy;
public class ProxySettingLinux
{
public class ProxySettingLinux
{
private static readonly string _proxySetFileName = $"{Global.ProxySetLinuxShellFileName.Replace(Global.NamespaceSample, "")}.sh";
public static async Task SetProxy(string host, int port, string exceptions)
@ -29,5 +29,4 @@ namespace ServiceLib.Handler.SysProxy
await Utils.GetCliWrapOutput(fileName, args);
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.SysProxy
namespace ServiceLib.Handler.SysProxy;
public class ProxySettingOSX
{
public class ProxySettingOSX
{
private static readonly string _proxySetFileName = $"{Global.ProxySetOSXShellFileName.Replace(Global.NamespaceSample, "")}.sh";
public static async Task SetProxy(string host, int port, string exceptions)
@ -34,5 +34,4 @@ namespace ServiceLib.Handler.SysProxy
await Utils.GetCliWrapOutput(fileName, args);
}
}
}

View file

@ -1,10 +1,10 @@
using System.Runtime.InteropServices;
using static ServiceLib.Handler.SysProxy.ProxySettingWindows.InternetConnectionOption;
namespace ServiceLib.Handler.SysProxy
namespace ServiceLib.Handler.SysProxy;
public class ProxySettingWindows
{
public class ProxySettingWindows
{
private const string _regPath = @"Software\Microsoft\Windows\CurrentVersion\Internet Settings";
private static bool SetProxyFallback(string? strProxy, string? exceptions, int type)
@ -356,5 +356,4 @@ namespace ServiceLib.Handler.SysProxy
ref int lpcEntries // Number of entries written to the buffer
);
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler.SysProxy
namespace ServiceLib.Handler.SysProxy;
public static class SysProxyHandler
{
public static class SysProxyHandler
{
private static readonly string _tag = "SysProxyHandler";
public static async Task<bool> UpdateSysProxy(Config config, bool forceDisable)
@ -95,5 +95,4 @@
var strProxy = $"{Global.HttpProtocol}{Global.Loopback}:{portPac}/pac?t={DateTime.Now.Ticks}";
ProxySettingWindows.SetProxy(strProxy, "", 4);
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Handler
namespace ServiceLib.Handler;
public class TaskHandler
{
public class TaskHandler
{
private static readonly Lazy<TaskHandler> _instance = new(() => new());
public static TaskHandler Instance => _instance.Value;
@ -94,5 +94,4 @@ namespace ServiceLib.Handler
});
}
}
}
}

View file

@ -1,10 +1,10 @@
using System.Net;
using WebDav;
namespace ServiceLib.Handler
namespace ServiceLib.Handler;
public sealed class WebDavHandler
{
public sealed class WebDavHandler
{
private static readonly Lazy<WebDavHandler> _instance = new(() => new());
public static WebDavHandler Instance => _instance.Value;
@ -178,5 +178,4 @@ namespace ServiceLib.Handler
}
public string GetLastError() => _lastDescription ?? string.Empty;
}
}

View file

@ -1,11 +1,10 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
public class CheckUpdateModel
{
public class CheckUpdateModel
{
public bool? IsSelected { get; set; }
public string? CoreType { get; set; }
public string? Remarks { get; set; }
public string? FileName { get; set; }
public bool? IsFinished { get; set; }
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
public class ClashConnectionModel
{
public class ClashConnectionModel
{
public string? Id { get; set; }
public string? Network { get; set; }
public string? Type { get; set; }
@ -13,5 +13,4 @@
public double Time { get; set; }
public string? Elapsed { get; set; }
public string? Chain { get; set; }
}
}

View file

@ -1,14 +1,14 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
public class ClashConnections
{
public class ClashConnections
{
public ulong downloadTotal { get; set; }
public ulong uploadTotal { get; set; }
public List<ConnectionItem>? connections { get; set; }
}
}
public class ConnectionItem
{
public class ConnectionItem
{
public string? id { get; set; }
public MetadataItem? metadata { get; set; }
public ulong upload { get; set; }
@ -17,10 +17,10 @@
public List<string>? chains { get; set; }
public string? rule { get; set; }
public string? rulePayload { get; set; }
}
}
public class MetadataItem
{
public class MetadataItem
{
public string? network { get; set; }
public string? type { get; set; }
public string? sourceIP { get; set; }
@ -33,5 +33,4 @@
public string? process { get; set; }
public string? processPath { get; set; }
public string? remoteDestination { get; set; }
}
}

View file

@ -1,9 +1,9 @@
using static ServiceLib.Models.ClashProxies;
using static ServiceLib.Models.ClashProxies;
namespace ServiceLib.Models
namespace ServiceLib.Models;
public class ClashProviders
{
public class ClashProviders
{
public Dictionary<string, ProvidersItem>? providers { get; set; }
public class ProvidersItem
@ -13,5 +13,4 @@ namespace ServiceLib.Models
public string? type { get; set; }
public string? vehicleType { get; set; }
}
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
public class ClashProxies
{
public class ClashProxies
{
public Dictionary<string, ProxiesItem>? proxies { get; set; }
public class ProxiesItem
@ -20,5 +20,4 @@
public string? time { get; set; }
public int delay { get; set; }
}
}
}

View file

@ -1,8 +1,8 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class ClashProxyModel
{
[Serializable]
public class ClashProxyModel
{
public string? Name { get; set; }
public string? Type { get; set; }
@ -14,5 +14,4 @@
public string? DelayName { get; set; }
public bool IsActive { get; set; }
}
}

View file

@ -1,8 +1,7 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
public class CmdItem
{
public class CmdItem
{
public string? Cmd { get; set; }
public List<string>? Arguments { get; set; }
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
public class ComboItem
{
public class ComboItem
{
public string? ID
{
get; set;
@ -11,5 +11,4 @@
{
get; set;
}
}
}

View file

@ -1,11 +1,11 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
/// <summary>
/// 本软件配置文件实体类
/// </summary>
[Serializable]
public class Config
{
/// <summary>
/// 本软件配置文件实体类
/// </summary>
[Serializable]
public class Config
{
#region property
public string IndexId { get; set; }
@ -53,5 +53,4 @@
public List<CoreTypeItem> CoreTypeItem { get; set; }
#endregion other entities
}
}

View file

@ -1,8 +1,8 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class CoreBasicItem
{
[Serializable]
public class CoreBasicItem
{
public bool LogEnabled { get; set; }
public string Loglevel { get; set; }
@ -18,11 +18,11 @@ namespace ServiceLib.Models
public bool EnableFragment { get; set; }
public bool EnableCacheFile4Sbox { get; set; } = true;
}
}
[Serializable]
public class InItem
{
[Serializable]
public class InItem
{
public int LocalPort { get; set; }
public string Protocol { get; set; }
public bool UdpEnabled { get; set; }
@ -34,11 +34,11 @@ namespace ServiceLib.Models
public string User { get; set; }
public string Pass { get; set; }
public bool SecondLocalPortEnabled { get; set; }
}
}
[Serializable]
public class KcpItem
{
[Serializable]
public class KcpItem
{
public int Mtu { get; set; }
public int Tti { get; set; }
@ -52,20 +52,20 @@ namespace ServiceLib.Models
public int ReadBufferSize { get; set; }
public int WriteBufferSize { get; set; }
}
}
[Serializable]
public class GrpcItem
{
[Serializable]
public class GrpcItem
{
public int? IdleTimeout { get; set; }
public int? HealthCheckTimeout { get; set; }
public bool? PermitWithoutStream { get; set; }
public int? InitialWindowsSize { get; set; }
}
}
[Serializable]
public class GUIItem
{
[Serializable]
public class GUIItem
{
public bool AutoRun { get; set; }
public bool EnableStatistics { get; set; }
public bool DisplayRealTimeSpeed { get; set; }
@ -75,18 +75,18 @@ namespace ServiceLib.Models
public int TrayMenuServersLimit { get; set; } = 20;
public bool EnableHWA { get; set; } = false;
public bool EnableLog { get; set; } = true;
}
}
[Serializable]
public class MsgUIItem
{
[Serializable]
public class MsgUIItem
{
public string? MainMsgFilter { get; set; }
public bool? AutoRefresh { get; set; }
}
}
[Serializable]
public class UIItem
{
[Serializable]
public class UIItem
{
public bool EnableAutoAdjustMainLvColWidth { get; set; }
public bool EnableUpdateSubOnlyRemarksExist { get; set; }
public double MainWidth { get; set; }
@ -105,20 +105,20 @@ namespace ServiceLib.Models
public bool Hide2TrayWhenClose { get; set; }
public List<ColumnItem> MainColumnItem { get; set; }
public bool ShowInTaskbar { get; set; }
}
}
[Serializable]
public class ConstItem
{
[Serializable]
public class ConstItem
{
public string? SubConvertUrl { get; set; }
public string? GeoSourceUrl { get; set; }
public string? SrsSourceUrl { get; set; }
public string? RouteRulesTemplateSourceUrl { get; set; }
}
}
[Serializable]
public class KeyEventItem
{
[Serializable]
public class KeyEventItem
{
public EGlobalHotkey EGlobalHotkey { get; set; }
public bool Alt { get; set; }
@ -128,19 +128,19 @@ namespace ServiceLib.Models
public bool Shift { get; set; }
public int? KeyCode { get; set; }
}
}
[Serializable]
public class CoreTypeItem
{
[Serializable]
public class CoreTypeItem
{
public EConfigType ConfigType { get; set; }
public ECoreType CoreType { get; set; }
}
}
[Serializable]
public class TunModeItem
{
[Serializable]
public class TunModeItem
{
public bool EnableTun { get; set; }
public bool StrictRoute { get; set; } = true;
public string Stack { get; set; }
@ -148,61 +148,61 @@ namespace ServiceLib.Models
public bool EnableExInbound { get; set; }
public bool EnableIPv6Address { get; set; }
public string? LinuxSudoPwd { get; set; }
}
}
[Serializable]
public class SpeedTestItem
{
[Serializable]
public class SpeedTestItem
{
public int SpeedTestTimeout { get; set; }
public string SpeedTestUrl { get; set; }
public string SpeedPingTestUrl { get; set; }
public int MixedConcurrencyCount { get; set; }
}
}
[Serializable]
public class RoutingBasicItem
{
[Serializable]
public class RoutingBasicItem
{
public string DomainStrategy { get; set; }
public string DomainStrategy4Singbox { get; set; }
public string DomainMatcher { get; set; }
public string RoutingIndexId { get; set; }
}
}
[Serializable]
public class ColumnItem
{
[Serializable]
public class ColumnItem
{
public string Name { get; set; }
public int Width { get; set; }
public int Index { get; set; }
}
}
[Serializable]
public class Mux4RayItem
{
[Serializable]
public class Mux4RayItem
{
public int? Concurrency { get; set; }
public int? XudpConcurrency { get; set; }
public string? XudpProxyUDP443 { get; set; }
}
}
[Serializable]
public class Mux4SboxItem
{
[Serializable]
public class Mux4SboxItem
{
public string Protocol { get; set; }
public int MaxConnections { get; set; }
public bool? Padding { get; set; }
}
}
[Serializable]
public class HysteriaItem
{
[Serializable]
public class HysteriaItem
{
public int UpMbps { get; set; }
public int DownMbps { get; set; }
public int HopInterval { get; set; } = 30;
}
}
[Serializable]
public class ClashUIItem
{
[Serializable]
public class ClashUIItem
{
public ERuleMode RuleMode { get; set; }
public bool EnableIPv6 { get; set; }
public bool EnableMixinContent { get; set; }
@ -211,38 +211,37 @@ namespace ServiceLib.Models
public int ProxiesAutoDelayTestInterval { get; set; } = 10;
public bool ConnectionsAutoRefresh { get; set; }
public int ConnectionsRefreshInterval { get; set; } = 2;
}
}
[Serializable]
public class SystemProxyItem
{
[Serializable]
public class SystemProxyItem
{
public ESysProxyType SysProxyType { get; set; }
public string SystemProxyExceptions { get; set; }
public bool NotProxyLocalAddress { get; set; } = true;
public string SystemProxyAdvancedProtocol { get; set; }
}
}
[Serializable]
public class WebDavItem
{
[Serializable]
public class WebDavItem
{
public string? Url { get; set; }
public string? UserName { get; set; }
public string? Password { get; set; }
public string? DirName { get; set; }
}
}
[Serializable]
public class CheckUpdateItem
{
[Serializable]
public class CheckUpdateItem
{
public bool CheckPreReleaseUpdate { get; set; }
public List<string>? SelectedCoreTypes { get; set; }
}
}
[Serializable]
public class Fragment4RayItem
{
[Serializable]
public class Fragment4RayItem
{
public string? Packets { get; set; }
public string? Length { get; set; }
public string? Interval { get; set; }
}
}

View file

@ -1,8 +1,8 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class CoreInfo
{
[Serializable]
public class CoreInfo
{
public ECoreType CoreType { get; set; }
public List<string>? CoreExes { get; set; }
public string? Arguments { get; set; }
@ -17,5 +17,4 @@ namespace ServiceLib.Models
public string? Match { get; set; }
public string? VersionArg { get; set; }
public bool AbsolutePath { get; set; }
}
}

View file

@ -1,10 +1,10 @@
using SQLite;
using SQLite;
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class DNSItem
{
[Serializable]
public class DNSItem
{
[PrimaryKey]
public string Id { get; set; }
@ -16,5 +16,4 @@ namespace ServiceLib.Models
public string? TunDNS { get; set; }
public string? DomainStrategy4Freedom { get; set; }
public string? DomainDNSAddress { get; set; }
}
}

View file

@ -1,9 +1,9 @@
using System.Text.Json.Serialization;
using System.Text.Json.Serialization;
namespace ServiceLib.Models
namespace ServiceLib.Models;
public class GitHubReleaseAsset
{
public class GitHubReleaseAsset
{
[JsonPropertyName("url")] public string? Url { get; set; }
[JsonPropertyName("id")] public int Id { get; set; }
@ -27,10 +27,10 @@ namespace ServiceLib.Models
[JsonPropertyName("updated_at")] public DateTime UpdatedAt { get; set; }
[JsonPropertyName("browser_download_url")] public string? BrowserDownloadUrl { get; set; }
}
}
public class GitHubRelease
{
public class GitHubRelease
{
[JsonPropertyName("url")] public string? Url { get; set; }
[JsonPropertyName("assets_url")] public string? AssetsUrl { get; set; }
@ -64,5 +64,4 @@ namespace ServiceLib.Models
[JsonPropertyName("zipball_url")] public string? ZipballUrl { get; set; }
[JsonPropertyName("body")] public string? Body { get; set; }
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
internal class IPAPIInfo
{
internal class IPAPIInfo
{
public string? ip { get; set; }
public string? city { get; set; }
public string? region { get; set; }
@ -9,5 +9,4 @@
public string? country { get; set; }
public string? country_name { get; set; }
public string? country_code { get; set; }
}
}

View file

@ -1,10 +1,10 @@
using SQLite;
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class ProfileExItem
{
[Serializable]
public class ProfileExItem
{
[PrimaryKey]
public string IndexId { get; set; }
@ -12,5 +12,4 @@ namespace ServiceLib.Models
public decimal Speed { get; set; }
public int Sort { get; set; }
public string? Message { get; set; }
}
}

View file

@ -1,10 +1,10 @@
using SQLite;
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class ProfileItem
{
[Serializable]
public class ProfileItem
{
public ProfileItem()
{
IndexId = string.Empty;
@ -64,6 +64,7 @@ namespace ServiceLib.Models
[PrimaryKey]
public string IndexId { get; set; }
public EConfigType ConfigType { get; set; }
public int ConfigVersion { get; set; }
public string Address { get; set; }
@ -92,5 +93,4 @@ namespace ServiceLib.Models
public string ShortId { get; set; }
public string SpiderX { get; set; }
public string Extra { get; set; }
}
}

View file

@ -1,8 +1,8 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class ProfileItemModel : ProfileItem
{
[Serializable]
public class ProfileItemModel : ProfileItem
{
public bool IsActive { get; set; }
public string SubRemarks { get; set; }
public int Delay { get; set; }
@ -14,5 +14,4 @@
public string TodayDown { get; set; }
public string TotalUp { get; set; }
public string TotalDown { get; set; }
}
}

View file

@ -1,7 +1,7 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
public class RetResult
{
public class RetResult
{
public bool Success { get; set; }
public string? Msg { get; set; }
public object? Data { get; set; }
@ -23,5 +23,4 @@
Msg = msg;
Data = data;
}
}
}

View file

@ -1,10 +1,10 @@
using SQLite;
using SQLite;
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class RoutingItem
{
[Serializable]
public class RoutingItem
{
[PrimaryKey]
public string Id { get; set; }
@ -19,5 +19,4 @@ namespace ServiceLib.Models
public string DomainStrategy { get; set; }
public string DomainStrategy4Singbox { get; set; }
public int Sort { get; set; }
}
}

View file

@ -1,8 +1,7 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class RoutingItemModel : RoutingItem
{
[Serializable]
public class RoutingItemModel : RoutingItem
{
public bool IsActive { get; set; }
}
}

View file

@ -1,9 +1,8 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class RoutingTemplate
{
[Serializable]
public class RoutingTemplate
{
public string Version { get; set; }
public RoutingItem[] RoutingItems { get; set; }
}
}

View file

@ -1,8 +1,8 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class RulesItem
{
[Serializable]
public class RulesItem
{
public string Id { get; set; }
public string? Type { get; set; }
public string? Port { get; set; }
@ -15,5 +15,4 @@
public List<string>? Process { get; set; }
public bool Enabled { get; set; } = true;
public string? Remarks { get; set; }
}
}

View file

@ -1,11 +1,10 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class RulesItemModel : RulesItem
{
[Serializable]
public class RulesItemModel : RulesItem
{
public string InboundTags { get; set; }
public string Ips { get; set; }
public string Domains { get; set; }
public string Protocols { get; set; }
}
}

View file

@ -1,8 +1,8 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class ServerSpeedItem : ServerStatItem
{
[Serializable]
public class ServerSpeedItem : ServerStatItem
{
public long ProxyUp { get; set; }
public long ProxyDown { get; set; }
@ -10,13 +10,12 @@
public long DirectUp { get; set; }
public long DirectDown { get; set; }
}
}
[Serializable]
public class TrafficItem
{
[Serializable]
public class TrafficItem
{
public ulong Up { get; set; }
public ulong Down { get; set; }
}
}

View file

@ -1,10 +1,10 @@
using SQLite;
using SQLite;
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class ServerStatItem
{
[Serializable]
public class ServerStatItem
{
[PrimaryKey]
public string IndexId { get; set; }
@ -17,5 +17,4 @@ namespace ServiceLib.Models
public long TodayDown { get; set; }
public long DateNow { get; set; }
}
}

View file

@ -1,13 +1,12 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class ServerTestItem
{
[Serializable]
public class ServerTestItem
{
public string? IndexId { get; set; }
public string? Address { get; set; }
public int Port { get; set; }
public EConfigType ConfigType { get; set; }
public bool AllowTest { get; set; }
public int QueueNum { get; set; }
}
}

View file

@ -1,25 +1,25 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
public class SingboxConfig
{
public class SingboxConfig
{
public Log4Sbox log { get; set; }
public Dns4Sbox? dns { get; set; }
public List<Inbound4Sbox> inbounds { get; set; }
public List<Outbound4Sbox> outbounds { get; set; }
public Route4Sbox route { get; set; }
public Experimental4Sbox? experimental { get; set; }
}
}
public class Log4Sbox
{
public class Log4Sbox
{
public bool? disabled { get; set; }
public string level { get; set; }
public string output { get; set; }
public bool? timestamp { get; set; }
}
}
public class Dns4Sbox
{
public class Dns4Sbox
{
public List<Server4Sbox> servers { get; set; }
public List<Rule4Sbox> rules { get; set; }
public string? final { get; set; }
@ -30,18 +30,18 @@ namespace ServiceLib.Models
public bool? reverse_mapping { get; set; }
public string? client_subnet { get; set; }
public Fakeip4Sbox? fakeip { get; set; }
}
}
public class Route4Sbox
{
public class Route4Sbox
{
public bool? auto_detect_interface { get; set; }
public List<Rule4Sbox> rules { get; set; }
public List<Ruleset4Sbox>? rule_set { get; set; }
}
}
[Serializable]
public class Rule4Sbox
{
[Serializable]
public class Rule4Sbox
{
public string? outbound { get; set; }
public string? server { get; set; }
public bool? disable_cache { get; set; }
@ -67,11 +67,11 @@ namespace ServiceLib.Models
public List<string>? process_name { get; set; }
public List<string>? rule_set { get; set; }
public List<Rule4Sbox>? rules { get; set; }
}
}
[Serializable]
public class Inbound4Sbox
{
[Serializable]
public class Inbound4Sbox
{
public string type { get; set; }
public string tag { get; set; }
public string listen { get; set; }
@ -87,16 +87,16 @@ namespace ServiceLib.Models
public bool? sniff { get; set; }
public bool? sniff_override_destination { get; set; }
public List<User4Sbox> users { get; set; }
}
}
public class User4Sbox
{
public class User4Sbox
{
public string username { get; set; }
public string password { get; set; }
}
}
public class Outbound4Sbox
{
public class Outbound4Sbox
{
public string type { get; set; }
public string tag { get; set; }
public string? server { get; set; }
@ -134,41 +134,41 @@ namespace ServiceLib.Models
public HyObfs4Sbox? obfs { get; set; }
public List<string>? outbounds { get; set; }
public bool? interrupt_exist_connections { get; set; }
}
}
public class Tls4Sbox
{
public class Tls4Sbox
{
public bool enabled { get; set; }
public string? server_name { get; set; }
public bool? insecure { get; set; }
public List<string>? alpn { get; set; }
public Utls4Sbox? utls { get; set; }
public Reality4Sbox? reality { get; set; }
}
}
public class Multiplex4Sbox
{
public class Multiplex4Sbox
{
public bool enabled { get; set; }
public string protocol { get; set; }
public int max_connections { get; set; }
public bool? padding { get; set; }
}
}
public class Utls4Sbox
{
public class Utls4Sbox
{
public bool enabled { get; set; }
public string fingerprint { get; set; }
}
}
public class Reality4Sbox
{
public class Reality4Sbox
{
public bool enabled { get; set; }
public string public_key { get; set; }
public string short_id { get; set; }
}
}
public class Transport4Sbox
{
public class Transport4Sbox
{
public string? type { get; set; }
public object? host { get; set; }
public string? path { get; set; }
@ -178,21 +178,21 @@ namespace ServiceLib.Models
public string? idle_timeout { get; set; }
public string? ping_timeout { get; set; }
public bool? permit_without_stream { get; set; }
}
}
public class Headers4Sbox
{
public class Headers4Sbox
{
public string? Host { get; set; }
}
}
public class HyObfs4Sbox
{
public class HyObfs4Sbox
{
public string? type { get; set; }
public string? password { get; set; }
}
}
public class Server4Sbox
{
public class Server4Sbox
{
public string? tag { get; set; }
public string? address { get; set; }
public string? address_resolver { get; set; }
@ -200,52 +200,52 @@ namespace ServiceLib.Models
public string? strategy { get; set; }
public string? detour { get; set; }
public string? client_subnet { get; set; }
}
}
public class Experimental4Sbox
{
public class Experimental4Sbox
{
public CacheFile4Sbox? cache_file { get; set; }
public V2ray_Api4Sbox? v2ray_api { get; set; }
public Clash_Api4Sbox? clash_api { get; set; }
}
}
public class V2ray_Api4Sbox
{
public class V2ray_Api4Sbox
{
public string listen { get; set; }
public Stats4Sbox stats { get; set; }
}
}
public class Clash_Api4Sbox
{
public class Clash_Api4Sbox
{
public string? external_controller { get; set; }
public bool? store_selected { get; set; }
}
}
public class Stats4Sbox
{
public class Stats4Sbox
{
public bool enabled { get; set; }
public List<string>? inbounds { get; set; }
public List<string>? outbounds { get; set; }
public List<string>? users { get; set; }
}
}
public class Fakeip4Sbox
{
public class Fakeip4Sbox
{
public bool enabled { get; set; }
public string inet4_range { get; set; }
public string inet6_range { get; set; }
}
}
public class CacheFile4Sbox
{
public class CacheFile4Sbox
{
public bool enabled { get; set; }
public string? path { get; set; }
public string? cache_id { get; set; }
public bool? store_fakeip { get; set; }
}
}
public class Ruleset4Sbox
{
public class Ruleset4Sbox
{
public string? tag { get; set; }
public string? type { get; set; }
public string? format { get; set; }
@ -253,5 +253,4 @@ namespace ServiceLib.Models
public string? url { get; set; }
public string? download_detour { get; set; }
public string? update_interval { get; set; }
}
}

View file

@ -1,12 +1,11 @@
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class SpeedTestResult
{
[Serializable]
public class SpeedTestResult
{
public string? IndexId { get; set; }
public string? Delay { get; set; }
public string? Speed { get; set; }
}
}

View file

@ -1,18 +1,17 @@
namespace ServiceLib.Models
{
public class SsSIP008
{
public List<SsServer>? servers { get; set; }
}
namespace ServiceLib.Models;
[Serializable]
public class SsServer
{
public class SsSIP008
{
public List<SsServer>? servers { get; set; }
}
[Serializable]
public class SsServer
{
public string? remarks { get; set; }
public string? server { get; set; }
public string? server_port { get; set; }
public string? method { get; set; }
public string? password { get; set; }
public string? plugin { get; set; }
}
}

View file

@ -1,10 +1,10 @@
using SQLite;
using SQLite;
namespace ServiceLib.Models
namespace ServiceLib.Models;
[Serializable]
public class SubItem
{
[Serializable]
public class SubItem
{
[PrimaryKey]
public string Id { get; set; }
@ -35,5 +35,4 @@ namespace ServiceLib.Models
public int? PreSocksPort { get; set; }
public string? Memo { get; set; }
}
}

View file

@ -1,9 +1,9 @@
using System.Text.Json.Serialization;
namespace ServiceLib.Models
namespace ServiceLib.Models;
public class V2rayConfig
{
public class V2rayConfig
{
public Log4Ray log { get; set; }
public object dns { get; set; }
public List<Inbounds4Ray> inbounds { get; set; }
@ -15,38 +15,38 @@ namespace ServiceLib.Models
public Observatory4Ray? observatory { get; set; }
public BurstObservatory4Ray? burstObservatory { get; set; }
public string? remarks { get; set; }
}
}
public class Stats4Ray
{ }
public class Stats4Ray
{ }
public class Metrics4Ray
{
public class Metrics4Ray
{
public string tag { get; set; }
}
}
public class Policy4Ray
{
public class Policy4Ray
{
public SystemPolicy4Ray system { get; set; }
}
}
public class SystemPolicy4Ray
{
public class SystemPolicy4Ray
{
public bool statsOutboundUplink { get; set; }
public bool statsOutboundDownlink { get; set; }
}
}
public class Log4Ray
{
public class Log4Ray
{
public string? access { get; set; }
public string? error { get; set; }
public string? loglevel { get; set; }
}
}
public class Inbounds4Ray
{
public class Inbounds4Ray
{
public string tag { get; set; }
public int port { get; set; }
@ -58,10 +58,10 @@ namespace ServiceLib.Models
public Sniffing4Ray sniffing { get; set; }
public Inboundsettings4Ray settings { get; set; }
}
}
public class Inboundsettings4Ray
{
public class Inboundsettings4Ray
{
public string? auth { get; set; }
public bool? udp { get; set; }
@ -77,10 +77,10 @@ namespace ServiceLib.Models
public bool? allowTransparent { get; set; }
public List<AccountsItem4Ray>? accounts { get; set; }
}
}
public class UsersItem4Ray
{
public class UsersItem4Ray
{
public string? id { get; set; }
public int? alterId { get; set; }
@ -92,17 +92,17 @@ namespace ServiceLib.Models
public string? encryption { get; set; }
public string? flow { get; set; }
}
}
public class Sniffing4Ray
{
public class Sniffing4Ray
{
public bool enabled { get; set; }
public List<string>? destOverride { get; set; }
public bool routeOnly { get; set; }
}
}
public class Outbounds4Ray
{
public class Outbounds4Ray
{
public string tag { get; set; }
public string protocol { get; set; }
@ -112,10 +112,10 @@ namespace ServiceLib.Models
public StreamSettings4Ray streamSettings { get; set; }
public Mux4Ray mux { get; set; }
}
}
public class Outboundsettings4Ray
{
public class Outboundsettings4Ray
{
public List<VnextItem4Ray>? vnext { get; set; }
public List<ServersItem4Ray>? servers { get; set; }
@ -127,19 +127,19 @@ namespace ServiceLib.Models
public int? userLevel { get; set; }
public FragmentItem4Ray? fragment { get; set; }
}
}
public class VnextItem4Ray
{
public class VnextItem4Ray
{
public string address { get; set; }
public int port { get; set; }
public List<UsersItem4Ray> users { get; set; }
}
}
public class ServersItem4Ray
{
public class ServersItem4Ray
{
public string email { get; set; }
public string address { get; set; }
@ -157,43 +157,43 @@ namespace ServiceLib.Models
public string flow { get; set; }
public List<SocksUsersItem4Ray> users { get; set; }
}
}
public class SocksUsersItem4Ray
{
public class SocksUsersItem4Ray
{
public string user { get; set; }
public string pass { get; set; }
public int? level { get; set; }
}
}
public class Mux4Ray
{
public class Mux4Ray
{
public bool enabled { get; set; }
public int? concurrency { get; set; }
public int? xudpConcurrency { get; set; }
public string? xudpProxyUDP443 { get; set; }
}
}
public class Response4Ray
{
public class Response4Ray
{
public string type { get; set; }
}
}
public class Dns4Ray
{
public class Dns4Ray
{
public List<string> servers { get; set; }
}
}
public class DnsServer4Ray
{
public class DnsServer4Ray
{
public string? address { get; set; }
public List<string>? domains { get; set; }
}
}
public class Routing4Ray
{
public class Routing4Ray
{
public string domainStrategy { get; set; }
public string? domainMatcher { get; set; }
@ -201,11 +201,11 @@ namespace ServiceLib.Models
public List<RulesItem4Ray> rules { get; set; }
public List<BalancersItem4Ray>? balancers { get; set; }
}
}
[Serializable]
public class RulesItem4Ray
{
[Serializable]
public class RulesItem4Ray
{
public string? type { get; set; }
public string? port { get; set; }
@ -222,62 +222,62 @@ namespace ServiceLib.Models
public List<string>? domain { get; set; }
public List<string>? protocol { get; set; }
}
}
public class BalancersItem4Ray
{
public class BalancersItem4Ray
{
public List<string>? selector { get; set; }
public BalancersStrategy4Ray? strategy { get; set; }
public string? tag { get; set; }
}
}
public class BalancersStrategy4Ray
{
public class BalancersStrategy4Ray
{
public string? type { get; set; }
public BalancersStrategySettings4Ray? settings { get; set; }
}
}
public class BalancersStrategySettings4Ray
{
public class BalancersStrategySettings4Ray
{
public int? expected { get; set; }
public string? maxRTT { get; set; }
public float? tolerance { get; set; }
public List<string>? baselines { get; set; }
public List<BalancersStrategySettingsCosts4Ray>? costs { get; set; }
}
}
public class BalancersStrategySettingsCosts4Ray
{
public class BalancersStrategySettingsCosts4Ray
{
public bool? regexp { get; set; }
public string? match { get; set; }
public float? value { get; set; }
}
}
public class Observatory4Ray
{
public class Observatory4Ray
{
public List<string>? subjectSelector { get; set; }
public string? probeUrl { get; set; }
public string? probeInterval { get; set; }
public bool? enableConcurrency { get; set; }
}
}
public class BurstObservatory4Ray
{
public class BurstObservatory4Ray
{
public List<string>? subjectSelector { get; set; }
public BurstObservatoryPingConfig4Ray? pingConfig { get; set; }
}
}
public class BurstObservatoryPingConfig4Ray
{
public class BurstObservatoryPingConfig4Ray
{
public string? destination { get; set; }
public string? connectivity { get; set; }
public string? interval { get; set; }
public int? sampling { get; set; }
public string? timeout { get; set; }
}
}
public class StreamSettings4Ray
{
public class StreamSettings4Ray
{
public string network { get; set; }
public string security { get; set; }
@ -303,10 +303,10 @@ namespace ServiceLib.Models
public GrpcSettings4Ray? grpcSettings { get; set; }
public Sockopt4Ray? sockopt { get; set; }
}
}
public class TlsSettings4Ray
{
public class TlsSettings4Ray
{
public bool? allowInsecure { get; set; }
public string? serverName { get; set; }
@ -319,15 +319,15 @@ namespace ServiceLib.Models
public string? publicKey { get; set; }
public string? shortId { get; set; }
public string? spiderX { get; set; }
}
}
public class TcpSettings4Ray
{
public class TcpSettings4Ray
{
public Header4Ray header { get; set; }
}
}
public class Header4Ray
{
public class Header4Ray
{
public string type { get; set; }
public object request { get; set; }
@ -335,10 +335,10 @@ namespace ServiceLib.Models
public object response { get; set; }
public string? domain { get; set; }
}
}
public class KcpSettings4Ray
{
public class KcpSettings4Ray
{
public int mtu { get; set; }
public int tti { get; set; }
@ -356,57 +356,57 @@ namespace ServiceLib.Models
public Header4Ray header { get; set; }
public string seed { get; set; }
}
}
public class WsSettings4Ray
{
public class WsSettings4Ray
{
public string? path { get; set; }
public string? host { get; set; }
public Headers4Ray headers { get; set; }
}
}
public class Headers4Ray
{
public class Headers4Ray
{
public string Host { get; set; }
[JsonPropertyName("User-Agent")]
public string UserAgent { get; set; }
}
}
public class HttpupgradeSettings4Ray
{
public class HttpupgradeSettings4Ray
{
public string? path { get; set; }
public string? host { get; set; }
}
}
public class XhttpSettings4Ray
{
public class XhttpSettings4Ray
{
public string? path { get; set; }
public string? host { get; set; }
public string? mode { get; set; }
public object? extra { get; set; }
}
}
public class HttpSettings4Ray
{
public class HttpSettings4Ray
{
public string? path { get; set; }
public List<string>? host { get; set; }
}
}
public class QuicSettings4Ray
{
public class QuicSettings4Ray
{
public string security { get; set; }
public string key { get; set; }
public Header4Ray header { get; set; }
}
}
public class GrpcSettings4Ray
{
public class GrpcSettings4Ray
{
public string? authority { get; set; }
public string? serviceName { get; set; }
public bool multiMode { get; set; }
@ -414,24 +414,23 @@ namespace ServiceLib.Models
public int? health_check_timeout { get; set; }
public bool? permit_without_stream { get; set; }
public int? initial_windows_size { get; set; }
}
}
public class AccountsItem4Ray
{
public class AccountsItem4Ray
{
public string user { get; set; }
public string pass { get; set; }
}
}
public class Sockopt4Ray
{
public class Sockopt4Ray
{
public string? dialerProxy { get; set; }
}
}
public class FragmentItem4Ray
{
public class FragmentItem4Ray
{
public string? packets { get; set; }
public string? length { get; set; }
public string? interval { get; set; }
}
}

View file

@ -1,11 +1,10 @@
using System.Collections;
using System.Collections;
namespace ServiceLib.Models
namespace ServiceLib.Models;
internal class V2rayMetricsVars
{
internal class V2rayMetricsVars
{
public V2rayMetricsVarsStats? stats { get; set; }
}
}
public class V2rayMetricsVarsStats

Some files were not shown because too many files have changed in this diff Show more