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

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


package com.tencent.mtt.external.setting;

import MTT.UpgradeRsp;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Space;
import android.widget.TextView;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import com.tencent.common.featuretoggle.FeatureToggle;
import com.tencent.common.threadpool.BrowserExecutorSupplier;
import com.tencent.common.utils.PlatformUtils;
import com.tencent.mtt.AppInfoHolder;
import com.tencent.mtt.ContextHolder;
import com.tencent.mtt.R;
import com.tencent.mtt.base.functionwindow.MttFunctionwindowProxy;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.stat.StatManager;
import com.tencent.mtt.base.stat.facade.IUserActionStatServer;
import com.tencent.mtt.base.stat.utils.PlatformStatUtils;
import com.tencent.mtt.base.utils.DeviceUtils;
import com.tencent.mtt.base.wup.facade.IWUPBusiness;
import com.tencent.mtt.boot.facade.IBootService;
import com.tencent.mtt.browser.QBTbsFactory;
import com.tencent.mtt.browser.WebEngine;
import com.tencent.mtt.browser.privacy.facade.PrivacyService;
import com.tencent.mtt.browser.share.facade.ShareBundle;
import com.tencent.mtt.browser.update.UpgradeService;
import com.tencent.mtt.browser.update.facade.UpdateInfoCallback;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.businesscenter.facade.IFrameworkDelegate;
import com.tencent.mtt.businesscenter.facade.IHostService;
import com.tencent.mtt.debug.facade.IDebugService;
import com.tencent.mtt.external.setting.facade.SettingView;
import com.tencent.mtt.external.setting.util.FeedBackUrlHelper;
import com.tencent.mtt.javaswitch.MttJavaSwitch;
import com.tencent.mtt.multiproc.QBSharedPreferences;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.qbinfo.IQConfigure;
import com.tencent.mtt.setting.PublicSettingManager;
import com.tencent.mtt.video.browser.export.constant.VideoConstants;
import com.tencent.mtt.video.internal.facade.IVideoService;
import com.tencent.mtt.view.dialog.alert.MttLoadingDialog;
import com.tencent.mtt.view.setting.SettingItem;
import com.tencent.mtt.view.toast.MttToaster;
import com.tencent.mtt.view.widget.SimpleStyledButtonView;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.net.URLEncoder;
import qb.a.e;
import qb.a.f;
import qb.a.g;
import qb.a.h;
import qb.framework.BuildConfig;

public final class AboutSettingView extends SettingView implements View.OnClickListener, UpdateInfoCallback {
    private ImageView F;
    private long G;
    private int H;
    private Context I;
    SettingItem i;
    SettingItem j;
    SettingItem k;
    SettingItem l;
    SettingItem m;
    SettingItem n;
    SettingItem o;
    SettingItem p;
    SettingItem q;
    SettingItem r;
    SettingItem s;
    SettingItem t;
    TextView u;
    Handler v;
    MttLoadingDialog w;

    public static final String f59404a = a("https://static.res.qq.com/nav/tort_privacy.html");
    private static final String E = ((PrivacyService) QBContext.getInstance().getService(PrivacyService.class)).getPrivacyUrl();

    public static final String f59405b = a(E);

    public static final String f59406c = a("https://rule.tencent.com/rule/preview/60870208-c9ff-42b8-af61-e4469d722d0b");

    public static final String f59407d = "qb://qlight?reurl=" + URLEncoder.encode("https://static.res.qq.com/qbt/help/adr/page/about_qb.html");
    public static final String e = a("https://privacy.qq.com/document/priview/d61b79b64e224a169b9e587ae6ce60c7");
    public static final String f = a("http://rule.tencent.com/rule/preview/5ab28962-1b6f-4ed5-adbb-6b76794be77f");
    public static final String g = a("http://rule.tencent.com/rule/preview/9ed26d22-f212-4aaf-ba91-66e756caac57");
    public static final String h = a("http://rule.tencent.com/rule/preview/1ea71f24-cf54-4c31-aace-b55f12c62a68");

