package com.tencent.mm.plugin.webview.ui.tools.jsapi;

import android.content.Intent;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ai.f;
import com.tencent.mm.ai.m;
import com.tencent.mm.kernel.g;
import com.tencent.mm.plugin.webview.model.v;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.ui.base.h;
import com.tencent.ytcommon.BuildConfig;
import java.util.HashMap;

class g$22 implements f {
    final /* synthetic */ String cgl;
    final /* synthetic */ g uHd;
    final /* synthetic */ Intent val$data;

    g$22(g gVar, Intent intent, String str) {
        this.uHd = gVar;
        this.val$data = intent;
        this.cgl = str;
    }

    public final void onSceneEnd(int i, int i2, String str, m mVar) {
        AppMethodBeat.i(9066);
        if (g.m(this.uHd) != null && g.m(this.uHd).isShowing()) {
            g.m(this.uHd).dismiss();
            g.a(this.uHd, null);
        }
        g.Rg().b(1177, this);
        if (i == 0 && i2 == 0) {
            ab.i("MicroMsg.MsgHandler", "mmOnActivityResult, MMFunc_Biz_Jsapi_Getuseropendid success");
            v vVar = (v) mVar;
            HashMap hashMap = new HashMap();
            hashMap.put("openid", vVar.ulZ);
            hashMap.put("headImgUrl", vVar.kKx);
            hashMap.put("nickName", vVar.kKw);
            ab.d("MicroMsg.MsgHandler", "opnid:%s, nick_name:%s", new Object[]{vVar.ulZ, vVar.kKw});
            g.a(this.uHd, null, BuildConfig.FLAVOR, this.cgl, (String) g.j(this.uHd).puc.get("img_url"), (String) g.j(this.uHd).puc.get("src_username"), (String) g.j(this.uHd).puc.get("src_displayname"), this.val$data == null ? null : this.val$data.getStringExtra("custom_send_text"), null);
            if (g.i(this.uHd) != null) {
                h.bQ(g.i(this.uHd), g.i(this.uHd).getResources().getString(2131297050));
            }
            g.a(this.uHd, g.j(this.uHd), "sendSingleAppMessage:ok", hashMap);
            AppMethodBeat.o(9066);
            return;
        }
        ab.e("MicroMsg.MsgHandler", "mmOnActivityResult, MMFunc_Biz_Jsapi_Getuseropendid fail");
        g.a(this.uHd, g.j(this.uHd), "sendSingleAppMessage:fail", null);
        AppMethodBeat.o(9066);
    }
}
