package com.tencent.mm.app.plugin;

import android.content.Intent;
import android.os.Bundle;
import com.google.android.gms.common.util.CrashUtils.ErrorDialogData;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.app.plugin.URISpanHandlerSet.BaseUriSpanHandler;
import com.tencent.mm.app.plugin.URISpanHandlerSet.a;
import com.tencent.mm.bp.d;
import com.tencent.mm.model.aw;
import com.tencent.mm.model.c;
import com.tencent.mm.pluginsdk.ui.applet.m;
import com.tencent.mm.pluginsdk.ui.e.g;
import com.tencent.mm.pluginsdk.v;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.storage.ad;
import com.tencent.mm.ui.contact.e;
import com.tencent.ytcommon.BuildConfig;

@a
class URISpanHandlerSet$ProfileUriSpanHandler extends BaseUriSpanHandler {
    final /* synthetic */ URISpanHandlerSet cgy;

    URISpanHandlerSet$ProfileUriSpanHandler(URISpanHandlerSet uRISpanHandlerSet) {
        this.cgy = uRISpanHandlerSet;
        super(uRISpanHandlerSet);
    }

    /* Access modifiers changed, original: final */
    public final m dr(String str) {
        AppMethodBeat.i(15686);
        if (str.trim().startsWith("weixin://contacts/profile/")) {
            m mVar = new m(str, 3, str.trim().replace("weixin://contacts/profile/", BuildConfig.FLAVOR).replace("/", BuildConfig.FLAVOR));
            AppMethodBeat.o(15686);
            return mVar;
        }
        AppMethodBeat.o(15686);
        return null;
    }

    /* Access modifiers changed, original: final */
    public final int[] Cm() {
        return new int[]{3};
    }

    /* Access modifiers changed, original: final */
    public final boolean a(String str, boolean z, v vVar, Bundle bundle) {
        AppMethodBeat.i(15688);
        if (str.startsWith("weixin://contacts/profile/")) {
            String replace = str.trim().replace("weixin://contacts/profile/", BuildConfig.FLAVOR).replace("/", BuildConfig.FLAVOR);
            if (bo.isNullOrNil(replace)) {
                ab.e("MicroMsg.URISpanHandlerSet", "jumpToActivity fail, user is null");
                AppMethodBeat.o(15688);
                return true;
            }
            Intent intent = new Intent();
            intent.addFlags(ErrorDialogData.BINDER_CRASH);
            intent.putExtra("Contact_User", replace);
            aw.ZK();
            ad aoO = c.XM().aoO(replace);
            if (aoO != null && ((int) aoO.ewQ) > 0 && com.tencent.mm.n.a.jh(aoO.field_type)) {
                e.a(intent, replace);
            }
            d.b(URISpanHandlerSet.a(this.cgy), "profile", ".ui.ContactInfoUI", intent);
            AppMethodBeat.o(15688);
            return true;
        }
        AppMethodBeat.o(15688);
        return false;
    }

    /* Access modifiers changed, original: final */
    public final boolean a(m mVar, g gVar) {
        AppMethodBeat.i(15687);
        if (mVar.type == 3) {
            if (gVar != null) {
                gVar.a(mVar);
            }
            String str = (String) mVar.au(String.class);
            Intent intent = new Intent();
            intent.addFlags(ErrorDialogData.BINDER_CRASH);
            intent.putExtra("Contact_User", str);
            aw.ZK();
            ad aoO = c.XM().aoO(str);
            if (aoO != null && ((int) aoO.ewQ) > 0 && com.tencent.mm.n.a.jh(aoO.field_type)) {
                e.a(intent, str);
            }
            if (bo.nullAsNil(str).length() > 0) {
                d.b(URISpanHandlerSet.a(this.cgy), "profile", ".ui.ContactInfoUI", intent);
            }
            if (gVar != null) {
                gVar.b(mVar);
            }
            AppMethodBeat.o(15687);
            return true;
        }
        AppMethodBeat.o(15687);
        return false;
    }
}
