From 6c8bfe64656caba1538041caabfe8c02873deccf Mon Sep 17 00:00:00 2001 From: Soar360 Date: Thu, 1 Aug 2024 21:55:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=9A=E8=8B=B9=E6=9E=9C?= =?UTF-8?q?=20M3=20=E8=8A=AF=E7=89=87=E8=8E=B7=E5=8F=96=E5=88=B0=E7=9A=84?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=90=8D=E7=A7=B0=E6=98=AF=20macOS=20?= =?UTF-8?q?=EF=BC=8C=E8=BF=99=E5=AF=BC=E8=87=B4=E8=AF=86=E5=88=AB=E4=B8=BA?= =?UTF-8?q?=20Unknown=20=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stardust/Models/OSKindHelper.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Stardust/Models/OSKindHelper.cs b/Stardust/Models/OSKindHelper.cs index fe4d4db3..5ee50eed 100644 --- a/Stardust/Models/OSKindHelper.cs +++ b/Stardust/Models/OSKindHelper.cs @@ -1,4 +1,5 @@ -using NewLife; +using System.Linq; +using NewLife; namespace Stardust.Models; @@ -21,8 +22,8 @@ public static OSKinds Parse(String osName, String osVersion) kind = ParseLinux(osName, osVersion); if (kind > 0) return kind; - if (osName.Contains("Mac")) return OSKinds.MacOSX; - if (osName.Contains("Android")) return OSKinds.Android; + if (osName.IndexOf("Android", StringComparison.OrdinalIgnoreCase) >= 0) return OSKinds.Android; + if (osName.IndexOf("Mac", StringComparison.InvariantCultureIgnoreCase) >= 0) return OSKinds.MacOSX; return 0; }