鑫垚影视 v20.42版本的 MD5 值为:e3822d25ef47121f1770bb4806abacfe
以下内容为反编译后的 CommentBrowserFragment.java 源代码,内容仅作参考
package com.movie.heaven.ui.index_comment;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.bytedance.msdk.api.v2.ad.nativeAd.GMNativeAd;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.movie.heaven.ui.search.SearchCmsListActivity;
import com.sniffer.xwebview.BaseWebViewFragment;
import com.sniffer.xwebview.base.dwebview.DWebView;
import com.sniffer.xwebview.base.dwebview.MyWebChromeClient;
import com.sniffer.xwebview.base.dwebview.MyWebViewClient;
import com.sniffer.xwebview.util.webutil.ShouldOverrideUrlUtil;
import com.yinghua.mediavideo.app.R;
import e.l.a.j.d0.c;
import e.l.a.j.x;
import l.f0;
import l.i0;
import l.k0;
public class CommentBrowserFragment extends BaseWebViewFragment {
private Unbinder f5023a;
@BindView(R.id.ad_layout)
public FrameLayout adLayout;
private String f5024b = "";
private String f5025c = "";
private String f5026d = "";
private e.l.a.j.d0.c f5027e;
@BindView(R.id.iv_back)
public ImageView ivBack;
@BindView(R.id.iv_search)
public ImageView ivSearch;
@BindView(R.id.progress)
public RelativeLayout progress;
@BindView(R.id.rl_error)
public LinearLayout rlError;
@BindView(R.id.tv_title)
public TextView tvTitle;
@BindView(R.id.tv_title2)
public TextView tvTitle2;
public class a implements c.i {
public a() {
}
@Override
public void onAdClick() {
}
@Override
public void onAdError(String str, int i2) {
}
@Override
public void onClose() {
}
@Override
public void onFeedList(GMNativeAd gMNativeAd, int i2) {
CommentBrowserFragment.this.adLayout.setVisibility(0);
CommentBrowserFragment.this.adLayout.removeAllViews();
CommentBrowserFragment.this.adLayout.addView(gMNativeAd.getExpressView());
}
}
public class b extends e.l.a.d.h.c<String> {
public b(e.l.a.f.c.d dVar) {
super(dVar);
}
@Override
public void onNext(String str) {
super.onNext(str);
CommentBrowserFragment commentBrowserFragment = CommentBrowserFragment.this;
if (commentBrowserFragment.webView == null || commentBrowserFragment.progress == null) {
return;
}
int i2 = 0;
while (str.contains("《")) {
str = str.replaceFirst("《", "<a id='" + i2 + "' style=\"color:red\" href=\"javascript:void(alert(document.getElementById('" + i2 + "').innerHTML))\">");
i2++;
}
CommentBrowserFragment.this.webView.loadStringHtml(str.replace(".innerHTML))\">", ".innerHTML))\">《").replace("》", "》</a>").replace("<img", "<img width=100% height=auto").replace("<img width=100% height=auto src=\"\"", "<src=\"\""));
CommentBrowserFragment.this.webView.setVisibility(0);
CommentBrowserFragment.this.progress.setVisibility(8);
CommentBrowserFragment.this.rlError.setVisibility(8);
}
@Override
public void onError(Throwable th) {
super.onError(th);
CommentBrowserFragment commentBrowserFragment = CommentBrowserFragment.this;
DWebView dWebView = commentBrowserFragment.webView;
if (dWebView == null || commentBrowserFragment.progress == null) {
return;
}
dWebView.setVisibility(8);
CommentBrowserFragment.this.progress.setVisibility(8);
CommentBrowserFragment.this.rlError.setVisibility(0);
}
}
public class d implements View.OnClickListener {
public d() {
}
@Override
public void onClick(View view) {
CommentBrowserFragment.this.getActivity().finish();
}
}
public class e implements View.OnClickListener {
public e() {
}
@Override
public void onClick(View view) {
CommentBrowserFragment.this.progress.setVisibility(0);
CommentBrowserFragment.this.M();
}
}
public class f extends MyWebChromeClient {
public f(Context context, DWebView dWebView) {
super(context, dWebView);
}
@Override
public boolean onJsAlert(WebView webView, String str, String str2, JsResult jsResult) {
SearchCmsListActivity.invoke(CommentBrowserFragment.this.getContext(), str2.replaceAll("《", "").replaceAll("》", ""), true);
return true;
}
}
public class g implements View.OnClickListener {
public g() {
}
@Override
public void onClick(View view) {
SearchCmsListActivity.invoke(CommentBrowserFragment.this.getContext(), CommentBrowserFragment.this.f5026d, true);
}
}
public class h implements View.OnClickListener {
public h() {
}
@Override
public void onClick(View view) {
SearchCmsListActivity.invoke(CommentBrowserFragment.this.getContext(), CommentBrowserFragment.this.f5026d, true);
}
}
public WebResourceResponse L(String str) {
try {
k0 execute = new f0().a(new i0.a().o(str.trim()).a("Referer", "https://api-shoulei-ssl.xunlei.com/").b()).execute();
return new WebResourceResponse(null, execute.M("content-encoding", "utf-8"), execute.f().byteStream());
} catch (Exception unused) {
return null;
}
}
public void M() {
e.l.a.d.b.K().v(this.f5024b).j6(new b(null));
}
private void N() {
Bundle arguments = getArguments();
this.f5024b = arguments.getString("EXTRA_URL");
String string = arguments.getString("EXTRA_TITLE");
this.f5025c = string;
if (x.f(string)) {
this.tvTitle2.setVisibility(8);
}
this.tvTitle2.setText(this.f5025c);
String string2 = arguments.getString(CommentBrowserActivity.EXTRA_KEYWORD);
this.f5026d = string2;
this.tvTitle.setText(string2);
}
private void O() {
this.ivBack.setOnClickListener(new d());
this.rlError.setOnClickListener(new e());
this.webView.setWebChromeClient(new f(getActivity(), this.webView));
this.ivSearch.setOnClickListener(new g());
((FloatingActionButton) this.layout.findViewById(R.id.fab)).setOnClickListener(new h());
}
private void P() {
WebSettings settings = getWebView().getSettings();
settings.setSupportZoom(false);
settings.setBuiltInZoomControls(false);
settings.setDisplayZoomControls(false);
settings.setDefaultTextEncodingName("UTF-8");
settings.setDefaultFontSize(37);
settings.setDefaultFixedFontSize(16);
settings.setMinimumFontSize(8);
settings.setMinimumLogicalFontSize(8);
settings.setTextZoom(100);
this.webView.setHorizontalScrollBarEnabled(false);
this.webView.setVerticalScrollBarEnabled(false);
this.webView.setWebViewClient(new c(getActivity(), this.webView));
}
private void Q() {
if (e.l.a.j.d0.a.d() && e.l.a.j.d0.a.c().isTt_feed_video() && !x.f(e.l.a.j.d0.a.b().getApp_key()) && !x.f(e.l.a.j.d0.a.b().getFeed_id())) {
this.f5027e.B(getActivity(), 1, new a());
}
}
public static CommentBrowserFragment R(String str, String str2, String str3) {
CommentBrowserFragment commentBrowserFragment = new CommentBrowserFragment();
Bundle bundle = new Bundle();
bundle.putString("EXTRA_URL", str);
bundle.putString("EXTRA_TITLE", str2);
bundle.putString(CommentBrowserActivity.EXTRA_KEYWORD, str3);
commentBrowserFragment.setArguments(bundle);
return commentBrowserFragment;
}
@Override
public int getLayoutId() {
return R.layout.fragment_comment_browser;
}
@Override
public void initView(Bundle bundle) {
this.f5023a = ButterKnife.bind(this, this.layout);
super.initView(bundle);
P();
N();
O();
M();
this.f5027e = e.l.a.j.d0.c.u();
Q();
}
@Override
public void onDestroyView() {
super.onDestroyView();
Unbinder unbinder = this.f5023a;
if (unbinder != null) {
unbinder.unbind();
}
}
@Override
public void onHideCustomView() {
super.onHideCustomView();
}
@Override
public void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
}
@Override
public void onReceivedError(WebView webView, String str) {
super.onReceivedError(webView, str);
}
@Override
public void onReceivedTitle(WebView webView, String str) {
super.onReceivedTitle(webView, str);
}
@Override
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback customViewCallback) {
super.onShowCustomView(view, customViewCallback);
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
return !ShouldOverrideUrlUtil.isHttp(str);
}
public class c extends MyWebViewClient {
public c(Context context, DWebView dWebView) {
super(context, dWebView);
}
@Override
public WebResourceResponse shouldInterceptRequest(WebView webView, String str) {
if (Build.VERSION.SDK_INT >= 21) {
return null;
}
super.shouldInterceptRequest(webView, str);
return CommentBrowserFragment.this.L(str);
}
@Override
public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) {
if (Build.VERSION.SDK_INT < 21) {
return null;
}
super.shouldInterceptRequest(webView, webResourceRequest);
return CommentBrowserFragment.this.L(webResourceRequest.getUrl().toString());
}
}
}