From 403764e7af6fad074fd19f00d87b9687dd11ac34 Mon Sep 17 00:00:00 2001 From: walon Date: Wed, 10 Sep 2025 18:20:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=AC=A6=E5=8F=B7?= =?UTF-8?q?=E6=B7=B7=E6=B7=86=E8=A7=84=E5=88=99=E6=96=87=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?modifier=E6=9D=A1=E4=BB=B6=E5=AF=B9property=E5=92=8Cevent?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E7=94=9F=E6=95=88=E7=9A=84bug=E3=80=82?= =?UTF-8?q?=E7=94=B1=E4=BA=8Eproperty=E5=92=8Cevent=E6=9C=AC=E8=BA=AB?= =?UTF-8?q?=E5=B9=B6=E4=B8=8D=E5=AD=98=E5=9C=A8Access=20Attributes?= =?UTF-8?q?=EF=BC=8C=E5=AE=9E=E9=99=85=E4=B8=8A=E6=98=AF=E7=94=B1=E5=AE=83?= =?UTF-8?q?=E4=BB=AC=E6=89=80=E5=8C=85=E5=90=AB=E7=9A=84method=E7=9A=84Acc?= =?UTF-8?q?ess=E5=B1=9E=E6=80=A7`=E6=88=96`=E8=AE=A1=E7=AE=97=E8=80=8C?= =?UTF-8?q?=E6=9D=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Policies/ConfigurableRenamePolicy.cs | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Editor/ObfusPasses/SymbolObfus/Policies/ConfigurableRenamePolicy.cs b/Editor/ObfusPasses/SymbolObfus/Policies/ConfigurableRenamePolicy.cs index 82ccc5f..029e5e7 100644 --- a/Editor/ObfusPasses/SymbolObfus/Policies/ConfigurableRenamePolicy.cs +++ b/Editor/ObfusPasses/SymbolObfus/Policies/ConfigurableRenamePolicy.cs @@ -395,12 +395,34 @@ namespace Obfuz.ObfusPasses.SymbolObfus.Policies private bool MatchModifier(ModifierType? modifierType, PropertyDef propertyDef) { - return modifierType == null || (modifierType & ComputeModifierType((FieldAttributes)propertyDef.Attributes)) != 0; + FieldAttributes access = default; + if (propertyDef.GetMethod != null) + { + access |= (FieldAttributes)propertyDef.GetMethod.Access; + } + if (propertyDef.SetMethod != null) + { + access |= (FieldAttributes)propertyDef.SetMethod.Access; + } + return modifierType == null || (modifierType & ComputeModifierType(access)) != 0; } private bool MatchModifier(ModifierType? modifierType, EventDef eventDef) { - return modifierType == null || (modifierType & ComputeModifierType((FieldAttributes)eventDef.Attributes)) != 0; + FieldAttributes access = default; + if (eventDef.AddMethod != null) + { + access |= (FieldAttributes)eventDef.AddMethod.Access; + } + if (eventDef.RemoveMethod != null) + { + access |= (FieldAttributes)eventDef.RemoveMethod.Access; + } + if (eventDef.InvokeMethod != null) + { + access |= (FieldAttributes)eventDef.InvokeMethod.Access; + } + return modifierType == null || (modifierType & ComputeModifierType(access)) != 0; } private class MethodComputeCache