Ejemplo n.º 1
0
        private void Extract()
        {
            steamAccount = bridge.ExtractSteamGuardAccount(SelectedSteamID, SelectedSteamID != "*");

            if (!string.IsNullOrEmpty(steamAccount.DeviceID))
            {
                Result = steamAccount;
                Log("Account extracted succesfully!");
                LoginAccount();
            }
            else
            {
                if (string.IsNullOrEmpty(steamAccount.DeviceID))
                {
                    InputForm deviceIdForm = new InputForm($"Error while getting file from adb.\n Enter the device Id form file \n data/data/com.valvesoftware.android.steam.community/shared_prefs/steam.uuid.xml \n OR \n /sdcard/steamauth/apps/com.valvesoftware.android.steam.community/sp/steam.uuid.xml");
                    deviceIdForm.Owner         = this;
                    deviceIdForm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
                    deviceIdForm.ShowDialog();
                    if (deviceIdForm.Canceled)
                    {
                        deviceIdForm.Close();
                    }
                    steamAccount.DeviceID = deviceIdForm.txtBox.Text;
                    if (!string.IsNullOrEmpty(steamAccount.DeviceID))
                    {
                        Result = steamAccount;
                        Log("Account extracted succesfully!");
                        LoginAccount();
                    }
                }
            }
        }
        private void Extract()
        {
            steamAccount = bridge.ExtractSteamGuardAccount(SelectedSteamID, SelectedSteamID != "*");

            if (steamAccount != null)
            {
                Result = steamAccount;
                Log("Account extracted succesfully!");
                LoginAccount();
            }
        }
Ejemplo n.º 3
0
        string GetMobileAuthCode()
        {
            var authFile = Path.Combine("authfiles", String.Format("{0}.auth", logOnDetails.Username));

            if (File.Exists(authFile))
            {
                SteamGuardAccount = Newtonsoft.Json.JsonConvert.DeserializeObject <SteamAuth.SteamGuardAccount>(File.ReadAllText(authFile));
                return(SteamGuardAccount.GenerateSteamGuardCode());
            }
            return(string.Empty);
        }
Ejemplo n.º 4
0
        private void Extract()
        {
            steamAccount = bridge.ExtractSteamGuardAccount(SelectedSteamID, SelectedSteamID != "*");

            if (steamAccount != null)
            {
                Result = steamAccount;
                Log("Account extracted successfully!");
                LoginAccount();
            }
        }
