From d1e047edf82bf1c02542bf2f38c9e3f5a2c90db9 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sun, 10 Jul 2016 20:57:59 +0200 Subject: [PATCH] Remove old converter --- ArchiSteamFarm/ArchiSteamFarm.csproj | 1 - ArchiSteamFarm/Bot.cs | 9 ---- ArchiSteamFarm/BotDatabase.cs | 18 -------- ArchiSteamFarm/MobileAuthenticator.cs | 18 +++----- ArchiSteamFarm/ObsoleteSteamGuardAccount.cs | 49 --------------------- 5 files changed, 5 insertions(+), 90 deletions(-) delete mode 100644 ArchiSteamFarm/ObsoleteSteamGuardAccount.cs diff --git a/ArchiSteamFarm/ArchiSteamFarm.csproj b/ArchiSteamFarm/ArchiSteamFarm.csproj index f7e6b90c2..20ffb4356 100644 --- a/ArchiSteamFarm/ArchiSteamFarm.csproj +++ b/ArchiSteamFarm/ArchiSteamFarm.csproj @@ -133,7 +133,6 @@ - diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index d7f2244c3..74ca673cb 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -152,15 +152,6 @@ namespace ArchiSteamFarm { return; } - // TODO: Converter code will be removed soon - if (BotDatabase.SteamGuardAccount != null) { - Logging.LogGenericWarning("Converting old ASF 2FA V2.0 format into new ASF 2FA V2.1 format...", botName); - BotDatabase.MobileAuthenticator = MobileAuthenticator.LoadFromSteamGuardAccount(BotDatabase.SteamGuardAccount); - Logging.LogGenericInfo("Done! If you didn't make a copy of your revocation code yet, then it's a good moment to do so: " + BotDatabase.SteamGuardAccount.RevocationCode, botName); - Logging.LogGenericWarning("ASF will not keep this code anymore!", botName); - BotDatabase.SteamGuardAccount = null; - } - if (BotDatabase.MobileAuthenticator != null) { BotDatabase.MobileAuthenticator.Init(this); } else { diff --git a/ArchiSteamFarm/BotDatabase.cs b/ArchiSteamFarm/BotDatabase.cs index a6996e201..77138cf59 100644 --- a/ArchiSteamFarm/BotDatabase.cs +++ b/ArchiSteamFarm/BotDatabase.cs @@ -64,24 +64,6 @@ namespace ArchiSteamFarm { } } - // TODO: Converter code will be removed soon - [JsonProperty] - private ObsoleteSteamGuardAccount _SteamGuardAccount; - - internal ObsoleteSteamGuardAccount SteamGuardAccount { - get { - return _SteamGuardAccount; - } - set { - if (_SteamGuardAccount == value) { - return; - } - - _SteamGuardAccount = value; - Save(); - } - } - private readonly object FileLock = new object(); private string FilePath; diff --git a/ArchiSteamFarm/MobileAuthenticator.cs b/ArchiSteamFarm/MobileAuthenticator.cs index fd3f626f0..2f65e411a 100644 --- a/ArchiSteamFarm/MobileAuthenticator.cs +++ b/ArchiSteamFarm/MobileAuthenticator.cs @@ -24,6 +24,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Security.Cryptography; using System.Text; using System.Threading; @@ -33,6 +34,8 @@ using HtmlAgilityPack; using Newtonsoft.Json; namespace ArchiSteamFarm { + [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] + [SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")] internal sealed class MobileAuthenticator { internal sealed class Confirmation { internal readonly uint ID; @@ -57,30 +60,19 @@ namespace ArchiSteamFarm { internal bool HasDeviceID => !string.IsNullOrEmpty(DeviceID); +#pragma warning disable 649 [JsonProperty(PropertyName = "shared_secret", Required = Required.DisallowNull)] private string SharedSecret; [JsonProperty(PropertyName = "identity_secret", Required = Required.DisallowNull)] private string IdentitySecret; +#pragma warning restore 649 [JsonProperty(PropertyName = "device_id")] private string DeviceID; private Bot Bot; - internal static MobileAuthenticator LoadFromSteamGuardAccount(ObsoleteSteamGuardAccount sga) { - if (sga != null) { - return new MobileAuthenticator { - SharedSecret = sga.SharedSecret, - IdentitySecret = sga.IdentitySecret, - DeviceID = sga.DeviceID - }; - } - - Logging.LogNullError(nameof(sga)); - return null; - } - private MobileAuthenticator() { } diff --git a/ArchiSteamFarm/ObsoleteSteamGuardAccount.cs b/ArchiSteamFarm/ObsoleteSteamGuardAccount.cs deleted file mode 100644 index 3df9718b9..000000000 --- a/ArchiSteamFarm/ObsoleteSteamGuardAccount.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using Newtonsoft.Json; - -namespace ArchiSteamFarm { - // TODO: This will be completely removed soon - [SuppressMessage("ReSharper", "MemberCanBeInternal")] - [SuppressMessage("ReSharper", "UnusedMember.Global")] - [SuppressMessage("ReSharper", "InconsistentNaming")] - [SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")] - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] - public class ObsoleteSteamGuardAccount { - [JsonProperty("shared_secret")] - public string SharedSecret { get; set; } - - [JsonProperty("serial_number")] - public string SerialNumber { get; set; } - - [JsonProperty("revocation_code")] - public string RevocationCode { get; set; } - - [JsonProperty("uri")] - public string URI { get; set; } - - [JsonProperty("server_time")] - public long ServerTime { get; set; } - - [JsonProperty("account_name")] - public string AccountName { get; set; } - - [JsonProperty("token_gid")] - public string TokenGID { get; set; } - - [JsonProperty("identity_secret")] - public string IdentitySecret { get; set; } - - [JsonProperty("secret_1")] - public string Secret1 { get; set; } - - [JsonProperty("status")] - public int Status { get; set; } - - [JsonProperty("device_id")] - public string DeviceID { get; set; } - - [JsonProperty("fully_enrolled")] - public bool FullyEnrolled { get; set; } - - } -}