Skip to content

Commit

Permalink
修正:苹果 M3 芯片获取到的系统名称是 macOS ,这导致识别为 Unknown 的问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
Soar360 committed Aug 1, 2024
1 parent c378ee1 commit 6c8bfe6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Stardust/Models/OSKindHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NewLife;
using System.Linq;
using NewLife;

namespace Stardust.Models;

Expand All @@ -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;
}
Expand Down

0 comments on commit 6c8bfe6

Please sign in to comment.