正在查看: 大众借. v4.1.2 应用的 MT10ACT.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 大众借. v4.1.2 应用的 MT10ACT.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.shiliuj.ui.activitys;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.SslErrorHandler;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.widget.LinearLayout;
import androidx.core.content.ContextCompat;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.base.commonlibrary.base.BaseResult;
import com.base.commonlibrary.base.baserx.RxSchedulers;
import com.base.commonlibrary.baseview.BaseAgentWebActivity;
import com.base.commonlibrary.views.LoadingTip;
import com.base.commonlibrary.views.TitleLayout;
import com.gyf.barlibrary.ImmersionBar;
import com.just.agentweb.MiddlewareWebChromeBase;
import com.just.agentweb.MiddlewareWebClientBase;
import com.shiliuj.mjyp.app.api.Api;
import com.shiliuj.mjyp.app.base.RxSubscriber;
import com.shiliuj.mjyp.app.utils.AppUtils;
public class MT10ACT extends BaseAgentWebActivity {
Unbinder bind;
@BindView(2131296443)
LinearLayout container;
private ImmersionBar mImmersionBar;
@BindView(2131296998)
TitleLayout titleView;
protected boolean canLoadMore() {
return false;
}
protected int getIndicatorHeight() {
return 1;
}
public int getLayoutId() {
return 2131492894;
}
public void initPresenter() {
}
protected void loadMore() {
}
protected void refresh() {
}
public void bindView() {
this.bind = ButterKnife.bind(this);
ImmersionBar with = ImmersionBar.with(this);
this.mImmersionBar = with;
with.statusBarDarkFont(true, 0.5f);
this.mImmersionBar.fitsSystemWindows(true);
this.mImmersionBar.init();
}
protected void onDestroy() {
this.bind.unbind();
if (this.mAgentWeb != null) {
this.mAgentWeb.clearWebCache();
}
ImmersionBar immersionBar = this.mImmersionBar;
if (immersionBar != null) {
immersionBar.destroy();
}
super.onDestroy();
}
public void initView(Bundle bundle) {
this.titleView.setOnBackButtonClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (MT10ACT.this.mAgentWeb == null || MT10ACT.this.mAgentWeb.back()) {
return;
}
MT10ACT.this.finish();
}
});
this.titleView.setRightButton(2131558488, new View.OnClickListener() {
@Override
public void onClick(View view) {
MT10ACT.this.finish();
}
});
}
protected ViewGroup getAgentWebParent() {
return (ViewGroup) findViewById(2131296443);
}
protected BaseAgentWebActivity.ErrorLayoutEntity getErrorLayoutEntity() {
BaseAgentWebActivity.ErrorLayoutEntity errorLayoutEntity = super.getErrorLayoutEntity();
errorLayoutEntity.setLayoutRes(2131492949);
errorLayoutEntity.setReloadId(2131296518);
return errorLayoutEntity;
}
public boolean onKeyDown(int i, KeyEvent keyEvent) {
if (this.mAgentWeb == null || !this.mAgentWeb.handleKeyEvent(i, keyEvent)) {
return super.onKeyDown(i, keyEvent);
}
return true;
}
protected int getIndicatorColor() {
return Color.parseColor("#ff0000");
}
protected String getUrl() {
Bundle extras = getIntent().getExtras();
if (extras == null) {
return "";
}
String string = extras.getString("url");
this.titleView.setTitle(extras.getString("title"));
return string;
}
protected MiddlewareWebChromeBase getMiddleWareWebChrome() {
return new MiddlewareWebChromeBase() {
public void onReceivedTitle(WebView webView, String str) {
super.onReceivedTitle(webView, str);
if (MT10ACT.this.titleView != null) {
MT10ACT.this.titleView.setTitle(str);
}
}
};
}
protected MiddlewareWebClientBase getMiddleWareWebClient() {
return new MiddlewareWebClientBase() {
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
String uri = webResourceRequest.getUrl().toString();
if (!uri.startsWith("http")) {
Log.i("vv", "处理自定义scheme");
try {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(uri));
intent.setFlags(805306368);
MT10ACT.this.startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
}
return true;
}
if (!uri.contains("https://nice800.com/")) {
return false;
}
MT10ACT.this.operatorBj();
return true;
}
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
if (!str.startsWith("http")) {
Log.i("vv", "处理自定义scheme");
try {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
intent.setFlags(805306368);
MT10ACT.this.startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
}
return true;
}
if (!str.contains("https://nice800.com/")) {
return false;
}
MT10ACT.this.operatorBj();
return true;
}
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
sslErrorHandler.proceed();
}
};
}
public void operatorBj() {
this.mRxManager.add(Api.getDefault().operatorBjStatus().compose(RxSchedulers.io_main()).subscribe(new RxSubscriber<BaseResult>(this.mContext, true) {
public void _onNext(BaseResult baseResult) {
MT10ACT.this.showShortToast(baseResult.getMessage());
MT10ACT.this.finish();
}
protected void _onError(String str) {
MT10ACT.this.showShortToast(str);
MT10ACT.this.finish();
}
}));
}
protected void onResume() {
super.onResume();
booleanWifiOrVpn();
}
private void booleanWifiOrVpn() {
if (AppUtils.INSTANCE.isWifiProxy() || AppUtils.INSTANCE.isVpnUsed()) {
if (this.loadTip != null) {
this.loadTip.setOnKnowListener(new LoadingTip.onKnowListener() {
public void know() {
MT10ACT.this.finish();
}
});
this.loadTip.setBackgroundColor(ContextCompat.getColor(this.mContext, 2131099932));
this.loadTip.setLoadingTip(LoadingTip.LoadStatus.know);
return;
}
return;
}
if (this.loadTip != null) {
this.loadTip.setLoadingTip(LoadingTip.LoadStatus.finish);
}
}
}