@@ -147,7 +147,8 @@ public void PostRename(ConfuserContext context, INameService service, Protection
147147 void AnalyzeMethod ( ConfuserContext context , INameService service , MethodDef method ) {
148148 var dpRegInstrs = new List < Tuple < bool , Instruction > > ( ) ;
149149 var routedEvtRegInstrs = new List < Instruction > ( ) ;
150- foreach ( Instruction instr in method . Body . Instructions ) {
150+ for ( int i = 0 ; i < method . Body . Instructions . Count ; i ++ ) {
151+ Instruction instr = method . Body . Instructions [ i ] ;
151152 if ( ( instr . OpCode . Code == Code . Call || instr . OpCode . Code == Code . Callvirt ) ) {
152153 var regMethod = ( IMethod ) instr . Operand ;
153154
@@ -160,6 +161,15 @@ void AnalyzeMethod(ConfuserContext context, INameService service, MethodDef meth
160161 routedEvtRegInstrs . Add ( instr ) ;
161162 }
162163 }
164+ else if ( instr . OpCode . Code == Code . Newobj ) {
165+ var methodRef = ( IMethod ) instr . Operand ;
166+
167+ if ( methodRef . DeclaringType . FullName == "System.Windows.Data.PropertyGroupDescription" &&
168+ methodRef . Name == ".ctor" && i - 1 >= 0 && method . Body . Instructions [ i - 1 ] . OpCode . Code == Code . Ldstr ) {
169+ foreach ( var property in analyzer . LookupProperty ( ( string ) method . Body . Instructions [ i - 1 ] . Operand ) )
170+ service . SetCanRename ( property , false ) ;
171+ }
172+ }
163173 else if ( instr . OpCode == OpCodes . Ldstr ) {
164174 var operand = ( ( string ) instr . Operand ) . ToUpperInvariant ( ) ;
165175 if ( operand . EndsWith ( ".BAML" ) || operand . EndsWith ( ".XAML" ) ) {
0 commit comments