云顶彩票 v1.0.0版本的 MD5 值为:63ba5d5275adbaa5b51a7abfd0af75f7
以下内容为反编译后的 MainActivity.java 源代码,内容仅作参考
package com.bet8df.cloudtopapp;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.DownloadListener;
import android.webkit.SslErrorHandler;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.RadioGroup;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import cn.jpush.android.api.JPushInterface;
import com.bet8df.cloudtopapp.jpush.BadgerUtil;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.SPUtils;
import com.just.library.AgentWeb;
import com.just.library.AgentWebSettings;
import com.just.library.DownLoadResultListener;
import com.just.library.IWebLayout;
import com.just.library.PermissionInterceptor;
import com.just.library.WebDefaultSettingsManager;
public class MainActivity extends AppCompatActivity {
private boolean isExit;
private AgentWeb mAgentWeb;
private WebView mWebView;
@BindView(R.id.rbMenue)
RadioGroup rbMenue;
private Unbinder unbinder;
@BindView(R.id.webView)
WebView webView;
private String url = "https://aa.41yd.bet";
protected DownLoadResultListener mDownLoadResultListener = new DownLoadResultListener() {
@Override
public void error(String path, String resUrl, String cause, Throwable e) {
}
@Override
public void success(String path) {
}
};
private WebViewClient mWebViewClient = new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
if (url.startsWith("http") || url.startsWith("https")) {
super.onPageStarted(view, url, favicon);
return;
}
try {
MainActivity.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(url)));
} catch (Exception unused) {
Toast.makeText(MainActivity.this, "您没有安装相应的程序", 1).show();
}
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith("http") || url.startsWith("https")) {
view.loadUrl(url);
return true;
}
try {
MainActivity.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(url)));
} catch (Exception unused) {
Toast.makeText(MainActivity.this, "您没有安装相应的程序", 1).show();
}
return true;
}
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
Log.d("SslError:", error.toString());
handler.proceed();
super.onReceivedSslError(view, handler, error);
}
};
protected PermissionInterceptor getPermissionInterceptor() {
return null;
}
WebChromeClient getWebChromeClient() {
return null;
}
protected IWebLayout getWebLayout() {
return null;
}
protected WebView getWebView() {
return null;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.url = getIntent().getStringExtra("url");
this.unbinder = ButterKnife.bind(this);
AgentWeb go = AgentWeb.with(this).setAgentWebParent(this.webView, new ViewGroup.LayoutParams(-1, -1)).useDefaultIndicator().setIndicatorColorWithHeight(ContextCompat.getColor(this, R.color.white), 1).setWebChromeClient(getWebChromeClient()).setWebViewClient(getWebViewClient()).setWebView(getWebView()).setPermissionInterceptor(getPermissionInterceptor()).setWebLayout(getWebLayout()).addDownLoadResultListener(this.mDownLoadResultListener).setAgentWebSettings(getAgentWebSettings()).setSecutityType(AgentWeb.SecurityType.strict).openParallelDownload().setNotifyIcon(R.mipmap.download).createAgentWeb().ready().go(this.url);
this.mAgentWeb = go;
WebView webView = go.getWebCreator().get();
this.mWebView = webView;
webView.setDownloadListener(new MyWebViewDownLoadListener());
SPUtils.getInstance().put("pushcount", 0);
LogUtils.a(JPushInterface.getRegistrationID(this));
BadgerUtil.addBadger(this, 0);
}
public void setBarBlackColor() {
if (Build.VERSION.SDK_INT >= 23) {
getWindow().getDecorView().setSystemUiVisibility(8192);
}
}
@Override
public void onResume() {
super.onResume();
JPushInterface.onResume(this);
SPUtils.getInstance().put("pushcount", 0);
BadgerUtil.addBadger(this, 0);
}
@OnClick({R.id.rbt_back, R.id.rbt_go, R.id.rbt_refresh, R.id.rbt_clear})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.rbt_back:
this.mWebView.goBack();
return;
case R.id.rbt_clear:
this.mWebView.clearCache(true);
this.mWebView.loadUrl(this.url);
this.mWebView.postDelayed(new Runnable() {
@Override
public final void run() {
MainActivity.this.lambda$onViewClicked$0$MainActivity();
}
}, 1000L);
return;
case R.id.rbt_go:
this.mWebView.goForward();
return;
case R.id.rbt_refresh:
this.mWebView.reload();
return;
default:
return;
}
}
public void lambda$onViewClicked$0$MainActivity() {
this.mWebView.clearHistory();
}
private class MyWebViewDownLoadListener implements DownloadListener {
private MyWebViewDownLoadListener() {
}
@Override
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
MainActivity.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(url)));
}
}
protected WebViewClient getWebViewClient() {
return this.mWebViewClient;
}
public AgentWebSettings getAgentWebSettings() {
return WebDefaultSettingsManager.getInstance();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == 4) {
exit();
if (!this.mAgentWeb.getWebCreator().get().canGoBack()) {
return false;
}
}
AgentWeb agentWeb = this.mAgentWeb;
if (agentWeb == null || !agentWeb.handleKeyEvent(keyCode, event)) {
return super.onKeyDown(keyCode, event);
}
return true;
}
private void exit() {
if (!this.isExit) {
this.isExit = true;
Toast.makeText(this, "再点击一次退出程序", 1).show();
new Handler().postDelayed(new Runnable() {
@Override
public final void run() {
MainActivity.this.lambda$exit$1$MainActivity();
}
}, 2000L);
} else {
Intent intent = new Intent("android.intent.action.MAIN");
intent.addCategory("android.intent.category.HOME");
intent.setFlags(268435456);
startActivity(intent);
}
}
public void lambda$exit$1$MainActivity() {
this.isExit = false;
}
@Override
public void onDestroy() {
super.onDestroy();
this.unbinder.unbind();
}
}