Because of this, we had to exclude those properties from Rename obfuscation to avoid a runtime error:
Rather than checking individual checkboxes for each property, I can translate this into a custom rule. Each model class with an OnPropertyChanged method must implement INotifyPropertyChanged. Based on this, I will write a rule to exclude properties (.*) of any type (.*) that implements INotifyPropertChanged:
By making this modification, we can change or expand the use of the MVVM pattern without having to update obfuscation rules. I will also apply the other obfuscation transforms, String Encryption, Control Flow, Linking, and Tamper defense, to secure that section of code.
The full MVVM example modified to use Custom Rules can be downloaded here.
The original Support Corner article “Protecting .NET applications that use the MVVM pattern” is here.
If you have any feedback on this topic or other topics you would like us to discuss in the Support Corner, please contact us.