mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Misc
This commit is contained in:
@@ -63,6 +63,13 @@ public static class Utilities {
|
||||
return collection.Select(static entry => entry);
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public static string AsMasked(this string text, char mask = '*') {
|
||||
ArgumentNullException.ThrowIfNull(text);
|
||||
|
||||
return new string(mask, text.Length);
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public static string GenerateChecksumFor(byte[] source) {
|
||||
ArgumentNullException.ThrowIfNull(source);
|
||||
|
||||
@@ -106,7 +106,7 @@ internal static class Logging {
|
||||
Console.Write(cryptKeyText);
|
||||
result = ConsoleReadLineMasked();
|
||||
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(new string('*', result.Length)));
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(result.AsMasked()));
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.DeviceConfirmation:
|
||||
@@ -145,7 +145,7 @@ internal static class Logging {
|
||||
Console.Write(passwordText);
|
||||
result = ConsoleReadLineMasked();
|
||||
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(new string('*', result.Length)));
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(result.AsMasked()));
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.SteamGuard:
|
||||
@@ -167,7 +167,7 @@ internal static class Logging {
|
||||
Console.Write(steamParentalCodeText);
|
||||
result = ConsoleReadLineMasked();
|
||||
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(new string('*', result.Length)));
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(result.AsMasked()));
|
||||
|
||||
break;
|
||||
case ASF.EUserInputType.TwoFactorAuthentication:
|
||||
@@ -178,7 +178,7 @@ internal static class Logging {
|
||||
Console.Write(twoFactorAuthenticationText);
|
||||
result = ConsoleReadLine();
|
||||
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(new string('*', result?.Length ?? 0)));
|
||||
ASF.ArchiLogger.LogGenericInfo(Strings.FormatInput(result?.AsMasked()));
|
||||
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user