QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 QQMarketHomePage.java 源代码,内容仅作参考
package com.tencent.mtt.external.market.ui.page;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.widget.FrameLayout;
import com.tencent.common.utils.UrlUtils;
import com.tencent.mtt.R;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.webview.QBWebView;
import com.tencent.mtt.base.webview.common.QBWebViewClient;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.businesscenter.facade.IFrameworkDelegate;
import com.tencent.mtt.external.market.QQMarketContainer;
import com.tencent.mtt.external.market.utils.QQMarketUrlUtil;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.view.common.QBViewResourceManager;
import java.util.HashMap;
import qb.a.f;
public class QQMarketHomePage extends BaseNativePage {
private static final String f54124d = MttResources.l(R.string.b22);
UIHandler f54125a;
boolean f54126b;
boolean f54127c;
private QBWebView e;
private QQMarketContainer f;
private String g;
private String h;
private class UIHandler extends Handler {
public UIHandler() {
super(Looper.getMainLooper());
}
@Override
public void handleMessage(Message message) {
super.handleMessage(message);
if (message.what == 3 && (message.obj instanceof String)) {
String str = (String) message.obj;
if (!str.startsWith("qb://market/") || QQMarketHomePage.this.f == null) {
((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(new UrlParams(str).c(0).b(1));
} else {
QQMarketHomePage.this.f.b(QQMarketUrlUtil.a(str, QQMarketHomePage.this.f, null), new HashMap());
}
}
}
}
public QQMarketHomePage(Context context, QQMarketContainer qQMarketContainer, String str) {
super(context, new FrameLayout.LayoutParams(-1, -1), qQMarketContainer, 0);
this.e = null;
this.f54125a = new UIHandler();
this.g = "";
this.h = "https://ag.qq.com/store";
this.f54126b = true;
this.f54127c = false;
this.f = qQMarketContainer;
this.g = str;
a(context, qQMarketContainer);
}
private void a(Context context, QQMarketContainer qQMarketContainer) {
this.e = new QBWebView(context);
this.e.addDefaultJavaScriptInterface();
this.e.setBackgroundNormalIds(QBViewResourceManager.D, R.color.qqmarket_home_page_tab_bkg);
this.e.loadUrl(this.h);
this.e.setQBWebViewClient(new QBWebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(QBWebView qBWebView, String str) {
String url = qBWebView.getUrl();
if (url != null && url.equals(str)) {
qBWebView.reload();
return true;
}
if (TextUtils.isEmpty(str)) {
return true;
}
Message obtainMessage = QQMarketHomePage.this.f54125a.obtainMessage(3);
obtainMessage.obj = str;
obtainMessage.sendToTarget();
return true;
}
});
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, -1);
layoutParams.topMargin = MttResources.h(f.Y);
addView(this.e, layoutParams);
switchSkin();
}
@Override
public void active() {
super.active();
this.f54127c = true;
this.f54126b = false;
}
@Override
public boolean can(int i) {
if (i == 9 || i == 11) {
return true;
}
return super.can(i);
}
@Override
public void destroy() {
super.destroy();
}
@Override
public boolean edgeBackforward() {
return true;
}
@Override
public String getPageTitle() {
return f54124d;
}
@Override
public QBWebView getQBWebView() {
return null;
}
public String getRefUrl() {
return QQMarketUrlUtil.b(QQMarketUrlUtil.f54180a, ((QQMarketContainer) getNativeGroup()).f53834a);
}
@Override
public String getRestoreUrl() {
return this.g;
}
@Override
public String getUrl() {
return UrlUtils.removeArg(this.g, "ref");
}
@Override
public void reload() {
}
@Override
public void switchSkin() {
setBackgroundNormalIds(0, R.color.qqmarket_default_bkg);
}
}