diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b29ba9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.idea +generator/.idea +generator/obj +generator/bin diff --git a/generator/Program.cs b/generator/Program.cs new file mode 100644 index 0000000..35fc871 --- /dev/null +++ b/generator/Program.cs @@ -0,0 +1,34 @@ +using System.Reflection; +using CoreLogic; +using Newtonsoft.Json; + +if (args.Length != 2) +{ + Console.WriteLine("Usage: dotnet run "); + return; +} + +var uuid = args[0]; +var email = args[1]; + +var appendTokenField = typeof(Statics).GetField("appendToken", BindingFlags.NonPublic | BindingFlags.Static); +if (appendTokenField == null) +{ + Console.WriteLine("Failed to find appendToken field"); + return; +} + +var appendToken = (string) appendTokenField.GetValue(null)!; +Console.WriteLine($"appendToken: {appendToken}"); + +var encrypted = EncDec.EncryptData( + JsonConvert.SerializeObject(new License { UniqueId = uuid, Email = email }), + uuid.Trim().ToUpperInvariant() + appendToken); + +Console.WriteLine($"License:\n{encrypted}"); + +internal struct License +{ + [JsonProperty("uniqueid")] public string UniqueId; + [JsonProperty("email")] public string Email; +} \ No newline at end of file diff --git a/generator/generator.csproj b/generator/generator.csproj new file mode 100644 index 0000000..1b0ccc2 --- /dev/null +++ b/generator/generator.csproj @@ -0,0 +1,20 @@ + + + + Exe + net6.0 + enable + enable + + + + + lib\CoreLogic.dll + + + + + + + + diff --git a/generator/generator.sln b/generator/generator.sln new file mode 100644 index 0000000..ab66ae5 --- /dev/null +++ b/generator/generator.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "generator", "generator.csproj", "{6A20249C-8538-44E8-9963-9E4EFA62703A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6A20249C-8538-44E8-9963-9E4EFA62703A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6A20249C-8538-44E8-9963-9E4EFA62703A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6A20249C-8538-44E8-9963-9E4EFA62703A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6A20249C-8538-44E8-9963-9E4EFA62703A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/generator/global.json b/generator/global.json new file mode 100644 index 0000000..aaac9e0 --- /dev/null +++ b/generator/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "7.0.0", + "rollForward": "latestMinor", + "allowPrerelease": false + } +} \ No newline at end of file diff --git a/generator/lib/CoreLogic.dll b/generator/lib/CoreLogic.dll new file mode 100644 index 0000000..eb035df Binary files /dev/null and b/generator/lib/CoreLogic.dll differ