Remove old converter

This commit is contained in:
JustArchi
2016-07-10 20:57:59 +02:00
parent 8742ace3d7
commit d1e047edf8
5 changed files with 5 additions and 90 deletions

View File

@@ -133,7 +133,6 @@
<Compile Include="InMemoryServerListProvider.cs" />
<Compile Include="MobileAuthenticator.cs" />
<Compile Include="Runtime.cs" />
<Compile Include="ObsoleteSteamGuardAccount.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SharedInfo.cs" />

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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() {
}

View File

@@ -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; }
}
}