    public AboutSettingView(Context context, MttFunctionwindowProxy mttFunctionwindowProxy) {
        super(context);
        this.G = 0L;
        this.H = 0;
        this.v = new Handler(Looper.getMainLooper()) {
            @Override
            public void handleMessage(Message message) {
                AboutSettingView aboutSettingView;
                Drawable i;
                int i2;
                int i3 = message.what;
                if (i3 == 1) {
                    aboutSettingView = AboutSettingView.this;
                    i = MttResources.i(R.drawable.bay);
                    i2 = R.string.qe;
                } else {
                    if (i3 != 2) {
                        if (i3 == 3) {
                            AboutSettingView.this.b((UpgradeRsp) message.obj);
                            return;
                        } else {
                            if (i3 == 4 && AboutSettingView.this.k != null) {
                                String str = (String) message.obj;
                                AboutSettingView.this.k.setSecondaryText(str);
                                AboutSettingView.this.k.setContentDescription("X5内核" + str);
                                return;
                            }
                            return;
                        }
                    }
                    aboutSettingView = AboutSettingView.this;
                    i = MttResources.i(R.drawable.b_z);
                    i2 = R.string.q4;
                }
                aboutSettingView.a(i, MttResources.l(i2));
            }
        };
        this.I = context;
        j();
        i();
    }

    static String a(String str) {
        if (TextUtils.isEmpty(str)) {
            return "";
        }
        return "qb://qlight?needshare=false&enablepulldown=false&reurl=" + URLEncoder.encode(str);
    }

    private String b(String str) {
        String str2 = "";
        Context appContext = ContextHolder.getAppContext();
        try {
            String str3 = appContext.getPackageManager().getPackageInfo(appContext.getPackageName(), 0).versionName;
            StringBuilder sb = new StringBuilder();
            sb.append(str3);
            if (!TextUtils.isEmpty("")) {
                str2 = " ";
            }
            sb.append(str2);
            return sb.toString();
        } catch (Exception unused) {
            return str;
        }
    }

    private void i() {
        SettingItem settingItem = this.i;
        if (settingItem != null) {
            settingItem.a(PublicSettingManager.a().getBoolean("key_is_new_version", false), (String) null);
        }
    }

