修复 ReflectionCompatibilityDetector检查Enum.ToString时的判定条件为枚举类型名被混淆的错误,应该是枚举项被混淆

1.x
walon 2025-06-13 21:31:05 +08:00
parent 3f00d5ca91
commit 174140c5da
1 changed files with 2 additions and 2 deletions

View File

@ -151,9 +151,9 @@ namespace Obfuz.ObfusPasses.SymbolObfus
if (constrainedType != null) if (constrainedType != null)
{ {
TypeDef enumTypeDef = constrainedType.ResolveTypeDef(); TypeDef enumTypeDef = constrainedType.ResolveTypeDef();
if (enumTypeDef != null && enumTypeDef.IsEnum && _renamePolicy.NeedRename(enumTypeDef)) if (enumTypeDef != null && enumTypeDef.IsEnum && enumTypeDef.Fields.Any(f => _renamePolicy.NeedRename(f)))
{ {
Debug.LogError($"[ReflectionCompatibilityDetector] Reflection compatibility issue in {_curCallingMethod}: Enum.ToString() T:{enumTypeDef.FullName} is renamed."); Debug.LogError($"[ReflectionCompatibilityDetector] Reflection compatibility issue in {_curCallingMethod}: {enumTypeDef.FullName}.ToString() the enum members are renamed.");
} }
} }
} }