From 61370fd939b108152e5b0f7d0947e398c39411ff Mon Sep 17 00:00:00 2001 From: walon Date: Tue, 29 Apr 2025 10:18:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96ProxyCall=E7=9A=84=E8=A7=84?= =?UTF-8?q?=E5=88=99=EF=BC=8C=E6=9A=82=E6=97=B6=E4=B8=8D=E5=AF=B9mscorlib?= =?UTF-8?q?=E5=8F=8AGetEnumerator=E5=87=BD=E6=95=B0=E6=B7=B7=E6=B7=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/ProxyCall/ConfigProxyCallPolicy.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Editor/ProxyCall/ConfigProxyCallPolicy.cs b/Editor/ProxyCall/ConfigProxyCallPolicy.cs index e6e9658..63317f2 100644 --- a/Editor/ProxyCall/ConfigProxyCallPolicy.cs +++ b/Editor/ProxyCall/ConfigProxyCallPolicy.cs @@ -20,11 +20,24 @@ namespace Obfuz.DynamicProxy ITypeDefOrRef declaringType = method.DeclaringType; TypeDef typeDef = declaringType.ResolveTypeDef(); // doesn't proxy call if the method is a delegate - if (typeDef != null && typeDef.IsDelegate) + if (typeDef != null) + { + // need configurable + if (typeDef.Module.IsCoreLibraryModule == true) + { + return false; + } + if (typeDef.IsDelegate) + return false; + } + // doesn't proxy call if the method is a constructor + if (method.Name == ".ctor") { return false; } - if (method.Name == ".ctor") + // special handle + // don't proxy call for List.Enumerator GetEnumerator() + if (method.Name == "GetEnumerator") { return false; }