package com.tencent.mm.app.plugin;

import android.app.Service;
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.model.aw;
import com.tencent.mm.model.c;
import com.tencent.mm.model.t;
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.storage.ad;
import com.tencent.mm.ui.chatting.ChattingUI;

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

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

    /* Access modifiers changed, original: final */
    public final m dr(String str) {
        return null;
    }

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

    /* Access modifiers changed, original: final */
    public final boolean a(m mVar, g gVar) {
        return false;
    }

    /* Access modifiers changed, original: final */
    public final boolean a(String str, boolean z, v vVar, Bundle bundle) {
        AppMethodBeat.i(15654);
        if (str.startsWith("weixin://jump/mainframe/")) {
            int lastIndexOf = str.trim().lastIndexOf("/");
            if (lastIndexOf >= 0 && lastIndexOf < str.trim().length() - 1) {
                String substring = str.trim().substring(lastIndexOf + 1);
                if (t.kH(substring)) {
                    aw.ZK();
                    ad aoO = c.XM().aoO(substring);
                    if (aoO == null || ((int) aoO.ewQ) == 0) {
                        aoO = new ad();
                        aoO.setUsername(substring);
                        aw.ZK();
                        c.XM().Z(aoO);
                    }
                }
                Intent putExtra = new Intent(URISpanHandlerSet.a(this.cgy), ChattingUI.class).putExtra("Chat_User", substring).putExtra("Chat_Mode", 1);
                if (URISpanHandlerSet.a(this.cgy) instanceof Service) {
                    putExtra.addFlags(ErrorDialogData.BINDER_CRASH);
                }
                URISpanHandlerSet.a(this.cgy).startActivity(putExtra);
                AppMethodBeat.o(15654);
                return true;
            }
        }
        AppMethodBeat.o(15654);
        return false;
    }
}
