Skip to content

Commit

Permalink
Allow bypass using a file (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz authored Nov 12, 2024
1 parent 6f3d50e commit 91663a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Deorcify/Initializer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
Expand All @@ -24,7 +25,9 @@ private static bool IsBypassed() =>
Environment.GetEnvironmentVariable("RUSNI"),
"PYZDA",
StringComparison.OrdinalIgnoreCase
);
)
|| File.Exists("SLAVA_UKRAINI")
|| File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SLAVA_UKRAINI"));

private static bool IsRestricted()
{
Expand Down Expand Up @@ -63,11 +66,12 @@ public static void Execute()
var assemblyName = Assembly.GetExecutingAssembly().GetName().Name;

var message = $"""
Based on your system settings, it appears you're located in Russia or Belarus. You cannot use {assemblyName} on the territory of a terrorist state.
Your system settings indicate that you're located in Russia or Belarus. You cannot use {assemblyName} on the territory of a terrorist state.
If you believe this to be an error, check your system settings and make sure your country and region are configured correctly.
If you wish to bypass this check, set the environment variable `SLAVA_UKRAINI=1` in your system settings.
Alternatively, you can also create a file named `SLAVA_UKRAINI` (no extension) in the current working directory.
""";

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
Expand Down

0 comments on commit 91663a7

Please sign in to comment.