From afed24f30c36296eda6a1f17f467b97e8080ca04 Mon Sep 17 00:00:00 2001 From: huiyadanli Date: Sat, 21 Aug 2021 12:08:22 +0800 Subject: [PATCH] =?UTF-8?q?[#]=20=E4=BF=AE=E5=A4=8D=20#220?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RevokeMsgPatcher/Utils/Device.cs | 18 +++++++++++++----- RevokeMsgPatcher/Utils/GAHelper.cs | 6 +++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/RevokeMsgPatcher/Utils/Device.cs b/RevokeMsgPatcher/Utils/Device.cs index be4d155..af607d4 100644 --- a/RevokeMsgPatcher/Utils/Device.cs +++ b/RevokeMsgPatcher/Utils/Device.cs @@ -50,13 +50,21 @@ namespace RevokeMsgPatcher.Utils /// GUID public static string Value() { - if (fingerPrint == null) + try { - fingerPrint = GetHash( - "MAC >> " + MacID - ); + if (fingerPrint == null) + { + fingerPrint = GetHash( + "MAC >> " + MacID + ); + } + return fingerPrint; } - return fingerPrint; + catch + { + return Guid.NewGuid().ToString(); + } + } private static string GetHash(string s) diff --git a/RevokeMsgPatcher/Utils/GAHelper.cs b/RevokeMsgPatcher/Utils/GAHelper.cs index 81ce3a1..b9f4010 100644 --- a/RevokeMsgPatcher/Utils/GAHelper.cs +++ b/RevokeMsgPatcher/Utils/GAHelper.cs @@ -24,14 +24,14 @@ namespace RevokeMsgPatcher.Utils { get { - lock (obj) - { + //lock (obj) + //{ if (instance == null) { instance = new GAHelper(); } return instance; - } + //} } }