Ejemplo n.º 5
0
 string GetMobileAuthCode()
 {
     var authFile = Path.Combine("authfiles", String.Format("{0}.auth", logOnDetails.Username));
     if (File.Exists(authFile))
     {
         SteamGuardAccount = Newtonsoft.Json.JsonConvert.DeserializeObject<SteamAuth.SteamGuardAccount>(File.ReadAllText(authFile));
         return SteamGuardAccount.GenerateSteamGuardCode();
     }
     return string.Empty;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Link a mobile authenticator to bot account, using SteamTradeOffersBot as the authenticator.
 /// Called from bot manager console. Usage: "exec [index] linkauth"
 /// If successful, 2FA will be required upon the next login.
 /// Use "exec [index] getauth" if you need to get a Steam Guard code for the account.
 /// To deactivate the authenticator, use "exec [index] unlinkauth".
 /// </summary>
 void LinkMobileAuth()
 {
     new Thread(() =>
         {
             var login = new SteamAuth.UserLogin(logOnDetails.Username, logOnDetails.Password);
             var loginResult = login.DoLogin();
             if (loginResult == SteamAuth.LoginResult.NeedEmail)
             {
                 while (loginResult == SteamAuth.LoginResult.NeedEmail)
                 {
                     Log.Interface("Enter Steam Guard code from email (type \"input [index] [code]\"):");
                     var emailCode = WaitForInput();
                     login.EmailCode = emailCode;
                     loginResult = login.DoLogin();
                 }
             }
             if (loginResult == SteamAuth.LoginResult.LoginOkay)
             {
                 Log.Info("Linking mobile authenticator...");
                 var authLinker = new SteamAuth.AuthenticatorLinker(login.Session);
                 var addAuthResult = authLinker.AddAuthenticator();
                 if (addAuthResult == SteamAuth.AuthenticatorLinker.LinkResult.MustProvidePhoneNumber)
                 {
                     while (addAuthResult == SteamAuth.AuthenticatorLinker.LinkResult.MustProvidePhoneNumber)
                     {
                         Log.Interface("Enter phone number with country code, e.g. +1XXXXXXXXXXX (type \"input [index] [number]\"):");
                         var phoneNumber = WaitForInput();
                         authLinker.PhoneNumber = phoneNumber;
                         addAuthResult = authLinker.AddAuthenticator();
                     }
                 }
                 if (addAuthResult == SteamAuth.AuthenticatorLinker.LinkResult.AwaitingFinalization)
                 {
                     SteamGuardAccount = authLinker.LinkedAccount;
                     try
                     {
                         var authFile = Path.Combine("authfiles", String.Format("{0}.auth", logOnDetails.Username));
                         Directory.CreateDirectory(Path.Combine(System.Windows.Forms.Application.StartupPath, "authfiles"));
                         File.WriteAllText(authFile, Newtonsoft.Json.JsonConvert.SerializeObject(SteamGuardAccount));
                         Log.Interface("Enter SMS code (type \"input [index] [code]\"):");
                         var smsCode = WaitForInput();
                         var authResult = authLinker.FinalizeAddAuthenticator(smsCode);
                         if (authResult == SteamAuth.AuthenticatorLinker.FinalizeResult.Success)
                         {
                             Log.Success("Linked authenticator.");
                         }
                         else
                         {
                             Log.Error("Error linking authenticator: " + authResult);
                         }
                     }
                     catch (IOException)
                     {
                         Log.Error("Failed to save auth file. Aborting authentication.");
                     }
                 }
                 else
                 {
                     Log.Error("Error adding authenticator: " + addAuthResult);
                 }
             }
             else
             {
                 if (loginResult == SteamAuth.LoginResult.Need2FA)
                 {
                     Log.Error("Mobile authenticator has already been linked!");
                 }
                 else
                 {
                     Log.Error("Error performing mobile login: " + loginResult);
                 }
             }
         }).Start();
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Link a mobile authenticator to bot account, using SteamTradeOffersBot as the authenticator.
 /// Called from bot manager console. Usage: "exec [index] linkauth"
 /// If successful, 2FA will be required upon the next login.
 /// Use "exec [index] getauth" if you need to get a Steam Guard code for the account.
 /// To deactivate the authenticator, use "exec [index] unlinkauth".
 /// </summary>
 void LinkMobileAuth()
 {
     new Thread(() =>
     {
         var login       = new SteamAuth.UserLogin(logOnDetails.Username, logOnDetails.Password);
         var loginResult = login.DoLogin();
         if (loginResult == SteamAuth.LoginResult.NeedEmail)
         {
             while (loginResult == SteamAuth.LoginResult.NeedEmail)
             {
                 Log.Interface("Enter Steam Guard code from email (type \"input [index] [code]\"):");
                 var emailCode   = WaitForInput();
                 login.EmailCode = emailCode;
                 loginResult     = login.DoLogin();
             }
         }
         if (loginResult == SteamAuth.LoginResult.LoginOkay)
         {
             Log.Info("Linking mobile authenticator...");
             var authLinker    = new SteamAuth.AuthenticatorLinker(login.Session);
             var addAuthResult = authLinker.AddAuthenticator();
             if (addAuthResult == SteamAuth.AuthenticatorLinker.LinkResult.MustProvidePhoneNumber)
             {
                 while (addAuthResult == SteamAuth.AuthenticatorLinker.LinkResult.MustProvidePhoneNumber)
                 {
                     Log.Interface("Enter phone number with country code, e.g. +1XXXXXXXXXXX (type \"input [index] [number]\"):");
                     var phoneNumber        = WaitForInput();
                     authLinker.PhoneNumber = phoneNumber;
                     addAuthResult          = authLinker.AddAuthenticator();
                 }
             }
             if (addAuthResult == SteamAuth.AuthenticatorLinker.LinkResult.AwaitingFinalization)
             {
                 SteamGuardAccount = authLinker.LinkedAccount;
                 try
                 {
                     var authFile = Path.Combine("authfiles", String.Format("{0}.auth", logOnDetails.Username));
                     Directory.CreateDirectory(Path.Combine(System.Windows.Forms.Application.StartupPath, "authfiles"));
                     File.WriteAllText(authFile, Newtonsoft.Json.JsonConvert.SerializeObject(SteamGuardAccount));
                     Log.Interface("Enter SMS code (type \"input [index] [code]\"):");
                     var smsCode    = WaitForInput();
                     var authResult = authLinker.FinalizeAddAuthenticator(smsCode);
                     if (authResult == SteamAuth.AuthenticatorLinker.FinalizeResult.Success)
                     {
                         Log.Success("Linked authenticator.");
                     }
                     else
                     {
                         Log.Error("Error linking authenticator: " + authResult);
                     }
                 }
                 catch (IOException)
                 {
                     Log.Error("Failed to save auth file. Aborting authentication.");
                 }
             }
             else
             {
                 Log.Error("Error adding authenticator: " + addAuthResult);
             }
         }
         else
         {
             if (loginResult == SteamAuth.LoginResult.Need2FA)
             {
                 Log.Error("Mobile authenticator has already been linked!");
             }
             else
             {
                 Log.Error("Error performing mobile login: " + loginResult);
             }
         }
     }).Start();
 }