Compare commits

...

3 Commits
v3.1.0 ... main

Author SHA1 Message Date
EP-Toushirou 7b06f0fed8 new: add support for 6000.3.x;
fix: fix deprecated warning of PlayerSettings.GetScriptingBackend(BuildTargetGroup) in Unity 6000
2026-02-27 12:36:49 +08:00
walon 3615bbcce9 fix: fix resolving type in Obfuz.Runtime failed when no to-obfuscated dll references to Obfuz.Runtime 2025-12-26 21:25:08 +08:00
walon 1ff3b5c324 new: 新增PS5平台支持 2025-11-24 18:40:22 +08:00
3 changed files with 27 additions and 14 deletions

View File

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

View File

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

View File

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