    private void j() {
        String str;
        if (this.F == null) {
            this.F = new ImageView(getContext());
            this.F.setOnLongClickListener(new View.OnLongClickListener() {
                @Override
                public boolean onLongClick(View view) {
                    EventCollector.getInstance().onViewLongClickedBefore(view);
                    ((IDebugService) QBContext.getInstance().getService(IDebugService.class)).showDebugDialog();
                    EventCollector.getInstance().onViewLongClicked(view);
                    return false;
                }
            });
            this.F.setLayoutParams(new LinearLayout.LayoutParams(-1, MttResources.g(R.dimen.a1l)));
            SimpleSkinBuilder.a(this.F).g(g.bW).f();
            addView(this.F);
        }
        String str2 = "";
        if (this.i == null) {
            this.i = new SettingItem(getContext(), 100, this.D);
            this.i.setId(1000);
            this.i.setOnClickListener(this);
            this.i.setMainText(MttResources.l(R.string.qk));
            String b2 = b(IQConfigure.k.replaceFirst("(?:\\d+\\.){3}\\d{4}", AppInfoHolder.getAppInfoByID(AppInfoHolder.AppInfoID.APP_INFO_VERSION_FULLNAME)));
            StringBuilder sb = new StringBuilder();
            sb.append(b2);
            sb.append(PlatformUtils.isCurrentProcess64Bit() ? " 64bit" : "");
            String sb2 = sb.toString();
            this.i.a(sb2, DeviceUtils.K() < 15);
            this.i.setContentDescription("版本" + sb2);
            addView(this.i);
        }
        if (this.j == null) {
            try {
                str2 = ("" + MttJavaSwitch.a()) + " " + getContext().getResources().getString(getContext().getResources().getIdentifier("app_buildtime", "string", "com.tencent.mtt"));
                str = str2 + " " + getContext().getResources().getString(getContext().getResources().getIdentifier("app_developer", "string", "com.tencent.mtt"));
            } catch (Exception unused) {
                str = str2;
            }
            if (!TextUtils.isEmpty(str)) {
                this.j = new SettingItem(getContext(), 101, this.D);
                this.j.setId(1014);
                this.j.setMainText(MttResources.l(R.string.q3));
                this.j.a(str, false);
                addView(this.j);
            } else if (h()) {
                e();
            }
        }
        if (WebEngine.e().o() && this.k == null) {
            this.k = new SettingItem(getContext(), 101, this.D);
            this.k.setEnabled(false);
            this.k.setMainText(MttResources.l(R.string.q8));
            BrowserExecutorSupplier.postForBackgroundTasks(new BrowserExecutorSupplier.BackgroundRunable() {
                @Override
                public void doRun() {
                    String str3 = ((IBootService) QBContext.getInstance().getService(IBootService.class)).isGPUEnable() ? "GPU" : "";
                    IVideoService iVideoService = (IVideoService) QBContext.getInstance().getService(IVideoService.class);
                    if (iVideoService != null) {
                        str3 = str3 + iVideoService.getCurWDPDecodeType();
                    }
                    String str4 = WebEngine.e().x() + str3;
                    Message obtainMessage = AboutSettingView.this.v.obtainMessage(4);
                    obtainMessage.obj = str4;
                    obtainMessage.sendToTarget();
                }
            });
            this.k.setOnLongClickListener(new View.OnLongClickListener() {
                @Override
                public boolean onLongClick(View view) {
                    EventCollector.getInstance().onViewLongClickedBefore(view);
                    QBSharedPreferences.getSharedPreferences(ContextHolder.getAppContext(), VideoConstants.VIDEO_PREFS_NAME, 0).edit().putBoolean("video_force_sw_decodec", true).commit();
                    MttToaster.show("sw set OK! reset qqbrowser", 0);
                    EventCollector.getInstance().onViewLongClicked(view);
                    return true;
                }
            });
            addView(this.k);
        }
        if (IHostService.IS_DEBUG_WINDOW_ENABLED && this.l == null) {
            this.l = new SettingItem(getContext(), 101, this.D);
            this.l.setId(1005);
            this.l.setMainText(MttResources.l(R.string.q7));
            this.l.setSecondaryText(QBTbsFactory.a().c());
            this.l.setOnClickListener(this);
        }
        if (!WebEngine.e().o() && this.m == null) {
            this.m = new SettingItem(getContext(), 101, this.D);
            this.m.setId(1006);
            this.m.setMainText(MttResources.l(R.string.q9));
            String x = WebEngine.e().x();
            if (!TextUtils.isEmpty(x)) {
                if (x.startsWith("03")) {
                    x = MttResources.l(R.string.q8) + x;
                } else if (x.startsWith(HiAnalyticsConstant.KeyAndValue.NUMBER_01)) {
                    x = MttResources.l(R.string.qh);
                }
                this.m.setSecondaryText(x);
            }
            addView(this.m);
        }
        if (this.n == null) {
            this.n = new SettingItem(getContext(), 101, this.D);
            this.n.setId(1002);
            this.n.setMainText(MttResources.l(R.string.qd));
            this.n.setOnClickListener(this);
            addView(this.n);
        }
        if (this.s == null) {
            this.s = new SettingItem(getContext(), 101, this.D);
            this.s.setId(1007);
            this.s.setMainText(MttResources.l(R.string.bdd));
            this.s.setOnClickListener(this);
        }
        if (this.t == null) {
            this.t = new SettingItem(getContext(), 101, this.D);
            this.t.setId(1004);
            this.t.setMainText(MttResources.l(R.string.qg));
            this.t.setOnClickListener(this);
        }
        if (this.o == null) {
            this.o = new SettingItem(getContext(), 101, this.D);
            this.o.setId(1010);
            this.o.setMainText("软件许可");
            this.o.setOnClickListener(this);
            addView(this.o);
        }
        if (this.p == null) {
            this.p = new SettingItem(getContext(), 101, this.D);
            this.p.setId(1011);
            this.p.setMainText("隐私政策");
            this.p.setOnClickListener(this);
            addView(this.p);
        }
        if (FeatureToggle.a(BuildConfig.FEATURE_TOGGLE_868763623) && this.q == null) {
            this.q = new SettingItem(getContext(), 101, this.D);
            this.q.setId(1013);
            this.q.setMainText("第三方SDK目录");
            this.q.setOnClickListener(this);
            addView(this.q);
        }
        if (this.r == null) {
            this.r = new SettingItem(getContext(), 102, this.D);
            this.r.setId(1012);
            this.r.setMainText("侵权投诉及反馈政策");
            this.r.setOnClickListener(this);
            addView(this.r);
        }
        if (this.u == null) {
            Space space = new Space(getContext());
            space.setLayoutParams(new LinearLayout.LayoutParams(-1, 0, 1.0f));
            addView(space);
            this.u = new TextView(getContext());
            this.u.setTextSize(1, MttResources.r(MttResources.g(f.cy)));
            this.u.setGravity(17);
            this.u.setText(MttResources.l(R.string.bb7));
            this.u.setId(1009);
            this.u.setOnClickListener(this);
            SimpleSkinBuilder.a(this.u).g(e.f85873b).f();
            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
            layoutParams.topMargin = MttResources.h(R.dimen.a2a);
            layoutParams.bottomMargin = MttResources.h(R.dimen.a2a);
            this.u.setLayoutParams(layoutParams);
            addView(this.u);
        }
    }

