Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compiler error on unity 2032.1.17f #599

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma warning disable SA1512,SA1124 // Single-line comments should not be followed by blank line
#if !((UNITY_EDITOR_WIN && UNITY_2023_1_OR_NEWER && NET_STANDARD) || NUGETFORUNITY_CLI)
#if !NUGETFORUNITY_CLI
using JetBrains.Annotations;
#else
using System.Security.Cryptography;
Expand Down Expand Up @@ -28,7 +28,7 @@ internal static class ConfigurationEncryptionHelper
{
private static readonly byte[] EntropyBytes = Encoding.UTF8.GetBytes("NuGet");

#if !((UNITY_EDITOR_WIN && UNITY_2023_1_OR_NEWER && NET_STANDARD) || NUGETFORUNITY_CLI)
#if !NUGETFORUNITY_CLI

// on .net framework the type lives in 'System.Security' on .net standard it in 'System.Security.Cryptography.ProtectedData'
[ItemCanBeNull]
Expand All @@ -55,7 +55,7 @@ public static string EncryptString(string value)
{
var decryptedByteArray = Encoding.UTF8.GetBytes(value);

#if (UNITY_EDITOR_WIN && UNITY_2023_1_OR_NEWER && NET_STANDARD) || NUGETFORUNITY_CLI
#if NUGETFORUNITY_CLI
#pragma warning disable CA1416 // Validate platform compatibility
var encryptedByteArray = ProtectedData.Protect(decryptedByteArray, EntropyBytes, DataProtectionScope.CurrentUser);
#pragma warning restore CA1416 // Validate platform compatibility
Expand Down Expand Up @@ -97,7 +97,7 @@ public static string DecryptString(string encryptedString)
{
var encryptedByteArray = Convert.FromBase64String(encryptedString);

#if (UNITY_EDITOR_WIN && UNITY_2023_1_OR_NEWER && NET_STANDARD) || NUGETFORUNITY_CLI
#if NUGETFORUNITY_CLI
#pragma warning disable CA1416 // Validate platform compatibility
var decryptedByteArray = ProtectedData.Unprotect(encryptedByteArray, EntropyBytes, DataProtectionScope.CurrentUser);
#pragma warning restore CA1416 // Validate platform compatibility
Expand All @@ -121,7 +121,7 @@ public static string DecryptString(string encryptedString)
}
}

#if !((UNITY_EDITOR_WIN && UNITY_2023_1_OR_NEWER && NET_STANDARD) || NUGETFORUNITY_CLI)
#if !NUGETFORUNITY_CLI
[CanBeNull]
private static byte[] ProtectOrUnprotectUsingReflection(string methodName, byte[] data)
{
Expand Down
Loading