package com.tencent.mm.plugin.webview.luggage.jsapi;

import com.tencent.luggage.d.a.a;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ai.b;
import com.tencent.mm.ipcinvoker.wx_extension.b$a;
import com.tencent.mm.protocal.protobuf.avv;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.ytcommon.BuildConfig;

class c$2 implements b$a {
    final /* synthetic */ int hmP;
    final /* synthetic */ a mUf;
    final /* synthetic */ c ujR;

    c$2(c cVar, a aVar, int i) {
        this.ujR = cVar;
        this.mUf = aVar;
        this.hmP = i;
    }

    public final void a(int i, int i2, String str, b bVar) {
        AppMethodBeat.i(6280);
        ab.i("MicroMsg.JsApiAuthorize", "onSceneEnd errType = %d, errCode = %d ,errMsg = %s", new Object[]{Integer.valueOf(i), Integer.valueOf(i2), str});
        if (i != 0 || i2 != 0) {
            this.mUf.a("fail", null);
            AppMethodBeat.o(6280);
        } else if (this.hmP == 2) {
            ab.d("MicroMsg.JsApiAuthorize", "press reject button");
            this.mUf.a("fail", null);
            AppMethodBeat.o(6280);
        } else {
            avv avv = (avv) bVar.fsH.fsP;
            if (avv == null || avv.wzH == null) {
                this.mUf.a("fail", null);
                AppMethodBeat.o(6280);
                return;
            }
            int i3 = avv.wzH.cyE;
            String str2 = avv.wzH.cyF;
            ab.i("MicroMsg.JsApiAuthorize", "jsErrcode = %d", new Object[]{Integer.valueOf(i3)});
            if (i3 == 0) {
                this.mUf.a(BuildConfig.FLAVOR, null);
                AppMethodBeat.o(6280);
                return;
            }
            ab.e("MicroMsg.JsApiAuthorize", "ERROR = %s", new Object[]{str2});
            this.mUf.a("fail", null);
            AppMethodBeat.o(6280);
        }
    }
}
