Unable to get private and/or public properties renamed #546
Unanswered
ReckonCiler
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If I obfuscate the following code with 'rename' protection:
`[System.Reflection.Obfuscation(Exclude = false, Feature = "-rename", ApplyToMembers = false)]
public class MyClass // <<<<< Does not get renamed, as expected
{
public void SaveData(System.IO.BinaryWriter writer) // <<<<<< Gets renamed, as expected
{
// Some code
}
// The following do not get renamed, with or without the explicit attribute applied
[System.Reflection.Obfuscation(Exclude = false, Feature = "+rename")]
private string PrivateStringProperty { get { return "PrivateStringProperty"; } }
[System.Reflection.Obfuscation(Exclude = false, Feature = "+rename")]
public string PublicStringProperty { get { return "PublicStringProperty"; } }
[System.Reflection.Obfuscation(Exclude = false, Feature = "+rename")]
private static string PrivateStaticStringProperty { get { return "PrivateStaticStringProperty"; } }
[System.Reflection.Obfuscation(Exclude = false, Feature = "+rename")]
public static string PublicStaticStringProperty { get { return "PublicStaticStringProperty"; } }}
`
the class name itself is not renamed and the member functions are renamed, just as expected, but the properties are not, regardless of whether they are public or private or static or not.
I know about
but applying that to the entire assembly results in a non-functional executable, which is no surprise.
I suppose I could create an additional with a number of conditions based on item-signatures to make that rule apply to specific properties only and put the forceRen argument in there but this would be very error-prone (get the signature of a function wrong and it won't work).
Is there any feasible way to get ConfuserEx to apply rename protection to public and/or private properties? I don't see how it could be done through the System.Reflection.Obfuscation attribute but something like that would be nice.
Beta Was this translation helpful? Give feedback.
All reactions