Is it possible to skip renaming a Type based on what it inherits from?

58 views
Skip to first unread message

Calvin Rien

unread,
Jan 30, 2011, 1:11:07 AM1/30/11
to obfu...@googlegroups.com
Sort of an odd situation, but I would like to skip the renaming of all types that inherit from a particular class.

It would also be great if it was possible to skip the renaming of fields, properties, and methods that were inherited from that parent class.

This is for obfuscating Unity3d assemblies, because objects that inherit from MonoBehavior need to be handled differently.

Calvin Rien

unread,
Jan 30, 2011, 1:52:33 AM1/30/11
to obfu...@googlegroups.com
Looks like I've found a hacky way to do what I want.  Since classes that inherit from MonoBehavior can't be in a namespace, I just skip all types that don't have a "." in their name.

<SkipType name="^[a-zA-Z0-9_]*$" />

It would still be great to know if there are smarter ways to do this.

Thanks,
Calvin

Calvin

unread,
Oct 24, 2012, 7:50:05 PM10/24/12
to obfu...@googlegroups.com
I finally got around to forking Obfuscar 2.0.0 Beta and adding this feature.

Among other things I added a "typeinherits" tag so you can create SkipMethod, SkipField and SkipType rules based on what the declaring type inherits.

I'm using it in a tool to obfuscate Unity3D games.
Reply all
Reply to author
Forward
0 new messages