Skip to content

Commit

Permalink
Fix CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahStolk committed Dec 22, 2022
1 parent c7192e7 commit 4a64f62
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
using DevilDaggersInfo.App.Ui.CustomLeaderboardsRecorder.States;
using DevilDaggersInfo.Common.Extensions;
using DevilDaggersInfo.Core.Encryption;
#if !CI
using System.IO.Compression;
using System.Text;
#endif
using System.Web;

namespace DevilDaggersInfo.App.Ui.CustomLeaderboardsRecorder;
Expand All @@ -18,8 +20,13 @@ public static class RecordingLogic
private static readonly AesBase32Wrapper _aesBase32Wrapper;
private static bool _uploadRun;

#pragma warning disable S3963
static RecordingLogic()
#pragma warning restore S3963
{
#if CI
_aesBase32Wrapper = new(string.Empty, string.Empty, string.Empty);
#else
using MemoryStream msIn = new(WarpBlobs.Value.Data.Select((b, i) => i < 4 ? (byte)(b << 4 | b >> 4) : (byte)~b).ToArray());
using MemoryStream msOut = new();
using DeflateStream ds = new(msIn, CompressionMode.Decompress);
Expand All @@ -28,6 +35,7 @@ static RecordingLogic()
br.BaseStream.Position = 0;
string[] values = Enumerable.Range(0, br.ReadByte()).Select(_ => Encoding.UTF8.GetString(br.ReadBytes(br.ReadByte()).Select((b, j) => j % 4 == 0 ? b : (byte)~b).ToArray())).ToArray();
_aesBase32Wrapper = new(values[0], values[1], values[2]);
#endif
}

/// <summary>
Expand Down
10 changes: 5 additions & 5 deletions src/app/DevilDaggersInfo.App/DevilDaggersInfo.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
</PropertyGroup>

<PropertyGroup Condition="'$(IsWindows)'=='true'">
<DefineConstants>WINDOWS</DefineConstants>
<PropertyGroup Condition="'$(IsWindows)' == 'true'">
<DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
<OutputType>WinExe</OutputType>
</PropertyGroup>

<PropertyGroup Condition="'$(IsLinux)'=='true'">
<DefineConstants>LINUX</DefineConstants>
<PropertyGroup Condition="'$(IsLinux)' == 'true'">
<DefineConstants>$(DefineConstants);LINUX</DefineConstants>
<OutputType>Exe</OutputType>
</PropertyGroup>

<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>obj\SourceGenOutput</CompilerGeneratedFilesOutputPath>
Expand Down

0 comments on commit 4a64f62

Please sign in to comment.