skylot / jadx

Dex to Java decompiler
Apache License 2.0
41.67k stars 4.88k forks source link

[core] Field reference is not deobfuscated #1011

Open bagipro opened 4 years ago

bagipro commented 4 years ago

Class com.mobile.activity.UnlockCardEnteringScreen

    static {
        try {
            if (!com.appdynamics.eumagent.runtime.BuildInfo.appdynamicsGeneratedBuildId_150e99d9-5bfa-481a-af06-7af0cf2b04cc) {
                com.appdynamics.eumagent.runtime.BuildInfo.appdynamicsGeneratedBuildId_150e99d9-5bfa-481a-af06-7af0cf2b04cc = true;
            }
        } catch (java.lang.Throwable unused) {
        }
    }

However in declaration the field is deobfuscated

    public static /* synthetic */ boolean f1260appdynamicsGeneratedBuildId_1a4ec0989a134558b17846316faa3f74 = false;
    public static final /* synthetic */ java.lang.String applicationBuildId = "1a4ec098-9a13-4558-b178-46316faa3f74";

APK: https://drive.google.com/file/d/1qfhikcko6C8PGtveVwmle6Lugk6QUXIX/view?usp=sharing

skylot commented 3 years ago

@bagipro fields names are different here, so the field used in code does not exist. jadx don't rename it because now only resolved fields (declared in classes) are scanned. And I am not sure how to fix this, options are:

So no option can restore code to compilable and semantically equal :cry:

bagipro commented 3 years ago

Hey @skylot! I didn't notice that their names are different. I think that renaming the field is better than doing nothing, because in this case it will be syntactically correct