diff --git a/Samples/WorkWithHybridCLR/Assets/Editor/BuildCommand.cs b/Samples/WorkWithHybridCLR/Assets/Editor/BuildCommand.cs index 6b9e378..de082f9 100644 --- a/Samples/WorkWithHybridCLR/Assets/Editor/BuildCommand.cs +++ b/Samples/WorkWithHybridCLR/Assets/Editor/BuildCommand.cs @@ -1,4 +1,6 @@ using HybridCLR.Editor; +using HybridCLR.Editor.Commands; +using Obfuz.Settings; using Obfuz4HybridCLR; using System.Collections; using System.Collections.Generic; @@ -12,17 +14,26 @@ public static class BuildCommand public static void CompileAndObfuscateAndCopyToStreamingAssets() { BuildTarget target = EditorUserBuildSettings.activeBuildTarget; - ObfuscateUtil.CompileAndObfuscateHotUpdateAssemblies(target); + CompileDllCommand.CompileDll(target); + + string obfuscatedHotUpdateDllPath = PrebuildCommandExt.GetObfuscatedHotUpdateAssemblyOutputPath(target); + ObfuscateUtil.ObfuscateHotUpdateAssemblies(target, obfuscatedHotUpdateDllPath); Directory.CreateDirectory(Application.streamingAssetsPath); string hotUpdateDllPath = $"{SettingsUtil.GetHotUpdateDllsOutputDirByTarget(target)}"; + List obfuscationRelativeAssemblyNames = ObfuzSettings.Instance.assemblySettings.GetObfuscationRelativeAssemblyNames(); + foreach (string assName in SettingsUtil.HotUpdateAssemblyNamesIncludePreserved) { - string srcFile = $"{hotUpdateDllPath}/{assName}.dll"; + string srcDir = obfuscationRelativeAssemblyNames.Contains(assName) ? obfuscatedHotUpdateDllPath : hotUpdateDllPath; + string srcFile = $"{srcDir}/{assName}.dll"; string dstFile = $"{Application.streamingAssetsPath}/{assName}.dll.bytes"; - File.Copy(srcFile, dstFile, true); - Debug.Log($"[CompileAndObfuscate] Copy {srcFile} to {dstFile}"); + if (File.Exists(srcFile)) + { + File.Copy(srcFile, dstFile, true); + Debug.Log($"[CompileAndObfuscate] Copy {srcFile} to {dstFile}"); + } } } } diff --git a/Samples/WorkWithHybridCLR/Assets/Obfuz/SymbolObfus/symbol-mapping.xml b/Samples/WorkWithHybridCLR/Assets/Obfuz/SymbolObfus/symbol-mapping.xml deleted file mode 100644 index 02ed222..0000000 --- a/Samples/WorkWithHybridCLR/Assets/Obfuz/SymbolObfus/symbol-mapping.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/WorkWithHybridCLR/Assets/StreamingAssets/HotUpdate.dll.bytes b/Samples/WorkWithHybridCLR/Assets/StreamingAssets/HotUpdate.dll.bytes deleted file mode 100644 index 3c26a54..0000000 Binary files a/Samples/WorkWithHybridCLR/Assets/StreamingAssets/HotUpdate.dll.bytes and /dev/null differ