正在查看: Easycash v3.75.13 应用的 H5ContainerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Easycash v3.75.13 应用的 H5ContainerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.lingyue.easycash.business.auth.web;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.webkit.WebView;
import androidx.annotation.CallSuper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.github.lzyzsd.jsbridge.BridgeWebView;
import com.github.lzyzsd.jsbridge.CallBackFunction;
import com.lingyue.easycash.activity.EasyCashWebViewActivity;
import com.lingyue.easycash.business.nsrender.IWebViewInstance;
import com.lingyue.idnbaselib.SentryTransactionConstants;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.framework.lifecycle.m;
import com.lingyue.idnbaselib.sentrybusiness.ISentryBusinessEventAutoFinish;
import com.lingyue.supertoolkit.rxjavatools.RxUtil;
import io.reactivex.Flowable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import io.sentry.ITransaction;
import io.sentry.Sentry;
import java.util.concurrent.TimeUnit;
public class H5ContainerActivity extends EasyCashWebViewActivity implements ISentryBusinessEventAutoFinish {
private Disposable Q;
private boolean R0() {
IWebViewInstance iWebViewInstance = this.E;
return (iWebViewInstance == null || iWebViewInstance.getWebView().getProgress() < 99 || this.E.v() || this.E.w()) ? false : true;
}
public void S0() {
getWebViewInstance().m().B(getWebView(), -8, "time out", this.D);
}
public void T0(Long l) throws Exception {
BridgeWebView webView = getWebView();
if (webView == null) {
return;
}
if (R0()) {
dismissLoadingDialog();
} else if (Build.VERSION.SDK_INT >= 26 && webView.getWebViewClient() != null) {
webView.getWebViewClient().onReceivedError(getWebView(), -8, "", this.D);
} else {
n0(new Runnable() {
@Override
public final void run() {
H5ContainerActivity.this.S0();
}
});
onWebReceivedError(-8, this.D);
}
}
public static Intent args(Context context, @NonNull String str, boolean z2, boolean z3) {
Intent args = EasyCashWebViewActivity.args(context, str, z2, z3);
args.setClass(context, H5ContainerActivity.class);
return args;
}
@Override
protected boolean F0(int i) {
L0(i);
return false;
}
@Override
protected void M0() {
super.M0();
pageLoadTimeOutProcess();
}
@Override
protected void X(String str) {
super.X(str);
pageLoadTimeOutProcess();
}
@Override
@CallSuper
protected void init() {
super.init();
this.J = true;
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
if (getWebView() == null) {
return;
}
getWebView().callHandler("onWebViewReenter", "", (CallBackFunction) null);
}
@Override
protected void onRestoreInstanceState(Bundle bundle) {
super.onRestoreInstanceState(bundle);
ITransaction C = Sentry.C(SentryTransactionConstants.f, "op_h5");
C.a("url", "" + getTrackUrl());
C.e();
}
@Override
protected void onStop() {
super.onStop();
RxUtil.b(this.Q);
}
public void pageLoadTimeOutProcess() {
if (R0()) {
dismissLoadingDialog();
return;
}
RxUtil.b(this.Q);
Disposable g02 = Flowable.v0(this.userSession.f().appCustomConfig.h5_loading_timeout, TimeUnit.SECONDS, Schedulers.c()).Q(AndroidSchedulers.a()).g0(new Consumer() {
public final void accept(Object obj) {
H5ContainerActivity.this.T0((Long) obj);
}
}, new Consumer() {
public final void accept(Object obj) {
H5ContainerActivity.U0((Throwable) obj);
}
});
this.Q = g02;
onSubscribe(g02);
}
@Override
protected void q0(int i) {
super.q0(i);
if (i == 0) {
RxUtil.b(this.Q);
}
}
@Override
public Disposable runOnActiveEvent(Runnable runnable) {
return m.a(this, runnable);
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnCreated(@NonNull Runnable runnable) {
return m.b(this, runnable);
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnDestroy(@NonNull Runnable runnable) {
return m.c(this, runnable);
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnEvent(@NonNull LifecycleEvent lifecycleEvent, @Nullable Runnable runnable) {
return m.d(this, lifecycleEvent, runnable);
}
@Override
public Disposable runOnEvents(@NonNull LifecycleEvent[] lifecycleEventArr, @Nullable Runnable runnable) {
return m.e(this, lifecycleEventArr, runnable);
}
@Override
public void webPageFinished(WebView webView) {
super.webPageFinished(webView);
RxUtil.b(this.Q);
}
public static void U0(Throwable th) throws Exception {
}
}