Compare commits

..

No commits in common. "main" and "v3.1.0" have entirely different histories.
main ... v3.1.0

3 changed files with 14 additions and 27 deletions

View File

@ -330,7 +330,6 @@ namespace Obfuz
private void LoadAssemblies(AssemblyCache assemblyCache, List<ModuleDef> modulesToObfuscate, List<ModuleDef> allObfuscationRelativeModules) private void LoadAssemblies(AssemblyCache assemblyCache, List<ModuleDef> modulesToObfuscate, List<ModuleDef> allObfuscationRelativeModules)
{ {
assemblyCache.LoadModule("Obfuz.Runtime");
foreach (string assName in _allObfuscationRelativeAssemblyNames) foreach (string assName in _allObfuscationRelativeAssemblyNames)
{ {
ModuleDefMD mod = assemblyCache.TryLoadModule(assName); ModuleDefMD mod = assemblyCache.TryLoadModule(assName);

View File

@ -90,28 +90,23 @@ namespace Obfuz
public static List<string> BuildUnityAssemblySearchPaths(bool searchPathIncludeUnityEditorDll = false) public static List<string> BuildUnityAssemblySearchPaths(bool searchPathIncludeUnityEditorDll = false)
{ {
#if UNITY_6000_3_OR_NEWER && UNITY_EDITOR_OSX
string monoBleedingEdgePath = "Resources/Scripting/MonoBleedingEdge";
#else
string monoBleedingEdgePath = "MonoBleedingEdge";
#endif
string applicationContentsPath = EditorApplication.applicationContentsPath; string applicationContentsPath = EditorApplication.applicationContentsPath;
var searchPaths = new List<string> var searchPaths = new List<string>
{ {
#if UNITY_2021_1_OR_NEWER #if UNITY_2021_1_OR_NEWER
#if UNITY_STANDALONE_WIN || (UNITY_EDITOR_WIN && UNITY_SERVER) || UNITY_WSA || UNITY_LUMIN #if UNITY_STANDALONE_WIN || (UNITY_EDITOR_WIN && UNITY_SERVER) || UNITY_WSA || UNITY_LUMIN
$"{monoBleedingEdgePath}/lib/mono/unityaot-win32", "MonoBleedingEdge/lib/mono/unityaot-win32",
$"{monoBleedingEdgePath}/lib/mono/unityaot-win32/Facades", "MonoBleedingEdge/lib/mono/unityaot-win32/Facades",
#elif UNITY_STANDALONE_OSX || (UNITY_EDITOR_OSX && UNITY_SERVER) || UNITY_IOS || UNITY_TVOS || UNITY_VISIONOS #elif UNITY_STANDALONE_OSX || (UNITY_EDITOR_OSX && UNITY_SERVER) || UNITY_IOS || UNITY_TVOS
$"{monoBleedingEdgePath}/lib/mono/unityaot-macos", "MonoBleedingEdge/lib/mono/unityaot-macos",
$"{monoBleedingEdgePath}/lib/mono/unityaot-macos/Facades", "MonoBleedingEdge/lib/mono/unityaot-macos/Facades",
#else
$"{monoBleedingEdgePath}/lib/mono/unityaot-linux",
$"{monoBleedingEdgePath}/lib/mono/unityaot-linux/Facades",
#endif
#else #else
$"{monoBleedingEdgePath}/lib/mono/unityaot", "MonoBleedingEdge/lib/mono/unityaot-linux",
$"{monoBleedingEdgePath}/lib/mono/unityaot/Facades", "MonoBleedingEdge/lib/mono/unityaot-linux/Facades",
#endif
#else
"MonoBleedingEdge/lib/mono/unityaot",
"MonoBleedingEdge/lib/mono/unityaot/Facades",
#endif #endif
#if UNITY_STANDALONE_WIN || (UNITY_EDITOR_WIN && UNITY_SERVER) #if UNITY_STANDALONE_WIN || (UNITY_EDITOR_WIN && UNITY_SERVER)
@ -140,8 +135,6 @@ namespace Obfuz
"PlaybackEngines/WSASupport/Variations/il2cpp/Managed", "PlaybackEngines/WSASupport/Variations/il2cpp/Managed",
#elif UNITY_LUMIN #elif UNITY_LUMIN
"PlaybackEngines/LuminSupport/Variations/il2cpp/Managed", "PlaybackEngines/LuminSupport/Variations/il2cpp/Managed",
#elif UNITY_PS5
"PlaybackEngines/PS5Player/Variations/il2cpp/Managed",
#else #else
#error "Unsupported platform, please report to us" #error "Unsupported platform, please report to us"
#endif #endif

View File

@ -26,13 +26,8 @@ namespace Obfuz.Utils
{ {
public static bool IsMonoBackend() public static bool IsMonoBackend()
{ {
BuildTargetGroup buildTargetGroup = EditorUserBuildSettings.selectedBuildTargetGroup; return PlayerSettings.GetScriptingBackend(EditorUserBuildSettings.selectedBuildTargetGroup)
#if UNITY_6000_0_OR_NEWER == ScriptingImplementation.Mono2x;
var namedBuildTarget = UnityEditor.Build.NamedBuildTarget.FromBuildTargetGroup(buildTargetGroup);
return PlayerSettings.GetScriptingBackend(namedBuildTarget) == ScriptingImplementation.Mono2x;
#else
return PlayerSettings.GetScriptingBackend(buildTargetGroup) == ScriptingImplementation.Mono2x;
#endif
} }
} }
} }