From 33a57edc365098124b4120dd3718b7d02b68196a Mon Sep 17 00:00:00 2001 From: hexadecimal <138823941+t0int1337@users.noreply.github.com> Date: Thu, 24 Apr 2025 22:06:25 +0300 Subject: [PATCH] Hardcode the Public key of Bunifu.Licensing --- Bunifu.Licensing/Bunifu.Licensing.csproj | 3 +++ Bunifu.Licensing/BunifuPublicKey.snk | Bin 0 -> 160 bytes Bunifu.Licensing/Properties/AssemblyInfo.cs | 10 +++++++++- Bunifu.Licensing/create-key.ps1 | 10 ++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 Bunifu.Licensing/BunifuPublicKey.snk create mode 100644 Bunifu.Licensing/create-key.ps1 diff --git a/Bunifu.Licensing/Bunifu.Licensing.csproj b/Bunifu.Licensing/Bunifu.Licensing.csproj index 5845739..1a85998 100644 --- a/Bunifu.Licensing/Bunifu.Licensing.csproj +++ b/Bunifu.Licensing/Bunifu.Licensing.csproj @@ -8,6 +8,9 @@ Bunifu.Licensing false false + true + BunifuPublicKey.snk + true diff --git a/Bunifu.Licensing/BunifuPublicKey.snk b/Bunifu.Licensing/BunifuPublicKey.snk new file mode 100644 index 0000000000000000000000000000000000000000..639c783f24563c4971a4839cd3eef1b626f75546 GIT binary patch literal 160 zcmV;R0AK$ABme*efB*oL000060ssI2Bme+XQ$aBR1ONa50096MragNe2pa+4*+l=P z)Jj=1nv$jm`QFVwvpWEtt6D3PujU?8jTW-e{=*t!^Ns&~JLX z7$Z9F@DNaK+rk+BuZ>WuWb%HGP|wy?+D5OMS#R%{EQvpAOk*dlPty!}iZc*Z6Jb(M O4{4gOqOIDBr+e|}I6#pA literal 0 HcmV?d00001 diff --git a/Bunifu.Licensing/Properties/AssemblyInfo.cs b/Bunifu.Licensing/Properties/AssemblyInfo.cs index 2bde4a0..c2d0bb7 100644 --- a/Bunifu.Licensing/Properties/AssemblyInfo.cs +++ b/Bunifu.Licensing/Properties/AssemblyInfo.cs @@ -18,4 +18,12 @@ using System.Runtime.Versioning; [assembly: AssemblyProduct("Bunifu.Licensing")] [assembly: AssemblyTitle("Bunifu.Licensing")] [assembly: TargetPlatform("Windows7.0")] -[assembly: SupportedOSPlatform("Windows7.0")] \ No newline at end of file +[assembly: SupportedOSPlatform("Windows7.0")] + +// Add the public key for strong name signing +[assembly: AssemblyDelaySign(false)] +// Setting the expected public key token for "f89b4760ba7dcb6b" +// This is 'f89b4760ba7dcb6b' represented as a byte array +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] +[assembly: InternalsVisibleTo("Bunifu.UI.WinForms, PublicKey=002400000480000094000000060200000024000052534131000400000100010015a63d7b1e081b01dfd944ffa5d44a59339a92a607f9decd3eb33b009dab5a2b92afe61e538d16b2d1feb7808228c32c4e139c19aa4e41c5efad6e20a4d06f7abb18233aeef010506ddbc218feaf8d50aa64f27e8f50cfd655da46af9a596fef982c893f6a4c6327ad4fd30c798a3310551361524f0f699aafa2adda8aa77bf1")] \ No newline at end of file diff --git a/Bunifu.Licensing/create-key.ps1 b/Bunifu.Licensing/create-key.ps1 new file mode 100644 index 0000000..f33a529 --- /dev/null +++ b/Bunifu.Licensing/create-key.ps1 @@ -0,0 +1,10 @@ +$publicKeyHex = "002400000480000094000000060200000024000052534131000400000100010015a63d7b1e081b01dfd944ffa5d44a59339a92a607f9decd3eb33b009dab5a2b92afe61e538d16b2d1feb7808228c32c4e139c19aa4e41c5efad6e20a4d06f7abb18233aeef010506ddbc218feaf8d50aa64f27e8f50cfd655da46af9a596fef982c893f6a4c6327ad4fd30c798a3310551361524f0f699aafa2adda8aa77bf1" + +# Convert hex string to byte array +$bytes = for ($i = 0; $i -lt $publicKeyHex.Length; $i += 2) { + [Convert]::ToByte($publicKeyHex.Substring($i, 2), 16) +} + +# Write bytes to file +[System.IO.File]::WriteAllBytes("$PSScriptRoot\BunifuPublicKey.snk", $bytes) +Write-Host "Key file created successfully at $PSScriptRoot\BunifuPublicKey.snk" \ No newline at end of file