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

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


package com.tencent.mtt.browser.video.feedsvideo;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import com.tencent.common.threadpool.BrowserExecutorSupplier;
import com.tencent.mtt.base.stat.StatManager;
import com.tencent.mtt.browser.video.QBLoadingWebView;
import com.tencent.mtt.browser.video.feedsvideo.data.FeedsVideoDataHelper;
import com.tencent.mtt.browser.video.feedsvideo.utils.ReportUtils;
import com.tencent.mtt.browser.video.feedsvideo.view.ICommentWebViewHost;
import com.tencent.mtt.browser.video.feedsvideo.view.VideoX5ScrollerDetector;
import com.tencent.mtt.comment.facade.ICommentListenerExt;
import com.tencent.mtt.comment.facade.ICommentManager;
import com.tencent.mtt.comment.facade.ICommentService;
import com.tencent.mtt.qbcontext.core.QBContext;
import java.util.ArrayList;
import java.util.Iterator;

public class FeedsVideoCommentController implements FeedsVideoDataHelper.ICircleInfoListener, ICommentListenerExt {

    Context f45794a;

    FeedsVideoDataHelper f45795b;

    Handler f45796c = new Handler(Looper.getMainLooper());

    private ICommentManager f45797d;
    private String e;
    private String f;
    private QBLoadingWebView g;
    private H5FeedsVideoInfo h;
    private ICommentWebViewHost i;
    private String j;

    public FeedsVideoCommentController(Context context, FeedsVideoDataHelper feedsVideoDataHelper, H5FeedsVideoInfo h5FeedsVideoInfo) {
        this.f45794a = null;
        this.f45795b = null;
        this.f45794a = context;
        this.f45795b = feedsVideoDataHelper;
        this.h = h5FeedsVideoInfo;
    }

    public void a(int i) {
        ArrayList<String> arrayList;
        H5FeedsVideoInfo h5FeedsVideoInfo = this.h;
        if (h5FeedsVideoInfo == null || !h5FeedsVideoInfo.mIsAd || this.h.mVideoAdInfo == null || this.h.mVideoAdInfo.mStatUrl == null || (arrayList = this.h.mVideoAdInfo.mStatUrl.get(25)) == null) {
            return;
        }
        Iterator<String> it = arrayList.iterator();
        while (it.hasNext()) {
            ReportUtils.a(it.next() + "&acttype=" + i);
        }
    }

    private void f() {
        ViewParent parent = this.g.getParent();
        if (parent != null) {
            ((ViewGroup) parent).clearChildFocus(this.g);
        }
    }

    private void g() {
        if (this.f45797d == null || TextUtils.isEmpty(this.e) || TextUtils.isEmpty(this.f)) {
            return;
        }
        this.f45797d.a(this.e, this.f, "001001", (Integer) 2);
    }

    public QBLoadingWebView a(String str, VideoX5ScrollerDetector.IWebViewScrollListener iWebViewScrollListener) {
        QBLoadingWebView qBLoadingWebView = new QBLoadingWebView(this.f45794a);
        qBLoadingWebView.setLoadingAlpha(0.7f);
        qBLoadingWebView.setFocusable(false);
        qBLoadingWebView.addDefaultJavaScriptInterface();
        qBLoadingWebView.addJavascriptInterface(new FeedsVideoJsExtension(this), "reader");
        qBLoadingWebView.setVerticalScrollBarEnabled(false);
        qBLoadingWebView.setHorizontalScrollBarEnabled(false);
        qBLoadingWebView.setWebCoreNightModeEnabled(true);
        qBLoadingWebView.loadUrl(str);
        qBLoadingWebView.setBackgroundColor(-16777216);
        if (iWebViewScrollListener != null) {
            VideoX5ScrollerDetector videoX5ScrollerDetector = new VideoX5ScrollerDetector();
            videoX5ScrollerDetector.a(iWebViewScrollListener);
            qBLoadingWebView.setX5WebViewOnScrollListener(videoX5ScrollerDetector);
        }
        this.g = qBLoadingWebView;
        return qBLoadingWebView;
    }

    public String a() {
        return this.j;
    }

    public void a(ICommentWebViewHost iCommentWebViewHost) {
        this.i = iCommentWebViewHost;
    }

    @Override
    public void a(String str, String str2) {
        this.e = str;
        this.f = str2;
        g();
    }

    public void a(String str, String str2, String str3) {
        H5FeedsVideoInfo h5FeedsVideoInfo = this.h;
        a(str, str2, h5FeedsVideoInfo != null ? h5FeedsVideoInfo.mVideoId : null, str3);
    }

    public void a(String str, String str2, String str3, String str4) {
        f();
        if (this.f45797d == null) {
            this.f45797d = ((ICommentService) QBContext.getInstance().getService(ICommentService.class)).getCommentManager(this.f45794a, null, null, null, null);
        }
        if (this.f45797d != null) {
            g();
            this.f45797d.a(this);
            ICommentManager iCommentManager = this.f45797d;
            if (str2 == null) {
                str2 = "";
            }
            iCommentManager.a(str, str4, str2, true, true);
        }
        if ((TextUtils.isEmpty(this.e) || TextUtils.isEmpty(this.f)) && !TextUtils.isEmpty(str3)) {
            this.f45795b.a(str3, this);
        }
    }

    public View b() {
        return this.g;
    }

    public void b(String str, String str2) {
        this.i.a(str, str2);
    }

    public void b(String str, String str2, String str3, String str4) {
        this.e = str2;
        this.f = str;
        this.j = str4;
        g();
    }

    public void c() {
        final ArrayList<String> arrayList;
        H5FeedsVideoInfo h5FeedsVideoInfo = this.h;
        if (h5FeedsVideoInfo == null || !h5FeedsVideoInfo.mIsAd || this.h.mVideoAdInfo == null || (arrayList = this.h.mVideoAdInfo.vAdClickUrls) == null || arrayList.size() <= 0) {
            return;
        }
        BrowserExecutorSupplier.postForBackgroundTasks(new BrowserExecutorSupplier.BackgroundRunable() {
            @Override
            public void doRun() {
                Iterator it = arrayList.iterator();
                while (it.hasNext()) {
                    ReportUtils.b((String) it.next());
                }
            }
        });
    }

    public void d() {
        QBLoadingWebView qBLoadingWebView = this.g;
        if (qBLoadingWebView != null) {
            qBLoadingWebView.deactive();
        }
    }

    public void e() {
        QBLoadingWebView qBLoadingWebView = this.g;
        if (qBLoadingWebView != null) {
            qBLoadingWebView.destroy();
        }
    }

    @Override
    public void onCommentCancel() {
    }

    @Override
    public void onCommitResult(int i, String str, String str2, String str3, String str4) {
    }

    @Override
    public void onCommitResult(final ICommentListenerExt.CommentResult commentResult) {
        if (commentResult == null || commentResult.f47614a != 0) {
            return;
        }
        this.f45796c.post(new Runnable() {
            @Override
            public void run() {
                try {
                    String str = "javascript:try{window.x5TweetSuccess(" + commentResult.j + ")}catch(e){}";
                    if (FeedsVideoCommentController.this.g != null) {
                        FeedsVideoCommentController.this.g.loadUrl(str);
                        StatManager.b().c("ADHF38");
                    }
                    FeedsVideoCommentController.this.a(10);
                } catch (Exception unused) {
                }
            }
        });
        StatManager.b().c("ADHF36");
    }

    @Override
    public void onPostBtnClick(boolean z) {
    }

    @Override
    public void onSwitchBtnClick(boolean z) {
    }
}