    @Override
    public void a(UpgradeRsp upgradeRsp) {
        Handler handler = this.v;
        handler.sendMessage(handler.obtainMessage(3, upgradeRsp));
    }

    public void a(Drawable drawable, String str) {
        MttLoadingDialog mttLoadingDialog = this.w;
        if (mttLoadingDialog == null) {
            return;
        }
        mttLoadingDialog.a(str);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if (AboutSettingView.this.w != null) {
                    AboutSettingView.this.w.hide();
                    AboutSettingView.this.w.dismiss();
                }
            }
        }, 1000L);
    }

    @Override
    public void b() {
        super.b();
        i();
        PlatformStatUtils.a("STAT_ABOUT_SETTING_EXPOSURE");
    }

    void b(UpgradeRsp upgradeRsp) {
        g();
        Bundle bundle = new Bundle();
        bundle.putSerializable("upgradeRsp", upgradeRsp);
        a(16, bundle);
    }

    @Override
    public void cb_() {
        this.v.sendEmptyMessage(1);
    }

    @Override
    public void cc_() {
        this.v.sendEmptyMessage(2);
    }

    protected void e() {
        this.j = new SettingItem(getContext(), 101, this.D);
        this.j.setId(1014);
        this.j.setMainText(MttResources.l(R.string.q3));
        this.j.a(AppInfoHolder.getAppInfoByID(AppInfoHolder.AppInfoID.APP_INFO_BUILD_NO), false);
        addView(this.j);
    }

    public void f() {
        this.w = new MttLoadingDialog(this.I);
        this.w.a(MttResources.l(R.string.bbg));
        this.w.setCancelable(true);
        new SimpleStyledButtonView(this.I).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                EventCollector.getInstance().onViewClickedBefore(view);
                if (AboutSettingView.this.w != null) {
                    AboutSettingView.this.w.hide();
                    AboutSettingView.this.w.dismiss();
                }
                EventCollector.getInstance().onViewClicked(view);
            }
        });
        this.w.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public void onDismiss(DialogInterface dialogInterface) {
                if (AboutSettingView.this.w == dialogInterface) {
                    AboutSettingView.this.w = null;
                }
            }
        });
        this.w.show();
    }

    public void g() {
        MttLoadingDialog mttLoadingDialog = this.w;
        if (mttLoadingDialog != null) {
            mttLoadingDialog.hide();
            this.w.dismiss();
        }
    }

    protected boolean h() {
        return TextUtils.equals("1", PublicSettingManager.a().getString("ANDROID_PUBLIC_PREFS_INNER_EXPERIENCE_SWITCHER", "")) || TextUtils.equals("1", PublicSettingManager.a().getString("ANDROID_PUBLIC_PREFS_IS_TENCENT_WIFI_USER", "")) || PublicSettingManager.a().getBoolean("operation_log_flag", false);
    }

    @Override
    public void onClick(View view) {
        SettingItem settingItem;
        UrlParams f2;
        UrlParams b2;
        IFrameworkDelegate iFrameworkDelegate;
        UrlParams urlParams;
        EventCollector.getInstance().onViewClickedBefore(view);
        long currentTimeMillis = System.currentTimeMillis();
        if (currentTimeMillis - this.C > 300) {
            this.C = currentTimeMillis;
            switch (view.getId()) {
                case 1000:
                    StatManager.b().c("EIC2401");
                    ((IUserActionStatServer) QBContext.getInstance().getService(IUserActionStatServer.class)).addUserAction(374);
                    f();
                    UpgradeService.a().d();
                    UpgradeService.a().a(this);
                    settingItem = this.i;
                    break;
                case 1001:
                    StatManager.b().c("EIC2402");
                    ((IUserActionStatServer) QBContext.getInstance().getService(IUserActionStatServer.class)).addUserAction(375);
                    f();
                    UpgradeService.a().d();
                    UpgradeService.a().a(this);
                    settingItem = this.k;
                    break;
                case 1002:
                    StatManager.b().c("EIC2403");
                    ((IUserActionStatServer) QBContext.getInstance().getService(IUserActionStatServer.class)).addUserAction(379);
                    f2 = new UrlParams(f59407d).b(1).c(13).f(122);
                    f2.e();
                    break;
                case 1004:
                    ((IUserActionStatServer) QBContext.getInstance().getService(IUserActionStatServer.class)).addUserAction(380);
                    String l = MttResources.l(h.U);
                    String l2 = MttResources.l(h.V);
                    String l3 = MttResources.l(h.W);
                    ShareBundle shareBundle = new ShareBundle(0);
                    shareBundle.f45014b = l;
                    shareBundle.f45015c = l2;
                    shareBundle.f45016d = l3;
                    shareBundle.m = 10;
                    shareBundle.i = MttResources.p(g.v);
                    shareBundle.D = 9;
                    ((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).handleMttMessage(57, 0, 0, shareBundle, 0L);
                    break;
                case 1007:
                    ((IUserActionStatServer) QBContext.getInstance().getService(IUserActionStatServer.class)).addUserAction(378);
                    b2 = new UrlParams(FeedBackUrlHelper.a()).b(1);
                    f2 = b2.c(13);
                    f2.e();
                    break;
                case 1008:
                    b2 = new UrlParams("https://pms.mb.qq.com/index?aid=act13&cid=qbdownload").b(2);
                    f2 = b2.c(13);
                    f2.e();
                    break;
                case 1009:
                    if (this.G == 0) {
                        this.G = System.currentTimeMillis();
                    }
                    this.H++;
                    if (System.currentTimeMillis() - this.G > 20000 || this.H < 3) {
                        break;
                    } else {
                        String str = "factory : ";
                        String appInfoByID = AppInfoHolder.getAppInfoByID(AppInfoHolder.AppInfoID.APP_INFO_FACTORY_CHANNEL_ID);
                        if (appInfoByID != null) {
                            str = "factory : " + appInfoByID;
                        }
                        String str2 = str + "  current : ";
                        String appInfoByID2 = AppInfoHolder.getAppInfoByID(AppInfoHolder.AppInfoID.APP_INFO_CURRENT_CHANNEL_ID);
                        if (appInfoByID2 != null) {
                            str2 = str2 + appInfoByID2;
                        }
                        ((IWUPBusiness) QBContext.getInstance().getService(IWUPBusiness.class)).getUserInfo();
                        MttToaster.show(MttResources.l(R.string.bbc) + str2, 0);
                        StatManager.b().i();
                    }
                    this.G = 0L;
                    this.H = 0;
                    break;
                case 1010:
                    StatManager.b().c("EIC2404");
                    iFrameworkDelegate = (IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class);
                    urlParams = new UrlParams(f59406c);
                    iFrameworkDelegate.doLoad(urlParams.c(13).f(123).b(33));
                    break;
                case 1011:
                    StatManager.b().c("EIC2405");
                    iFrameworkDelegate = (IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class);
                    urlParams = new UrlParams(f59405b);
                    iFrameworkDelegate.doLoad(urlParams.c(13).f(123).b(33));
                    break;
                case 1012:
                    StatManager.b().c("EIC2406");
                    PlatformStatUtils.a("ABOUT_SETTING_COMPLAINT");
                    iFrameworkDelegate = (IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class);
                    urlParams = new UrlParams(f59404a);
                    iFrameworkDelegate.doLoad(urlParams.c(13).f(123).b(33));
                    break;
                case 1013:
                    StatManager.b().c("EIC2407");
                    iFrameworkDelegate = (IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class);
                    urlParams = new UrlParams(e);
                    iFrameworkDelegate.doLoad(urlParams.c(13).f(123).b(33));
                    break;
            }
        }
        EventCollector.getInstance().onViewClicked(view);
    }

    @Override
    public void onLayout(boolean z, int i, int i2, int i3, int i4) {
        super.onLayout(z, i, i2, i3, i4);
        if (this.u.getBottom() < getHeight() - MttResources.h(R.dimen.a2a)) {
            TextView textView = this.u;
            textView.layout(textView.getLeft(), (getHeight() - MttResources.h(R.dimen.a2a)) - this.u.getHeight(), this.u.getRight(), getHeight() - MttResources.h(R.dimen.a2a));
        }
    }
}