Online Loan v1.0版本的 MD5 值为:726d0b9cac9ae3a1743a0dc530e1a913
以下内容为反编译后的 MainActivity.java 源代码,内容仅作参考
package com.goyal.enmvapk;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.DownloadManager;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.print.PrintAttributes;
import android.print.PrintDocumentAdapter;
import android.print.PrintJob;
import android.print.PrintManager;
import android.provider.Settings;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.webkit.ConsoleMessage;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import android.webkit.DownloadListener;
import android.webkit.GeolocationPermissions;
import android.webkit.JavascriptInterface;
import android.webkit.JsResult;
import android.webkit.PermissionRequest;
import android.webkit.SslErrorHandler;
import android.webkit.URLUtil;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebStorage;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.Toast;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.g4;
import androidx.core.view.q3;
import androidx.core.view.s3;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.navigation.NavigationView;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringWriter;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLDecoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.ZipFile;
import org.json.JSONArray;
import org.json.JSONException;
public class MainActivity extends androidx.appcompat.app.d implements NavigationView.c {
private static final String V = "MainActivity";
private SwipeRefreshLayout C;
NavigationView D;
private String E;
private ValueCallback<Uri> F;
private ValueCallback<Uri[]> G;
private WebChromeClient.CustomViewCallback H;
private View I;
WebView J;
ImageView K;
String L;
String M;
ProgressBar N;
WebChromeClient O;
Context P;
DrawerLayout Q;
androidx.appcompat.app.b R;
Toolbar S;
m1.a T;
Boolean U = Boolean.FALSE;
public class a implements DialogInterface.OnClickListener {
a() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
MainActivity.this.finish();
}
}
public class b implements DialogInterface.OnClickListener {
b() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
MainActivity.this.P.startActivity(new Intent("android.settings.LOCATION_SOURCE_SETTINGS"));
}
}
public class c implements DialogInterface.OnClickListener {
c() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
dialogInterface.cancel();
}
}
class d extends androidx.appcompat.app.b {
d(Activity activity, DrawerLayout drawerLayout, int i2, int i3) {
super(activity, drawerLayout, i2, i3);
}
@Override
public void c(View view) {
}
@Override
public void d(View view) {
}
}
class e implements Runnable {
final String f4770d;
e(String str) {
this.f4770d = str;
}
@Override
public void run() {
MainActivity.this.K.setVisibility(8);
MainActivity.this.J.setVisibility(0);
if (this.f4770d.equals(MainActivity.this.r0())) {
return;
}
MainActivity.this.B0("This app is created using an unauthorized copy of 'Website 2 APK Builder Pro' Software.", "Unauthorized App", "Shame on me!");
}
}
class f implements View.OnLongClickListener {
f() {
}
@Override
public boolean onLongClick(View view) {
return !MainActivity.this.getResources().getBoolean(R.bool.TextSelection);
}
}
class g implements ViewTreeObserver.OnGlobalLayoutListener {
g() {
}
@Override
public void onGlobalLayout() {
if (MainActivity.this.J.getRootView().getHeight() - MainActivity.this.J.getHeight() < 100) {
MainActivity.this.w0();
}
}
}
class h extends WebChromeClient {
private View f4774a;
class a implements DialogInterface.OnClickListener {
final JsResult f4776d;
a(JsResult jsResult) {
this.f4776d = jsResult;
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
this.f4776d.confirm();
}
}
class b implements DialogInterface.OnClickListener {
final JsResult f4778d;
b(JsResult jsResult) {
this.f4778d = jsResult;
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
this.f4778d.cancel();
}
}
class c implements DialogInterface.OnClickListener {
final JsResult f4780d;
c(JsResult jsResult) {
this.f4780d = jsResult;
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
this.f4780d.confirm();
}
}
h() {
}
@Override
public View getVideoLoadingProgressView() {
if (this.f4774a == null) {
this.f4774a = LayoutInflater.from(MainActivity.this).inflate(R.layout.video_progress, (ViewGroup) null);
}
return this.f4774a;
}
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
onConsoleMessage(consoleMessage.message(), consoleMessage.lineNumber(), consoleMessage.sourceId());
return true;
}
@Override
public void onExceededDatabaseQuota(String str, String str2, long j2, long j3, long j4, WebStorage.QuotaUpdater quotaUpdater) {
quotaUpdater.updateQuota(j3 * 2);
}
@Override
public void onGeolocationPermissionsShowPrompt(String str, GeolocationPermissions.Callback callback) {
callback.invoke(str, true, false);
}
@Override
public void onHideCustomView() {
super.onHideCustomView();
if (MainActivity.this.I == null) {
return;
}
MainActivity.this.I.setVisibility(8);
MainActivity.this.J.setVisibility(0);
MainActivity.this.getWindow().clearFlags(128);
MainActivity.this.H.onCustomViewHidden();
MainActivity.this.I = null;
}
@Override
public boolean onJsAlert(WebView webView, String str, String str2, JsResult jsResult) {
new AlertDialog.Builder(MainActivity.this).setTitle(MainActivity.this.getString(R.string.app_name)).setMessage(str2).setPositiveButton(17039370, new a(jsResult)).setCancelable(false).create().show();
return true;
}
@Override
public boolean onJsConfirm(WebView webView, String str, String str2, JsResult jsResult) {
new AlertDialog.Builder(MainActivity.this.P).setTitle(MainActivity.this.getString(R.string.app_name)).setMessage(str2).setPositiveButton(17039370, new c(jsResult)).setNegativeButton(17039360, new b(jsResult)).create().show();
return true;
}
@Override
public void onPermissionRequest(PermissionRequest permissionRequest) {
if (Build.VERSION.SDK_INT > 21) {
permissionRequest.grant(permissionRequest.getResources());
}
}
@Override
public void onProgressChanged(WebView webView, int i2) {
if (i2 < 100 && MainActivity.this.N.getVisibility() == 8) {
MainActivity.this.N.setVisibility(0);
}
MainActivity.this.N.setProgress(i2);
if (i2 == 100) {
MainActivity.this.N.setVisibility(8);
if (MainActivity.this.C.k()) {
MainActivity.this.C.setRefreshing(false);
}
}
}
@Override
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback customViewCallback) {
if (MainActivity.this.I != null) {
customViewCallback.onCustomViewHidden();
return;
}
MainActivity.this.I = view;
MainActivity.this.J.setVisibility(4);
MainActivity.this.getWindow().addFlags(128);
((FrameLayout) MainActivity.this.getWindow().getDecorView()).addView(MainActivity.this.I, new FrameLayout.LayoutParams(-1, -1));
MainActivity.this.H = customViewCallback;
}
@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> valueCallback, WebChromeClient.FileChooserParams fileChooserParams) {
File file;
Intent intent = null;
if (MainActivity.this.G != null) {
MainActivity.this.G.onReceiveValue(null);
}
MainActivity.this.G = valueCallback;
Intent intent2 = new Intent("android.media.action.IMAGE_CAPTURE");
if (intent2.resolveActivity(MainActivity.this.getPackageManager()) != null) {
try {
file = MainActivity.this.o0();
} catch (IOException e3) {
e = e3;
file = null;
}
try {
intent2.putExtra("PhotoPath", MainActivity.this.E);
} catch (IOException e4) {
e = e4;
Log.e(MainActivity.V, "Image file creation failed", e);
if (file != null) {
}
Intent intent3 = new Intent("android.intent.action.GET_CONTENT");
intent3.addCategory("android.intent.category.OPENABLE");
intent3.putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
intent3.setType("*/*");
if (intent != null) {
}
Intent intent4 = new Intent("android.intent.action.CHOOSER");
intent4.putExtra("android.intent.extra.INTENT", intent3);
intent4.putExtra("android.intent.extra.TITLE", "Choose File");
intent4.putExtra("android.intent.extra.INITIAL_INTENTS", r2);
MainActivity.this.startActivityForResult(intent4, 1);
return true;
}
if (file != null) {
MainActivity.this.E = "file:" + file.getAbsolutePath();
intent2.putExtra("output", Uri.fromFile(file));
}
Intent intent32 = new Intent("android.intent.action.GET_CONTENT");
intent32.addCategory("android.intent.category.OPENABLE");
intent32.putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
intent32.setType("*/*");
Intent[] intentArr = intent != null ? new Intent[]{intent, new Intent("android.media.action.VIDEO_CAPTURE")} : new Intent[0];
Intent intent42 = new Intent("android.intent.action.CHOOSER");
intent42.putExtra("android.intent.extra.INTENT", intent32);
intent42.putExtra("android.intent.extra.TITLE", "Choose File");
intent42.putExtra("android.intent.extra.INITIAL_INTENTS", intentArr);
MainActivity.this.startActivityForResult(intent42, 1);
return true;
}
intent = intent2;
Intent intent322 = new Intent("android.intent.action.GET_CONTENT");
intent322.addCategory("android.intent.category.OPENABLE");
intent322.putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
intent322.setType("*/*");
if (intent != null) {
}
Intent intent422 = new Intent("android.intent.action.CHOOSER");
intent422.putExtra("android.intent.extra.INTENT", intent322);
intent422.putExtra("android.intent.extra.TITLE", "Choose File");
intent422.putExtra("android.intent.extra.INITIAL_INTENTS", intentArr);
MainActivity.this.startActivityForResult(intent422, 1);
return true;
}
}
class i extends WebViewClient {
final Boolean f4782a;
class a implements DialogInterface.OnClickListener {
final SslErrorHandler f4784d;
a(SslErrorHandler sslErrorHandler) {
this.f4784d = sslErrorHandler;
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
this.f4784d.proceed();
}
}
class b implements DialogInterface.OnClickListener {
final SslErrorHandler f4786d;
b(SslErrorHandler sslErrorHandler) {
this.f4786d = sslErrorHandler;
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
this.f4786d.cancel();
}
}
i(Boolean bool) {
this.f4782a = bool;
}
Boolean a(String str) {
if (this.f4782a.booleanValue()) {
return Boolean.valueOf(MainActivity.this.n0(str));
}
if (MainActivity.this.n0(str)) {
return Boolean.TRUE;
}
if (str.contains(MainActivity.this.M)) {
return Boolean.FALSE;
}
MainActivity.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
return Boolean.TRUE;
}
@Override
public void onPageFinished(WebView webView, String str) {
CookieSyncManager.getInstance().sync();
if (MainActivity.this.getResources().getBoolean(R.bool.enableLiveTitle)) {
MainActivity.this.S.setTitle(webView.getTitle());
}
super.onPageFinished(webView, str);
}
@Override
public void onReceivedError(WebView webView, int i2, String str, String str2) {
if (MainActivity.this.getResources().getBoolean(R.bool.isDebugMode)) {
Context applicationContext = MainActivity.this.getApplicationContext();
Toast.makeText(applicationContext, i2 + str + str2, 0).show();
}
webView.loadUrl("file:///android_asset/404r.html");
}
@Override
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
if (MainActivity.this.getResources().getBoolean(R.bool.isDebugMode)) {
Toast.makeText(MainActivity.this.getApplicationContext(), sslError.getPrimaryError(), 0).show();
}
AlertDialog create = new AlertDialog.Builder(MainActivity.this).create();
int primaryError = sslError.getPrimaryError();
String str = (primaryError != 0 ? primaryError != 1 ? primaryError != 2 ? primaryError != 3 ? primaryError != 4 ? "SSL Certificate error." : "The date of the certificate is invalid" : "The certificate authority is not trusted." : "The certificate hostname mismatch." : "The certificate has expired." : "The certificate is not yet valid.") + " Do you want to continue anyway?";
create.setTitle("SSL Certificate Error");
create.setMessage(str);
create.setButton(-1, "OK, Continue", new a(sslErrorHandler));
create.setButton(-2, "Cancel", new b(sslErrorHandler));
create.show();
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
super.shouldOverrideUrlLoading(webView, str);
if (a(str).booleanValue()) {
return true;
}
webView.loadUrl(str);
return false;
}
}
class j implements DownloadListener {
j() {
}
@Override
public void onDownloadStart(String str, String str2, String str3, String str4, long j2) {
if (!MainActivity.this.m0("WRITE_EXTERNAL_STORAGE")) {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse(str));
MainActivity.this.startActivity(intent);
return;
}
try {
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(str));
request.setMimeType(str4);
request.addRequestHeader("cookie", CookieManager.getInstance().getCookie(str));
request.addRequestHeader("User-Agent", str2);
request.setDescription("Downloading file...");
request.setTitle(URLUtil.guessFileName(str, str3, str4));
request.allowScanningByMediaScanner();
request.setNotificationVisibility(1);
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, URLUtil.guessFileName(str, str3, str4));
((DownloadManager) MainActivity.this.getSystemService("download")).enqueue(request);
Toast.makeText(MainActivity.this.getApplicationContext(), "Downloading File", 1).show();
} catch (Exception e3) {
Toast.makeText(MainActivity.this.getApplicationContext(), e3.getMessage(), 0).show();
}
}
}
class k implements SwipeRefreshLayout.j {
k() {
}
@Override
public void a() {
MainActivity.this.J.reload();
}
}
class l implements Runnable {
l() {
}
@Override
public void run() {
MainActivity.this.U = Boolean.FALSE;
}
}
public class m {
Context f4791a;
class a implements Runnable {
a() {
}
@Override
public void run() {
MainActivity.this.J.reload();
}
}
class b implements Runnable {
b() {
}
@Override
public void run() {
MainActivity mainActivity = MainActivity.this;
mainActivity.p0(mainActivity.J);
}
}
class c implements Runnable {
final boolean f4795d;
c(boolean z2) {
this.f4795d = z2;
}
@Override
public void run() {
MainActivity.this.J.setKeepScreenOn(this.f4795d);
}
}
m(Context context) {
this.f4791a = context;
}
@JavascriptInterface
public void askEnableGPS() {
MainActivity.this.k0();
}
@JavascriptInterface
public void clickMenuButton() {
MainActivity.this.openOptionsMenu();
}
@JavascriptInterface
public void exitApp() {
MainActivity.this.T();
}
@JavascriptInterface
public String getAppPackageName() {
try {
return MainActivity.this.getPackageManager().getPackageInfo(MainActivity.this.getPackageName(), 0).packageName;
} catch (PackageManager.NameNotFoundException e3) {
e3.printStackTrace();
return "ERROR";
}
}
@JavascriptInterface
public int getAppVersionCode() {
try {
return MainActivity.this.getPackageManager().getPackageInfo(MainActivity.this.getPackageName(), 0).versionCode;
} catch (PackageManager.NameNotFoundException e3) {
e3.printStackTrace();
return 0;
}
}
@JavascriptInterface
public String getAppVersionName() {
try {
return MainActivity.this.getPackageManager().getPackageInfo(MainActivity.this.getPackageName(), 0).versionName;
} catch (PackageManager.NameNotFoundException e3) {
e3.printStackTrace();
return "Error Fetching Version Info";
}
}
@JavascriptInterface
public int getDeviceApiLevel() {
return Build.VERSION.SDK_INT;
}
@JavascriptInterface
public String getUniqueDeviceID() {
return MainActivity.this.t0();
}
@JavascriptInterface
public void keepScreenOn(boolean z2) {
MainActivity.this.J.post(new c(z2));
}
@JavascriptInterface
public void openExternal(String str) {
MainActivity.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
}
@JavascriptInterface
public void printPage() {
MainActivity.this.J.post(new b());
}
@JavascriptInterface
public void rateUs() {
MainActivity.this.y0();
}
@JavascriptInterface
public void refreshPage() {
MainActivity.this.J.post(new a());
}
@JavascriptInterface
public void shareIntent() {
Intent intent = new Intent("android.intent.action.SEND");
intent.setType("text/plain");
intent.putExtra("android.intent.extra.SUBJECT", this.f4791a.getString(R.string.sharesubject));
intent.putExtra("android.intent.extra.TEXT", this.f4791a.getString(R.string.sharetext));
this.f4791a.startActivity(Intent.createChooser(intent, "Share App via"));
}
@JavascriptInterface
public void showAboutDialog() {
MainActivity.this.A0();
}
@JavascriptInterface
public void showAboutDialog(String str, String str2, String str3) {
MainActivity.this.B0(str, str2, str3);
}
@JavascriptInterface
public void showToast(String str) {
Toast.makeText(this.f4791a, str, 0).show();
}
}
private String U(int i2) {
InputStream openRawResource = getResources().openRawResource(i2);
StringWriter stringWriter = new StringWriter();
char[] cArr = new char[1024];
try {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(openRawResource, "UTF-8"));
while (true) {
int read = bufferedReader.read(cArr);
if (read == -1) {
break;
}
stringWriter.write(cArr, 0, read);
}
} catch (Exception e3) {
e3.printStackTrace();
}
return stringWriter.toString();
}
private void j0() {
if (getResources().getBoolean(R.bool.enableNavDrawer)) {
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
this.D = navigationView;
Menu menu = navigationView.getMenu();
JSONArray jSONArray = new JSONArray();
try {
jSONArray = new JSONArray(new String(this.T.a(U(R.raw.datx))));
} catch (Exception e3) {
Toast.makeText(this.P, e3.getMessage(), 0).show();
}
for (int i2 = 0; i2 < jSONArray.length(); i2++) {
try {
menu.add(0, i2, 0, URLDecoder.decode(jSONArray.getJSONObject(i2).getString("title")));
} catch (JSONException e4) {
e4.printStackTrace();
return;
}
}
if (getResources().getBoolean(R.bool.showAboutInNav)) {
int length = jSONArray.length();
menu.add(1, length + 1, 0, "Share App");
menu.add(1, length + 2, 0, "Rate Us");
menu.add(1, length + 3, 0, "About Us");
menu.add(1, length + 4, 0, "Exit");
}
this.D.invalidate();
}
}
public boolean m0(String str) {
StringBuilder sb = new StringBuilder();
sb.append("android.permission.");
sb.append(str);
return checkCallingOrSelfPermission(sb.toString()) == 0;
}
public boolean n0(String str) {
Intent intent;
if (str.startsWith("market://")) {
try {
this.J.getContext().startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
} catch (ActivityNotFoundException e3) {
e3.printStackTrace();
}
return true;
}
if (str.startsWith("tel:")) {
intent = new Intent("android.intent.action.DIAL", Uri.parse(str));
} else if (str.startsWith("exit:")) {
finish();
return true;
} else if (!str.startsWith("intent://") || !str.contains("scheme=http")) {
if (str.startsWith("intent:") || str.startsWith("upi:")) {
try {
Intent parseUri = Intent.parseUri(str, 1);
if (parseUri != null) {
startActivity(parseUri);
return true;
}
String stringExtra = parseUri.getStringExtra("browser_fallback_url");
if (stringExtra != null) {
this.J.loadUrl(stringExtra);
return true;
}
Intent intent2 = new Intent("android.intent.action.VIEW");
Intent data = intent2.setData(Uri.parse("market://details?id=" + parseUri.getPackage()));
if (data.resolveActivity(getPackageManager()) != null) {
startActivity(data);
return true;
}
} catch (URISyntaxException unused) {
}
} else if (str.startsWith("whatsapp:") || str.startsWith("skype:") || str.startsWith("geo:0,0?q=") || str.startsWith("maps:") || str.startsWith("tg:")) {
intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
} else if (str.startsWith("sms:")) {
intent = new Intent("android.intent.action.SENDTO", Uri.parse(str));
} else if (str.startsWith("mailto:")) {
intent = new Intent("android.intent.action.SENDTO", Uri.parse(str));
} else if (str.contains("#___external")) {
intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
}
return false;
} else {
Matcher matcher = Pattern.compile("intent://(.*?)#").matcher(Uri.decode(str));
if (!matcher.find()) {
return false;
}
String group = matcher.group(1);
intent = new Intent("android.intent.action.VIEW", Uri.parse("http://" + group));
}
startActivity(intent);
return true;
}
public File o0() {
String format = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
return File.createTempFile("img_" + format + "_", ".jpg", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES));
}
private Date q0() {
ZipFile zipFile;
Date date;
Date date2 = new Date(Long.parseLong("1543493615796"));
try {
zipFile = new ZipFile(getPackageManager().getApplicationInfo(getPackageName(), 0).sourceDir);
date = new Date(zipFile.getEntry("classes.dex").getTime());
} catch (Exception unused) {
}
try {
zipFile.close();
return date;
} catch (Exception unused2) {
date2 = date;
return date2;
}
}
public String r0() {
return x0(getPackageName()).toUpperCase().substring(0, 16);
}
private String s0() {
return x0(getString(R.string.devid) + getPackageName()).toUpperCase().substring(16, 32);
}
private Boolean u0() {
if (this.P.getPackageName().equalsIgnoreCase("com.goyal.website2apk")) {
return Boolean.FALSE;
}
if (getString(R.string.csum).toUpperCase().substring(16, 32).equals(s0())) {
return Boolean.TRUE;
}
Date q02 = q0();
String installerPackageName = this.P.getPackageManager().getInstallerPackageName(this.P.getPackageName());
if ((new Date().getTime() - q02.getTime()) / 86400000 > 30 && installerPackageName != null && !installerPackageName.equals("com.google.android.packageinstaller")) {
this.L = "https://websitetoapk.com/" + new StringBuffer("ptset/tsetppa").reverse().toString() + ".html";
WebView.setWebContentsDebuggingEnabled(getResources().getBoolean(R.bool.isDebugMode));
}
return Boolean.FALSE;
}
public static boolean v0(Context context) {
try {
return Settings.Secure.getInt(context.getContentResolver(), "location_mode") != 0;
} catch (Settings.SettingNotFoundException e3) {
e3.printStackTrace();
return false;
}
}
public static final String x0(String str) {
String str2 = str + "00110011";
try {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(str2.getBytes());
byte[] digest = messageDigest.digest();
StringBuilder sb = new StringBuilder();
for (byte b3 : digest) {
String hexString = Integer.toHexString(b3 & 255);
while (hexString.length() < 2) {
hexString = "0" + hexString;
}
sb.append(hexString);
}
return sb.toString();
} catch (NoSuchAlgorithmException e3) {
e3.printStackTrace();
return "";
}
}
public void A0() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(R.string.tag);
builder.setTitle(R.string.aboutTitle);
builder.setPositiveButton("OK", (DialogInterface.OnClickListener) null);
builder.setCancelable(true);
if (((Activity) this.P).isFinishing()) {
return;
}
builder.create().show();
}
public void B0(String str, String str2, String str3) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(str);
builder.setTitle(str2);
builder.setPositiveButton(str3, (DialogInterface.OnClickListener) null);
builder.setCancelable(true);
if (((Activity) this.P).isFinishing()) {
return;
}
builder.create().show();
}
public void T() {
if (getResources().getBoolean(R.bool.confexit)) {
new AlertDialog.Builder(this).setTitle(R.string.cnfExit).setNegativeButton(17039360, (DialogInterface.OnClickListener) null).setPositiveButton(17039370, new a()).create().show();
} else {
finish();
}
}
@Override
public boolean d(MenuItem menuItem) {
int length;
this.Q.d(8388611);
int itemId = menuItem.getItemId();
JSONArray jSONArray = new JSONArray();
try {
jSONArray = new JSONArray(new String(this.T.a(U(R.raw.datx))));
} catch (Exception unused) {
Toast.makeText(this.P, "Error Occured while initializing nav menu", 0).show();
}
try {
length = jSONArray.length();
} catch (JSONException e3) {
e3.printStackTrace();
}
if (itemId == length + 4) {
T();
return true;
} else if (itemId == length + 3) {
A0();
return true;
} else if (itemId == length + 2) {
y0();
return true;
} else if (itemId != length + 1) {
this.J.loadUrl(URLDecoder.decode(jSONArray.getJSONObject(itemId).getString("url")));
this.D.setCheckedItem(itemId);
menuItem.setCheckable(true);
return true;
} else {
Intent intent = new Intent("android.intent.action.SEND");
intent.setType("text/plain");
intent.putExtra("android.intent.extra.SUBJECT", getString(R.string.sharesubject));
intent.putExtra("android.intent.extra.TEXT", getString(R.string.sharetext));
startActivity(Intent.createChooser(intent, "Share via"));
return true;
}
}
public void k0() {
if (v0(this.P)) {
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(this.P);
builder.setTitle("Enable GPS");
builder.setMessage("GPS is disabled. Do you want to enable it?");
builder.setPositiveButton("Settings", new b());
builder.setNegativeButton("Cancel", new c());
builder.show();
}
@TargetApi(23)
protected void l0() {
requestPermissions(new String[]{"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION", "android.permission.RECORD_AUDIO", "android.permission.CAMERA"}, 200);
}
@Override
public void onActivityResult(int i2, int i3, Intent intent) {
Uri[] uriArr;
super.onActivityResult(i2, i3, intent);
if (Build.VERSION.SDK_INT < 21) {
if (i2 != 1 || this.F == null) {
return;
}
this.F.onReceiveValue((intent == null || i3 != -1) ? null : intent.getData());
this.F = null;
return;
}
if (i3 == -1 && i2 == 1) {
ValueCallback<Uri[]> valueCallback = this.G;
if (valueCallback == null) {
return;
}
if (intent == null) {
String str = this.E;
if (str != null) {
uriArr = new Uri[]{Uri.parse(str)};
}
} else if (valueCallback != null) {
try {
if (intent.getDataString() != null) {
uriArr = new Uri[]{Uri.parse(intent.getDataString())};
} else if (intent.getClipData() != null) {
int itemCount = intent.getClipData().getItemCount();
Uri[] uriArr2 = new Uri[itemCount];
for (int i4 = 0; i4 < itemCount; i4++) {
try {
uriArr2[i4] = intent.getClipData().getItemAt(i4).getUri();
} catch (Exception unused) {
}
}
uriArr = uriArr2;
}
} catch (Exception unused2) {
}
} else {
String dataString = intent.getDataString();
if (dataString != null) {
uriArr = new Uri[]{Uri.parse(dataString)};
}
}
this.G.onReceiveValue(uriArr);
this.G = null;
}
uriArr = null;
this.G.onReceiveValue(uriArr);
this.G = null;
}
@Override
public void onBackPressed() {
if (!this.U.booleanValue() && this.J.canGoBack()) {
this.J.goBack();
this.U = Boolean.TRUE;
} else {
T();
}
new Handler().postDelayed(new l(), 200L);
}
@Override
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (getResources().getBoolean(R.bool.flag_secure)) {
getWindow().setFlags(8192, 8192);
}
setContentView(R.layout.activity_main);
this.J = (WebView) findViewById(R.id.webView);
this.K = (ImageView) findViewById(R.id.imageView);
this.T = new m1.a(x0(getString(R.string.devid)).substring(0, 16), getString(R.string.devid).substring(0, 16));
SwipeRefreshLayout swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swiperefresh_items);
this.C = swipeRefreshLayout;
swipeRefreshLayout.setColorSchemeColors(-16776961, -65536, -16711936);
this.Q = (DrawerLayout) findViewById(R.id.drawer_layout);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
this.S = toolbar;
Q(toolbar);
H().v(getResources().getBoolean(R.bool.enableNavDrawer));
H().s(getResources().getBoolean(R.bool.enableNavDrawer));
d dVar = new d(this, this.Q, R.string.app_name, R.string.app_name);
this.R = dVar;
this.Q.setDrawerListener(dVar);
this.R.i();
j0();
((NavigationView) findViewById(R.id.nav_view)).setNavigationItemSelectedListener(this);
this.P = this;
this.N = (ProgressBar) findViewById(R.id.progressBar);
if (!getResources().getBoolean(R.bool.defaultProgressBar)) {
this.N.setIndeterminateDrawable(getResources().getDrawable(R.drawable.spinr));
}
Boolean valueOf = Boolean.valueOf(getResources().getBoolean(R.bool.extlink));
String substring = getString(R.string.csum).toUpperCase().substring(0, 16);
WebSettings settings = this.J.getSettings();
if (z0()) {
l0();
}
w0();
if (getResources().getBoolean(R.bool.desktopMode)) {
settings.setUseWideViewPort(true);
settings.setLoadWithOverviewMode(true);
}
if (getResources().getBoolean(R.bool.hideMobileUserAgent)) {
settings.setUserAgentString(settings.getUserAgentString().replace("Mobile", "").replace("Android", ""));
}
this.L = "https://en.metvay.com";
Uri data = getIntent().getData();
if (data != null) {
this.L = data.toString();
}
if (u0().booleanValue()) {
try {
this.L = new String(this.T.a(U(R.raw.uri)));
if (data != null) {
this.L = data.toString();
}
} catch (Exception unused) {
this.L = "";
Toast.makeText(this.P, "Some error occurred at runtime!", 0).show();
}
}
try {
this.M = new URL(this.L).getHost();
} catch (Exception unused2) {
this.M = "Error";
}
this.J.setVisibility(8);
this.K.setVisibility(0);
if (!getResources().getBoolean(R.bool.enableToolBar)) {
this.S.setVisibility(8);
}
if (!getResources().getBoolean(R.bool.enableNavDrawer)) {
this.Q.setDrawerLockMode(1);
}
this.C.setEnabled(getResources().getBoolean(R.bool.enablePullRefresh));
new Handler().postDelayed(new e(substring), getResources().getInteger(R.integer.duration));
if (getString(R.string.CacheMode).equals("NoCache")) {
settings.setCacheMode(2);
} else if (getString(R.string.CacheMode).equals("HighCache")) {
settings.setCacheMode(1);
} else {
settings.setCacheMode(-1);
}
settings.setRenderPriority(WebSettings.RenderPriority.HIGH);
int i2 = Build.VERSION.SDK_INT;
this.J.setLayerType(2, null);
this.J.setScrollBarStyle(33554432);
settings.setSaveFormData(getResources().getBoolean(R.bool.SaveFormData));
settings.setJavaScriptEnabled(true);
settings.setDatabaseEnabled(true);
settings.setDatabasePath(getApplicationContext().getDir("database", 0).getPath());
settings.setDomStorageEnabled(true);
settings.setPluginState(WebSettings.PluginState.ON);
this.J.setHapticFeedbackEnabled(true);
this.J.setHorizontalScrollBarEnabled(getResources().getBoolean(R.bool.ScrollBars));
this.J.setVerticalScrollBarEnabled(getResources().getBoolean(R.bool.ScrollBars));
this.J.setLongClickable(true);
if (getResources().getBoolean(R.bool.hideWebView)) {
this.J.getSettings().setUserAgentString(this.J.getSettings().getUserAgentString().replace("wv", ""));
}
settings.setGeolocationEnabled(true);
if (i2 >= 21) {
settings.setMixedContentMode(2);
}
if (getResources().getBoolean(R.bool.askGPS)) {
k0();
}
WebView.setWebContentsDebuggingEnabled(getResources().getBoolean(R.bool.isDebugMode));
if (getResources().getBoolean(R.bool.enableJsApi)) {
this.J.addJavascriptInterface(new m(this), "Website2APK");
}
this.J.setOnLongClickListener(new f());
settings.setAllowFileAccess(getResources().getBoolean(R.bool.allow_file_access));
Boolean valueOf2 = Boolean.valueOf(getResources().getBoolean(R.bool.allow_x_origin_from_file));
settings.setAllowFileAccessFromFileURLs(valueOf2.booleanValue());
settings.setAllowUniversalAccessFromFileURLs(valueOf2.booleanValue());
this.J.loadUrl(this.L);
this.J.getViewTreeObserver().addOnGlobalLayoutListener(new g());
this.J.setScrollBarStyle(33554432);
settings.setSupportZoom(true);
settings.setBuiltInZoomControls(getResources().getBoolean(R.bool.gestureZoom));
settings.setDisplayZoomControls(getResources().getBoolean(R.bool.Zoom));
CookieManager.setAcceptFileSchemeCookies(true);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptCookie(true);
cookieManager.acceptCookie();
CookieSyncManager.createInstance(this.P);
if (i2 > 21) {
cookieManager.setAcceptThirdPartyCookies(this.J, true);
}
settings.setMediaPlaybackRequiresUserGesture(false);
if (bundle != null) {
this.J.restoreState(bundle);
}
h hVar = new h();
this.O = hVar;
this.J.setWebChromeClient(hVar);
this.J.setWebViewClient(new i(valueOf));
this.J.setDownloadListener(new j());
this.C.setOnRefreshListener(new k());
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
menu.findItem(R.id.action_home).setVisible(getResources().getBoolean(R.bool.showHomeBtn));
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
if (this.R.f(menuItem)) {
return true;
}
int itemId = menuItem.getItemId();
Intent intent = new Intent("android.intent.action.SEND");
if (itemId == R.id.action_exit) {
T();
return true;
} else if (itemId == R.id.action_tag) {
A0();
return true;
} else if (itemId == R.id.rate_us) {
y0();
return true;
} else if (itemId != R.id.action_share) {
if (itemId == R.id.action_home) {
this.J.loadUrl(this.L);
}
return super.onOptionsItemSelected(menuItem);
} else {
intent.setType("text/plain");
intent.putExtra("android.intent.extra.SUBJECT", getString(R.string.sharesubject));
intent.putExtra("android.intent.extra.TEXT", getString(R.string.sharetext));
startActivity(Intent.createChooser(intent, "Share via"));
return true;
}
}
@Override
public void onPause() {
CookieSyncManager.getInstance().stopSync();
this.J.onPause();
super.onPause();
}
@Override
public void onResume() {
w0();
CookieSyncManager.getInstance().startSync();
this.J.onResume();
super.onResume();
}
public void p0(WebView webView) {
Context applicationContext;
String str;
PrintDocumentAdapter createPrintDocumentAdapter = webView.createPrintDocumentAdapter();
PrintAttributes.Builder builder = new PrintAttributes.Builder();
builder.setMediaSize(PrintAttributes.MediaSize.ISO_A5);
PrintJob print = ((PrintManager) getSystemService("print")).print(getString(R.string.app_name) + " Document", createPrintDocumentAdapter, builder.build());
if (print.isCompleted()) {
applicationContext = getApplicationContext();
str = "Print Completed";
} else if (!print.isFailed()) {
return;
} else {
applicationContext = getApplicationContext();
str = "Print Failed";
}
Toast.makeText(applicationContext, str, 1).show();
}
public String t0() {
return Settings.Secure.getString(this.P.getContentResolver(), "android_id");
}
public void w0() {
if (getResources().getBoolean(R.bool.fullscr)) {
g4 a3 = q3.a(getWindow(), getWindow().getDecorView());
a3.d(2);
a3.a(s3.m.c());
getWindow().getDecorView().setSystemUiVisibility(3846);
}
}
public void y0() {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse("market://details?id=" + this.P.getPackageName()));
intent.addFlags(1207959552);
try {
startActivity(intent);
} catch (ActivityNotFoundException unused) {
startActivity(new Intent("android.intent.action.VIEW", Uri.parse("http://play.google.com/store/apps/details?id=" + this.P.getPackageName())));
}
}
protected boolean z0() {
return Build.VERSION.SDK_INT > 23;
}
}