-
Notifications
You must be signed in to change notification settings - Fork 372
Open
Labels
Milestone
Description
Versions:
- jOOR: for Java 8+
- Java: 8
Reflection is actually helpful most of the time, even with obfuscation, but there is a problem while working against obfuscation. Some obfuscators make member names duplicate so we can't directly access it just by giving the name and maybe arguments.
As an example, this is allowed at both compile time and runtime:
public void foo(String str) {
System.out.println(str);
}
public void foo() {
System.out.println("Legit");
}
public void random() {
this.foo();
this.foo("Legit");
}
This example is not allowed at compile time but allowed at runtime:
public int duplicate() {
return 0;
}
public String duplicate() {
return "Duplicate";
}
public void random() {
int i = this.duplicate(); //INVOKEVIRTUAL randomPackage/randomClass.duplicate()I
String str = this.duplicate(); //INVOKEVIRTUAL randomPackage/randomClass.duplicate()Ljava/lang/String;
}
There should be some additional methods that considers return types to fully recognize method signatures (name
and description
) to solve this problem.
By the way I am not talking about runtime compilation, this issue is about calling duplicate methods