From c5ed21b8225e2f8272ce84c79f889feb1073b4af Mon Sep 17 00:00:00 2001 From: Nolij Date: Wed, 11 Dec 2024 17:18:25 -0500 Subject: [PATCH] Exclude annotation members from aggressive overloading --- base/src/main/java/proguard/obfuscate/MemberNameCollector.java | 2 +- .../main/java/proguard/obfuscate/MemberNameConflictFixer.java | 2 +- base/src/main/java/proguard/obfuscate/MemberObfuscator.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/base/src/main/java/proguard/obfuscate/MemberNameCollector.java b/base/src/main/java/proguard/obfuscate/MemberNameCollector.java index db4518073..a9261f467 100644 --- a/base/src/main/java/proguard/obfuscate/MemberNameCollector.java +++ b/base/src/main/java/proguard/obfuscate/MemberNameCollector.java @@ -78,7 +78,7 @@ public void visitAnyMember(Clazz clazz, Member member) String descriptor = member.getDescriptor(clazz); // Check whether we're allowed to do aggressive overloading - if (!allowAggressiveOverloading) + if (!allowAggressiveOverloading || clazz.extendsOrImplements("java/lang/annotation/Annotation")) { // Trim the return argument from the descriptor if not. // Works for fields and methods alike. diff --git a/base/src/main/java/proguard/obfuscate/MemberNameConflictFixer.java b/base/src/main/java/proguard/obfuscate/MemberNameConflictFixer.java index 8956ac93d..a6d05502c 100644 --- a/base/src/main/java/proguard/obfuscate/MemberNameConflictFixer.java +++ b/base/src/main/java/proguard/obfuscate/MemberNameConflictFixer.java @@ -109,7 +109,7 @@ private void visitMember(Clazz clazz, String descriptor = member.getDescriptor(clazz); // Check whether we're allowed to overload aggressively. - if (!allowAggressiveOverloading) + if (!allowAggressiveOverloading || clazz.extendsOrImplements("java/lang/annotation/Annotation")) { // Trim the return argument from the descriptor if not. // Works for fields and methods alike. diff --git a/base/src/main/java/proguard/obfuscate/MemberObfuscator.java b/base/src/main/java/proguard/obfuscate/MemberObfuscator.java index f26cd0ad0..1bf3d1fcd 100644 --- a/base/src/main/java/proguard/obfuscate/MemberObfuscator.java +++ b/base/src/main/java/proguard/obfuscate/MemberObfuscator.java @@ -81,7 +81,7 @@ public void visitAnyMember(Clazz clazz, Member member) String descriptor = member.getDescriptor(clazz); // Check whether we're allowed to overload aggressively. - if (!allowAggressiveOverloading) + if (!allowAggressiveOverloading || clazz.extendsOrImplements("java/lang/annotation/Annotation")) { // Trim the return argument from the descriptor if not. // Works for fields and methods alike.