Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't hide strings on methods where Exclude = True and ApplyToMember = True. #216

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

PatrickHofman
Copy link
Contributor

@PatrickHofman PatrickHofman commented Jul 3, 2019

Currently method bodies which have Exclude = True on them are still obfuscated.

This pull request will exclude method bodies when Exclude = True and ApplyToMember = True.

More on the repro for the problem this fixes.

Unobfuscated class:

    internal static class SomeClass
    {
        [Obfuscation(Exclude = true, ApplyToMembers = true, Feature = "all")]
        public static void SomeMethod()
        {
            string s = "something";
        }
    }

This is now obfuscated as:

    internal static class SomeClass
    {
        [Obfuscation(Exclude = true, ApplyToMembers = true, Feature = "all")]
        public static void SomeMethod()
        {
            string s = ia.Sdhgcbf();
        }
    }

While it should preserve the strings since Exclude = True and ApplyToMembers = True.

@monty241
Copy link
Contributor

monty241 commented Jul 4, 2019

Solved my issue with stack overflow on .NET Core with small stacks due to massive creation of variables for constants in very large methods. Thx

@lextm lextm added the tentative Not likely to be considered. Should use the workaround instead. label Nov 20, 2022
@lextm
Copy link
Member

lextm commented Nov 20, 2022

Filters are usually used to control the API surface on what should be changed or remain. Hiding strings, however, does not change API surface. So, it is optional to attach a filter to string hiding. Thus, at this time no plan to accept this pull request.

@PatrickHofman
Copy link
Contributor Author

The issue at hand here is that very very large assemblies will contain so much constant strings, the number of possible fields in a class is exceeded. Accepting this pull request will significantly lower the number of fields required.

@NazimMertBilgi
Copy link

Does this topic work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tentative Not likely to be considered. Should use the workaround instead.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants