package com.ss.android.ugc.aweme.router;

import X.FL1;
import android.app.Activity;
import android.content.Context;
import com.bytedance.covode.number.Covode;
import com.bytedance.router.RouteIntent;
import com.bytedance.router.interceptor.IInterceptor;
import com.ss.android.ugc.aweme.commercialize.im.OpenChatExt;

public final class OpenChatExtInterceptor implements IInterceptor {
    public static final FL1 LIZ = new FL1((byte) 0);

    static {
        Covode.recordClassIndex(103826);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:11:0x0023, code lost:
        if (r4 != null) goto L_0x000d;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final boolean matchInterceptRules(com.bytedance.router.RouteIntent r4) {
        /*
            r3 = this;
            r2 = 0
            if (r4 == 0) goto L_0x0022
            android.net.Uri r0 = r4.getUri()
            if (r0 == 0) goto L_0x0022
            java.lang.String r1 = r0.getHost()
        L_0x000d:
            android.net.Uri r0 = r4.getUri()
            if (r0 == 0) goto L_0x0017
            java.lang.String r2 = r0.getPath()
        L_0x0017:
            java.lang.String r1 = kotlin.h.b.n.LIZ(r1, r2)
            java.lang.String r0 = "chatting/message"
            boolean r0 = kotlin.h.b.n.LIZ(r0, r1)
            return r0
        L_0x0022:
            r1 = r2
            if (r4 == 0) goto L_0x0017
            goto L_0x000d
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.router.OpenChatExtInterceptor.matchInterceptRules(com.bytedance.router.RouteIntent):boolean");
    }

    public final boolean onInterceptRoute(Context context, RouteIntent routeIntent) {
        String str;
        String str2 = null;
        if (context instanceof Activity) {
            OpenChatExt openChatExt = OpenChatExt.LIZ;
            Activity activity = (Activity) context;
            if (routeIntent != null) {
                str2 = routeIntent.getUrl();
            }
            openChatExt.LIZ(activity, str2);
            return true;
        }
        OpenChatExt openChatExt2 = OpenChatExt.LIZ;
        if (routeIntent != null) {
            str = routeIntent.getUrl();
        } else {
            str = null;
        }
        openChatExt2.LIZ((Activity) null, str);
        return true;
    }
}
