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

import X.AnonymousClass2OR;
import X.AnonymousClass41F;
import X.FNe;
import X.LsH;
import android.content.Context;
import android.net.Uri;
import com.bytedance.covode.number.Covode;
import com.bytedance.router.RouteIntent;
import com.bytedance.router.interceptor.IInterceptor;
import com.ss.android.ugc.aweme.global.config.settings.pojo.FeedbackConf;
import com.ss.android.ugc.aweme.global.config.settings.pojo.IESSettingsProxy;
import kotlin.h.b.n;

public final class FeedbackSubmitInterceptor implements IInterceptor {
    public static final AnonymousClass41F LIZ = new AnonymousClass41F((byte) 0);

    static {
        Covode.recordClassIndex(103819);
    }

    public final boolean matchInterceptRules(RouteIntent routeIntent) {
        String str;
        Uri uri;
        Uri uri2;
        String str2 = null;
        if (routeIntent == null || (uri2 = routeIntent.getUri()) == null) {
            str = null;
        } else {
            str = uri2.getHost();
        }
        if (n.LIZ(str, "feedback_input")) {
            return true;
        }
        if (!(routeIntent == null || (uri = routeIntent.getUri()) == null)) {
            str2 = uri.getHost();
        }
        if (n.LIZ(str2, "i18n_feedback_input")) {
            return true;
        }
        return false;
    }

    public final boolean onInterceptRoute(Context context, RouteIntent routeIntent) {
        String str;
        try {
            IESSettingsProxy iESSettingsProxy = AnonymousClass2OR.LIZ.LIZIZ;
            n.LIZIZ(iESSettingsProxy, "");
            FeedbackConf feedbackConf = iESSettingsProxy.getFeedbackConf();
            n.LIZIZ(feedbackConf, "");
            FNe LIZ2 = FNe.LIZ(feedbackConf.getFeHelp());
            if (routeIntent != null) {
                str = routeIntent.getOriginUrl();
            } else {
                str = null;
            }
            Uri parse = Uri.parse(str);
            n.LIZIZ(parse, "");
            for (String next : parse.getQueryParameterNames()) {
                LIZ2.LIZ(next, parse.getQueryParameter(next));
            }
            LsH.LIZ(LsH.LIZ(), LIZ2.LIZ.LIZ());
            return true;
        } catch (Exception unused) {
            return true;
        }
    }
}
