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

Obfuscator with "$" #986

Open
Midaco-YT opened this issue Nov 25, 2023 · 3 comments
Open

Obfuscator with "$" #986

Midaco-YT opened this issue Nov 25, 2023 · 3 comments

Comments

@Midaco-YT
Copy link

Midaco-YT commented Nov 25, 2023

hello I had a question. is there an obfuscator who obfuscates with "$" if yes how to remove them? and replace some argument to Object

like this

@OverRide

public boolean equals(final Object o) {
    if (o == this) {
        return true;
    }
    if (!(o instanceof Pair)) {
        return false;
    }
    final Pair<?> other = (Pair<?>)o;
    if (!other.canEqual(this)) {
        return false;
    }
    final Object this$left = this.getLeft();
    final Object other$left = other.getLeft();
    Label_0065: {
        if (this$left == null) {
            if (other$left == null) {
                break Label_0065;
            }
        }
        else if (this$left.equals(other$left)) {
            break Label_0065;
        }
        return false;
    }
    final Object this$right = this.getRight();
    final Object other$right = other.getRight();
    if (this$right == null) {
        if (other$right == null) {
            return true;
        }
    }
    else if (this$right.equals(other$right)) {
        return true;
    }
    return false;
}
@Janmm14
Copy link
Contributor

Janmm14 commented Nov 25, 2023

That is no obfuscation. This is just a local variable named with a $ sign.
Such code might be automatically generated by project-lombok or other tools.

Obfuscators would not leave meaningful names like "left", "right", "this" or "other" inside local variable names. They would either remove all local variable name information or fill it with garbage.

@Midaco-YT
Copy link
Author

How can I put them back the way they were? and the same for "Object" it’s not normally object but something else

@Janmm14
Copy link
Contributor

Janmm14 commented Nov 25, 2023

This is only possible to handle manually.
Or try to use another decompiler or tell the decompiler to not use existing local variable info (might backfire in other places).

The reason that there is "Object" is very likely due to generic erasure if that equals method was not originally created by an automatictool like lombok.
Generic types are a source code / compilation construct and afaik optional generic extra information cannot be safed in class files for local variables.

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

No branches or pull requests

2 participants