mirror of
https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies.git
synced 2026-07-25 06:14:31 +00:00
Prepared for 1.5.2 release
HOTFIX: Resolved an issue introduced by the September 18, 2024, Steam update, where an error occurred during session refresh due to changes in Steam's response model.
This commit is contained in:
@@ -1,14 +1,7 @@
|
|||||||
using AutoUpdaterDotNET;
|
using AutoUpdaterDotNET;
|
||||||
using MaterialDesignThemes.Wpf;
|
|
||||||
using NebulaAuth.Model;
|
using NebulaAuth.Model;
|
||||||
using NebulaAuth.View;
|
|
||||||
using NebulaAuth.ViewModel.Other;
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using System.Windows.Threading;
|
|
||||||
using Application = System.Windows.Application;
|
|
||||||
|
|
||||||
|
|
||||||
namespace NebulaAuth.Core;
|
namespace NebulaAuth.Core;
|
||||||
@@ -29,55 +22,55 @@ public static class UpdateManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static UpdateManager()
|
//static UpdateManager()
|
||||||
{
|
//{
|
||||||
//AutoUpdater.CheckForUpdateEvent += AutoUpdaterOnCheckForUpdateEvent;
|
// //AutoUpdater.CheckForUpdateEvent += AutoUpdaterOnCheckForUpdateEvent;
|
||||||
|
|
||||||
}
|
//}
|
||||||
|
|
||||||
private static async void AutoUpdaterOnCheckForUpdateEvent(UpdateInfoEventArgs args)
|
//private static async void AutoUpdaterOnCheckForUpdateEvent(UpdateInfoEventArgs args)
|
||||||
{
|
//{
|
||||||
if (args.Error == null)
|
// if (args.Error == null)
|
||||||
{
|
// {
|
||||||
if (args.IsUpdateAvailable)
|
// if (args.IsUpdateAvailable)
|
||||||
{
|
// {
|
||||||
DialogResult dialogResult;
|
// DialogResult dialogResult;
|
||||||
var dialog = new UpdaterView()
|
// var dialog = new UpdaterView()
|
||||||
{
|
// {
|
||||||
DataContext = new UpdaterVM(args)
|
// DataContext = new UpdaterVM(args)
|
||||||
};
|
// };
|
||||||
|
|
||||||
await DialogHost.Show(dialog);
|
// await DialogHost.Show(dialog);
|
||||||
Application.Current.Shutdown();
|
// Application.Current.Shutdown();
|
||||||
|
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
|
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
if (args.Error is WebException)
|
// if (args.Error is WebException)
|
||||||
{
|
// {
|
||||||
|
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
|
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
//}
|
||||||
|
|
||||||
private static void RunUpdate(UpdateInfoEventArgs args)
|
//private static void RunUpdate(UpdateInfoEventArgs args)
|
||||||
{
|
//{
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
// Application.Current.Dispatcher.Invoke(() =>
|
||||||
{
|
// {
|
||||||
if (AutoUpdater.DownloadUpdate(args))
|
// if (AutoUpdater.DownloadUpdate(args))
|
||||||
{
|
// {
|
||||||
Application.Current.Shutdown();
|
// Application.Current.Shutdown();
|
||||||
}
|
// }
|
||||||
}, DispatcherPriority.ContextIdle);
|
// }, DispatcherPriority.ContextIdle);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:theme="clr-namespace:NebulaAuth.Theme"
|
xmlns:theme="clr-namespace:NebulaAuth.Theme"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800"
|
|
||||||
theme:FontScaleWindow.ResizeFont="True" theme:FontScaleWindow.Scale="1"
|
theme:FontScaleWindow.ResizeFont="True" theme:FontScaleWindow.Scale="1"
|
||||||
Foreground="WhiteSmoke"
|
Foreground="WhiteSmoke"
|
||||||
Background="{DynamicResource WindowBackground}">
|
Background="{DynamicResource WindowBackground}">
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<item>
|
<item>
|
||||||
<version>1.5.1.0</version>
|
<version>1.5.2.0</version>
|
||||||
<url>https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/releases/download/1.5.1/NebulaAuth.1.5.1.zip</url>
|
<url>https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/releases/download/1.5.2/NebulaAuth.1.5.2.zip</url>
|
||||||
<changelog>https://achiez.github.io/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/changelog/1.5.1.html</changelog>
|
<changelog>https://achiez.github.io/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/changelog/1.5.2.html</changelog>
|
||||||
<mandatory>false</mandatory>
|
<mandatory>false</mandatory>
|
||||||
|
|
||||||
</item>
|
</item>
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
using Newtonsoft.Json;
|
using AchiesUtilities.Models;
|
||||||
|
using AchiesUtilities.Newtonsoft.JSON.Converters.Special;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using SteamLib.Authentication;
|
using SteamLib.Authentication;
|
||||||
using SteamLib.Core;
|
using SteamLib.Core;
|
||||||
using SteamLib.Core.Enums;
|
using SteamLib.Core.Enums;
|
||||||
using SteamLib.Core.StatusCodes;
|
using SteamLib.Core.StatusCodes;
|
||||||
using SteamLib.Exceptions;
|
using SteamLib.Exceptions;
|
||||||
|
using SteamLib.Exceptions.General;
|
||||||
|
|
||||||
namespace SteamLib.Api;
|
namespace SteamLib.Api;
|
||||||
|
|
||||||
@@ -27,7 +30,17 @@ public static class SteamGlobalApi
|
|||||||
var cont = new FormUrlEncodedContent(data);
|
var cont = new FormUrlEncodedContent(data);
|
||||||
var resp = await client.PostAsync("https://login.steampowered.com/jwt/ajaxrefresh", cont, cancellationToken);
|
var resp = await client.PostAsync("https://login.steampowered.com/jwt/ajaxrefresh", cont, cancellationToken);
|
||||||
var respStr = await resp.EnsureSuccessStatusCode().Content.ReadAsStringAsync(cancellationToken);
|
var respStr = await resp.EnsureSuccessStatusCode().Content.ReadAsStringAsync(cancellationToken);
|
||||||
var jwtRefresh = JsonConvert.DeserializeObject<JwtRefreshJson>(respStr);
|
|
||||||
|
JwtRefreshJson? jwtRefresh;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
jwtRefresh = JsonConvert.DeserializeObject<JwtRefreshJson>(respStr);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new UnsupportedResponseException(respStr, ex);
|
||||||
|
}
|
||||||
|
|
||||||
if (jwtRefresh?.Success != true)
|
if (jwtRefresh?.Success != true)
|
||||||
{
|
{
|
||||||
Exception? inner = null;
|
Exception? inner = null;
|
||||||
@@ -52,14 +65,26 @@ public static class SteamGlobalApi
|
|||||||
cont = new FormUrlEncodedContent(data);
|
cont = new FormUrlEncodedContent(data);
|
||||||
var update = await client.PostAsync(jwtRefresh.LoginUrl, cont, cancellationToken);
|
var update = await client.PostAsync(jwtRefresh.LoginUrl, cont, cancellationToken);
|
||||||
var updateResp = await update.Content.ReadAsStringAsync(cancellationToken);
|
var updateResp = await update.Content.ReadAsStringAsync(cancellationToken);
|
||||||
if (updateResp != "{\"result\":1}")
|
JwtUpdateJson result;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
result = JsonConvert.DeserializeObject<JwtUpdateJson>(updateResp) ?? throw new NullReferenceException();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new UnsupportedResponseException(updateResp, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
var resultStatus = SteamStatusCode.Translate<SteamStatusCode>(result.Result, out _);
|
||||||
|
if (resultStatus.Equals(SteamStatusCode.Ok) == false)
|
||||||
{
|
{
|
||||||
throw new SessionInvalidException(
|
throw new SessionInvalidException(
|
||||||
"AjaxRefresh (set-token) response was not successful. Response string stored in Exception.Data")
|
"AjaxRefresh (set-token) response was not successful. Response string stored in Exception.Data")
|
||||||
{
|
{
|
||||||
Data = {{"Response", updateResp}}
|
Data = { { "Response", updateResp } }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return SteamTokenHelper.ExtractJwtFromSetCookiesHeader(update.Headers);
|
return SteamTokenHelper.ExtractJwtFromSetCookiesHeader(update.Headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,5 +99,15 @@ public static class SteamGlobalApi
|
|||||||
[JsonProperty("auth")] public string Auth { get; set; } = string.Empty;
|
[JsonProperty("auth")] public string Auth { get; set; } = string.Empty;
|
||||||
[JsonProperty("error")] public int? Error { get; set; }
|
[JsonProperty("error")] public int? Error { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class JwtUpdateJson
|
||||||
|
{
|
||||||
|
[JsonProperty("result")]
|
||||||
|
public int Result { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("rtExpiry")]
|
||||||
|
[JsonConverter(typeof(UnixTimeStampConverter))]
|
||||||
|
public UnixTimeStamp RtExpiry { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-9
@@ -67,16 +67,17 @@
|
|||||||
<!-- Changelog entry -->
|
<!-- Changelog entry -->
|
||||||
<div class="change">
|
<div class="change">
|
||||||
<div class="version">Version 1.5.2</div>
|
<div class="version">Version 1.5.2</div>
|
||||||
<div class="date">DATE</div>
|
<div class="date">18.09.2024</div>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
- FIX: Potentially fixed problem with memory-leak on some devices (Windows 10, 11 Home/Professional)<br />
|
- HOTFIX: Resolved an issue introduced by the September 18, 2024, Steam update, where an error occurred during session refresh due to changes in Steam's response model.<br />
|
||||||
- FIX: Small performance improvements<br />
|
- FIX: Potentially resolved a memory leak issue on some devices (Windows 10, 11 Home/Professional).<br />
|
||||||
- UI: Added splash screen on application start <br/>
|
- FIX: Minor performance improvements.<br />
|
||||||
- UI: Added "Copy Login" in context menu of account on right-click. <br/>
|
- UI: Added a splash screen on application startup.<br />
|
||||||
- UI: Small localization update <br/>
|
- UI: Added "Copy Login" option in the account context menu on right-click.<br />
|
||||||
- UI: Added tooltip to "Use Indicator" setting <br/>
|
- UI: Minor localization updates.<br />
|
||||||
- UI: Small design improvements <br/>
|
- UI: Added a tooltip to the "Use Indicator" setting.<br />
|
||||||
- UPDATE: most of the libraries were updated to the last version<br />
|
- UI: Minor design improvements.<br />
|
||||||
|
- UPDATE: Most libraries have been updated to their latest versions.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user