diff options
Diffstat (limited to 'Ryujinx/Modules/Updater/Updater.cs')
-rw-r--r-- | Ryujinx/Modules/Updater/Updater.cs | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Ryujinx/Modules/Updater/Updater.cs b/Ryujinx/Modules/Updater/Updater.cs index 3f186ce6..5ad5924e 100644 --- a/Ryujinx/Modules/Updater/Updater.cs +++ b/Ryujinx/Modules/Updater/Updater.cs @@ -2,14 +2,14 @@ using Gtk; using ICSharpCode.SharpZipLib.GZip; using ICSharpCode.SharpZipLib.Tar; using ICSharpCode.SharpZipLib.Zip; +using Newtonsoft.Json.Linq; using Ryujinx.Common; using Ryujinx.Common.Logging; -using Ryujinx.Common.Utilities; using Ryujinx.Ui; -using Ryujinx.Ui.Common.Models.Github; using Ryujinx.Ui.Widgets; using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Net; @@ -38,8 +38,6 @@ namespace Ryujinx.Modules private static string _buildUrl; private static long _buildSize; - private static readonly GithubReleasesJsonSerializerContext SerializerContext = new(JsonHelper.GetDefaultSerializerOptions()); - // On Windows, GtkSharp.Dependencies adds these extra dirs that must be cleaned during updates. private static readonly string[] WindowsDependencyDirs = new string[] { "bin", "etc", "lib", "share" }; @@ -109,16 +107,22 @@ namespace Ryujinx.Modules // Fetch latest build information string fetchedJson = await jsonClient.GetStringAsync(buildInfoURL); - var fetched = JsonHelper.Deserialize(fetchedJson, SerializerContext.GithubReleasesJsonResponse); - _buildVer = fetched.Name; + JObject jsonRoot = JObject.Parse(fetchedJson); + JToken assets = jsonRoot["assets"]; + + _buildVer = (string)jsonRoot["name"]; - foreach (var asset in fetched.Assets) + foreach (JToken asset in assets) { - if (asset.Name.StartsWith("ryujinx") && asset.Name.EndsWith(_platformExt)) + string assetName = (string)asset["name"]; + string assetState = (string)asset["state"]; + string downloadURL = (string)asset["browser_download_url"]; + + if (assetName.StartsWith("ryujinx") && assetName.EndsWith(_platformExt)) { - _buildUrl = asset.BrowserDownloadUrl; + _buildUrl = downloadURL; - if (asset.State != "uploaded") + if (assetState != "uploaded") { if (showVersionUpToDate) { |