Compare commits

..

No commits in common. "24ccfb80776585bee04b0544999f2ba58eb9e21c" and "6ad07627314ebd7a6f523264884e18c1046cbd69" have entirely different histories.

204 changed files with 24063 additions and 24146 deletions

View file

@ -1,5 +1,5 @@
namespace AmazTool;
namespace AmazTool
{
internal static class Program
{
[STAThread]
@ -23,3 +23,4 @@ internal static class Program
UpgradeApp.Upgrade(argData);
}
}
}

View file

@ -2,8 +2,8 @@ using System.Diagnostics;
using System.IO.Compression;
using System.Text;
namespace AmazTool;
namespace AmazTool
{
internal class UpgradeApp
{
public static void Upgrade(string fileName)
@ -114,3 +114,4 @@ internal class UpgradeApp
Utils.StartV2RayN();
}
}
}

View file

@ -1,7 +1,7 @@
using System.Diagnostics;
namespace AmazTool;
namespace AmazTool
{
internal class Utils
{
public static string GetExePath()
@ -49,3 +49,4 @@ internal class Utils
}
}
}
}

View file

@ -1,14 +1,14 @@
<Project>
<PropertyGroup>
<Version>7.11.0</Version>
<Version>7.10.5</Version>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<NoWarn>CA1031;CS1591;NU1507;CA1416;IDE0058</NoWarn>
<NoWarn>CA1031;CS1591;NU1507;CA1416</NoWarn>
<Nullable>annotations</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Authors>2dust</Authors>

View file

@ -5,10 +5,10 @@
<CentralPackageVersionOverrideEnabled>false</CentralPackageVersionOverrideEnabled>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.2.6" />
<PackageVersion Include="Avalonia.Desktop" Version="11.2.6" />
<PackageVersion Include="Avalonia.Diagnostics" Version="11.2.6" />
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.2.6" />
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.2.5" />
<PackageVersion Include="Avalonia.Desktop" Version="11.2.5" />
<PackageVersion Include="Avalonia.Diagnostics" Version="11.2.5" />
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.2.5" />
<PackageVersion Include="CliWrap" Version="3.8.2" />
<PackageVersion Include="Downloader" Version="3.3.4" />
<PackageVersion Include="H.NotifyIcon.Wpf" Version="2.3.0" />
@ -18,12 +18,12 @@
<PackageVersion Include="ReactiveUI" Version="20.2.45" />
<PackageVersion Include="ReactiveUI.Fody" Version="19.5.41" />
<PackageVersion Include="ReactiveUI.WPF" Version="20.2.45" />
<PackageVersion Include="Semi.Avalonia" Version="11.2.1.6" />
<PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.2.1.6" />
<PackageVersion Include="Semi.Avalonia" Version="11.2.1.5" />
<PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.2.1.5" />
<PackageVersion Include="Splat.NLog" Version="15.3.1" />
<PackageVersion Include="sqlite-net-pcl" Version="1.9.172" />
<PackageVersion Include="TaskScheduler" Version="2.12.1" />
<PackageVersion Include="WebDav.Client" Version="2.9.0" />
<PackageVersion Include="WebDav.Client" Version="2.8.0" />
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
<PackageVersion Include="ZXing.Net.Bindings.SkiaSharp" Version="0.16.14" />
</ItemGroup>

View file

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

View file

@ -1,8 +1,8 @@
using System.Security.Cryptography;
using System.Text;
namespace ServiceLib.Common;
namespace ServiceLib.Common
{
public class AesUtils
{
private const int KeySize = 256; // AES-256
@ -98,3 +98,4 @@ public class AesUtils
return randomNumber;
}
}
}

View file

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

View file

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

View file

@ -2,8 +2,8 @@ using System.Formats.Tar;
using System.IO.Compression;
using System.Text;
namespace ServiceLib.Common;
namespace ServiceLib.Common
{
public static class FileManager
{
private static readonly string _tag = "FileManager";
@ -224,3 +224,4 @@ public static class FileManager
}
}
}
}

View file

@ -2,8 +2,8 @@ using System.Net.Http.Headers;
using System.Net.Mime;
using System.Text;
namespace ServiceLib.Common;
namespace ServiceLib.Common
{
/// <summary>
/// </summary>
public class HttpClientHelper
@ -203,3 +203,4 @@ public class HttpClientHelper
} while (isMoreToRead);
}
}
}

