Simplify decrypt args creation

This commit is contained in:
Matt Nadareski
2024-10-12 02:27:45 -04:00
parent 2e7bc64e26
commit 3742a5c29e
2 changed files with 2 additions and 7 deletions

View File

@@ -79,12 +79,8 @@ namespace NDecrypt.Core
/// </summary>
/// <param name="keyfile">Path to the keyfile</param>
/// <param name="useAesKeysTxt">Indicates if the keyfile format is aeskeys.txt</param>
public void Initialize(string? keyfile, bool useAesKeysTxt)
public DecryptArgs(string? keyfile, bool useAesKeysTxt)
{
// If we're already attempted to set the constants, don't try to again
if (IsReady != null)
return;
// Read the proper keyfile format
if (useAesKeysTxt)
InitAesKeysTxt(keyfile);

View File

@@ -31,7 +31,6 @@ namespace NDecrypt
}
bool encrypt;
var decryptArgs = new DecryptArgs();
if (args[0] == "decrypt" || args[0] == "d")
{
encrypt = false;
@@ -104,7 +103,7 @@ namespace NDecrypt
}
// Initialize the decrypt args, if possible
decryptArgs.Initialize(keyfile, useAesKeysTxt);
var decryptArgs = new DecryptArgs(keyfile, useAesKeysTxt);
for (int i = start; i < args.Length; i++)
{