pxb1988 / dex2jar

Tools to work with android .dex and java .class files
Apache License 2.0
12.06k stars 2.09k forks source link

dex2jar关于lambda生成问题 #532

Closed cooljiatao closed 2 years ago

cooljiatao commented 2 years ago

您好,非常感谢您的工作!

我在使用dex2jar.bat的时候遇到一个问题,希望能得到您的回复:

环境: dex2jar:dex-tools-2.1与dex-tools-2.2-SNAPSHOT-2021-10-31 jadx:1.3.2

下面的代码是dex2jar.bat生成的,里面生成了 import okhttp3.-$-$.Lambda.Authenticator.xBBU2iHkJpDKH0vhaB2vteUyEoc INSTANCE,但是它们并不存在。

package okhttp3;
import okhttp3.-$;
/* loaded from: GENERATE_JAR_M.jar:okhttp3/_$$Lambda$Authenticator$xBBU2iHkJpDKH0vhaB2vteUyEoc.class */
public final /* synthetic */ class _$$Lambda$Authenticator$xBBU2iHkJpDKH0vhaB2vteUyEoc implements Authenticator {
    public static final /* synthetic */ -$.Lambda.Authenticator.xBBU2iHkJpDKH0vhaB2vteUyEoc INSTANCE = new _$$Lambda$Authenticator$xBBU2iHkJpDKH0vhaB2vteUyEoc();
    private /* synthetic */ _$$Lambda$Authenticator$xBBU2iHkJpDKH0vhaB2vteUyEoc() {
    }
    @Override // okhttp3.Authenticator
    public final Request authenticate(Route route, Response response) {
        return Authenticator.lambda$static$0(route, response);
    }
}

下面的代码是直接反编译dex的结果,这是正常的。

package okhttp3;

/* compiled from: lambda */
/* renamed from: okhttp3.-$$Lambda$Authenticator$xBBU2iHkJpDKH0vhaB2vteUyEoc  reason: invalid class name */
public final /* synthetic */ class $$Lambda$Authenticator$xBBU2iHkJpDKH0vhaB2vteUyEoc implements Authenticator {
    public static final /* synthetic */ $$Lambda$Authenticator$xBBU2iHkJpDKH0vhaB2vteUyEoc INSTANCE = new $$Lambda$Authenticator$xBBU2iHkJpDKH0vhaB2vteUyEoc();

    private /* synthetic */ $$Lambda$Authenticator$xBBU2iHkJpDKH0vhaB2vteUyEoc() {
    }

    @Override // okhttp3.Authenticator
    public final Request authenticate(Route route, Response response) {
        return Authenticator.lambda$static$0(route, response);
    }
}

我现在遇到这样的问题,但是我处理不了! 希望您告诉我为什么会出现这样的结果,并如何避免,万分感谢,期待您的回复!

richardwrq commented 1 year ago

我也碰到了这个问题,请问是怎么解决的呢?