Skip to content

Commit 40d79b2

Browse files
committed
add EncryptKeyMd5 for identifying database
1 parent 08ec9c6 commit 40d79b2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Diff for: src/Flow.Launcher.Plugin.ClipboardPlus.Core/Utils/StringUtils.cs

+12-2
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,14 @@ public static string GetSha256(string s)
179179

180180
#region Encrypt & Decrypt
181181

182-
private static string encryptKey = null!;
182+
private static string encryptKey = string.Empty;
183183
public static string EncryptKey => encryptKey;
184184

185+
private static string encryptKeyMd5 = string.Empty;
186+
public static string EncryptKeyMd5 => encryptKeyMd5;
187+
188+
private static bool initialized = false;
189+
185190
/// <summary>
186191
/// Initialize the AES key for encryption and decryption
187192
/// </summary>
@@ -190,7 +195,12 @@ public static string GetSha256(string s)
190195
/// </param>
191196
public static void InitEncryptKey(string key)
192197
{
193-
encryptKey ??= key;
198+
if (!initialized)
199+
{
200+
encryptKey = key;
201+
encryptKeyMd5 = GetMd5(key);
202+
initialized = true;
203+
}
194204
}
195205

196206
/// <summary>

0 commit comments

Comments
 (0)