QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

以下内容为反编译后的 SearchInputHistory.java 源代码,内容仅作参考


package com.tencent.mtt.search.data.history;

import android.text.TextUtils;
import com.tencent.common.featuretoggle.FeatureToggle;
import com.tencent.common.utils.StringUtils;
import com.tencent.common.utils.UrlUtils;
import com.tencent.mtt.ContextHolder;
import com.tencent.mtt.browser.db.pub.InputHistoryBean;
import com.tencent.mtt.browser.db.user.SearchHistoryBean;
import com.tencent.mtt.search.SearchUtils;
import qb.a.h;
import qb.search.BuildConfig;

public class SearchInputHistory {

    public static final int f70166a;
    public String A;
    public String B;
    public String C;
    public int D;
    public boolean E;

    public String f70167b;

    public int f70168c;

    public String f70169d;
    public String e;
    public long f;
    public int g;
    public String h;
    public long i;
    public long j;
    public boolean k;
    public boolean l;
    public int m;
    public int n;
    public String o;
    public String p;
    public String q;
    public String r;
    public int s;
    public byte[] t;
    public String u;
    public String v;
    public String w;
    public String x;
    public String y;
    public int z;

    static {
        f70166a = FeatureToggle.a(BuildConfig.BUG_TOGGLE_94239323) ? 50 : 30;
    }

    public SearchInputHistory(InputHistoryBean inputHistoryBean) {
        this(inputHistoryBean.f36276c, inputHistoryBean.f36275b);
        this.g = inputHistoryBean.f36274a.intValue();
        this.f = inputHistoryBean.f36277d.longValue();
        this.m = inputHistoryBean.e.intValue();
        this.o = inputHistoryBean.f;
        this.n = inputHistoryBean.g.intValue();
        this.f70167b = inputHistoryBean.h;
        this.q = inputHistoryBean.i;
        this.f70168c = inputHistoryBean.j.intValue();
        this.t = inputHistoryBean.k;
        this.r = inputHistoryBean.l;
        this.u = inputHistoryBean.m;
        this.v = inputHistoryBean.n;
        this.w = inputHistoryBean.o;
        this.x = inputHistoryBean.p;
        this.y = inputHistoryBean.q;
        this.z = inputHistoryBean.r.intValue();
        this.A = inputHistoryBean.s;
        this.B = inputHistoryBean.t;
        this.C = inputHistoryBean.u;
    }

    public SearchInputHistory(SearchHistoryBean searchHistoryBean) {
        this(searchHistoryBean.f36447b, searchHistoryBean.f36448c);
        this.g = searchHistoryBean.f36446a.intValue();
        this.f = searchHistoryBean.f36449d.longValue();
        this.h = searchHistoryBean.e;
        this.i = searchHistoryBean.f.longValue();
        this.j = searchHistoryBean.g.longValue();
        this.k = searchHistoryBean.h.intValue() == 1;
        this.f70167b = searchHistoryBean.i;
        this.f70168c = searchHistoryBean.j.intValue();
        this.y = searchHistoryBean.k;
        this.z = searchHistoryBean.l.intValue();
        this.A = searchHistoryBean.m;
        this.B = searchHistoryBean.n;
        this.C = searchHistoryBean.o;
    }

    public SearchInputHistory(String str, String str2) {
        this(str, str2, System.currentTimeMillis());
    }

    public SearchInputHistory(String str, String str2, int i, int i2, String str3, String str4) {
        this(str, str2);
        this.m = i;
        this.n = i2;
        this.o = str3;
        this.p = str4;
    }

    public SearchInputHistory(String str, String str2, long j) {
        this.f70167b = "";
        this.f70168c = 0;
        this.h = "";
        this.i = 0L;
        this.j = 0L;
        this.k = false;
        this.l = false;
        this.m = 0;
        this.n = 0;
        this.o = "";
        this.p = "";
        this.q = "";
        this.r = "";
        this.s = 0;
        this.t = null;
        this.u = "";
        this.v = null;
        this.w = null;
        this.x = null;
        this.y = "";
        this.z = -1;
        this.A = "";
        this.B = "";
        this.D = 0;
        this.E = false;
        if (str == null || str.length() == 0) {
            this.f70169d = str2;
        } else {
            this.f70169d = str;
        }
        this.e = str2;
        this.f = j;
    }

    public SearchInputHistory(String str, String str2, String str3, int i) {
        this(str, str2, System.currentTimeMillis());
        this.f70167b = str3;
        this.m = i;
    }

    public SearchInputHistory(String str, String str2, String str3, int i, String str4) {
        this(str, str2, System.currentTimeMillis());
        this.f70167b = str3;
        this.m = i;
        this.q = str4;
    }

    private boolean a(String str) {
        if (TextUtils.isEmpty(str)) {
            return false;
        }
        String str2 = this.e;
        if (str2 != null && str2.startsWith(str)) {
            return true;
        }
        String str3 = this.f70169d;
        return str3 != null && str3.contains(str);
    }