View file

@ -1,7 +1,8 @@
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
@ -177,4 +178,4 @@ namespace ServiceLib.Common;
}
#endregion Helper classes
}

View file

@ -1,9 +1,9 @@
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
{
private static readonly string _tag = "JsonUtils";
@ -128,3 +128,4 @@ public class JsonUtils
/// <returns></returns>
public static JsonNode? SerializeToNode(object? obj) => JsonSerializer.SerializeToNode(obj);
}
}

View file

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

View file

@ -1,9 +1,9 @@
using QRCoder;
using QRCoder;
using SkiaSharp;
using ZXing.SkiaSharp;
namespace ServiceLib.Common;
namespace ServiceLib.Common
{
public class QRCodeHelper
{
public static byte[]? GenQRCode(string? url)
@ -87,3 +87,4 @@ public class QRCodeHelper
return flipped;
}
}
}

View file

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

View file

@ -1,8 +1,8 @@
using System.Collections;
using SQLite;
namespace ServiceLib.Common;
namespace ServiceLib.Common
{
public sealed class SQLiteHelper
{
private static readonly Lazy<SQLiteHelper> _instance = new(() => new());
@ -88,3 +88,4 @@ public sealed class SQLiteHelper
});
}
}
}

View file

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

View file

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

View file

@ -2,8 +2,8 @@ using System.Security.Cryptography;
using System.Text;
using Microsoft.Win32;
namespace ServiceLib.Common;
namespace ServiceLib.Common
{
internal static class WindowsUtils
{
private static readonly string _tag = "WindowsUtils";
@ -71,3 +71,4 @@ internal static class WindowsUtils
}
}
}
}

