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

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


package com.tencent.mtt.external.reader.dex.component;

import android.content.Context;
import android.graphics.Paint;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import com.tencent.mtt.R;
import com.tencent.mtt.base.nativeframework.NativeWebLongClickListener;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.utils.DeviceUtils;
import com.tencent.mtt.base.webview.QBWebView;
import com.tencent.mtt.base.webview.common.QBWebChromeClient;
import com.tencent.mtt.base.webview.common.QBWebChromeClientExtension;
import com.tencent.mtt.base.webview.common.QBWebViewClient;
import com.tencent.mtt.browser.WebEngine;
import com.tencent.mtt.setting.BaseSettings;
import com.tencent.mtt.view.common.QBImageView;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.layout.QBLinearLayout;
import com.tencent.mtt.view.recyclerview.QBListView;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.io.File;
import qb.a.f;

public class ReaderFeedbackView extends QBLinearLayout {
    protected static final int e = MttResources.h(R.dimen.ld);
    protected static final int f = MttResources.h(f.Y);
    protected static int g = 0;

    protected Context f56993a;

    protected QBImageView f56994b;

    protected QBTextView f56995c;

    protected QBListView f56996d;
    protected int h;
    boolean i;
    Paint j;
    int k;
    protected IReaderFeedbackView l;
    protected ReaderTopBar m;
    private QBWebView n;
    private String o;

    public interface IReaderFeedbackView {
        int aC_();

        void aD_();

        String aE_();

        String f();
    }

    public ReaderFeedbackView(Context context, IReaderFeedbackView iReaderFeedbackView) {
        super(context);
        this.f56993a = null;
        this.f56994b = null;
        this.f56995c = null;
        this.f56996d = null;
        this.h = BaseSettings.a().m();
        this.i = false;
        this.j = new Paint();
        this.k = MttResources.c(R.color.reader_theme_popup_item_line_normal);
        this.n = null;
        this.o = "https://bbs.mb.qq.com/mobilefb/feedback?from=file";
        this.l = null;
        this.m = null;
        this.f56993a = context;
        this.l = iReaderFeedbackView;
        a();
        WebEngine e2 = WebEngine.e();
        if (e2 != null) {
            e2.a(context);
        }
        this.n = new QBWebView(this.f56993a);
        this.n.getQBSettings().o(true);
        this.n.addDefaultJavaScriptInterface();
        this.n.setQBWebViewClient(new QBWebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(QBWebView qBWebView, String str) {
                if (!str.contains("ui.ptlogin2.qq.com")) {
                    return false;
                }
                ReaderFeedbackView.this.n.loadUrl(str + "&pt_no_onekey=1");
                return true;
            }
        });
        this.n.setQQBrowserClient(null);
        this.n.setQBWebChromeClient(new QBWebChromeClient() {
            @Override
            public void onReceivedTitle(QBWebView qBWebView, String str) {
                ReaderFeedbackView.this.setTilteText(str);
                super.onReceivedTitle(qBWebView, str);
            }
        });
        this.n.setWebViewType(6);
        QBWebView qBWebView = this.n;
        qBWebView.setWebChromeClientExtension(new QBWebChromeClientExtension(qBWebView, 6, new NativeWebLongClickListener(qBWebView)));
        addView(this.n, new LinearLayout.LayoutParams(-1, -1));
        this.n.getQBSettings().a(100);
    }

    public void a() {
        g = DeviceUtils.af() - (f * 2);
        setOrientation(1);
        setBackgroundColor(MttResources.c(R.color.reader_statusbar_default));
        IReaderFeedbackView iReaderFeedbackView = this.l;
        this.m = new ReaderTopBar(getContext(), iReaderFeedbackView != null ? iReaderFeedbackView.aC_() : MttResources.c(R.color.reader_titlebar_bg), false);
        this.m.setLeftBtnShow(true);
        this.m.setLeftBtnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                EventCollector.getInstance().onViewClickedBefore(view);
                ReaderFeedbackView.this.l.aD_();
                EventCollector.getInstance().onViewClicked(view);
            }
        });
        this.m.setRightBtnShow(false);
        addView(this.m);
    }

    public void a(String str, String str2) {
        if (this.n != null) {
            if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
                this.n.loadUrl(this.o);
                return;
            }
            try {
                StringBuilder sb = new StringBuilder(this.o.length() + 256);
                sb.append(this.o);
                File file = new File(str);
                sb.append("&filename=");
                sb.append(file.getName());
                sb.append("&filetype=");
                sb.append(str2);
                sb.append("&filesize=");
                sb.append(file.length());
                this.n.loadUrl(sb.toString());
            } catch (Throwable unused) {
                this.n.loadUrl(this.o);
            }
        }
    }

    public void b() {
        if (this.n != null) {
            try {
                StringBuilder sb = new StringBuilder(this.o.length() + 256);
                sb.append(this.o);
                File file = new File(this.l.f());
                sb.append("&filename=");
                sb.append(file.getName());
                sb.append("&filetype=");
                sb.append(this.l.aE_());
                sb.append("&filesize=");
                sb.append(file.length());
                this.n.loadUrl(sb.toString());
            } catch (Throwable unused) {
                this.n.loadUrl(this.o);
            }
        }
    }

    public boolean c() {
        QBWebView qBWebView = this.n;
        if (qBWebView == null || !qBWebView.canGoBack()) {
            return false;
        }
        this.n.goBack();
        return true;
    }

    public void d() {
        QBWebView qBWebView = this.n;
        if (qBWebView != null) {
            qBWebView.destroy();
            this.n = null;
        }
    }

    public void setFeedbackUrl(String str) {
        this.o = str;
    }

    public void setTilteText(String str) {
        ReaderTopBar readerTopBar;
        if (TextUtils.isEmpty(str) || (readerTopBar = this.m) == null) {
            return;
        }
        readerTopBar.setTitle(str);
    }
}