QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 DataSourceProcessor.java 源代码,内容仅作参考
package com.tencent.mtt.businesscenter.page;
import android.text.TextUtils;
import com.tencent.common.featuretoggle.FeatureToggle;
import com.tencent.common.utils.UrlUtils;
import com.tencent.mtt.R;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.browser.bra.addressbar.AddressBarController;
import com.tencent.mtt.browser.bra.addressbar.AddressBarDataSource;
import com.tencent.mtt.browser.bra.addressbar.view.AddressBarView;
import com.tencent.mtt.browser.bra.addressbar.view.AddressBarViewState;
import com.tencent.mtt.browser.security.datastruct.SecurityLevel;
import com.tencent.mtt.browser.window.IWebView;
import com.tencent.mtt.browser.window.WindowManager;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.search.data.entrance.SearchEntranceInfo;
import com.tencent.mtt.search.facade.ISearchEngineService;
import com.tencent.mtt.search.facade.ISearchService;
import com.tencent.mtt.support.utils.UIDeviceUtils;
import java.net.URLDecoder;
import qb.framework.BuildConfig;
public class DataSourceProcessor implements AddressBarView.OnAdderssBarModeChangedListener {
static final String f47012b = MttResources.l(R.string.qu);
private static final String k = MttResources.l(R.string.dp);
private static final String l = MttResources.l(R.string.f11do);
private static final String m = MttResources.l(R.string.dg);
private static final String n = MttResources.l(R.string.dh);
private static final String o = MttResources.l(R.string.ql);
AddressBarDataSource f47013a;
private AddressBarView f47015d;
private String f47014c = null;
private byte e = 1;
private String f = null;
private String g = null;
private String h = null;
private String i = null;
private String j = null;
public DataSourceProcessor(AddressBarView addressBarView) {
this.f47015d = addressBarView;
AddressBarView addressBarView2 = this.f47015d;
if (addressBarView2 != null) {
addressBarView2.setOnAdderssBarModeChangedListener(this);
}
}
private byte a(byte b2, AddressBarDataSource addressBarDataSource) {
if (b2 == 0) {
return (byte) 5;
}
byte b3 = 6;
if (b2 != 1) {
if (b2 != 2) {
b3 = 7;
if (b2 != 3) {
if (b2 != 4) {
return b2 != 5 ? b2 != 7 ? (byte) 1 : (byte) 10 : TextUtils.equals(o, addressBarDataSource.f35820a) ? (byte) 9 : (byte) 8;
}
return (byte) 1;
}
}
return b3;
}
SecurityLevel securityLevel = (SecurityLevel) addressBarDataSource.a(SecurityLevel.class);
if (securityLevel != null) {
int i = securityLevel.level;
if (securityLevel.url.startsWith("https://res.imtt.qq.com/qbsecurity/qbsecurity_")) {
return (byte) 4;
}
if (i == 4) {
return (byte) 3;
}
if (i == 3 || i == 2 || i == 1) {
return (byte) 4;
}
}
return (byte) 6;
}
private byte a(String str) {
String str2;
this.g = null;
this.h = null;
this.j = null;
this.i = null;
if (!TextUtils.isEmpty(str)) {
if (str.startsWith("qb://home")) {
return (byte) 0;
}
if (str.startsWith("qb://ext/voice")) {
return (byte) 6;
}
if (str.equals("restore")) {
return (byte) 4;
}
if (TextUtils.equals("https://m.baidu.com/?from=1086k", str) || TextUtils.equals("https://m.baidu.com/?from=1000953b", str)) {
return (byte) 5;
}
ISearchEngineService iSearchEngineService = (ISearchEngineService) QBContext.getInstance().getService(ISearchEngineService.class);
String searchWord = iSearchEngineService != null ? iSearchEngineService.getSearchWord(str) : null;
if (!TextUtils.isEmpty(searchWord)) {
this.f47014c = searchWord;
return (byte) 3;
}
String urlParamValue = UrlUtils.getUrlParamValue(str, "t");
if (!TextUtils.isEmpty(urlParamValue) && ((urlParamValue.length() == 1 || urlParamValue.length() == 2) && urlParamValue.matches("[0-9]+"))) {
try {
str2 = ((ISearchService) QBContext.getInstance().getService(ISearchService.class)).getUrlFromWhiteList((int) Long.parseLong(urlParamValue), str);
} catch (Exception unused) {
str2 = "";
}
if (!TextUtils.isEmpty(str) && !TextUtils.isEmpty(str2) && str.startsWith(str2)) {
this.g = urlParamValue;
b();
try {
this.f47014c = URLDecoder.decode(UrlUtils.getUrlParamValue(str, "q"), "UTF-8");
} catch (Exception unused2) {
this.f47014c = null;
}
return (byte) 3;
}
if (TextUtils.equals(urlParamValue, "0") && str.startsWith(((ISearchService) QBContext.getInstance().getService(ISearchService.class)).getVerticalSearchPreFix())) {
try {
this.f47014c = URLDecoder.decode(UrlUtils.getUrlParamValue(str, "q"), "UTF-8");
} catch (Exception unused3) {
this.f47014c = null;
}
return (byte) 3;
}
}
}
return (byte) 1;
}
private void a() {
if (this.f47015d == null) {
this.f47015d = AddressBarController.a().p();
}
AddressBarView addressBarView = this.f47015d;
if (addressBarView != null) {
addressBarView.setOnAdderssBarModeChangedListener(this);
}
}
private byte b(byte b2, AddressBarDataSource addressBarDataSource) {
if (b2 == 0) {
IWebView t = WindowManager.t();
return (UIDeviceUtils.f71515a || (t != null && t.isHomePage() && t.can(7))) ? (byte) 3 : (byte) 6;
}
if (b2 != 1 && b2 != 2) {
if (b2 != 3) {
if (b2 == 4) {
return (byte) 1;
}
if (b2 != 5) {
if (b2 == 7) {
return (byte) 3;
}
}
}
if (addressBarDataSource != null && addressBarDataSource.b()) {
return (byte) 2;
}
if (addressBarDataSource != null && !addressBarDataSource.b()) {
return (byte) 7;
}
} else {
if (addressBarDataSource != null && addressBarDataSource.b()) {
return (byte) 2;
}
if (addressBarDataSource != null && !addressBarDataSource.b()) {
return (byte) 3;
}
}
return (byte) 1;
}
private void b() {
ISearchService iSearchService;
if (FeatureToggle.a(BuildConfig.FEATURE_TOGGLE_868483289) || (iSearchService = (ISearchService) QBContext.getInstance().getService(ISearchService.class)) == null) {
return;
}
int i = -1;
try {
i = Integer.parseInt(this.g);
} catch (Exception unused) {
}
SearchEntranceInfo verticalItem = iSearchService.getVerticalItem(i);
if (verticalItem != null) {
this.h = verticalItem.k;
this.i = verticalItem.l;
this.j = verticalItem.j;
}
}
private boolean b(AddressBarDataSource addressBarDataSource) {
return TextUtils.isEmpty(this.f) || !this.f.equals(addressBarDataSource.f35821b) || this.e == 5;
}
private String c(byte b2, AddressBarDataSource addressBarDataSource) {
return b2 != 0 ? b2 != 2 ? b2 != 3 ? b2 != 4 ? b2 != 5 ? TextUtils.isEmpty(addressBarDataSource.f35820a) ? addressBarDataSource.f35821b : addressBarDataSource.f35820a : TextUtils.equals(o, addressBarDataSource.f35820a) ? o : "百度搜索" : "" : this.f47014c : l : f47012b;
}
private void c(AddressBarDataSource addressBarDataSource) {
if (addressBarDataSource.k == null || !addressBarDataSource.k.containsKey("NOVEL_MODE")) {
return;
}
boolean z = addressBarDataSource.k.getBoolean("NOVEL_MODE");
addressBarDataSource.k.remove("NOVEL_MODE");
this.e = z ? (byte) 7 : (byte) 1;
}
private byte d(byte b2, AddressBarDataSource addressBarDataSource) {
return (byte) 0;
}
private boolean d(AddressBarDataSource addressBarDataSource) {
return this.e == 1 && !TextUtils.isEmpty(this.f) && (this.f.startsWith("http://m.sogou.com") || this.f.startsWith("https://m.sogou.com") || this.f.startsWith("http://wap.sogou.com") || this.f.startsWith("https://wap.sogou.com") || this.f.startsWith("https://m.sogou.com")) && TextUtils.equals(o, addressBarDataSource.f35820a);
}
private boolean e(AddressBarDataSource addressBarDataSource) {
return this.e == 1 && !TextUtils.isEmpty(this.f) && (this.f.startsWith("https://m.baidu.com") || this.f.startsWith("https://www.baidu.com") || this.f.startsWith("http://m.baidu.com")) && (TextUtils.equals(m, addressBarDataSource.f35820a) || TextUtils.equals(n, addressBarDataSource.f35820a) || TextUtils.equals("百度搜索", addressBarDataSource.f35820a));
}
private byte f(AddressBarDataSource addressBarDataSource) {
return ((addressBarDataSource == null || addressBarDataSource.o() == null || !addressBarDataSource.o().b() || addressBarDataSource.l()) && addressBarDataSource != null && addressBarDataSource.k()) ? (byte) 0 : (byte) 1;
}
private byte g(AddressBarDataSource addressBarDataSource) {
if (addressBarDataSource == null || !addressBarDataSource.n()) {
return (addressBarDataSource == null || !addressBarDataSource.m()) ? (byte) 1 : (byte) 0;
}
return (byte) 2;
}
@Override
public void a(int i) {
AddressBarView addressBarView;
AddressBarDataSource addressBarDataSource = this.f47013a;
if (addressBarDataSource != null) {
a(addressBarDataSource);
if (this.f47013a.f == null || (addressBarView = this.f47015d) == null) {
return;
}
addressBarView.a(this.f47013a.f);
}
}
public void a(AddressBarDataSource addressBarDataSource) {
if (addressBarDataSource != null) {
a();
this.f47013a = addressBarDataSource;
byte b2 = this.e;
if (b(addressBarDataSource)) {
this.e = a(addressBarDataSource.f35821b);
this.f = addressBarDataSource.f35821b;
}
if (e(addressBarDataSource) || d(addressBarDataSource)) {
this.e = (byte) 5;
}
c(addressBarDataSource);
String str = null;
String string = (addressBarDataSource.k == null || !addressBarDataSource.k.containsKey("NOVEL_MODE_URL")) ? null : addressBarDataSource.k.getString("NOVEL_MODE_URL");
if (addressBarDataSource.k != null && addressBarDataSource.k.containsKey("NOVEL_SERIAL_INFO")) {
str = addressBarDataSource.k.getString("NOVEL_SERIAL_INFO");
}
byte b3 = this.e;
if (b3 == 3 || b3 == 5) {
addressBarDataSource.g = true;
AddressBarController.a().b(addressBarDataSource);
} else {
addressBarDataSource.g = false;
}
byte a2 = a(b3, addressBarDataSource);
byte b4 = b(b3, addressBarDataSource);
String c2 = c(b3, addressBarDataSource);
byte f = f(addressBarDataSource);
byte g = g(addressBarDataSource);
byte d2 = d(b3, addressBarDataSource);
if (addressBarDataSource.f == null) {
addressBarDataSource.f = new AddressBarViewState();
}
addressBarDataSource.f.f35858b = a2;
addressBarDataSource.f.f35857a = b3;
addressBarDataSource.f.f35859c = b4;
addressBarDataSource.f.j = c2;
addressBarDataSource.f.i = addressBarDataSource.f35821b;
addressBarDataSource.f.g = f;
addressBarDataSource.f.f = g;
addressBarDataSource.f.h = d2;
addressBarDataSource.f.m = this.g;
addressBarDataSource.f.o = this.h;
addressBarDataSource.f.n = this.i;
addressBarDataSource.f.p = this.j;
addressBarDataSource.f.k = addressBarDataSource.o();
addressBarDataSource.f35820a = c2;
addressBarDataSource.f.t = string;
addressBarDataSource.f.u = str;
}
}
}