From 064cef8e5fd88b722e1a1e97e698b7637ddffb42 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Thu, 5 Sep 2019 16:18:54 -0600 Subject: [PATCH] removed endorsing option, include version/sha in install report, link sha to virustotal --- CHANGELOG.md | 2 ++ Wabbajack.Common/Utils.cs | 10 ++++++++++ Wabbajack/Installer.cs | 4 +++- Wabbajack/ReportBuilder.cs | 10 +++++++++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06b1d8a0..aadb5adc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ to be a list of other profiles to be included in the install. This list should b * Config files that don't otherwise match a rule are inlined into the modlist * Warn users before installing into an existing MO2 install folder (prevents unintentional data loss from overwriting existing data #24) * Fix for read only folder deletion bug (#23) +* Include version numbers and SHAs in the install report +* Removed option to endorse mods, Nexus devs mentioned it was of questionable worth, I (halgari) agree #### Version 0.8.1 - 8/29/2019 * Fixed a bug that was causing VFS temp folders not to be cleaned diff --git a/Wabbajack.Common/Utils.cs b/Wabbajack.Common/Utils.cs index b69dde9e..26ae877f 100644 --- a/Wabbajack.Common/Utils.cs +++ b/Wabbajack.Common/Utils.cs @@ -93,6 +93,16 @@ namespace Wabbajack.Common return Convert.ToBase64String(data); } + public static string ToHEX(this byte[] bytes) + { + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < bytes.Length; i++) + { + builder.Append(bytes[i].ToString("x2")); + } + return builder.ToString(); + } + /// /// Returns data from a base64 stream /// diff --git a/Wabbajack/Installer.cs b/Wabbajack/Installer.cs index ddf8ba47..ebed4718 100644 --- a/Wabbajack/Installer.cs +++ b/Wabbajack/Installer.cs @@ -138,7 +138,9 @@ namespace Wabbajack BuildBSAs(); Info("Installation complete! You may exit the program."); - AskToEndorse(); + // Removed until we decide if we want this functionality + // Nexus devs weren't sure this was a good idea, I (halgari) agree. + //AskToEndorse(); } private void AskToEndorse() diff --git a/Wabbajack/ReportBuilder.cs b/Wabbajack/ReportBuilder.cs index 4ed536d2..635ccd62 100644 --- a/Wabbajack/ReportBuilder.cs +++ b/Wabbajack/ReportBuilder.cs @@ -44,23 +44,31 @@ namespace Wabbajack Text($"#### Download Summary ({lst.Archives.Count} archives)"); foreach (var archive in SortArchives(lst.Archives)) { + var hash = archive.Hash.FromBase64().ToHEX(); switch (archive) { case NexusMod m: var profile = m.UploaderProfile.Replace("/games/", "/"+NexusAPI.ConvertGameName(m.GameName).ToLower()+"/"); - NoWrapText($"* [{m.UploadedBy}]({profile}) - [{m.Name}](http://nexusmods.com/{NexusAPI.ConvertGameName(m.GameName)}/mods/{m.ModID})"); + NoWrapText($"* [{m.Name}](http://nexusmods.com/{NexusAPI.ConvertGameName(m.GameName)}/mods/{m.ModID})"); + NoWrapText($" * Author : [{m.UploadedBy}]({profile})"); + NoWrapText($" * Version : {m.Version}"); + NoWrapText($" * SHA256 : [{hash}](https://www.virustotal.com/gui/file/{hash})"); break; case MODDBArchive m: NoWrapText($"* MODDB - [{m.Name}]({m.URL})"); + NoWrapText($" * SHA256 : [{hash}](https://www.virustotal.com/gui/file/{hash})"); break; case MEGAArchive m: NoWrapText($"* MEGA - [{m.Name}]({m.URL})"); + NoWrapText($" * SHA256 : [{hash}](https://www.virustotal.com/gui/file/{hash})"); break; case GoogleDriveMod m: NoWrapText($"* GoogleDrive - [{m.Name}](https://drive.google.com/uc?id={m.Id}&export=download)"); + NoWrapText($" * SHA256 : [{hash}](https://www.virustotal.com/gui/file/{hash})"); break; case DirectURLArchive m: NoWrapText($"* URL - [{m.Name} - {m.URL}]({m.URL})"); + NoWrapText($" * SHA256 : [{hash}](https://www.virustotal.com/gui/file/{hash})"); break; } }