From 32d1aac9ba62195a54ed71b1985b1559c7ee4aa6 Mon Sep 17 00:00:00 2001 From: walon Date: Fri, 23 May 2025 10:18:37 +0800 Subject: [PATCH] =?UTF-8?q?change:=20ObfuscatorBuilder::BuildUnityAssembly?= =?UTF-8?q?SearchPaths=20=E4=B8=BA=E5=90=84=E4=B8=AA=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9=E5=BA=94=E7=9A=84PlaybackEngine?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=EF=BC=8C=E8=A7=A3=E5=86=B3=E6=9E=84=E5=BB=BA?= =?UTF-8?q?webgl=E4=B9=8B=E7=B1=BB=E5=B9=B3=E5=8F=B0=E6=97=B6=E6=89=BE?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E4=B8=80=E4=BA=9B=E7=89=B9=E5=AE=9Adll?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Editor/ObfuscatorBuilder.cs | 50 ++++++++++++++++--- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/com.code-philosophy.obfuz/Editor/ObfuscatorBuilder.cs b/com.code-philosophy.obfuz/Editor/ObfuscatorBuilder.cs index eb20bd6..e5f2c19 100644 --- a/com.code-philosophy.obfuz/Editor/ObfuscatorBuilder.cs +++ b/com.code-philosophy.obfuz/Editor/ObfuscatorBuilder.cs @@ -166,19 +166,53 @@ namespace Obfuz public static List BuildUnityAssemblySearchPaths() { string applicationContentsPath = EditorApplication.applicationContentsPath; - return new List + var searchPaths = new List { #if UNITY_2021_1_OR_NEWER - Path.Combine(applicationContentsPath, "UnityReferenceAssemblies/unity-4.8-api/Facades"), - Path.Combine(applicationContentsPath, "UnityReferenceAssemblies/unity-4.8-api"), -#elif UNITY_2020 || UNITY_2019 - Path.Combine(applicationContentsPath, "MonoBleedingEdge/lib/mono/4.7.1-api/Facades"), - Path.Combine(applicationContentsPath, "MonoBleedingEdge/lib/mono/4.7.1-api"), +#if UNITY_STANDALONE_WIN || (UNITY_EDITOR_WIN && UNITY_SERVER) || UNITY_WSA || UNITY_LUMIN + "MonoBleedingEdge/lib/mono/unityaot-win32", + "MonoBleedingEdge/lib/mono/unityaot-win32/Facades", +#elif UNITY_STANDALONE_OSX || (UNITY_EDITOR_OSX && UNITY_SERVER) || UNITY_IOS || UNITY_TVOS + "MonoBleedingEdge/lib/mono/unityaot-macos", + "MonoBleedingEdge/lib/mono/unityaot-macos/Facades", #else -#error "Unsupported Unity version" + "MonoBleedingEdge/lib/mono/unityaot-linux", + "MonoBleedingEdge/lib/mono/unityaot-linux/Facades", #endif - Path.Combine(applicationContentsPath, "Managed/UnityEngine"), +#else + "MonoBleedingEdge/lib/mono/unityaot", + "MonoBleedingEdge/lib/mono/unityaot/Facades", +#endif + +#if UNITY_STANDALONE_WIN || (UNITY_EDITOR_WIN && UNITY_SERVER) + "PlaybackEngines\\windowsstandalonesupport\\Variations\\il2cpp\\Managed", +#elif UNITY_STANDALONE_OSX || (UNITY_EDITOR_OSX && UNITY_SERVER) + "PlaybackEngines\\MacStandaloneSupport\\Variations\\il2cpp\\Managed", +#elif UNITY_STANDALONE_LINUX || (UNITY_EDITOR_LINUX && UNITY_SERVER) + "PlaybackEngines\\LinuxStandaloneSupport\\Variations\\il2cpp\\Managed", +#elif UNITY_ANDROID + "PlaybackEngines\\AndroidPlayer\\Variations\\il2cpp\\Managed", +#elif UNITY_IOS + "PlaybackEngines\\iOSSupport\\Variations\\il2cpp\\Managed", +#elif UNITY_WEBGL + "PlaybackEngines\\WebGLSupport\\Variations\\il2cpp\\Managed", +#elif UNITY_MINIGAME || UNITY_WEIXINMINIGAME + "PlaybackEngines\\WeixinMiniGameSupport\\Variations\\il2cpp\\Managed", +#elif UNITY_OPENHARMONY + "PlaybackEngines\\OpenHarmonyPlayer\\Variations\\il2cpp\\Managed", +#elif UNITY_TVOS + "PlaybackEngines\AppleTVSupport\\Variations\\il2cpp\\Managed", +#elif UNITY_WSA + "PlaybackEngines\\WSASupport\\Variations\\il2cpp\\Managed", +#elif UNITY_LUMIN + "PlaybackEngines\\LuminSupport\\Variations\\il2cpp\\Managed", +#else +#error "Unsupported platform, please report to us" +#endif + + "Managed/UnityEngine", }; + return searchPaths.Select(path => Path.Combine(applicationContentsPath, path)).ToList(); } public static ObfuscatorBuilder FromObfuzSettings(ObfuzSettings settings, BuildTarget target, bool searchPathIncludeUnityEditorInstallLocation)