Skip to content

TTS-2142 Fix method grouping - #29

Merged
andriipokrovskyi merged 4 commits into
ThreeShape.Obfuscarfrom
features/TTS-2142-obfuscation
Jun 16, 2026
Merged

TTS-2142 Fix method grouping#29
andriipokrovskyi merged 4 commits into
ThreeShape.Obfuscarfrom
features/TTS-2142-obfuscation

Conversation

@andriipokrovskyi

Copy link
Copy Markdown

Old method grouping strategy created a lot of unnecessary groups and failed to merge them properly, resulting in related methods having different names.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes method-grouping behavior in Obfuscar’s inheritance map so that related/overriding methods are more reliably merged into a single group, preventing inconsistent renames across a hierarchy.

Changes:

  • Removes the post-pass “merge overlapping method groups” step in InheritMap and instead builds/merges method groups incrementally while scanning nodes.
  • Updates GraphNode.FillMethodGroup to operate on a shared IDictionary<MethodKey, MethodGroup> and merge groups on contact (including re-pointing keys when merging).
  • Minor refactors in GraphNode (spelling fix scanedscanned, readonly fields, visibility tweak to internal).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Obfuscar/InheritMap.cs Switches method grouping to rely on GraphNode.FillMethodGroup writing directly into methodGroups, eliminating the separate merge pass.
Obfuscar/GraphNode.cs Reworks method grouping to use a shared dictionary and perform merging during traversal; includes small refactors/cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andriipokrovskyi
andriipokrovskyi merged commit 23c9a79 into ThreeShape.Obfuscar Jun 16, 2026
1 of 2 checks passed
@andriipokrovskyi
andriipokrovskyi deleted the features/TTS-2142-obfuscation branch June 16, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants