Skip to content

Conversation

@Fadouse
Copy link
Owner

@Fadouse Fadouse commented Oct 29, 2025

Summary

  • introduce UI-facing JvmRenamerConfig/JvmRenamerEntityConfig models and plumb them through ObfuscatorConfig and NativeObfuscator
  • emit renamer settings into generated Skidfuscator configs and enable the session renamer when configured
  • extend the Swing UI with a JVM renamer panel, input validation, and builder wiring for per-entity options

Testing

  • ./gradlew :obfuscator:test --tests by.radioegor146.JvmRenamerIntegrationTest (fails: missing org.topdank.byteio.out dependency during compilation)

https://chatgpt.com/codex/tasks/task_e_690158e8c6248332a4ad97a6d3d555d6

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +112 to +138
private void renameMethods(List<SkidClassNode> classes, Map<MethodSignature, String> methodMappings) {
EntityRenamerSettings methodSettings = settings.getMethodSettings();
if (!methodSettings.isEnabled()) {
return;
}

ExemptManager exemptManager = skidfuscator.getExemptAnalysis();

for (SkidClassNode classNode : classes) {
if (skidfuscator.getClassSource().isLibraryClass(classNode.getName()) || exemptManager.isExempt(classNode)) {
continue;
}

NameGenerator generator = new RadixNameGenerator(methodSettings.getAlphabet(), methodSettings.getMinLength());
Set<String> usedNames = new HashSet<>();

for (MethodNode method : classNode.getMethods()) {
SkidMethodNode skidMethod = method instanceof SkidMethodNode ? (SkidMethodNode) method : new SkidMethodNode(method.node, classNode, skidfuscator);
if (!shouldRenameMethod(skidMethod, exemptManager)) {
continue;
}

String newName = nextUniqueName(generator, usedNames);
methodMappings.put(new MethodSignature(classNode.getName(), skidMethod.getName(), skidMethod.node.desc), newName);
skidfuscator.getClassRemapper().add(classNode.getName() + '.' + skidMethod.getName() + skidMethod.node.desc, newName);
}
}

Choose a reason for hiding this comment

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

P1 Badge Preserve inherited method names when renaming

The current implementation renames methods per class by instantiating a fresh RadixNameGenerator and usedNames set for every SkidClassNode. Because the algorithm does not look up the mapping already applied to superclasses or interfaces, overriding methods are renamed independently. Whenever a subclass declares methods in a different order than its parent (or has extra members), the override will very likely receive a different obfuscated name than the parent implementation, breaking virtual dispatch at runtime. Consider tracking renamed signatures in a global map keyed by owner/name/descriptor and reusing the parent’s mapping before generating a new name, so overrides keep identical obfuscated names.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants