正在查看: SpeedCash v6.5.1482 应用的 LiveChatActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: SpeedCash v6.5.1482 应用的 LiveChatActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.bm.sc.kotlin.ui.cs;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.core.app.ActivityCompat;
import androidx.core.content.FileProvider;
import androidx.exifinterface.media.ExifInterface;
import com.bm.sc.bebasbayar.R;
import com.bm.sc.bebasbayar.adapter.entity.TrainScheduleEntity;
import com.bm.sc.bebasbayar.handler.FirebaseProcessor;
import com.bm.sc.bebasbayar.helper.Affinity;
import com.bm.sc.bebasbayar.iface.BBCallback;
import com.bm.sc.bebasbayar.setting.session.AppSession;
import com.bm.sc.bebasbayar.setting.session.ConfigSession;
import com.bm.sc.bebasbayar.ui.BaseActivity;
import com.bm.sc.bebasbayar.ui.activity.OtherHomeMenuActivity;
import com.bm.sc.bebasbayar.ui.activity.account.DetailDocumentActivity;
import com.bm.sc.kotlin.helper.HelperKt;
import com.bm.sc.kotlin.ui.cs.LiveChatActivity;
import com.bm.sc.util.common.Var;
import com.facebook.gamingservices.cloudgaming.internal.SDKConstants;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Objects;
import java.util.Timer;
import java.util.TimerTask;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import org.apache.commons.text.lookup.StringLookupFactory;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@Metadata(d1 = {"\u0000j\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\n\n\u0002\u0010\u0011\n\u0000\n\u0002\u0010\u0015\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0011\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u000b\u0018\u0000 M2\u00020\u0001:\u0001MB\u0007¢\u0006\u0004\bK\u0010LJ\b\u0010\u0003\u001a\u00020\u0002H\u0002J\b\u0010\u0004\u001a\u00020\u0002H\u0002J\b\u0010\u0005\u001a\u00020\u0002H\u0002J\b\u0010\u0007\u001a\u00020\u0006H\u0002J\b\u0010\b\u001a\u00020\u0002H\u0002J\b\u0010\t\u001a\u00020\u0002H\u0002J\u0012\u0010\f\u001a\u00020\u00022\b\u0010\u000b\u001a\u0004\u0018\u00010\nH\u0002J\b\u0010\r\u001a\u00020\u0002H\u0002J\b\u0010\u000e\u001a\u00020\u0002H\u0002J\u0012\u0010\u0011\u001a\u00020\u00022\b\u0010\u0010\u001a\u0004\u0018\u00010\u000fH\u0015J\"\u0010\u0017\u001a\u00020\u00022\u0006\u0010\u0013\u001a\u00020\u00122\u0006\u0010\u0014\u001a\u00020\u00122\b\u0010\u0016\u001a\u0004\u0018\u00010\u0015H\u0016J\b\u0010\u0018\u001a\u00020\u0012H\u0014J\b\u0010\u001a\u001a\u00020\u0019H\u0016J\b\u0010\u001b\u001a\u00020\nH\u0014J\b\u0010\u001c\u001a\u00020\u0002H\u0017J\b\u0010\u001d\u001a\u00020\u0002H\u0017J\b\u0010\u001e\u001a\u00020\u0002H\u0016J\b\u0010\u001f\u001a\u00020\u0012H\u0014J\b\u0010 \u001a\u00020\u0012H\u0014J\b\u0010!\u001a\u00020\u0012H\u0014J\b\u0010\"\u001a\u00020\u0002H\u0016J\u0006\u0010#\u001a\u00020\u0002J-\u0010(\u001a\u00020\u00022\u0006\u0010\u0013\u001a\u00020\u00122\f\u0010%\u001a\b\u0012\u0004\u0012\u00020\n0$2\u0006\u0010'\u001a\u00020&H\u0016¢\u0006\u0004\b(\u0010)J\u0010\u0010,\u001a\u00020\u00192\u0006\u0010+\u001a\u00020*H\u0016R\u0016\u0010/\u001a\u00020\u00198\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b-\u0010.R\u0018\u00102\u001a\u0004\u0018\u00010\n8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b0\u00101R\u0016\u00104\u001a\u00020\n8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b3\u00101R$\u0010;\u001a\u0004\u0018\u00010\u000f8\u0006@\u0006X\u0086\u000e¢\u0006\u0012\n\u0004\b5\u00106\u001a\u0004\b7\u00108\"\u0004\b9\u0010:R\u0016\u0010?\u001a\u00020<8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\b=\u0010>R\u0018\u0010A\u001a\u0004\u0018\u00010\n8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b@\u00101R$\u0010F\u001a\u0010\u0012\n\u0012\b\u0012\u0004\u0012\u00020C0$\u0018\u00010B8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bD\u0010ER\u0016\u0010H\u001a\u00020\u00198\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bG\u0010.R\u0016\u0010J\u001a\u00020\u00198\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bI\u0010.¨\u0006N"}, d2 = {"Lcom/bm/sc/kotlin/ui/cs/LiveChatActivity;", "Lcom/bm/sc/bebasbayar/ui/BaseActivity;", "", "E", "v", "openWebView", "Ljava/io/File;", ExifInterface.GPS_MEASUREMENT_IN_PROGRESS, TrainScheduleEntity.CLASS_BUSSINESS, "u", "", StringLookupFactory.KEY_SCRIPT, "C", "cekPermissionCamera", "cekPermissionStorage", "Landroid/os/Bundle;", "savedInstanceState", "onCreate", "", "requestCode", "resultCode", "Landroid/content/Intent;", SDKConstants.PARAM_INTENT, "onActivityResult", "getLayoutResource", "", "isEligibleForFavorit", "getWikiNameSpace", "onResume", "onPause", "onDestroy", "getContentResource", "getMenuResource", "getToolbarIconResource", "onBackPressed", "confirmExit", "", "permissions", "", "grantResults", "onRequestPermissionsResult", "(I[Ljava/lang/String;[I)V", "Landroid/view/Menu;", FirebaseProcessor.TYPE_MENU, "onCreateOptionsMenu", "c", "Z", "enableWaDisableWeb", "d", "Ljava/lang/String;", "urlLiveChat", "e", "phoneLivechat", "f", "Landroid/os/Bundle;", "getBundle", "()Landroid/os/Bundle;", "setBundle", "(Landroid/os/Bundle;)V", "bundle", "Landroid/webkit/WebView;", "g", "Landroid/webkit/WebView;", "webView", "h", "mCM", "Landroid/webkit/ValueCallback;", "Landroid/net/Uri;", "i", "Landroid/webkit/ValueCallback;", "mUMA", "j", "permissionCamera", "k", "permissionStorage", "<init>", "()V", "Companion", "app_release"}, k = 1, mv = {1, 8, 0})
@SourceDebugExtension({"SMAP\nLiveChatActivity.kt\nKotlin\n*S Kotlin\n*F\n+ 1 LiveChatActivity.kt\ncom/bm/sc/kotlin/ui/cs/LiveChatActivity\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 3 ArraysJVM.kt\nkotlin/collections/ArraysKt__ArraysJVMKt\n*L\n1#1,579:1\n1#2:580\n37#3,2:581\n*S KotlinDebug\n*F\n+ 1 LiveChatActivity.kt\ncom/bm/sc/kotlin/ui/cs/LiveChatActivity\n*L\n489#1:581,2\n*E\n"})
public final class LiveChatActivity extends BaseActivity {
public boolean enableWaDisableWeb = true;
@Nullable
public String urlLiveChat = "";
@NotNull
public String phoneLivechat = "";
@Nullable
public Bundle bundle;
public WebView webView;
@Nullable
public String mCM;
@Nullable
public ValueCallback<Uri[]> mUMA;
public boolean permissionCamera;
public boolean permissionStorage;
public static final void D(LiveChatActivity this$0, View view) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.onBackPressed();
}
public static final void w(LiveChatActivity this$0, int i, boolean z) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
if (z) {
this$0.cekPermissionCamera();
} else {
Affinity.info(this$0, false, this$0.getString(R.string.transaction_camera_permission_denied));
}
}
public static final void x(LiveChatActivity this$0, int i, boolean z) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
if (z) {
this$0.cekPermissionStorage();
} else {
Affinity.info(this$0, false, this$0.getString(R.string.transaction_storage_permission_denied));
}
}
public static final void y(LiveChatActivity this$0, int i, boolean z) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
if (z) {
this$0.cekPermissionStorage();
} else {
Affinity.info(this$0, false, this$0.getString(R.string.transaction_storage_permission_denied));
}
}
public static final void z(LiveChatActivity this$0, int i, boolean z) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
if (z) {
if (this$0.webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
}
WebView webView = this$0.webView;
WebView webView2 = null;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
webView.removeAllViews();
if (this$0.webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
}
WebView webView3 = this$0.webView;
if (webView3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView3 = null;
}
webView3.clearHistory();
WebView webView4 = this$0.webView;
if (webView4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView4 = null;
}
webView4.clearCache(true);
WebView webView5 = this$0.webView;
if (webView5 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
} else {
webView2 = webView5;
}
webView2.loadUrl("about:blank");
this$0.B();
this$0.u();
}
}
public final File A() throws IOException {
String str = "img_" + new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()) + '_';
StringBuilder sb = new StringBuilder();
File cacheDir = getApplicationContext().getCacheDir();
Objects.requireNonNull(cacheDir);
sb.append(cacheDir.toString());
sb.append('/');
sb.append(str);
sb.append(".jpg");
return new File(sb.toString());
}
public final void B() {
if (this.webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
}
WebView webView = this.webView;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
webView.freeMemory();
}
public final void C(String script) {
if (this.webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
}
if (script != null) {
WebView webView = this.webView;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
webView.evaluateJavascript(script, null);
}
}
public final void E() {
Affinity.openDraftWhatsApp(this, this.phoneLivechat, "Hai kak, saya butuh bantuan nih");
finish();
}
public final void cekPermissionCamera() {
boolean isPermissionGranted = Affinity.isPermissionGranted(this, "android.permission.CAMERA");
this.permissionCamera = isPermissionGranted;
boolean z = false;
if (!isPermissionGranted) {
ArrayList arrayList = new ArrayList();
arrayList.add("android.permission.CAMERA");
ActivityCompat.requestPermissions(this, (String[]) arrayList.toArray(new String[0]), DetailDocumentActivity.REQUEST_CAMERA_PERMISSIONS);
}
if (Build.VERSION.SDK_INT < 33 ? Affinity.isPermissionGranted(this, "android.permission.READ_EXTERNAL_STORAGE") || Affinity.isPermissionGranted(this, "android.permission.WRITE_EXTERNAL_STORAGE") : Affinity.isPermissionGranted(this, "android.permission.READ_MEDIA_IMAGES") && Affinity.isPermissionGranted(this, "android.permission.READ_MEDIA_VIDEO")) {
z = true;
}
this.permissionStorage = z;
if (this.permissionCamera && z) {
openWebView();
}
}
public final void cekPermissionStorage() {
this.permissionCamera = Affinity.isPermissionGranted(this, "android.permission.CAMERA");
int i = Build.VERSION.SDK_INT;
boolean z = false;
if (i < 33 ? Affinity.isPermissionGranted(this, "android.permission.READ_EXTERNAL_STORAGE") || Affinity.isPermissionGranted(this, "android.permission.WRITE_EXTERNAL_STORAGE") : Affinity.isPermissionGranted(this, "android.permission.READ_MEDIA_IMAGES") && Affinity.isPermissionGranted(this, "android.permission.READ_MEDIA_VIDEO")) {
z = true;
}
this.permissionStorage = z;
if (!z) {
if (i >= 33) {
ActivityCompat.requestPermissions(this, new String[]{"android.permission.READ_MEDIA_IMAGES", "android.permission.READ_MEDIA_VIDEO", "android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"}, 445);
} else {
ActivityCompat.requestPermissions(this, new String[]{"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"}, 445);
}
}
if (this.permissionCamera && this.permissionStorage) {
openWebView();
}
}
public final void confirmExit() {
Affinity.confirm(this, getString(R.string.title_confirm), getString(R.string.confirm_quit_lc), new BBCallback() {
@Override
public final void do_callback(int i, Object obj) {
LiveChatActivity.z(LiveChatActivity.this, i, ((Boolean) obj).booleanValue());
}
});
}
@Nullable
public final Bundle getBundle() {
return this.bundle;
}
@Override
public int getContentResource() {
return R.layout.activity_live_chat;
}
@Override
public int getLayoutResource() {
return R.layout.activity_live_chat;
}
@Override
public int getMenuResource() {
return R.menu.main;
}
@Override
public int getToolbarIconResource() {
return R.drawable.ic_chevron_left_white_24dp;
}
@Override
@NotNull
public String getWikiNameSpace() {
String name = LiveChatActivity.class.getName();
Intrinsics.checkNotNullExpressionValue(name, "javaClass.name");
return name;
}
@Override
public boolean isEligibleForFavorit() {
return false;
}
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent intent) {
Uri[] uriArr;
super.onActivityResult(requestCode, resultCode, intent);
if (resultCode == -1 && requestCode == 1) {
if (this.mUMA == null) {
return;
}
if (intent == null) {
String str = this.mCM;
if (str != null) {
Uri parse = Uri.parse(str);
Intrinsics.checkNotNullExpressionValue(parse, "parse(mCM)");
uriArr = new Uri[]{parse};
}
} else {
String dataString = intent.getDataString();
if (dataString != null) {
Uri parse2 = Uri.parse(dataString);
Intrinsics.checkNotNullExpressionValue(parse2, "parse(dataString)");
uriArr = new Uri[]{parse2};
}
}
if (uriArr != null) {
ValueCallback<Uri[]> valueCallback = this.mUMA;
Intrinsics.checkNotNull(valueCallback);
valueCallback.onReceiveValue(uriArr);
}
this.mUMA = null;
}
uriArr = null;
if (uriArr != null) {
}
this.mUMA = null;
}
@Override
public void onBackPressed() {
confirmExit();
}
@Override
@SuppressLint({"SetJavaScriptEnabled"})
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.bundle = getIntent().getExtras();
View findViewById = findViewById(R.id.lc_web_view);
Intrinsics.checkNotNullExpressionValue(findViewById, "findViewById(R.id.lc_web_view)");
this.webView = (WebView) findViewById;
boolean z = true;
this.enableWaDisableWeb = Var.toBoolean(new ConfigSession(this).retrieveMap(ConfigSession.PROPERTY_CONTACT_CENTER, ConfigSession.KEY_PREFERENCE_ENABLE_WA_DISABLE_WEB), true);
String retrieveMap = new ConfigSession(this).retrieveMap(ConfigSession.PROPERTY_CONTACT_CENTER, "wa_livechat");
Intrinsics.checkNotNullExpressionValue(retrieveMap, "ConfigSession(this).retr…NCE_WA_LIVECHAT\n )");
this.phoneLivechat = retrieveMap;
this.urlLiveChat = new ConfigSession(this).retrieveMap(ConfigSession.PROPERTY_CONTACT_CENTER, ConfigSession.KEY_PREFERENCE_WEB_LIVECHAT);
if (!HelperKt.isAppInstalled("com.whatsapp", this) && !HelperKt.isAppInstalled("com.whatsapp.w4b", this)) {
z = false;
}
this.enableWaDisableWeb = z;
if (z) {
E();
} else {
v();
}
}
@Override
public boolean onCreateOptionsMenu(@NotNull Menu menu) {
Intrinsics.checkNotNullParameter(menu, "menu");
super.onCreateOptionsMenu(menu);
int size = menu.size();
for (int i = 0; i < size; i++) {
menu.getItem(i).setVisible(false);
}
return true;
}
@Override
public void onDestroy() {
if (this.webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
}
WebView webView = this.webView;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
webView.destroy();
super.onDestroy();
}
@Override
@SuppressLint({"NewApi"})
public void onPause() {
if (this.webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
}
WebView webView = this.webView;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
webView.onPause();
super.onPause();
}
@Override
public void onRequestPermissionsResult(int requestCode, @NotNull String[] permissions, @NotNull int[] grantResults) {
Intrinsics.checkNotNullParameter(permissions, "permissions");
Intrinsics.checkNotNullParameter(grantResults, "grantResults");
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == 445) {
if (grantResults.length <= 0 || grantResults[0] != 0) {
return;
}
this.permissionStorage = true;
if (this.permissionCamera) {
openWebView();
return;
}
return;
}
if (requestCode != 555) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
return;
}
if (grantResults.length <= 0 || grantResults[0] != 0) {
return;
}
this.permissionCamera = true;
if (this.permissionStorage) {
openWebView();
}
}
@Override
@SuppressLint({"NewApi"})
public void onResume() {
super.onResume();
if (this.webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
}
WebView webView = this.webView;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
webView.onResume();
}
public final void openWebView() {
WebView webView = this.webView;
WebView webView2 = null;
if (webView == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView = null;
}
webView.setInitialScale(1);
WebView webView3 = this.webView;
if (webView3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView3 = null;
}
webView3.getSettings().setLoadWithOverviewMode(true);
WebView webView4 = this.webView;
if (webView4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView4 = null;
}
webView4.getSettings().setUseWideViewPort(true);
WebView webView5 = this.webView;
if (webView5 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView5 = null;
}
webView5.getSettings().setJavaScriptEnabled(true);
WebView webView6 = this.webView;
if (webView6 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView6 = null;
}
webView6.getSettings().setDatabaseEnabled(true);
WebView webView7 = this.webView;
if (webView7 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView7 = null;
}
webView7.getSettings().setDomStorageEnabled(true);
WebView webView8 = this.webView;
if (webView8 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView8 = null;
}
webView8.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
WebView webView9 = this.webView;
if (webView9 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView9 = null;
}
webView9.getSettings().setSupportZoom(true);
WebView webView10 = this.webView;
if (webView10 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView10 = null;
}
webView10.getSettings().setBuiltInZoomControls(true);
WebView webView11 = this.webView;
if (webView11 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView11 = null;
}
webView11.getSettings().setDisplayZoomControls(false);
WebView webView12 = this.webView;
if (webView12 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView12 = null;
}
webView12.getSettings().setGeolocationEnabled(true);
WebView webView13 = this.webView;
if (webView13 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView13 = null;
}
webView13.setWebViewClient(new WebViewClient());
WebView webView14 = this.webView;
if (webView14 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
webView14 = null;
}
webView14.setWebChromeClient(new WebChromeClient() {
@Override
public boolean onShowFileChooser(@NotNull WebView webView15, @NotNull ValueCallback<Uri[]> filePathCallback, @NotNull WebChromeClient.FileChooserParams fileChooserParams) {
ValueCallback valueCallback;
File file;
String str;
ValueCallback valueCallback2;
Intrinsics.checkNotNullParameter(webView15, "webView");
Intrinsics.checkNotNullParameter(filePathCallback, "filePathCallback");
Intrinsics.checkNotNullParameter(fileChooserParams, "fileChooserParams");
valueCallback = LiveChatActivity.this.mUMA;
Intent intent = null;
if (valueCallback != null) {
valueCallback2 = LiveChatActivity.this.mUMA;
Intrinsics.checkNotNull(valueCallback2);
valueCallback2.onReceiveValue(null);
}
LiveChatActivity.this.mUMA = filePathCallback;
Intent intent2 = new Intent("android.media.action.IMAGE_CAPTURE");
if (intent2.resolveActivity(LiveChatActivity.this.getPackageManager()) != null) {
try {
file = LiveChatActivity.this.A();
try {
str = LiveChatActivity.this.mCM;
intent2.putExtra("PhotoPath", str);
} catch (IOException unused) {
}
} catch (IOException unused2) {
file = null;
}
if (file != null) {
LiveChatActivity.this.mCM = "file:" + file.getAbsolutePath();
intent2.putExtra("output", FileProvider.getUriForFile(LiveChatActivity.this.getApplicationContext(), "com.bm.sc.bebasbayar.provider", file));
}
Intent intent3 = new Intent("android.intent.action.GET_CONTENT");
intent3.addCategory("android.intent.category.OPENABLE");
intent3.setType("*/*");
Intent[] intentArr = intent == null ? new Intent[]{intent} : new Intent[0];
Intent intent4 = new Intent("android.intent.action.CHOOSER");
intent4.putExtra("android.intent.extra.INTENT", intent3);
intent4.putExtra("android.intent.extra.TITLE", "Image Chooser");
intent4.putExtra("android.intent.extra.INITIAL_INTENTS", intentArr);
LiveChatActivity.this.startActivityForResult(intent4, 1);
return true;
}
intent = intent2;
Intent intent32 = new Intent("android.intent.action.GET_CONTENT");
intent32.addCategory("android.intent.category.OPENABLE");
intent32.setType("*/*");
if (intent == null) {
}
Intent intent42 = new Intent("android.intent.action.CHOOSER");
intent42.putExtra("android.intent.extra.INTENT", intent32);
intent42.putExtra("android.intent.extra.TITLE", "Image Chooser");
intent42.putExtra("android.intent.extra.INITIAL_INTENTS", intentArr);
LiveChatActivity.this.startActivityForResult(intent42, 1);
return true;
}
});
String str = this.urlLiveChat;
if (str != null) {
WebView webView15 = this.webView;
if (webView15 == null) {
Intrinsics.throwUninitializedPropertyAccessException("webView");
} else {
webView2 = webView15;
}
webView2.loadUrl(str);
}
setTitle("Live Chat SpeedCash");
getToolbar().setNavigationOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
LiveChatActivity.D(LiveChatActivity.this, view);
}
});
}
public final void setBundle(@Nullable Bundle bundle) {
this.bundle = bundle;
}
public final void u() {
C("javascript:(function(){l=document.getElementById('info_disconnect_text');e=document.createEvent('HTMLEvents');e.initEvent('click',true,true);l.dispatchEvent(e);})()");
new Timer().schedule(new TimerTask() {
@Override
public void run() {
boolean z = false;
if (LiveChatActivity.this.getIntent().getExtras() != null) {
Bundle extras = LiveChatActivity.this.getIntent().getExtras();
Intrinsics.checkNotNull(extras);
z = Var.toBoolean(Boolean.valueOf(extras.getBoolean(AppSession.IS_FROM_NEW_HOME)), false);
}
if (z) {
Affinity.purge(LiveChatActivity.this, OtherHomeMenuActivity.class);
} else {
LiveChatActivity.this.finish();
}
}
}, 500L);
}
public final void v() {
if (!Affinity.isPermissionGranted(this, "android.permission.CAMERA")) {
Affinity.confirm(this, getString(R.string.title_confirm), getString(R.string.transaction_camera_permission), new BBCallback() {
@Override
public final void do_callback(int i, Object obj) {
LiveChatActivity.w(LiveChatActivity.this, i, ((Boolean) obj).booleanValue());
}
});
}
if (Build.VERSION.SDK_INT < 33) {
if (Affinity.isPermissionGranted(this, "android.permission.READ_EXTERNAL_STORAGE")) {
openWebView();
return;
} else {
Affinity.confirm(this, getString(R.string.title_confirm), getString(R.string.transaction_storage_permission), new BBCallback() {
@Override
public final void do_callback(int i, Object obj) {
LiveChatActivity.y(LiveChatActivity.this, i, ((Boolean) obj).booleanValue());
}
});
return;
}
}
if (Affinity.isPermissionGranted(this, "android.permission.READ_MEDIA_VIDEO") && Affinity.isPermissionGranted(this, "android.permission.READ_MEDIA_IMAGES")) {
openWebView();
} else {
Affinity.confirm(this, getString(R.string.title_confirm), getString(R.string.transaction_storage_permission), new BBCallback() {
@Override
public final void do_callback(int i, Object obj) {
LiveChatActivity.x(LiveChatActivity.this, i, ((Boolean) obj).booleanValue());
}
});
}
}
}