diff --git a/NebulaAuth/Core/UpdateManager.cs b/NebulaAuth/Core/UpdateManager.cs index 784fbec..d93e794 100644 --- a/NebulaAuth/Core/UpdateManager.cs +++ b/NebulaAuth/Core/UpdateManager.cs @@ -1,14 +1,7 @@ using AutoUpdaterDotNET; -using MaterialDesignThemes.Wpf; using NebulaAuth.Model; -using NebulaAuth.View; -using NebulaAuth.ViewModel.Other; using System; using System.IO; -using System.Net; -using System.Windows.Forms; -using System.Windows.Threading; -using Application = System.Windows.Application; namespace NebulaAuth.Core; @@ -29,55 +22,55 @@ public static class UpdateManager } - static UpdateManager() - { - //AutoUpdater.CheckForUpdateEvent += AutoUpdaterOnCheckForUpdateEvent; + //static UpdateManager() + //{ + // //AutoUpdater.CheckForUpdateEvent += AutoUpdaterOnCheckForUpdateEvent; - } + //} - private static async void AutoUpdaterOnCheckForUpdateEvent(UpdateInfoEventArgs args) - { - if (args.Error == null) - { - if (args.IsUpdateAvailable) - { - DialogResult dialogResult; - var dialog = new UpdaterView() - { - DataContext = new UpdaterVM(args) - }; + //private static async void AutoUpdaterOnCheckForUpdateEvent(UpdateInfoEventArgs args) + //{ + // if (args.Error == null) + // { + // if (args.IsUpdateAvailable) + // { + // DialogResult dialogResult; + // var dialog = new UpdaterView() + // { + // DataContext = new UpdaterVM(args) + // }; - await DialogHost.Show(dialog); - Application.Current.Shutdown(); + // await DialogHost.Show(dialog); + // Application.Current.Shutdown(); - } - else - { + // } + // else + // { - } - } - else - { - if (args.Error is WebException) - { + // } + // } + // else + // { + // if (args.Error is WebException) + // { - } - else - { + // } + // else + // { - } - } + // } + // } - } + //} - private static void RunUpdate(UpdateInfoEventArgs args) - { - Application.Current.Dispatcher.Invoke(() => - { - if (AutoUpdater.DownloadUpdate(args)) - { - Application.Current.Shutdown(); - } - }, DispatcherPriority.ContextIdle); - } + //private static void RunUpdate(UpdateInfoEventArgs args) + //{ + // Application.Current.Dispatcher.Invoke(() => + // { + // if (AutoUpdater.DownloadUpdate(args)) + // { + // Application.Current.Shutdown(); + // } + // }, DispatcherPriority.ContextIdle); + //} } \ No newline at end of file diff --git a/NebulaAuth/View/Dialogs/WaitLoginDialog.xaml b/NebulaAuth/View/Dialogs/WaitLoginDialog.xaml index 6de5e85..41f263b 100644 --- a/NebulaAuth/View/Dialogs/WaitLoginDialog.xaml +++ b/NebulaAuth/View/Dialogs/WaitLoginDialog.xaml @@ -5,7 +5,6 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:theme="clr-namespace:NebulaAuth.Theme" mc:Ignorable="d" - d:DesignHeight="450" d:DesignWidth="800" theme:FontScaleWindow.ResizeFont="True" theme:FontScaleWindow.Scale="1" Foreground="WhiteSmoke" Background="{DynamicResource WindowBackground}"> diff --git a/NebulaAuth/update.xml b/NebulaAuth/update.xml index 0e9d39e..de7990a 100644 --- a/NebulaAuth/update.xml +++ b/NebulaAuth/update.xml @@ -1,8 +1,8 @@  - 1.5.1.0 - https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/releases/download/1.5.1/NebulaAuth.1.5.1.zip - https://achiez.github.io/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/changelog/1.5.1.html + 1.5.2.0 + https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/releases/download/1.5.2/NebulaAuth.1.5.2.zip + https://achiez.github.io/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/changelog/1.5.2.html false \ No newline at end of file diff --git a/SteamLibForked/Api/SteamGlobalApi.cs b/SteamLibForked/Api/SteamGlobalApi.cs index 39f9421..4c6b2e9 100644 --- a/SteamLibForked/Api/SteamGlobalApi.cs +++ b/SteamLibForked/Api/SteamGlobalApi.cs @@ -1,9 +1,12 @@ -using Newtonsoft.Json; +using AchiesUtilities.Models; +using AchiesUtilities.Newtonsoft.JSON.Converters.Special; +using Newtonsoft.Json; using SteamLib.Authentication; using SteamLib.Core; using SteamLib.Core.Enums; using SteamLib.Core.StatusCodes; using SteamLib.Exceptions; +using SteamLib.Exceptions.General; namespace SteamLib.Api; @@ -27,7 +30,17 @@ public static class SteamGlobalApi var cont = new FormUrlEncodedContent(data); var resp = await client.PostAsync("https://login.steampowered.com/jwt/ajaxrefresh", cont, cancellationToken); var respStr = await resp.EnsureSuccessStatusCode().Content.ReadAsStringAsync(cancellationToken); - var jwtRefresh = JsonConvert.DeserializeObject(respStr); + + JwtRefreshJson? jwtRefresh; + try + { + jwtRefresh = JsonConvert.DeserializeObject(respStr); + } + catch (Exception ex) + { + throw new UnsupportedResponseException(respStr, ex); + } + if (jwtRefresh?.Success != true) { Exception? inner = null; @@ -52,14 +65,26 @@ public static class SteamGlobalApi cont = new FormUrlEncodedContent(data); var update = await client.PostAsync(jwtRefresh.LoginUrl, cont, cancellationToken); var updateResp = await update.Content.ReadAsStringAsync(cancellationToken); - if (updateResp != "{\"result\":1}") + JwtUpdateJson result; + try + { + result = JsonConvert.DeserializeObject(updateResp) ?? throw new NullReferenceException(); + } + catch (Exception ex) + { + throw new UnsupportedResponseException(updateResp, ex); + } + + var resultStatus = SteamStatusCode.Translate(result.Result, out _); + if (resultStatus.Equals(SteamStatusCode.Ok) == false) { throw new SessionInvalidException( "AjaxRefresh (set-token) response was not successful. Response string stored in Exception.Data") { - Data = {{"Response", updateResp}} + Data = { { "Response", updateResp } } }; } + return SteamTokenHelper.ExtractJwtFromSetCookiesHeader(update.Headers); } @@ -74,5 +99,15 @@ public static class SteamGlobalApi [JsonProperty("auth")] public string Auth { get; set; } = string.Empty; [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; } + } } diff --git a/changelog/1.5.2.html b/changelog/1.5.2.html index 04ab1f6..613f9cc 100644 --- a/changelog/1.5.2.html +++ b/changelog/1.5.2.html @@ -67,16 +67,17 @@
Version 1.5.2
-
DATE
+
18.09.2024
- - FIX: Potentially fixed problem with memory-leak on some devices (Windows 10, 11 Home/Professional)
- - FIX: Small performance improvements
- - UI: Added splash screen on application start
- - UI: Added "Copy Login" in context menu of account on right-click.
- - UI: Small localization update
- - UI: Added tooltip to "Use Indicator" setting
- - UI: Small design improvements
- - UPDATE: most of the libraries were updated to the last version
+ - 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.
+ - FIX: Potentially resolved a memory leak issue on some devices (Windows 10, 11 Home/Professional).
+ - FIX: Minor performance improvements.
+ - UI: Added a splash screen on application startup.
+ - UI: Added "Copy Login" option in the account context menu on right-click.
+ - UI: Minor localization updates.
+ - UI: Added a tooltip to the "Use Indicator" setting.
+ - UI: Minor design improvements.
+ - UPDATE: Most libraries have been updated to their latest versions.