    private String b(String str) {
        int i;
        String lowerCase = str.toLowerCase();
        if (!lowerCase.startsWith("www.") && !lowerCase.startsWith("wap.")) {
            if (lowerCase.startsWith("3g.")) {
                i = 3;
            } else {
                if (!lowerCase.startsWith("m.")) {
                    return null;
                }
                i = 2;
            }
            return str.substring(i);
        }
        return str.substring(4);
    }

    public String a() {
        String str = this.f70169d;
        return (str == null || str.length() < 0) ? this.e : this.f70169d;
    }

    public boolean a(String str, int i) {
        if ((i() != i && i != 0) || ((f() && i == 0) || TextUtils.isEmpty(str))) {
            return false;
        }
        if (a(str)) {
            return true;
        }
        String b2 = b(str);
        return !TextUtils.isEmpty(b2) && a(b2);
    }

    public int b() {
        return this.n;
    }

    public InputHistoryBean c() {
        InputHistoryBean inputHistoryBean = new InputHistoryBean();
        int i = this.g;
        inputHistoryBean.f36274a = i <= 0 ? null : Integer.valueOf(i);
        inputHistoryBean.f36275b = this.e;
        inputHistoryBean.f36276c = this.f70169d;
        inputHistoryBean.f36277d = Long.valueOf(this.f);
        inputHistoryBean.e = Integer.valueOf(this.m);
        inputHistoryBean.f = this.o;
        inputHistoryBean.g = Integer.valueOf(this.n);
        inputHistoryBean.h = this.f70167b;
        inputHistoryBean.i = this.q;
        inputHistoryBean.j = Integer.valueOf(this.s);
        inputHistoryBean.k = this.t;
        inputHistoryBean.l = this.r;
        inputHistoryBean.m = this.u;
        inputHistoryBean.n = this.v;
        inputHistoryBean.o = this.w;
        inputHistoryBean.p = this.x;
        inputHistoryBean.q = this.y;
        inputHistoryBean.r = Integer.valueOf(this.z);
        inputHistoryBean.s = this.A;
        inputHistoryBean.t = this.B;
        inputHistoryBean.u = this.C;
        return inputHistoryBean;
    }

    public SearchHistoryBean d() {
        SearchHistoryBean searchHistoryBean = new SearchHistoryBean();
        int i = this.g;
        searchHistoryBean.f36446a = i <= 0 ? null : Integer.valueOf(i);
        searchHistoryBean.f36448c = this.e;
        searchHistoryBean.f36447b = this.f70169d;
        searchHistoryBean.f36449d = Long.valueOf(this.f);
        searchHistoryBean.e = this.h;
        searchHistoryBean.f = Long.valueOf(this.i);
        searchHistoryBean.g = Long.valueOf(this.j);
        searchHistoryBean.h = Integer.valueOf(this.k ? 1 : 0);
        searchHistoryBean.i = this.f70167b;
        searchHistoryBean.j = Integer.valueOf(this.f70168c);
        searchHistoryBean.k = this.y;
        searchHistoryBean.l = Integer.valueOf(this.z);
        searchHistoryBean.m = this.A;
        searchHistoryBean.n = this.B;
        searchHistoryBean.o = this.C;
        return searchHistoryBean;
    }

    public String e() {
        if (!SearchHistoryManager.f70158a.equals(a()) && !ContextHolder.getAppContext().getResources().getString(h.f85888a).equals(a())) {
            return a();
        }
        return this.e;
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof SearchInputHistory)) {
            return false;
        }
        SearchInputHistory searchInputHistory = (SearchInputHistory) obj;
        return TextUtils.equals(this.f70169d, searchInputHistory.a()) && TextUtils.equals(this.e, searchInputHistory.e);
    }

    public boolean f() {
        return this.z == 21;
    }

    public boolean g() {
        if (this.z == 5) {
            return true;
        }
        return SearchHistoryManager.f70158a.equals(a());
    }

    public boolean h() {
        int i;
        if (!this.e.startsWith("https://smartbox.html5.qq.com/search?") && !this.e.startsWith("https://ag.qq.com/community/searchStart?t=5&keyword=")) {
            return f() && (i = this.m) > 0 && i < 23;
        }
        String urlParamValue = UrlUtils.getUrlParamValue(this.e, "t");
        if (!TextUtils.isEmpty(urlParamValue) && ((urlParamValue.length() == 1 || urlParamValue.length() == 2) && urlParamValue.matches("[0-9]+"))) {
            String b2 = SearchUtils.b(StringUtils.b(urlParamValue, 1));
            if (!TextUtils.isEmpty(this.e) && this.e.startsWith(b2)) {
                return true;
            }
        }
        return false;
    }

    public int hashCode() {
        return this.f70169d.hashCode() + this.e.hashCode();
    }

    public int i() {
        if (TextUtils.isEmpty(this.e)) {
            return 0;
        }
        return this.m;
    }
}