what-the-bank/sources/com/scb/phone/view/fragment/easycash/BaseTakePhotoFragment.java

213 lines
8.4 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.easycash;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import com.scb.phone.R;
import com.scb.phone.view.activity.BaseActivity;
import com.scb.phone.view.custom.common.CustomDialog;
import com.scb.phone.view.fragment.etb.BreadcrumbFragment;
import o.C12891fKc;
import o.InterfaceC15577gud;
import o.eSW;
import o.guQ;
/* loaded from: classes5.dex */
public abstract class BaseTakePhotoFragment extends BreadcrumbFragment {
public String c;
public boolean p() {
return false;
}
public String q() {
return null;
}
public int t() {
return 0;
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityCreated(Bundle bundle) {
super.onActivityCreated(bundle);
if (bundle != null) {
this.c = bundle.getString("IMAGE_PATH");
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
bundle.putString("IMAGE_PATH", this.c);
}
/* JADX WARN: Removed duplicated region for block: B:12:0x003b A[Catch: Exception -> 0x0063, TryCatch #0 {Exception -> 0x0063, blocks: (B:2:0x0000, B:4:0x0015, B:6:0x0021, B:10:0x0031, B:12:0x003b, B:13:0x0050, B:14:0x0061, B:18:0x0046), top: B:1:0x0000 }] */
/* JADX WARN: Removed duplicated region for block: B:18:0x0046 A[Catch: Exception -> 0x0063, TryCatch #0 {Exception -> 0x0063, blocks: (B:2:0x0000, B:4:0x0015, B:6:0x0021, B:10:0x0031, B:12:0x003b, B:13:0x0050, B:14:0x0061, B:18:0x0046), top: B:1:0x0000 }] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public void w() {
/*
r4 = this;
android.content.Intent r0 = new android.content.Intent // Catch: java.lang.Exception -> L63
java.lang.String r1 = "android.media.action.IMAGE_CAPTURE"
r0.<init>(r1) // Catch: java.lang.Exception -> L63
android.content.Context r1 = r4.getContext() // Catch: java.lang.Exception -> L63
android.content.pm.PackageManager r1 = r1.getPackageManager() // Catch: java.lang.Exception -> L63
android.content.ComponentName r1 = r0.resolveActivity(r1) // Catch: java.lang.Exception -> L63
if (r1 == 0) goto L5f
java.lang.String r1 = "mounted"
java.lang.String r2 = android.os.Environment.getExternalStorageState() // Catch: java.lang.Exception -> L63
boolean r1 = r1.equals(r2) // Catch: java.lang.Exception -> L63
if (r1 != 0) goto L30
java.lang.String r1 = "mounted_ro"
java.lang.String r2 = android.os.Environment.getExternalStorageState() // Catch: java.lang.Exception -> L63
boolean r1 = r1.equals(r2) // Catch: java.lang.Exception -> L63
if (r1 == 0) goto L2e
goto L30
L2e:
r1 = 0
goto L31
L30:
r1 = 1
L31:
android.content.Context r2 = r4.getContext() // Catch: java.lang.Exception -> L63
java.io.File r2 = o.C12891fKc.a(r2, r1) // Catch: java.lang.Exception -> L63
if (r1 == 0) goto L46
android.content.Context r1 = r4.getContext() // Catch: java.lang.Exception -> L63
java.lang.String r3 = o.cXH.RVV.e // Catch: java.lang.Exception -> L63
android.net.Uri r1 = o.C9257dgM.getUriForFile(r1, r3, r2) // Catch: java.lang.Exception -> L63
goto L50
L46:
android.content.Context r1 = r4.getContext() // Catch: java.lang.Exception -> L63
java.lang.String r3 = o.cXH.RVV.b // Catch: java.lang.Exception -> L63
android.net.Uri r1 = o.C9257dgM.getUriForFile(r1, r3, r2) // Catch: java.lang.Exception -> L63
L50:
java.lang.String r2 = r2.getAbsolutePath() // Catch: java.lang.Exception -> L63
java.lang.String r3 = "output"
r0.putExtra(r3, r1) // Catch: java.lang.Exception -> L63
r1 = 10003(0x2713, float:1.4017E-41)
r4.startActivityForResult(r0, r1) // Catch: java.lang.Exception -> L63
goto L61
L5f:
java.lang.String r2 = ""
L61:
r4.c = r2 // Catch: java.lang.Exception -> L63
L63:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.scb.phone.view.fragment.easycash.BaseTakePhotoFragment.w():void");
}
public final void d(final InterfaceC15577gud interfaceC15577gud) {
((CustomDialog) CustomDialog.e(new Object[]{CustomDialog.b(getContext()).c(R.string.permission_camera_title).d(R.string.permission_camera).aoT_(R.string.permission_allow, new DialogInterface.OnClickListener(interfaceC15577gud) { // from class: o.eST
private InterfaceC15577gud c;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
this.c.c();
}
{
this.c = interfaceC15577gud;
}
}), Integer.valueOf(R.string.permission_deny), new DialogInterface.OnClickListener(interfaceC15577gud) { // from class: o.eSS
private InterfaceC15577gud b;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
this.b.e();
}
{
this.b = interfaceC15577gud;
}
}})).show();
}
public static void A() {
guQ.b("onPermissionDenied", new Object[0]);
}
public static void C() {
guQ.b("onNeverAskAgain", new Object[0]);
}
public final void j(final InterfaceC15577gud interfaceC15577gud) {
((CustomDialog) CustomDialog.e(new Object[]{CustomDialog.b(getContext()).c(R.string.permission_storage_title).d(R.string.permission_storage).aoT_(R.string.permission_allow, new DialogInterface.OnClickListener(interfaceC15577gud) { // from class: o.eSM
private InterfaceC15577gud e;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
this.e.c();
}
{
this.e = interfaceC15577gud;
}
}), Integer.valueOf(R.string.permission_deny), new DialogInterface.OnClickListener(interfaceC15577gud) { // from class: o.eSR
private InterfaceC15577gud c;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
this.c.e();
}
{
this.c = interfaceC15577gud;
}
}})).show();
}
public static void F() {
guQ.b("onPermissionDenied", new Object[0]);
}
public static void B() {
guQ.b("onNeverAskAgain", new Object[0]);
}
public static void D() {
guQ.b("onPermissionDeniedAndroid13", new Object[0]);
}
public static void z() {
guQ.b("onNeverAskAgainAndroid13", new Object[0]);
}
public static void I() {
guQ.b("onPermissionDeniedAndroid13", new Object[0]);
}
public static void G() {
guQ.b("onNeverAskAgainAndroid13", new Object[0]);
}
@Override // androidx.fragment.app.Fragment
public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
super.onRequestPermissionsResult(i, strArr, iArr);
eSW.b(this, i, iArr);
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
if (i2 != -1 || getContext() == null || i == 10003 || i != 10005) {
return;
}
this.c = C12891fKc.ayS_(getContext(), intent.getData());
}
public final void H() {
if (getActivity() != null) {
if (BaseActivity.P()) {
eSW.b(this);
return;
}
}
eSW.d(this);
}
}