package mc;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Handler;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;

/* JADX INFO: loaded from: classes.dex */
public final class k {

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public static final /* synthetic */ int f30608n = 0;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Activity f30609a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final DecoratedBarcodeView f30610b;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final rb.g f30616h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final rb.d f30617i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final Handler f30618j;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public boolean f30621m;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f30611c = -1;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public boolean f30612d = false;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f30613e = true;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public String f30614f = "";

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public boolean f30615g = false;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public boolean f30619k = false;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public final j f30620l = new j(this);

    public k(Activity activity, DecoratedBarcodeView decoratedBarcodeView) {
        e eVar = new e(this, 1);
        this.f30621m = false;
        this.f30609a = activity;
        this.f30610b = decoratedBarcodeView;
        decoratedBarcodeView.getBarcodeView().f24585j.add(eVar);
        this.f30618j = new Handler();
        this.f30616h = new rb.g(activity, new g(this, 0));
        this.f30617i = new rb.d(activity);
    }

    public final void a() {
        DecoratedBarcodeView decoratedBarcodeView = this.f30610b;
        nc.f fVar = decoratedBarcodeView.getBarcodeView().f24570a;
        if (fVar == null || fVar.f31209g) {
            this.f30609a.finish();
        } else {
            this.f30619k = true;
        }
        decoratedBarcodeView.f24591a.e();
        this.f30616h.a();
    }

    public final void b(String str) {
        Activity activity = this.f30609a;
        if (activity.isFinishing() || this.f30615g || this.f30619k) {
            return;
        }
        if (str.isEmpty()) {
            str = activity.getString(rb.l.zxing_msg_camera_framework_bug);
        }
        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
        builder.setTitle(activity.getString(rb.l.zxing_app_name));
        builder.setMessage(str);
        builder.setPositiveButton(rb.l.zxing_button_ok, new DialogInterface.OnClickListener() { // from class: mc.h
            @Override // android.content.DialogInterface.OnClickListener
            public final void onClick(DialogInterface dialogInterface, int i10) {
                this.f30604a.f30609a.finish();
            }
        });
        builder.setOnCancelListener(new i(this, 0));
        builder.show();
    }
}
