mirror of
https://github.com/jakeswenson/BitBetter.git
synced 2025-12-16 19:26:18 +00:00
Update and fix unified branch (#257)
* Upstream patches * Fix license generator according to upstream changes (#245) (#249) * Test generating user and organization licenses during build check (#252) * Fix ps1 script and update language * Update class path * Cleanup code * Cleanup code * Cleanup code * Refactor and fixes * Copy all files * Copy files only when needed * Make call consistent * Simplify call * Clarify language * Reuse code * Cleanup * Cleanup * Remove NewtonSoft.Json * Upgrade dnlib * Cleanup * Fix path issue * Fix comparator * Cleanup circleci * Fix type * Fix circleci * Properly detect previous version * Add missing parameter * Better detect running patched containers * Improve naming * Fix line endings * Fix typo * Add comment * Fix tabs * Cleanup org license * Use proper file extension * Add missing file * Migrate cert.cert if exists * Check for the correct file * Fix character check * Add comment * Add more documentation * Add proper line endings * Add potentially correct line * Add auto restart * Update comment * Improve consistency between bash and powerhell * Update documentation * Detect buildx * Fix spelling mistake * Fix check order and improve verbosity
This commit is contained in:
@@ -14,7 +14,7 @@ internal class Program
|
||||
{
|
||||
private static Int32 Main()
|
||||
{
|
||||
const String certFile = "/app/cert.cert";
|
||||
const String certFile = "/app/cert.cer";
|
||||
String[] files = Directory.GetFiles("/app/mount", "Core.dll", SearchOption.AllDirectories);
|
||||
|
||||
foreach (String file in files)
|
||||
@@ -23,12 +23,7 @@ internal class Program
|
||||
ModuleDefMD moduleDefMd = ModuleDefMD.Load(file);
|
||||
Byte[] cert = File.ReadAllBytes(certFile);
|
||||
|
||||
EmbeddedResource embeddedResourceToRemove = moduleDefMd.Resources
|
||||
.OfType<EmbeddedResource>()
|
||||
.First(r => r.Name.Equals("Bit.Core.licensing.cer"));
|
||||
|
||||
Console.WriteLine(embeddedResourceToRemove.Name);
|
||||
|
||||
EmbeddedResource embeddedResourceToRemove = moduleDefMd.Resources.OfType<EmbeddedResource>().First(r => r.Name.Equals("Bit.Core.licensing.cer"));
|
||||
EmbeddedResource embeddedResourceToAdd = new("Bit.Core.licensing.cer", cert) { Attributes = embeddedResourceToRemove.Attributes };
|
||||
moduleDefMd.Resources.Add(embeddedResourceToAdd);
|
||||
moduleDefMd.Resources.Remove(embeddedResourceToRemove);
|
||||
@@ -45,10 +40,7 @@ internal class Program
|
||||
TypeDef type = services.First(t => t.Name == "LicensingService");
|
||||
MethodDef constructor = type.FindConstructors().First();
|
||||
|
||||
Instruction instructionToPatch =
|
||||
constructor.Body.Instructions
|
||||
.FirstOrDefault(i => i.OpCode == OpCodes.Ldstr
|
||||
&& String.Equals((String)i.Operand, existingCert.Thumbprint, StringComparison.InvariantCultureIgnoreCase));
|
||||
Instruction instructionToPatch = constructor.Body.Instructions.FirstOrDefault(i => i.OpCode == OpCodes.Ldstr && String.Equals((String)i.Operand, existingCert.Thumbprint, StringComparison.InvariantCultureIgnoreCase));
|
||||
|
||||
if (instructionToPatch != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user