View file

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

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums;
namespace ServiceLib.Enums
{
public enum EConfigType
{
VMess = 1,
@ -13,3 +13,4 @@ public enum EConfigType
WireGuard = 9,
HTTP = 10
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums;
namespace ServiceLib.Enums
{
public enum ECoreType
{
v2fly = 1,
@ -16,3 +16,4 @@ public enum ECoreType
overtls = 28,
v2rayN = 99
}
}

View file

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

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums;
namespace ServiceLib.Enums
{
public enum EGlobalHotkey
{
ShowForm = 0,
@ -8,3 +8,4 @@ public enum EGlobalHotkey
SystemProxyUnchanged = 3,
SystemProxyPac = 4,
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums;
namespace ServiceLib.Enums
{
public enum EInboundProtocol
{
socks = 0,
@ -11,3 +11,4 @@ public enum EInboundProtocol
mixed,
speedtest = 21
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums;
namespace ServiceLib.Enums
{
public enum EMove
{
Top = 1,
@ -8,3 +8,4 @@ public enum EMove
Bottom = 4,
Position = 5
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums;
namespace ServiceLib.Enums
{
public enum EMsgCommand
{
ClearMsg,
@ -8,3 +8,4 @@ public enum EMsgCommand
RefreshProfiles,
AppExit
}
}

View file

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

View file

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

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums;
namespace ServiceLib.Enums
{
public enum ERuleMode
{
Rule = 0,
@ -7,3 +7,4 @@ public enum ERuleMode
Direct = 2,
Unchanged = 3
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums;
namespace ServiceLib.Enums
{
public enum EServerColName
{
Def = 0,
@ -18,3 +18,4 @@ public enum EServerColName
TotalDown,
TotalUp
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums;
namespace ServiceLib.Enums
{
public enum ESpeedActionType
{
Tcping,
@ -7,3 +7,4 @@ public enum ESpeedActionType
Speedtest,
Mixedtest
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums;
namespace ServiceLib.Enums
{
public enum ESysProxyType
{
ForcedClear = 0,
@ -7,3 +7,4 @@ public enum ESysProxyType
Unchanged = 2,
Pac = 3
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums;
namespace ServiceLib.Enums
{
public enum ETheme
{
FollowSystem,
@ -10,3 +10,4 @@ public enum ETheme
Dusk,
NightSky
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums;
namespace ServiceLib.Enums
{
public enum ETransport
{
tcp,
@ -12,3 +12,4 @@ public enum ETransport
quic,
grpc
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums;
namespace ServiceLib.Enums
{
public enum EViewAction
{
CloseWindow,
@ -43,3 +43,4 @@ public enum EViewAction
DispatcherCheckUpdateFinished,
DispatcherShowMsg,
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib;
namespace ServiceLib
{
public class Global
{
#region const
@ -521,3 +521,4 @@ public class Global
#endregion const
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler;
namespace ServiceLib.Handler
{
public sealed class AppHandler
{
#region Property
@ -80,10 +80,6 @@ public sealed class AppHandler
Logging.SaveLog($"v2rayN start up | {Utils.GetRuntimeInfo()}");
Logging.LoggingEnabled(_config.GuiItem.EnableLog);
//First determine the port value
_ = StatePort;
_ = StatePort2;
return true;
}
@ -245,3 +241,4 @@ public sealed class AppHandler
#endregion Core Type
}
}

View file

@ -1,8 +1,8 @@
using System.Security.Principal;
using System.Text.RegularExpressions;
namespace ServiceLib.Handler;
namespace ServiceLib.Handler
{
public static class AutoStartupHandler
{
private static readonly string _tag = "AutoStartupHandler";
@ -239,3 +239,4 @@ public static class AutoStartupHandler
#endregion macOS
}
}

View file

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

View file

@ -1,8 +1,8 @@
using System.Data;
using System.Text.RegularExpressions;
namespace ServiceLib.Handler;
namespace ServiceLib.Handler
{
/// <summary>
/// 本软件配置文件处理类
/// </summary>
@ -1005,12 +1005,12 @@ public class ConfigHandler
return 0;
}
public static async Task<RetResult> AddCustomServer4Multiple(Config config, List<ProfileItem> selecteds, ECoreType coreType, EMultipleLoad multipleLoad)
public static async Task<RetResult> AddCustomServer4Multiple(Config config, List<ProfileItem> selecteds, ECoreType coreType)
{
var indexId = Utils.GetMd5(Global.CoreMultipleLoadConfigFileName);
var configPath = Utils.GetConfigPath(Global.CoreMultipleLoadConfigFileName);
var result = await CoreConfigHandler.GenerateClientMultipleLoadConfig(config, configPath, selecteds, coreType, multipleLoad);
var result = await CoreConfigHandler.GenerateClientMultipleLoadConfig(config, configPath, selecteds, coreType);
if (result.Success != true)
{
return result;
@ -1023,14 +1023,7 @@ public class ConfigHandler
var profileItem = await AppHandler.Instance.GetProfileItem(indexId) ?? new();
profileItem.IndexId = indexId;
profileItem.Remarks = multipleLoad switch
{
EMultipleLoad.Random => ResUI.menuSetDefaultMultipleServerXrayRandom,
EMultipleLoad.RoundRobin => ResUI.menuSetDefaultMultipleServerXrayRoundRobin,
EMultipleLoad.LeastPing => ResUI.menuSetDefaultMultipleServerXrayLeastPing,
EMultipleLoad.LeastLoad => ResUI.menuSetDefaultMultipleServerXrayLeastLoad,
_ => ResUI.menuSetDefaultMultipleServerXrayRoundRobin,
};
profileItem.Remarks = coreType == ECoreType.sing_box ? ResUI.menuSetDefaultMultipleServer : ResUI.menuSetDefaultLoadBalanceServer;
profileItem.Address = Global.CoreMultipleLoadConfigFileName;
profileItem.ConfigType = EConfigType.Custom;
profileItem.CoreType = coreType;
@ -1923,3 +1916,4 @@ public class ConfigHandler
#endregion Regional Presets
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler;
namespace ServiceLib.Handler
{
/// <summary>
/// Core configuration file processing class
/// </summary>
@ -133,16 +133,16 @@ public class CoreConfigHandler
return result;
}
public static async Task<RetResult> GenerateClientMultipleLoadConfig(Config config, string fileName, List<ProfileItem> selecteds, ECoreType coreType, EMultipleLoad multipleLoad)
public static async Task<RetResult> GenerateClientMultipleLoadConfig(Config config, string fileName, List<ProfileItem> selecteds, ECoreType coreType)
{
var result = new RetResult();
if (coreType == ECoreType.sing_box)
{
result = await new CoreConfigSingboxService(config).GenerateClientMultipleLoadConfig(selecteds);
}
else
else if (coreType == ECoreType.Xray)
{
result = await new CoreConfigV2rayService(config).GenerateClientMultipleLoadConfig(selecteds, multipleLoad);
result = await new CoreConfigV2rayService(config).GenerateClientMultipleLoadConfig(selecteds);
}
if (result.Success != true)
@ -153,3 +153,4 @@ public class CoreConfigHandler
return result;
}
}
}

View file

@ -1,8 +1,8 @@
using System.Diagnostics;
using System.Text;
namespace ServiceLib.Handler;
namespace ServiceLib.Handler
{
/// <summary>
/// Core process processing class
/// </summary>
@ -407,3 +407,4 @@ public class CoreHandler
#endregion Linux
}
}

View file

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

View file

@ -1,7 +1,7 @@
using System.Collections.Specialized;
namespace ServiceLib.Handler.Fmt;
namespace ServiceLib.Handler.Fmt
{
public class BaseFmt
{
protected static string GetIpv6(string address)
@ -239,3 +239,4 @@ public class BaseFmt
return $"{Global.ProtocolShares[eConfigType]}{url}{query}{remark}";
}
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt;
namespace ServiceLib.Handler.Fmt
{
public class ClashFmt : BaseFmt
{
public static ProfileItem? ResolveFull(string strData, string? subRemarks)
@ -20,3 +20,4 @@ public class ClashFmt : BaseFmt
return null;
}
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt;
namespace ServiceLib.Handler.Fmt
{
public class FmtHandler
{
private static readonly string _tag = "FmtHandler";
@ -89,3 +89,4 @@ public class FmtHandler
}
}
}
}

View file

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

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt;
namespace ServiceLib.Handler.Fmt
{
public class NaiveproxyFmt : BaseFmt
{
public static ProfileItem? ResolveFull(string strData, string? subRemarks)
@ -20,3 +20,4 @@ public class NaiveproxyFmt : BaseFmt
return null;
}
}
}

View file

@ -1,7 +1,7 @@
using System.Text.RegularExpressions;
namespace ServiceLib.Handler.Fmt;
namespace ServiceLib.Handler.Fmt
{
public class ShadowsocksFmt : BaseFmt
{
public static ProfileItem? Resolve(string str, out string msg)
@ -177,3 +177,4 @@ public class ShadowsocksFmt : BaseFmt
return null;
}
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt;
namespace ServiceLib.Handler.Fmt
{
public class SingboxFmt : BaseFmt
{
public static List<ProfileItem>? ResolveFullArray(string strData, string? subRemarks)
@ -45,3 +45,4 @@ public class SingboxFmt : BaseFmt
return profileItem;
}
}
}

View file

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

View file

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

View file

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

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt;
namespace ServiceLib.Handler.Fmt
{
public class V2rayFmt : BaseFmt
{
public static List<ProfileItem>? ResolveFullArray(string strData, string? subRemarks)
@ -46,3 +46,4 @@ public class V2rayFmt : BaseFmt
return profileItem;
}
}
}

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
using ReactiveUI;
namespace ServiceLib.Handler;
using ReactiveUI;
namespace ServiceLib.Handler
{
public class NoticeHandler
{
private static readonly Lazy<NoticeHandler> _instance = new(() => new());
@ -41,3 +41,4 @@ public class NoticeHandler
SendMessage(msg);
}
}
}

View file

@ -1,8 +1,8 @@
using System.Net.Sockets;
using System.Text;
namespace ServiceLib.Handler;
namespace ServiceLib.Handler
{
public class PacHandler
{
private static string _configPath;
@ -112,3 +112,4 @@ public class PacHandler
}
}
}
}

View file

@ -2,8 +2,8 @@ using System.Collections.Concurrent;
//using System.Reactive.Linq;
namespace ServiceLib.Handler;
namespace ServiceLib.Handler
{
public class ProfileExHandler
{
private static readonly Lazy<ProfileExHandler> _instance = new(() => new());
@ -179,3 +179,4 @@ public class ProfileExHandler
return _lstProfileEx.Max(t => t == null ? 0 : t.Sort);
}
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler;
namespace ServiceLib.Handler
{
public class StatisticsHandler
{
private static readonly Lazy<StatisticsHandler> instance = new(() => new());
@ -161,3 +161,4 @@ public class StatisticsHandler
}
}
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.SysProxy;
namespace ServiceLib.Handler.SysProxy
{
public class ProxySettingLinux
{
private static readonly string _proxySetFileName = $"{Global.ProxySetLinuxShellFileName.Replace(Global.NamespaceSample, "")}.sh";
@ -30,3 +30,4 @@ public class ProxySettingLinux
await Utils.GetCliWrapOutput(fileName, args);
}
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.SysProxy;
namespace ServiceLib.Handler.SysProxy
{
public class ProxySettingOSX
{
private static readonly string _proxySetFileName = $"{Global.ProxySetOSXShellFileName.Replace(Global.NamespaceSample, "")}.sh";
@ -35,3 +35,4 @@ public class ProxySettingOSX
await Utils.GetCliWrapOutput(fileName, args);
}
}
}

View file

@ -1,8 +1,8 @@
using System.Runtime.InteropServices;
using static ServiceLib.Handler.SysProxy.ProxySettingWindows.InternetConnectionOption;
namespace ServiceLib.Handler.SysProxy;
namespace ServiceLib.Handler.SysProxy
{
public class ProxySettingWindows
{
private const string _regPath = @"Software\Microsoft\Windows\CurrentVersion\Internet Settings";
@ -357,3 +357,4 @@ public class ProxySettingWindows
);
}
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.SysProxy;
namespace ServiceLib.Handler.SysProxy
{
public static class SysProxyHandler
{
private static readonly string _tag = "SysProxyHandler";
@ -96,3 +96,4 @@ public static class SysProxyHandler
ProxySettingWindows.SetProxy(strProxy, "", 4);
}
}
}

View file

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

View file

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

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
public class CheckUpdateModel
{
public bool? IsSelected { get; set; }
@ -8,3 +8,4 @@ public class CheckUpdateModel
public string? FileName { get; set; }
public bool? IsFinished { get; set; }
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
public class ClashConnectionModel
{
public string? Id { get; set; }
@ -14,3 +14,4 @@ public class ClashConnectionModel
public string? Elapsed { get; set; }
public string? Chain { get; set; }
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
public class ClashConnections
{
public ulong downloadTotal { get; set; }
@ -34,3 +34,4 @@ public class MetadataItem
public string? processPath { get; set; }
public string? remoteDestination { get; set; }
}
}

View file

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

View file

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

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable]
public class ClashProxyModel
{
@ -15,3 +15,4 @@ public class ClashProxyModel
public bool IsActive { get; set; }
}
}

View file

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

View file

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

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
/// <summary>
/// 本软件配置文件实体类
/// </summary>
@ -54,3 +54,4 @@ public class Config
#endregion other entities
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable]
public class CoreBasicItem
{
@ -245,3 +245,4 @@ public class Fragment4RayItem
public string? Length { get; set; }
public string? Interval { get; set; }
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable]
public class CoreInfo
{
@ -18,3 +18,4 @@ public class CoreInfo
public string? VersionArg { get; set; }
public bool AbsolutePath { get; set; }
}
}

View file

@ -1,7 +1,7 @@
using SQLite;
namespace ServiceLib.Models;
using SQLite;
namespace ServiceLib.Models
{
[Serializable]
public class DNSItem
{
@ -17,3 +17,4 @@ public class DNSItem
public string? DomainStrategy4Freedom { get; set; }
public string? DomainDNSAddress { get; set; }
}
}

View file

@ -1,7 +1,7 @@
using System.Text.Json.Serialization;
namespace ServiceLib.Models;
using System.Text.Json.Serialization;
namespace ServiceLib.Models
{
public class GitHubReleaseAsset
{
[JsonPropertyName("url")] public string? Url { get; set; }
@ -65,3 +65,4 @@ public class GitHubRelease
[JsonPropertyName("body")] public string? Body { get; set; }
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
internal class IPAPIInfo
{
public string? ip { get; set; }
@ -10,3 +10,4 @@ internal class IPAPIInfo
public string? country_name { get; set; }
public string? country_code { get; set; }
}
}

View file

@ -1,7 +1,7 @@
using SQLite;
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable]
public class ProfileExItem
{
@ -13,3 +13,4 @@ public class ProfileExItem
public int Sort { get; set; }
public string? Message { get; set; }
}
}

View file

@ -1,7 +1,7 @@
using SQLite;
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable]
public class ProfileItem
{
@ -64,7 +64,6 @@ public class ProfileItem
[PrimaryKey]
public string IndexId { get; set; }
public EConfigType ConfigType { get; set; }
public int ConfigVersion { get; set; }
public string Address { get; set; }
@ -94,3 +93,4 @@ public class ProfileItem
public string SpiderX { get; set; }
public string Extra { get; set; }
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable]
public class ProfileItemModel : ProfileItem
{
@ -15,3 +15,4 @@ public class ProfileItemModel : ProfileItem
public string TotalUp { get; set; }
public string TotalDown { get; set; }
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
public class RetResult
{
public bool Success { get; set; }
@ -24,3 +24,4 @@ public class RetResult
Data = data;
}
}
}

View file

@ -1,7 +1,7 @@
using SQLite;
namespace ServiceLib.Models;
using SQLite;
namespace ServiceLib.Models
{
[Serializable]
public class RoutingItem
{
@ -20,3 +20,4 @@ public class RoutingItem
public string DomainStrategy4Singbox { get; set; }
public int Sort { get; set; }
}
}

View file

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

View file

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

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable]
public class RulesItem
{
@ -16,3 +16,4 @@ public class RulesItem
public bool Enabled { get; set; } = true;
public string? Remarks { get; set; }
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable]
public class RulesItemModel : RulesItem
{
@ -8,3 +8,4 @@ public class RulesItemModel : RulesItem
public string Domains { get; set; }
public string Protocols { get; set; }
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable]
public class ServerSpeedItem : ServerStatItem
{
@ -19,3 +19,4 @@ public class TrafficItem
public ulong Down { get; set; }
}
}

View file

@ -1,7 +1,7 @@
using SQLite;
namespace ServiceLib.Models;
using SQLite;
namespace ServiceLib.Models
{
[Serializable]
public class ServerStatItem
{
@ -18,3 +18,4 @@ public class ServerStatItem
public long DateNow { get; set; }
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable]
public class ServerTestItem
{
@ -10,3 +10,4 @@ public class ServerTestItem
public bool AllowTest { get; set; }
public int QueueNum { get; set; }
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
public class SingboxConfig
{
public Log4Sbox log { get; set; }
@ -254,3 +254,4 @@ public class Ruleset4Sbox
public string? download_detour { get; set; }
public string? update_interval { get; set; }
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable]
public class SpeedTestResult
{
@ -9,3 +9,4 @@ public class SpeedTestResult
public string? Speed { get; set; }
}
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
public class SsSIP008
{
public List<SsServer>? servers { get; set; }
@ -15,3 +15,4 @@ public class SsServer
public string? password { get; set; }
public string? plugin { get; set; }
}
}

View file

@ -1,7 +1,7 @@
using SQLite;
namespace ServiceLib.Models;
using SQLite;
namespace ServiceLib.Models
{
[Serializable]
public class SubItem
{
@ -36,3 +36,4 @@ public class SubItem
public string? Memo { get; set; }
}
}

View file

@ -1,7 +1,7 @@
using System.Text.Json.Serialization;
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
public class V2rayConfig
{
public Log4Ray log { get; set; }
@ -12,8 +12,6 @@ public class V2rayConfig
public Metrics4Ray? metrics { get; set; }
public Policy4Ray? policy { get; set; }
public Stats4Ray? stats { get; set; }
public Observatory4Ray? observatory { get; set; }
public BurstObservatory4Ray? burstObservatory { get; set; }
public string? remarks { get; set; }
}
@ -234,46 +232,6 @@ public class BalancersItem4Ray
public class BalancersStrategy4Ray
{
public string? type { get; set; }
public BalancersStrategySettings4Ray? settings { get; set; }
}
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 bool? regexp { get; set; }
public string? match { get; set; }
public float? value { get; set; }
}
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 List<string>? subjectSelector { get; set; }
public BurstObservatoryPingConfig4Ray? pingConfig { get; set; }
}
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
@ -434,3 +392,4 @@ public class FragmentItem4Ray
public string? length { get; set; }
public string? interval { get; set; }
}
}

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