update nuget

This commit is contained in:
rmbgame
2021-05-12 21:53:45 +08:00
parent d391e3b266
commit 2dfd72b34b
4 changed files with 13 additions and 258 deletions
@@ -40,17 +40,17 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.999-cibuild0014012-beta" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.999-cibuild0014012-beta" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.999-cibuild0014012-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.999-cibuild0014012-beta" />
<PackageReference Include="Avalonia" Version="0.10.999-cibuild0014036-beta" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.999-cibuild0014036-beta" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.999-cibuild0014036-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.999-cibuild0014036-beta" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.3.3" />
<!--<PackageReference Include="CefNet.Avalonia" Version="88.1.21022.1657" />-->
<PackageReference Include="LibVLCSharp.Avalonia" Version="3.5.0" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='Debug'">
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.999-cibuild0014012-beta" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.999-cibuild0014036-beta" />
</ItemGroup>
<ItemGroup>
@@ -4,7 +4,6 @@ using Newtonsoft.Json.Linq;
using ReactiveUI;
using System.Application.Models;
using System.Application.Models.Settings;
using System.Application.Services;
using System.Application.UI.Resx;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -22,7 +21,7 @@ namespace System.Application.UI.ViewModels
//_SteamHideApp = new ObservableCollection<SteamHideApps>();
//_SteamHideApp.Subscribe(_ => this.RaisePropertyChanged(nameof(IsHideAppEmpty)));
SteamHideApp = ProxySettings.HideGameList.Value;
SteamHideApp = new ReadOnlyObservableCollection<SteamHideApps>(ProxySettings.HideGameList.Value ?? new ObservableCollection<SteamHideApps>());
this.WhenAnyValue(v => v.SteamHideApp)
@@ -40,9 +39,12 @@ namespace System.Application.UI.ViewModels
return null;
})
.Subscribe(s =>
{
{
if (ThreeStateEnable != s)
{
_ThreeStateEnable = s;
this.RaisePropertyChanged();
this.RaisePropertyChanged(nameof(ThreeStateEnable));
}
})
);
@@ -73,8 +75,8 @@ namespace System.Application.UI.ViewModels
get => _SearchText;
set => this.RaiseAndSetIfChanged(ref _SearchText, value);
}
private ObservableCollection<SteamHideApps>? _SteamHideApp;
public ObservableCollection<SteamHideApps>? SteamHideApp
private ReadOnlyObservableCollection<SteamHideApps>? _SteamHideApp;
public ReadOnlyObservableCollection<SteamHideApps>? SteamHideApp
{
get => _SteamHideApp;
set
-119
View File
@@ -1,119 +0,0 @@
using MessagePack;
using System.Collections.Generic;
using System.ComponentModel;
namespace System.Application.Models
{
[MessagePackObject(keyAsPropertyName: true)]
public class ProxyDomain
{
/// <summary>
/// 显示在UI上的名称
/// </summary>
public string? Name { get; set; }
/// <summary>
/// 代理域名合集
/// </summary>
public IReadOnlyCollection<string>? Domains { get; set; }
/// <summary>
/// 端口
/// </summary>
public int Port { get; set; } = 443;
/// <summary>
/// 转发域名
/// </summary>
public string? ToDomain { get; set; }
/// <summary>
/// 转发域名IP
/// </summary>
public string? ProxyIPAddres { get; set; }
/// <summary>
/// 伪装的ServerName
/// </summary>
public string? ServerName { get; set; }
/// <summary>
/// 启用该域名代理
/// </summary>
public bool IsEnable { get; set; }
/// <summary>
/// 启用重定向
/// </summary>
public bool IsRedirect { get; set; }
public IReadOnlyCollection<string>? Hosts { get; set; }
public DomainTag DomainTag { get; set; }
}
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum DomainTag : byte
{
[Description("steam社区")]
SteamCommunity = 0,
[Description("steam商店")]
SteamStore = 1,
[Description("steam部分图片修复")]
SteamImage = 2,
[Description("steam好友服务")]
SteamChat = 3,
[Description("Discord语音")]
Discord = 4,
[Description("Twitch直播")]
Twitch = 5,
[Description("Origin下载(Akamai)")]
OriginGameDownload = 6,
[Description("GOG.COM")]
GOG = 7,
[Description("Google(Recaptcha)")]
GoogleCode = 8,
[Description("Github图片及资源修复")]
GithubContent = 9,
[Description("Pixiv")]
Pixiv = 10,
[Description("Discord更新下载")]
DiscordNet = 11,
[Description("Uplay更新防劫持")]
UplayUpdate = 12,
[Description("Twitch聊天")]
TwitchChat = 13,
[Description("Github Gist")]
GithubGist = 14,
[Description("Pixiv图片")]
PixivImage = 15,
[Description("steam图片上传(聊天\\截图)")]
SteamImageUpload = 16,
[Description("steam更新")]
SteamMeidia = 17,
}
#if DEBUG
[Obsolete("use ProxyDomain", true)]
public class ProxyDomainModel { }
#endif
}
-128
View File
@@ -1,128 +0,0 @@
using MessagePack;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace System.Application.Models
{
[MessagePackObject(keyAsPropertyName: true)]
public class ProxyScript
{
/// <summary>
/// 脚本文件路径
/// </summary>
public string? FilePath { get; set; }
/// <summary>
/// 脚本文件名称
/// </summary>
public string? FileName { get; set; }
/// <summary>
/// name
/// </summary>
public string? Name { get; set; }
/// <summary>
/// namespace
/// </summary>
public string[]? NameSpace { get; set; }
/// <summary>
/// Version
/// </summary>
public string? Version { get; set; }
public string? HomepageURL { get; set; }
public string? SupportURL { get; set; }
public string? DownloadURL { get; set; }
public string? UpdateURL { get; set; }
/// <summary>
/// description
/// </summary>
public string? Description { get; set; }
/// <summary>
/// author
/// </summary>
public string? Author { get; set; }
/// <summary>
/// author
/// </summary>
public string[]? Match { get; set; }
/// <summary>
/// include
/// </summary>
public string[]? Include { get; set; }
/// <summary>
/// exclude
/// </summary>
public string[]? Exclude { get; set; }
public string[]? Grant { get; set; }
public string[]? Require { get; set; }
public bool Enable { get; set; }
public string? Content { get; set; }
const string DescRegex = @"(?<={0})[\s\S]*?(?=\n)";
public static bool TryParse(string path, [NotNullWhen(true)] out ProxyScript? proxyScript)
{
var content = File.ReadAllText(path);
if (!string.IsNullOrEmpty(content))
{
var userScript = content.Substring("==UserScript==", "==/UserScript==");
if (!string.IsNullOrEmpty(userScript))
{
var script = new ProxyScript
{
FilePath = path,
Content = RemoveComment(content.Replace("</script>", "<\\/script>")),
//Content = content.Replace("</script>", "<\\/script>").Replace(" ", "").Replace("\r", "").Replace("\n", "").Replace("\t", ""),
FileName = Path.GetFileName(path),
Name = Regex.Match(userScript, string.Format(DescRegex, $"@{nameof(Name)}"), RegexOptions.IgnoreCase).GetValue(s => s.Success == true),
NameSpace = Regex.Matches(userScript, string.Format(DescRegex, $"@{nameof(NameSpace)}"), RegexOptions.IgnoreCase).GetValues(s => s.Success == true).ToArray(),
Version = Regex.Match(userScript, string.Format(DescRegex, $"@{nameof(Version)}"), RegexOptions.IgnoreCase).GetValue(s => s.Success == true),
Description = Regex.Match(userScript, string.Format(DescRegex, $"@{nameof(Description)}"), RegexOptions.IgnoreCase).GetValue(s => s.Success == true),
Author = Regex.Match(userScript, string.Format(DescRegex, $"@{nameof(Author)}"), RegexOptions.IgnoreCase).GetValue(s => s.Success == true),
HomepageURL = Regex.Match(userScript, string.Format(DescRegex, $"@{nameof(HomepageURL)}"), RegexOptions.IgnoreCase).GetValue(s => s.Success == true),
SupportURL = Regex.Match(userScript, string.Format(DescRegex, $"@{nameof(SupportURL)}"), RegexOptions.IgnoreCase).GetValue(s => s.Success == true),
DownloadURL = Regex.Match(userScript, string.Format(DescRegex, $"@{nameof(DownloadURL)}"), RegexOptions.IgnoreCase).GetValue(s => s.Success == true),
UpdateURL = Regex.Match(userScript, string.Format(DescRegex, $"@{nameof(UpdateURL)}"), RegexOptions.IgnoreCase).GetValue(s => s.Success == true),
Exclude = Regex.Matches(userScript, string.Format(DescRegex, $"@{nameof(Exclude)}"), RegexOptions.IgnoreCase).GetValues(s => s.Success == true).ToArray(),
Grant = Regex.Matches(userScript, string.Format(DescRegex, $"@{nameof(Grant)}"), RegexOptions.IgnoreCase).GetValues(s => s.Success == true).ToArray(),
Require = Regex.Matches(userScript, string.Format(DescRegex, $"@{nameof(Require)}"), RegexOptions.IgnoreCase).GetValues(s => s.Success == true).ToArray()
};
var matchs = Regex.Matches(userScript, string.Format(DescRegex, $"@{nameof(Match)}"), RegexOptions.IgnoreCase).GetValues(s => s.Success == true).ToArray();
var Includes = Regex.Matches(userScript, string.Format(DescRegex, $"@{nameof(Include)}"), RegexOptions.IgnoreCase).GetValues(s => s.Success == true).ToArray();
script.Match = matchs.Length == 0 ? Includes : matchs;
var enable = Regex.Match(userScript, string.Format(DescRegex, $"@{nameof(Enable)}"), RegexOptions.IgnoreCase).GetValue(s => s.Success == true);
script.Enable = bool.TryParse(enable, out var e) && e;
proxyScript = script;
return true;
}
}
proxyScript = null;
return false;
}
static string RemoveComment(string str)
{
var r = Regex.Replace(str, "^//.*", "", RegexOptions.Multiline);
return Regex.Replace(r, @"^\s*\n", "", RegexOptions.Multiline);
}
}
}