mirror of
https://github.com/SabreTools/NDecrypt.git
synced 2026-09-21 22:35:03 +00:00
Simplify decrypt args creation
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user