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

Bugfixes and speedup #241

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

Bugfixes and speedup #241

wants to merge 57 commits into from

Conversation

mv3shape
Copy link
Contributor

I've been testing Obfuscar on a large project with 70+ assemblies, lots of XAML with styling and lots of generics, and in order to make the obfuscation pass without crashing and get a working application afterwards I've fixed a number of bugs. Also, the process now runs in about half the time, from ~2mins to ~1min on my app. All tests pass, including a few new ones I added.

lextm and others added 30 commits June 8, 2019 10:51
…ilyOrAssembly-property of FieldDefinition (now behaves like the method check.

- InheritMap now also generates groups for virtual methods of props (set, get) and events (add, remove).
- The group info is used to find out if any virtual method in the group belongs to a public type and therefore should be skipped. e.g. public interface implemented by internal class or vice a versa.
@CLAassistant
Copy link

CLAassistant commented Oct 17, 2019

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ christiantinauer
✅ mv3shape
✅ SorenMaagaard
❌ lextm
You have signed the CLA already but the status is still pending? Let us recheck it.

@jetersen
Copy link

FYI, I also signed the CLA as I was so kind to cleanup some of @mv3shape commit history 😅
When we forked the repo on GitHub and moved our changes to the GitHub repo 👍

@jetersen
Copy link

jetersen commented Oct 17, 2019

👋 @SorenMaagaard please remember to sign the CLA and associate your 3shape email with your github account: https://help.github.com/en/articles/adding-an-email-address-to-your-github-account

return true;
}

if (prop.Property.IsPublic() && prop.DeclaringType.ImplementsInterface("System.ComponentModel.INotifyPropertyChanged"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all public properties of a type derived from INotifyPropertyChanged are used for MVVM pattern (though I agree most of them should), so I still prefer explicit skip rules to such automatic processing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about making it an option like I did with AbortOnInconsistentState?

@lextm
Copy link
Member

lextm commented Oct 17, 2019

I think it should be split into several pull requests for me to review. Some of the changes (logging related) are trivial while others can be further discussed.

I cannot take it in the current form.

@mv3shape
Copy link
Contributor Author

mv3shape commented Oct 21, 2019

I have fixed around 20 different issues primarily related to XAML and using complex generics across multiple assemblies, but also simpler things like being able to override Equals and GetHashCode. There is more or less one fix in each commit as you can see on the commit descriptions, but changing it to 20 independent pull requests would be a lot of work as some of the fixes also build on each other.
As you point out some of the things with XAML bindings could be handled with skip rules or attributes, but this is easy to forget and hard to maintain, especially because it often requires manual testing of the obfuscated app to find such mistakes.
We are a large organization with more than 400 developers working on a large number of projects which also share a lot of code. We would like a streamlined build pipeline where the output is obfuscated but without everyone having to be obfuscation experts, Therefore we need to be able to make a fairly safe configuration where obfuscation doesn't introduce unexpected errors, perhaps at the cost of a few properties not being obfuscated even though they could have been.

@lextm
Copy link
Member

lextm commented Oct 21, 2019

Thanks. Then I might have to cherry pick the commits, instead of accepting them in this pull request. I will close this one once I finish reviewing each commits.

@mv3shape
Copy link
Contributor Author

Of course, if you think I've made a mistake let me know so that I can correct it and update the request..

@GF-Huang
Copy link

What's the progress?

@lextm
Copy link
Member

lextm commented Jun 15, 2021

@GF-Huang you can try 3sharp's fork out yourself https://github.com/3shape/obfuscar

I don't plan to accept this pull request yet, because at least it doesn't work for a few key projects of my own.

@GF-Huang
Copy link

@GF-Huang you can try 3sharp's fork out yourself https://github.com/3shape/obfuscar

I don't plan to accept this pull request yet, because at least it doesn't work for a few key projects of my own.

How about #58? Any plans?

@mv3shape
Copy link
Contributor Author

@lextm which problems do you experience with your projects?

@lextm
Copy link
Member

lextm commented Jun 15, 2021

@mv3shape They are relatively large closed source projects, so I won't be able to share much information.

@lextm lextm added tentative Not likely to be considered. Should use the workaround instead. and removed in progress labels Nov 20, 2022
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

7 participants