From 07950780d0f73533d07869ce4674962eedf9b6dc Mon Sep 17 00:00:00 2001 From: ZouJin Date: Fri, 16 Jun 2023 12:40:16 +1000 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=92=E4=BB=B6=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E4=BF=A1=E4=BB=BB=E6=9C=89=E7=AD=BE=E5=90=8D=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Windows/Function/CoreMOD.cs | 30 ++++++++++++------- .../WinDesign/winBetterBuy.xaml | 2 +- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/VPet-Simulator.Windows/Function/CoreMOD.cs b/VPet-Simulator.Windows/Function/CoreMOD.cs index d1bb9c9..35bddf4 100644 --- a/VPet-Simulator.Windows/Function/CoreMOD.cs +++ b/VPet-Simulator.Windows/Function/CoreMOD.cs @@ -35,10 +35,6 @@ namespace VPet_Simulator.Windows public int Ver; public string Content = ""; public bool SuccessLoad = true; - /// - /// LBGame 信任的MOD,自动加载 - /// - public bool IsTrust = false; public static string INTtoVER(int ver) => $"{ver / 100}.{ver % 100:00}"; public static void LoadImage(MainWindow mw, DirectoryInfo di) { @@ -130,7 +126,7 @@ namespace VPet_Simulator.Windows break; case "plugin": Content += "代码插件\n"; - SuccessLoad = false; + SuccessLoad = true; foreach (FileInfo tmpfi in di.EnumerateFiles("*.dll")) { try @@ -141,9 +137,24 @@ namespace VPet_Simulator.Windows LoadedDLL.Add(path); Assembly dll = Assembly.LoadFrom(tmpfi.FullName); var certificate = dll.GetModules()?.First()?.GetSignerCertificate(); - if (certificate != null && certificate.Subject == "") - {//LBGame 信任的证书 - + if (certificate != null) + { + if (certificate.Subject == "CN=\"Shenzhen Lingban Computer Technology Co., Ltd.\", O=\"Shenzhen Lingban Computer Technology Co., Ltd.\", L=Shenzhen, S=Guangdong Province, C=CN, SERIALNUMBER=91440300MA5H8REU3K, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.1=Shenzhen, OID.1.3.6.1.4.1.311.60.2.1.2=Guangdong Province, OID.1.3.6.1.4.1.311.60.2.1.3=CN" + && certificate.Issuer == "CN=DigiCert Trusted G4 Code Signing RSA4096 SHA384 2021 CA1, O=\"DigiCert, Inc.\", C=US") + {//LBGame 信任的证书 + if (!Author.Contains("[")) + Author += "[认证]"; + } + else if (!IsPassMOD(mw)) + {//不是通过模组,不加载 + SuccessLoad = false; + continue; + } + else if (!Author.Contains("[")) + { + Author += "[签名]"; + Intro += $"Subject:{certificate.Subject}\nIssuer:{certificate.Subject}"; + } } else { @@ -158,13 +169,12 @@ namespace VPet_Simulator.Windows if (exportedType.BaseType == typeof(MainPlugin)) { mw.Plugins.Add((MainPlugin)Activator.CreateInstance(exportedType, mw)); - SuccessLoad = true; } } } catch { - + SuccessLoad = false; } } break; diff --git a/VPet-Simulator.Windows/WinDesign/winBetterBuy.xaml b/VPet-Simulator.Windows/WinDesign/winBetterBuy.xaml index ad8b88b..4ec3611 100644 --- a/VPet-Simulator.Windows/WinDesign/winBetterBuy.xaml +++ b/VPet-Simulator.Windows/WinDesign/winBetterBuy.xaml @@ -4,7 +4,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:pu="https://opensource.panuon.com/wpf-ui" xmlns:local="clr-namespace:VPet_Simulator.Windows" - mc:Ignorable="d" Title="更好买" Height="450" Width="800" FontSize="14" WindowStartupLocation="CenterScreen" + mc:Ignorable="d" Title="更好买" Height="500" Width="800" FontSize="14" WindowStartupLocation="CenterScreen" Background="#E0F6FF" pu:WindowXCaption.Height="45" pu:WindowXCaption.Background="{DynamicResource DARKPrimary}" pu:WindowXCaption.Foreground="#FFFFFF" pu:WindowXCaption.Buttons="Close" Icon="/Res/BetterBuy.png" pu:WindowXCaption.ShadowColor="{DynamicResource ShadowColor}" Closing="WindowX_Closing">