From 35f6b1b541819897e2d80fc08b98e0f8e4880f33 Mon Sep 17 00:00:00 2001 From: itectori Date: Mon, 2 Dec 2024 13:48:56 -0500 Subject: [PATCH] include DeobfuscationMap.csv.gz in ComputeHash (#1020) --- .../BepInEx.Unity.IL2CPP/Il2CppInteropManager.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Runtimes/Unity/BepInEx.Unity.IL2CPP/Il2CppInteropManager.cs b/Runtimes/Unity/BepInEx.Unity.IL2CPP/Il2CppInteropManager.cs index 1ebf4c9..4212195 100644 --- a/Runtimes/Unity/BepInEx.Unity.IL2CPP/Il2CppInteropManager.cs +++ b/Runtimes/Unity/BepInEx.Unity.IL2CPP/Il2CppInteropManager.cs @@ -137,6 +137,8 @@ internal static partial class Il2CppInteropManager internal static string IL2CPPInteropAssemblyPath => Path.Combine(IL2CPPBasePath, "interop"); + private static string RenameMapPath => Path.Combine(Paths.BepInExRootPath, "DeobfuscationMap.csv.gz"); + private static ILoggerFactory LoggerFactory { get; } = MSLoggerFactory.Create(b => { b.AddProvider(new BepInExLoggerProvider()) @@ -173,6 +175,11 @@ internal static partial class Il2CppInteropManager HashFile(md5, file); } + if (File.Exists(RenameMapPath)) + { + HashFile(md5, RenameMapPath); + } + // Hash some common dependencies as they can affect output HashString(md5, typeof(InteropAssemblyGenerator).Assembly.GetName().Version.ToString()); HashString(md5, typeof(Cpp2IlApi).Assembly.GetName().Version.ToString()); @@ -361,11 +368,10 @@ internal static partial class Il2CppInteropManager : null, }; - var renameMapLocation = Path.Combine(Paths.BepInExRootPath, "DeobfuscationMap.csv.gz"); - if (File.Exists(renameMapLocation)) + if (File.Exists(RenameMapPath)) { Logger.LogInfo("Parsing deobfuscation rename mappings"); - opts.ReadRenameMap(renameMapLocation); + opts.ReadRenameMap(RenameMapPath); } Logger.LogInfo("Generating interop assemblies");