Closed GoogleCodeExporter closed 9 years ago
I cannot reproduce this problem...I've committed an update to the unit tests
(in r20)
that obfuscates an assembly with an attribute on a class and an attribute on a
method
within the class. In both cases, the attribute stays in place after the
obfuscation.
Can you provide some example code?
Original comment by drcfor...@gmail.com
on 15 May 2007 at 7:03
Original comment by drcfor...@gmail.com
on 15 May 2007 at 8:54
After I obfuscate my VS.NET 2005 project my (Properties.)Settings are
generating
what seems to be a Configuration Exception (SettingsPropertyNotFoundException).
I
think it is because all the code attributes are gone.
The Settings type itself as well as the property are excluded from obfuscation
using
SkipType and SkipMethod. Perhaps it is a bug that only occurs to 'skipped'
members?
Original comment by obiwanja...@hotmail.com
on 17 May 2007 at 10:54
I've created a test project that demonstrates the problem. I've put in the
obfuscar
group at
http://groups.google.com/group/obfuscar/web/ObfuscarCodeAttributeTest.zip
It is a VS.NET 2005 console project with a Settings class. There is a build
event
that obfuscates the output in the 'obfuscated' dir of either Debug or Release.
The
zip also contains the obfuscar.exe v1.0.1.0.
Good luck ;-)
Original comment by obiwanja...@hotmail.com
on 17 May 2007 at 1:51
This is now fixed in Obfuscar 1.1.0, by the addition of the SkipProperty
element.
The problem is caused by the platform reflecting into your assembly at runtime
to
retrieve the value of a property.
In your example, you used the following xml:
<Module file="$(InPath)\ObfuscarCodeAttributeTest.exe" >
<SkipType name="ObfuscarCodeAttributeTest.Properties.Settings" />
<SkipMethod type="ObfuscarCodeAttributeTest.Properties.Settings" attrib="public"
rx=".*" />
</Module>
The xml caused it to skip renaming of the Settings class and all methods within
it,
but the flags that state that the methods make up a property were being
stripped.
Now that we have a SkipProperty element, you can skip just the property:
<Module file="$(InPath)\ObfuscarCodeAttributeTest.exe">
<SkipProperty type="ObfuscarCodeAttributeTest.Properties.Settings"
name="SomeSetting" />
</Module>
Or you can skip all of the properties in your settings class as follows:
<Module file="$(InPath)\ObfuscarCodeAttributeTest.exe">
<SkipProperty type="ObfuscarCodeAttributeTest.Properties.Settings" rx=".*" />
</Module>
The SkipProperty element allows Obfuscar to rename the type, while leaving the
get_XXX / set_XXX methods alone, and leaving in place the flag that says they
make up
a property.
Original comment by drcfor...@gmail.com
on 17 May 2007 at 7:52
It works great! Thanx!
Is there an overlap in what SkipMethod and SkipProperty does? Does SkipMethod
still
affect properties?
Original comment by obiwanja...@hotmail.com
on 18 May 2007 at 6:26
There is a bit of overlap...SkipMethod can still be made to skip get_XXX/set_XXX
methods, but if SkipProperty isn't used, they will no longer be marked as being
associated with a property.
I.e., SkipProperty instructs Obfuscar not to strip the property and not to
rename the
methods, whereas SkipMethod can only instruct Obfuscar not to rename the
methods.
Original comment by drcfor...@gmail.com
on 18 May 2007 at 6:33
So will there be a conflict if I use both SkipMethod and SkipProperty both with
a '.*' expression? Or will SkipProperty take precendence over SkipMethod for
properties and SkipMethod for methods.
I saw a similar thing happening with events. Works this in the same way?
Original comment by obiwanja...@hotmail.com
on 21 May 2007 at 6:47
They shouldn't conflict, the SkipProperty / SkipEvent will take precedence over
the
SkipMethod elements (they're processed first to avoid trouble).
Original comment by drcfor...@gmail.com
on 21 May 2007 at 12:48
Original issue reported on code.google.com by
obiwanja...@hotmail.com
on 15 May 2007 at 5:22