From 3742a5c29edfe2ccf832c81cce643b63bbfefe7e Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 12 Oct 2024 02:27:45 -0400 Subject: [PATCH] Simplify decrypt args creation --- NDecrypt.Core/DecryptArgs.cs | 6 +----- NDecrypt/Program.cs | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/NDecrypt.Core/DecryptArgs.cs b/NDecrypt.Core/DecryptArgs.cs index a01a419..2714b28 100644 --- a/NDecrypt.Core/DecryptArgs.cs +++ b/NDecrypt.Core/DecryptArgs.cs @@ -79,12 +79,8 @@ namespace NDecrypt.Core /// /// Path to the keyfile /// Indicates if the keyfile format is aeskeys.txt - 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); diff --git a/NDecrypt/Program.cs b/NDecrypt/Program.cs index 88cb990..9126a8c 100644 --- a/NDecrypt/Program.cs +++ b/NDecrypt/Program.cs @@ -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++) {