Regex exclude class from confusing?

Jun 3, 2013 at 6:17 PM
I have many classes/namespaces, and I want to obfuscate all but one. I was wondering what would be the easiest way to achieve it? I tried couple regex patterns, but nothing seems to work as I want it. I am using the latest build - "confuser-79440". So here's an example

Namespace.Test.Foo
Namespace.Test.Foo1
Namespace.Test.Foo2
Namespace.Test.Foo3
Namespace.Test.Foo4
Namespace.Test.Bar.ClassName

I want to obfuscate all namespaces except Namespace.Test.Bar.ClassName or even Namespace.Test.Bar would be sufficient, how would I go about doing that? The old versions where I could simply check/uncheck the namespaces/classes/methods etc were much easier and faster, regex is killing my brain. Thanks for the awesome work.
Coordinator
Jul 15, 2013 at 5:54 AM
Hi,
In this case, you have to use 2 rules, first one for '*' with your desired obfuscation, second one for 'Namespace.Test.Bar.ClassName' with no obfuscation selected and uncheck Inherit. This way it will override the first rule and apply the second rule which applies no obfuscation.
Feb 15, 2014 at 12:20 AM
Edited Feb 15, 2014 at 12:23 AM
I just downloaded the latest beta version. I tried to add the following

Rule #1
Image
Rule #2
Image
Result:
Image

If rule #2 overrides rule #1, does this mean that the that it shouldn't do the Obfuscating because rule #2 said "None" even though rule #1 said "Aggressive". The result should be "None", but somehow I see codes got obfuscated.

I also try to ignore a namespace. For example.
Namespace.Namespace2.Namespac3.* (Select None) (Checkbox "Inherit") ... Basically I want to ignore all classes in this namespace, it's seem like it's not working correctly.

Am I doing something wrong? Or I'm not configuring something correctly?

thanks,
Mike
Coordinator
Mar 14, 2014 at 5:16 AM
I'm not good at explaining, so I'll use an example.
You want to obfuscate all classes using 'Normal' Preset, but excluding all classes in 'ABC' namespace from obfuscation (i.e. using 'None' preset), then,
Rule 1: .* Normal Preset
Rule 2: ABC..* None Preset (Inherit not selected)
For normal classes, only first pattern would match it. For classes in ABC namespace, first normal preset would be applied by rule 1, then it would be cleared and none preset would be applied. If Inherit is not selected, the settings would be cleared before applying the rule.