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

[core] JADX fails to write methods with samey signature when there are multiple of them #1560

Closed
Dragas opened this issue Jun 25, 2022 · 1 comment
Labels
bug Core Issues in jadx-core module

Comments

@Dragas
Copy link

Dragas commented Jun 25, 2022

Sadly, this issue does not fall under regular decompilation error template, as it does not produce an exception or an error.

In the APK that I'm analyzing, I found that xshield sometimes likes to generate methods with following signature:

.method private static synthetic IIIIIiiIIi(II)Ljava/lang/String;
....
.end method
.method private static synthetic IIIIIiiIIi(II)I
....
.end method

As per smali specification, this is fine, as when you call a method (via invoke- instructions), you specify the full signature, including the return type of the method that you're trying to invoke.

Meanwhile, the java decompiled counterpart does not contain these methods, as they violate the language specification, where you cannot have multiple methods with same calling signature, as a result, the decompiled methods would result in invalid java code:

private static String IIIIIiiIIi(int p0, int p1) { ... }
private static int IIIIIiiIIi(int p0, int p1) { ... }

Is there an option to automatically rename methods (much like the deobfuscation feature) when their equivalent signature in java would clash with another method's signature?

The content of these methods is not really important, as it's an overly obfuscated call to another decoding method.

The following is extracted smali file from the application scratch_6.txt

@Dragas Dragas added bug Core Issues in jadx-core module labels Jun 25, 2022
@skylot
Copy link
Owner

skylot commented Jun 29, 2022

@Dragas look like it was a bug in check for removing synthetic bridge method, so both methods were removed.
I commit a fix, so now one of these methods got renamed. Please check latest unstable build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core Issues in jadx-core module
Projects
None yet
Development

No branches or pull requests

2 participants