From 31a5c7b06489751145477f4c5f5feda9cb380673 Mon Sep 17 00:00:00 2001 From: augiem Date: Mon, 21 Mar 2016 16:09:20 -0700 Subject: [PATCH 1/2] Fix Properties and Events declared as internal failing rename Analyze method for Property and Event did not check if the event was public before setting CanRename = false. --- Confuser.Renamer/AnalyzePhase.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Confuser.Renamer/AnalyzePhase.cs b/Confuser.Renamer/AnalyzePhase.cs index 2207167c7..311af917a 100644 --- a/Confuser.Renamer/AnalyzePhase.cs +++ b/Confuser.Renamer/AnalyzePhase.cs @@ -204,7 +204,8 @@ void Analyze(NameService service, ConfuserContext context, ProtectionParameters } void Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, PropertyDef property) { - if (IsVisibleOutside(context, parameters, property.DeclaringType) && + if (IsVisibleOutside(context, parameters, property.DeclaringType && + property.IsPublic() && IsVisibleOutside(context, parameters, property)) service.SetCanRename(property, false); @@ -223,6 +224,7 @@ void Analyze(NameService service, ConfuserContext context, ProtectionParameters void Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, EventDef evt) { if (IsVisibleOutside(context, parameters, evt.DeclaringType) && + evt.IsPublic() && IsVisibleOutside(context, parameters, evt)) service.SetCanRename(evt, false); @@ -230,4 +232,4 @@ void Analyze(NameService service, ConfuserContext context, ProtectionParameters service.SetCanRename(evt, false); } } -} \ No newline at end of file +} From da35a080f36908c9281b04a2e6262a2087b0b92a Mon Sep 17 00:00:00 2001 From: augiem Date: Mon, 21 Mar 2016 18:12:09 -0700 Subject: [PATCH 2/2] Update AnalyzePhase.cs --- Confuser.Renamer/AnalyzePhase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Confuser.Renamer/AnalyzePhase.cs b/Confuser.Renamer/AnalyzePhase.cs index 311af917a..d0e2697f0 100644 --- a/Confuser.Renamer/AnalyzePhase.cs +++ b/Confuser.Renamer/AnalyzePhase.cs @@ -204,7 +204,7 @@ void Analyze(NameService service, ConfuserContext context, ProtectionParameters } void Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, PropertyDef property) { - if (IsVisibleOutside(context, parameters, property.DeclaringType && + if (IsVisibleOutside(context, parameters, property.DeclaringType) && property.IsPublic() && IsVisibleOutside(context, parameters, property)) service.SetCanRename(property, false);