From 37d4e74b8d42c1199aed9394b237c3f04ec84100 Mon Sep 17 00:00:00 2001 From: DmitriySalnikov Date: Wed, 13 Mar 2024 14:16:08 +0300 Subject: [PATCH] validation of the `-p` arguments has been fixed. fixes #15 --- .github/workflows/dotnet-desktop.yml | 2 +- Bruteforcer/UI/PCKBruteforcer.UI.csproj | 8 ++---- Core/Global.Shared/Logger.cs | 19 +++++++++++--- Core/GodotPCKExplorer/GodotPCKExplorer.csproj | 2 +- Core/GodotPCKExplorer/PCKPacker.cs | 9 +++++++ Core/GodotPCKExplorer/PCKReader.cs | 2 +- Explorer/Console/ConsoleCommands.cs | 25 +++++++++++-------- Explorer/UI/GodotPCKExplorer.UI.csproj | 6 ++--- Explorer/UI/VersionCheckGitHub.cs | 5 ++-- 9 files changed, 48 insertions(+), 30 deletions(-) diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index 5706a1e..2ee23ca 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -37,7 +37,7 @@ jobs: # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild - name: Setup MSBuild.exe - uses: microsoft/setup-msbuild@v1 + uses: microsoft/setup-msbuild@v2 # Add nuget to cache - name: Setup Cache diff --git a/Bruteforcer/UI/PCKBruteforcer.UI.csproj b/Bruteforcer/UI/PCKBruteforcer.UI.csproj index 90f868c..83af6db 100644 --- a/Bruteforcer/UI/PCKBruteforcer.UI.csproj +++ b/Bruteforcer/UI/PCKBruteforcer.UI.csproj @@ -12,12 +12,8 @@ Dmitriy Salnikov A small utility to find the encryption key for PCK. Copyright © 2024 - - https://github.com/DmitriySalnikov/GodotPCKExplorer/tree/master/Bruteforcer - - - https://github.com/DmitriySalnikov/GodotPCKExplorer/tree/master/Bruteforcer - + https://github.com/DmitriySalnikov/GodotPCKExplorer/tree/master/Bruteforcer + https://github.com/DmitriySalnikov/GodotPCKExplorer/tree/master/Bruteforcer git en 1.0.0 diff --git a/Core/Global.Shared/Logger.cs b/Core/Global.Shared/Logger.cs index b920e34..1021357 100644 --- a/Core/Global.Shared/Logger.cs +++ b/Core/Global.Shared/Logger.cs @@ -55,7 +55,7 @@ public Logger(string saveFile) try { - string dir_name = Path.GetDirectoryName(this.saveFile) ?? ""; + string dir_name = Path.GetDirectoryName(this.saveFile) ?? string.Empty; if (!Directory.Exists(dir_name)) Directory.CreateDirectory(dir_name); @@ -104,12 +104,20 @@ public void Dispose() logWriter = null; } + public void Flush() + { + FastConsole.Flush(); + flushFastConsole.Cancel(); + timeFlushConsole = DateTime.UtcNow; + logWriter?.Flush(); + } + public void Write(string txt) { var isFirst = true; txt = string.Join(Environment.NewLine, - txt.Split('\n'). - Select((t) => + txt.Split(["\r\n", "\n", "\r"], StringSplitOptions.None) + .Select((t) => { var res = $"[{DateTime.Now.ToString(CultureInfo.InvariantCulture)}]{(isFirst ? "\t" : "-\t")}{t}"; isFirst = false; @@ -141,6 +149,11 @@ public void Write(string txt) } } + public void WriteError(string txt) + { + Write("❗ Error: " + txt); + } + public void Write(Exception ex) { Write($"⚠ {ex.GetType().Name}:\n{ex.Message}\nStackTrace:\n{ex.StackTrace}"); diff --git a/Core/GodotPCKExplorer/GodotPCKExplorer.csproj b/Core/GodotPCKExplorer/GodotPCKExplorer.csproj index c11f2d4..12b1d13 100644 --- a/Core/GodotPCKExplorer/GodotPCKExplorer.csproj +++ b/Core/GodotPCKExplorer/GodotPCKExplorer.csproj @@ -14,7 +14,7 @@ mbedTLS\**\*.pdb; **\.gitignore - 1.4.0 + 1.4.1 $(Version) diff --git a/Core/GodotPCKExplorer/PCKPacker.cs b/Core/GodotPCKExplorer/PCKPacker.cs index 0343878..0031697 100644 --- a/Core/GodotPCKExplorer/PCKPacker.cs +++ b/Core/GodotPCKExplorer/PCKPacker.cs @@ -113,6 +113,15 @@ public static bool PackFiles(string outPck, bool embed, IEnumerableGodotPCKExplorer GodotPCKExplorer.UI Dmitriy Salnikov - - C# implementation of the Godot's PCK file format with the ability to export files from it and create new PCK packs, as well as giving several more useful features. - + C# implementation of the Godot's PCK file format with the ability to export files from it and create new PCK packs, as well as giving several more useful features. Copyright © 2024 https://github.com/DmitriySalnikov/GodotPCKExplorer pckAbout.png https://github.com/DmitriySalnikov/GodotPCKExplorer git en - 1.4.0 + 1.4.1 $(NoWarn);IDE1006 diff --git a/Explorer/UI/VersionCheckGitHub.cs b/Explorer/UI/VersionCheckGitHub.cs index 44959eb..c9a4ab6 100644 --- a/Explorer/UI/VersionCheckGitHub.cs +++ b/Explorer/UI/VersionCheckGitHub.cs @@ -1,7 +1,6 @@ -using System.Text.Json; -using System.Text.Json.Serialization; -using System.Diagnostics; +using System.Diagnostics; using System.Reflection; +using System.Text.Json; internal sealed class VersionCheckerGitHub : IDisposable {