TikTok.apk(点击下载) / C26339AWi.java


package X;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.crossplatform.activity.CrossPlatformActivity;
import com.ss.android.ugc.aweme.discover.model.SearchIntermediateViewModel;
import com.ss.android.ugc.aweme.search.feedback.FeedbackHelper$startObserver$1;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import kotlin.g.b.m;

/* renamed from: X.AWi  reason: case insensitive filesystem */
public final class C26339AWi {
    public static Integer LIZ;
    public static boolean LIZIZ;
    public static final C26339AWi LIZJ = new C26339AWi();

    static {
        Covode.recordClassIndex(92558);
    }

    private final Map<String, String> LIZ(Map<String, String> map) {
        if (map == null || !(!map.isEmpty()) || map == null) {
            return null;
        }
        if (!m.LIZ((Object) map.get("search_type"), (Object) EnumC18900p5.HASHTAG.getTabName())) {
            return map;
        }
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        for (Map.Entry<String, String> entry : map.entrySet()) {
            linkedHashMap.put(entry.getKey(), m.LIZ(entry.getKey(), "search_type") ? C26340AWj.LIZ.LIZ(entry.getValue()) : entry.getValue());
        }
        return linkedHashMap;
    }

    public static void LIZ(ActivityC31021Kp r0, Intent intent) {
        C21280sv.LIZ(intent, r0);
        r0.startActivity(intent);
    }

    public static C03260Bv LIZIZ(ActivityC31021Kp r2) {
        C03260Bv LIZ2 = C03270Bw.LIZ(r2, (AbstractC03240Bt) null);
        if (C09030Ya.LIZ) {
            C03210Bq.LIZ(LIZ2, r2);
        }
        return LIZ2;
    }

    public final void LIZ(ActivityC31021Kp r2) {
        C20630rs.LIZ(r2, new FeedbackHelper$startObserver$1(r2));
    }

    public final boolean LIZ(Context context, String str, boolean z, Map<String, String> map, String str2) {
        C178086zF LIZ2;
        Uri uri = null;
        if (!(context instanceof ActivityC31021Kp)) {
            context = null;
        }
        ActivityC31021Kp r10 = (ActivityC31021Kp) context;
        if (r10 == null) {
            return false;
        }
        AbstractC03220Br LIZ3 = LIZIZ(r10).LIZ(SearchIntermediateViewModel.class);
        m.LIZIZ(LIZ3, "");
        Integer value = ((SearchIntermediateViewModel) LIZ3).getSearchTabIndex().getValue();
        if (value == null) {
            value = -1;
        }
        m.LIZIZ(value, "");
        int intValue = value.intValue();
        if ((str == null && ((LIZ2 = C178076zE.LIZ(C52698Kmd.LIZ(intValue))) == null || (str = LIZ2.getSchema()) == null || str.length() <= 0)) || str == null) {
            if (z) {
                str = "https://www.tiktok.com/web-inapp/search-feedback?hide_nav_bar=1";
            }
            return false;
        }
        if (!(str == null || str.length() == 0)) {
            LIZ = m.LIZ(str2, "survey") ? 1 : 0;
            Map<String, String> LIZ4 = LIZ(map);
            C51780KUv LIZIZ2 = AnonymousClass1NW.Companion.LIZIZ(r10);
            if (LIZ4 == null) {
                C23760wv[] r4 = new C23760wv[5];
                r4[0] = C23820x1.LIZ("search_id", LIZIZ2 != null ? LIZIZ2.getSearchId() : null);
                r4[1] = C23820x1.LIZ("search_type", C26340AWj.LIZ.LIZ(intValue));
                r4[2] = C23820x1.LIZ("search_keyword", LIZIZ2 != null ? LIZIZ2.getSearchKeyword() : null);
                r4[3] = C23820x1.LIZ("enter_from", C52698Kmd.LIZ(r10));
                r4[4] = C23820x1.LIZ("from_source", str2);
                LIZ4 = AnonymousClass1YE.LIZIZ(r4);
            }
            Intent intent = new Intent(r10, CrossPlatformActivity.class);
            Uri parse = Uri.parse(str);
            if (parse != null) {
                Set<String> queryParameterNames = parse.getQueryParameterNames();
                Uri.Builder buildUpon = parse.buildUpon();
                if (buildUpon != null) {
                    for (Map.Entry<String, String> entry : LIZ4.entrySet()) {
                        if (!queryParameterNames.contains(entry.getKey())) {
                            buildUpon.appendQueryParameter(entry.getKey(), entry.getValue());
                        }
                    }
                    if (buildUpon != null) {
                        uri = buildUpon.build();
                    }
                }
            }
            intent.setData(uri);
            LIZ(r10, intent);
            LIZIZ = true;
            return true;
        }
        return false;
    }
}