导航菜单

页面标题

页面副标题

SpeedCash v6.5.1482 - QRPay2Activity.java 源代码

正在查看: SpeedCash v6.5.1482 应用的 QRPay2Activity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.bm.sc.bebasbayar.ui.activity.cash;

import android.app.AlertDialog;
import android.graphics.PorterDuff;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.Html;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.SearchView;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import com.bm.sc.bebasbayar.R;
import com.bm.sc.bebasbayar.handler.MessageComposer;
import com.bm.sc.bebasbayar.handler.MessageSender;
import com.bm.sc.bebasbayar.helper.Affinity;
import com.bm.sc.bebasbayar.helper.FileHelper;
import com.bm.sc.bebasbayar.iface.BBCallback;
import com.bm.sc.bebasbayar.iface.MessageProcess;
import com.bm.sc.bebasbayar.message.BaseMessage;
import com.bm.sc.bebasbayar.message.BusMessage;
import com.bm.sc.bebasbayar.message.MPMessage;
import com.bm.sc.bebasbayar.message.QRMessage;
import com.bm.sc.bebasbayar.message.mp.QRISMessage;
import com.bm.sc.bebasbayar.message.mp.ReportingMessage;
import com.bm.sc.bebasbayar.message.qr.DataMessage;
import com.bm.sc.bebasbayar.message.qr.TCICOQRMessage;
import com.bm.sc.bebasbayar.setting.ApiConfig;
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.account.KYCActivity;
import com.bm.sc.bebasbayar.ui.activity.account.KYCNewKtpActivity;
import com.bm.sc.bebasbayar.ui.activity.cash.QRPay2Activity;
import com.bm.sc.bebasbayar.ui.fragment.BaseDialogFragment;
import com.bm.sc.bebasbayar.ui.fragment.dialog.StrukFragment;
import com.bm.sc.bebasbayar.ui.fragment.dialog.TransactionReceiptProgressFragment;
import com.bm.sc.bebasbayar.ui.fragment.dialog.TransactionReceiptTransferBankFragment;
import com.bm.sc.util.android.Device;
import com.bm.sc.util.common.Var;
import com.bm.sc.util.format.Locales;
import com.bm.sc.util.format.Mapper;
import com.google.android.material.textfield.TextInputEditText;
import com.google.firebase.crashlytics.FirebaseCrashlytics;
import com.orhanobut.dialogplus.DialogPlus;
import com.orhanobut.dialogplus.ViewHolder;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Map;
import java.util.Objects;
import org.apache.commons.text.WordUtils;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

public class QRPay2Activity extends BaseActivity implements BaseDialogFragment.OnDialogClosingListener {
    public static final String BODY = "bundle:body";
    public QRMessage A;
    public TCICOQRMessage B;
    public TextView C;
    public TextView D;
    public TextView E;
    public TextView F;
    public TextView G;
    public TextView H;
    public TextView I;
    public TextView J;
    public TextView K;
    public LinearLayout L;
    public Button M;
    public Button N;
    public View O;
    public View P;
    public TextInputEditText Q;
    public AlertDialog R;
    public String S;
    public String T;
    public String U;
    public ArrayList<String> V;
    public boolean W;
    public EditText X;
    public String Y;
    public boolean c;
    public View d;
    public String g;
    public String h;
    public String i;
    public String j;
    public String k;
    public String l;
    public String m;
    public MPMessage mpMessage_result;
    public String n;
    public String o;
    public String p;
    public String q;
    public String r;
    public String s;
    public String t;
    public String u;
    public String v;
    public String w;
    public String x;
    public double y;
    public boolean z;
    public boolean isSudahDapatResponse = false;
    public boolean isAlreadyShowProgressReceiptPageTransaction = false;
    public boolean isSuksesOrPendingTransaction = true;
    public int e = 0;
    public int f = 0;
    public DialogPlus Z = null;

    public class a implements View.OnClickListener {
        public a() {
        }

        @Override
        public void onClick(View view) {
            if (QRPay2Activity.this.Q.getVisibility() == 8) {
                QRPay2Activity.this.findViewById(R.id.rl_info_tip_qr).setVisibility(0);
                QRPay2Activity.this.Q.setVisibility(0);
            } else {
                QRPay2Activity.this.findViewById(R.id.rl_info_tip_qr).setVisibility(8);
                QRPay2Activity.this.Q.setVisibility(8);
            }
        }
    }

    public class b implements TextWatcher {
        public final TextView a;
        public final double b;

        public b(TextView textView, double d) {
            this.a = textView;
            this.b = d;
        }

        @Override
        public void afterTextChanged(Editable editable) {
            double doubleValue;
            if (editable.toString().isEmpty() && editable.toString().equals("")) {
                this.a.setText(Locales.money(QRPay2Activity.this.y));
                doubleValue = 0.0d;
            } else {
                doubleValue = Double.valueOf(editable.toString().replaceAll("[^0-9]", "")).doubleValue() + QRPay2Activity.this.y;
                this.a.setText(Locales.money(doubleValue));
                if (!QRPay2Activity.this.isEditing()) {
                    QRPay2Activity.this.setEditing(true);
                    editable.toString();
                    editable.replace(0, editable.length(), Locales.money(Var.toInt(editable.toString().replaceAll("[^\\d]", ""), 0), ""));
                    QRPay2Activity.this.setEditing(false);
                }
            }
            if (this.b >= doubleValue) {
                QRPay2Activity.this.findViewById(R.id.btn_pay).setBackgroundResource(R.drawable.bb_background_gradient_round_25);
                QRPay2Activity.this.findViewById(R.id.btn_pay).setEnabled(true);
                QRPay2Activity.this.findViewById(R.id.btn_pay).setVisibility(0);
                QRPay2Activity.this.findViewById(R.id.btn_top_up_form).setVisibility(8);
                return;
            }
            QRPay2Activity qRPay2Activity = QRPay2Activity.this;
            if (qRPay2Activity.c) {
                qRPay2Activity.findViewById(R.id.btn_pay).setBackgroundResource(R.drawable.bb_background_gradient_round_25);
                QRPay2Activity.this.findViewById(R.id.btn_pay).setEnabled(true);
                QRPay2Activity.this.findViewById(R.id.btn_pay).setVisibility(0);
                QRPay2Activity.this.findViewById(R.id.btn_top_up_form).setVisibility(8);
                return;
            }
            qRPay2Activity.findViewById(R.id.btn_pay).setBackgroundResource(R.drawable.bb_button_grey_inactive_round_25);
            QRPay2Activity.this.findViewById(R.id.btn_pay).setEnabled(false);
            QRPay2Activity.this.findViewById(R.id.btn_pay).setVisibility(8);
            QRPay2Activity.this.findViewById(R.id.btn_top_up_form).setVisibility(0);
        }

        @Override
        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }
    }

    public class c implements TextWatcher {
        public final TextView a;
        public final double b;

        public c(TextView textView, double d) {
            this.a = textView;
            this.b = d;
        }

        @Override
        public void afterTextChanged(Editable editable) {
            double d = 0.0d;
            if (editable.toString().isEmpty() && editable.toString().equals("")) {
                QRPay2Activity.this.X.setError("Harus diisi");
                this.a.setText(Locales.money("0"));
                QRPay2Activity.this.findViewById(R.id.btn_pay).setBackgroundResource(R.drawable.bb_button_grey_inactive_round_25);
                QRPay2Activity.this.findViewById(R.id.btn_pay).setEnabled(false);
            } else if (Var.toDouble(QRPay2Activity.this.n, 0.0d) <= 0.0d || Var.toDouble(QRPay2Activity.this.n, 0.0d) >= 1.0d) {
                d = Var.toDouble(QRPay2Activity.this.n, 0.0d) + Double.valueOf(editable.toString().replaceAll("[^0-9]", "")).doubleValue();
                StringBuilder sb = new StringBuilder();
                sb.append("afterTextChanged: ");
                sb.append(d);
                this.a.setText(Locales.money(d));
            } else {
                double doubleValue = Double.valueOf(editable.toString().replaceAll("[^0-9]", "")).doubleValue();
                double d2 = Var.toDouble(QRPay2Activity.this.n, 0.0d) * doubleValue;
                d = doubleValue + Var.toDouble(QRPay2Activity.this.n, 0.0d) + d2;
                StringBuilder sb2 = new StringBuilder();
                sb2.append("afterTextChanged: ");
                sb2.append(d2);
                QRPay2Activity.this.K.setText(String.valueOf(d2));
                this.a.setText(Locales.money(d));
            }
            if (editable.toString().isEmpty()) {
                QRPay2Activity.this.findViewById(R.id.btn_pay).setBackgroundResource(R.drawable.bb_button_grey_inactive_round_25);
                QRPay2Activity.this.findViewById(R.id.btn_pay).setEnabled(false);
            } else if (this.b < d) {
                QRPay2Activity qRPay2Activity = QRPay2Activity.this;
                if (qRPay2Activity.c) {
                    qRPay2Activity.findViewById(R.id.btn_pay).setBackgroundResource(R.drawable.bb_background_gradient_round_25);
                    QRPay2Activity.this.findViewById(R.id.btn_pay).setEnabled(true);
                    QRPay2Activity.this.findViewById(R.id.btn_pay).setVisibility(0);
                    QRPay2Activity.this.findViewById(R.id.btn_top_up_form).setVisibility(8);
                } else {
                    qRPay2Activity.findViewById(R.id.btn_pay).setBackgroundResource(R.drawable.bb_button_grey_inactive_round_25);
                    QRPay2Activity.this.findViewById(R.id.btn_pay).setEnabled(false);
                    QRPay2Activity.this.findViewById(R.id.btn_pay).setVisibility(8);
                    QRPay2Activity.this.findViewById(R.id.btn_top_up_form).setVisibility(0);
                }
            } else {
                QRPay2Activity.this.findViewById(R.id.btn_pay).setBackgroundResource(R.drawable.bb_background_gradient_round_25);
                QRPay2Activity.this.findViewById(R.id.btn_pay).setEnabled(true);
                QRPay2Activity.this.findViewById(R.id.btn_pay).setVisibility(0);
                QRPay2Activity.this.findViewById(R.id.btn_top_up_form).setVisibility(8);
            }
            if (QRPay2Activity.this.isEditing()) {
                return;
            }
            QRPay2Activity.this.setEditing(true);
            editable.toString();
            editable.replace(0, editable.length(), Locales.money(Var.toInt(editable.toString().replaceAll("[^\\d]", ""), 0), ""));
            QRPay2Activity.this.setEditing(false);
        }

        @Override
        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }
    }

    public class d implements Runnable {
        public final String a;

        public d(String str) {
            this.a = str;
        }

        @Override
        public void run() {
            QRPay2Activity qRPay2Activity = QRPay2Activity.this;
            if (qRPay2Activity.isSudahDapatResponse || !qRPay2Activity.isSuksesOrPendingTransaction) {
                return;
            }
            String retrieve = new AppSession(QRPay2Activity.this).retrieve(AppSession.PROPERTY_MERCHANT_ID);
            String str = QRPay2Activity.this.x;
            String str2 = this.a;
            String str3 = QRPay2Activity.this.x;
            String str4 = QRPay2Activity.this.x;
            int i = (int) Var.toDouble(this.a, 0.0d);
            TransactionReceiptProgressFragment transactionReceiptProgressFragment = new TransactionReceiptProgressFragment();
            transactionReceiptProgressFragment.setArguments(TransactionReceiptProgressFragment.getPaymentBundle(5, retrieve, str, str2, str3, i, str4));
            ?? r1 = QRPay2Activity.this;
            r1.isAlreadyShowProgressReceiptPageTransaction = true;
            transactionReceiptProgressFragment.show(r1.getSupportFragmentManager(), "CetakUlangPending");
        }
    }

    public class e implements MessageProcess {
        public e() {
        }

        public void e(int i, Boolean bool) {
            Affinity.purge(QRPay2Activity.this, KYCNewKtpActivity.class);
        }

        public void f(int i, Boolean bool) {
            Affinity.purge(QRPay2Activity.this, KYCActivity.class);
        }

        public void g(int i, String str) {
            QRPay2Activity.this.setSuksesOrPendingTransaction(true);
            QRPay2Activity.this.Y = str;
            QRPay2Activity qRPay2Activity = QRPay2Activity.this;
            qRPay2Activity.Z(String.valueOf(qRPay2Activity.e), String.valueOf(QRPay2Activity.this.f), str);
        }

        public void h(int i, Boolean bool) {
            if (bool.booleanValue()) {
                Affinity.requestInputPin(QRPay2Activity.this, new BBCallback() {
                    @Override
                    public final void do_callback(int i2, Object obj) {
                        QRPay2Activity.e.this.g(i2, (String) obj);
                    }
                });
            }
        }

        @Override
        public void afterProcess(BaseMessage baseMessage) {
            QRPay2Activity.this.isSudahDapatResponse = true;
            QRISMessage qRISMessage = new QRISMessage(baseMessage);
            QRPay2Activity.this.mpMessage_result = qRISMessage;
            String var = Var.toString(qRISMessage.getValueFromIncludes(MPMessage.IncludeMessage.REFF_ID), "");
            QRPay2Activity.this.x = Var.toString(qRISMessage.getValueFromIncludes("product_code"), "");
            if (qRISMessage.isOK()) {
                QRPay2Activity.this.buildStrukTransaction(var);
                return;
            }
            if (qRISMessage.getResponse_code().equals("68") || qRISMessage.getResponse_code().equals("")) {
                QRPay2Activity qRPay2Activity = QRPay2Activity.this;
                if (qRPay2Activity.isAlreadyShowProgressReceiptPageTransaction) {
                    return;
                }
                boolean z = qRPay2Activity.isSuksesOrPendingTransaction;
                return;
            }
            if (QRPay2Activity.this.mpMessage_result.getResponse_code().equals(BaseMessage.RESULT_NOK_NEED_KYC)) {
                QRPay2Activity.this.isSuksesOrPendingTransaction = false;
                if (Var.toBoolean(new ConfigSession(QRPay2Activity.this).retrieveMap(ConfigSession.PROPERTY_CUSTOM_CONFIG, ConfigSession.KEY_USE_NEW_KYC_BIGVISION), true)) {
                    ?? r6 = QRPay2Activity.this;
                    Affinity.info(r6, 2, "Informasi", r6.mpMessage_result.getMessageDescription(), new BBCallback() {
                        @Override
                        public final void do_callback(int i, Object obj) {
                            QRPay2Activity.e.this.e(i, (Boolean) obj);
                        }
                    });
                    return;
                } else {
                    ?? r62 = QRPay2Activity.this;
                    Affinity.info(r62, 2, "Informasi", r62.mpMessage_result.getMessageDescription(), new BBCallback() {
                        @Override
                        public final void do_callback(int i, Object obj) {
                            QRPay2Activity.e.this.f(i, (Boolean) obj);
                        }
                    });
                    return;
                }
            }
            if (qRISMessage.isNeedSetPin()) {
                Affinity.dialogSetPin(QRPay2Activity.this);
                return;
            }
            if (qRISMessage.getResponse_code().equals("01")) {
                Affinity.info(QRPay2Activity.this, false, qRISMessage.getMessageDescription());
            } else {
                if (!qRISMessage.getResponse_code().equals("02")) {
                    QRPay2Activity.this.M(qRISMessage.getMessageDescription());
                    return;
                }
                QRPay2Activity.this.setSuksesOrPendingTransaction(false);
                SearchView.OnQueryTextListener onQueryTextListener = QRPay2Activity.this;
                Affinity.confirm(onQueryTextListener, onQueryTextListener.getString(R.string.masukin_ulang_pin_anda), qRISMessage.getMessageDescription(), new BBCallback() {
                    @Override
                    public final void do_callback(int i, Object obj) {
                        QRPay2Activity.e.this.h(i, (Boolean) obj);
                    }
                });
            }
        }

        @Override
        public void backgroundProcess(long j, long j2, boolean z) {
        }

        @Override
        public void preProcess() {
            QRPay2Activity.this.hideKeyboard();
        }
    }

    public class f implements MessageProcess {
        public final String a;

        public f(String str) {
            this.a = str;
        }

        @Override
        public void afterProcess(BaseMessage baseMessage) {
            ReportingMessage reportingMessage = new ReportingMessage(baseMessage);
            String str = "";
            if (!reportingMessage.isOK()) {
                TransactionReceiptProgressFragment transactionReceiptProgressFragment = new TransactionReceiptProgressFragment();
                if (reportingMessage.getMap().get("biller_info") != null) {
                    Object obj = reportingMessage.getMap().get("biller_info");
                    Objects.requireNonNull(obj);
                    str = Var.toString(obj, "");
                }
                transactionReceiptProgressFragment.setArguments(TransactionReceiptProgressFragment.getPaymentBundle(reportingMessage.getStruks(), reportingMessage.getValueFromIncludes(MPMessage.IncludeMessage.REFF_ID), str, reportingMessage.getReportHead(), reportingMessage.getReportBodyEntities(), reportingMessage.getReportFooter(), 2, reportingMessage.getResponse_code(), QRPay2Activity.this.x, QRPay2Activity.this.x, reportingMessage.getReportAdditionalDataEntity()));
                transactionReceiptProgressFragment.show(QRPay2Activity.this.getSupportFragmentManager(), "CetakUlangPending");
                return;
            }
            if (FileHelper.isValidActivityForFragmentShow(QRPay2Activity.this)) {
                if (reportingMessage.getReportHead() == null || reportingMessage.getReportBodyEntities() == null) {
                    StrukFragment strukFragment = new StrukFragment();
                    strukFragment.setArguments(strukFragment.setupDefaultBundle(QRPay2Activity.this.x, this.a, reportingMessage.getStruks().replace("*", "\n"), reportingMessage.getStruks(), 2));
                    strukFragment.show(QRPay2Activity.this.getSupportFragmentManager(), "CetakUlang");
                } else {
                    TransactionReceiptTransferBankFragment transactionReceiptTransferBankFragment = new TransactionReceiptTransferBankFragment();
                    String var = Var.toString(reportingMessage.getReportHead().getCashbackPoint(), "0");
                    if (var.equals("")) {
                        var = "0";
                    }
                    transactionReceiptTransferBankFragment.setArguments(transactionReceiptTransferBankFragment.setupDefaultBundle(reportingMessage.getReportHead(), reportingMessage.getReportBodyEntities(), reportingMessage.getReportFooter(), reportingMessage.getReportAdditionalDataEntity(), QRPay2Activity.this.x, this.a, reportingMessage.getStruks().replace("*", "\n"), reportingMessage.getStruks(), 2, "", "", Var.toString(reportingMessage.getValueFromIncludes("product_code"), ""), "", !var.equals("0") ? Double.valueOf(Double.parseDouble(reportingMessage.getReportHead().getCashbackPoint().replace(".", ""))) : Double.valueOf(0.0d), Boolean.FALSE));
                    transactionReceiptTransferBankFragment.show(QRPay2Activity.this.getSupportFragmentManager(), "CetakUlang");
                }
            }
        }

        @Override
        public void backgroundProcess(long j, long j2, boolean z) {
        }

        @Override
        public void preProcess() {
        }
    }

    public void O() {
        this.Z.show();
    }

    public void P(View view) {
        this.Z.dismiss();
    }

    public void Q(double d2, double d3, int i, String str) {
        this.Y = str;
        int i2 = (int) d2;
        this.e = i2;
        this.f = (int) d3;
        Z(String.valueOf(i2), String.valueOf(this.f), str);
    }

    public void R(final double d2, final double d3, View view) {
        this.Z.dismiss();
        Affinity.requestInputPin(this, new BBCallback() {
            @Override
            public final void do_callback(int i, Object obj) {
                QRPay2Activity.this.Q(d2, d3, i, (String) obj);
            }
        });
    }

    public void S(double d2, double d3, int i, String str) {
        this.Y = str;
        int i2 = (int) d2;
        this.e = i2;
        this.f = (int) d3;
        Z(String.valueOf(i2), String.valueOf(this.f), str);
    }

    public void T(final double d2, final double d3, View view) {
        this.Z.dismiss();
        Affinity.requestInputPin(this, new BBCallback() {
            @Override
            public final void do_callback(int i, Object obj) {
                QRPay2Activity.this.S(d2, d3, i, (String) obj);
            }
        });
    }

    public void U(double d2, double d3, int i, String str) {
        this.Y = str;
        int i2 = (int) d2;
        this.e = i2;
        this.f = (int) d3;
        Z(String.valueOf(i2), String.valueOf(this.f), str);
    }

    public void V(final double d2, final double d3, View view) {
        this.Z.dismiss();
        Affinity.requestInputPin(this, new BBCallback() {
            @Override
            public final void do_callback(int i, Object obj) {
                QRPay2Activity.this.U(d2, d3, i, (String) obj);
            }
        });
    }

    public void W(int i, Boolean bool) {
        finish();
    }

    public void X(int i, Boolean bool) {
        if (this.g.equals("CHECK")) {
            return;
        }
        finish();
    }

    public final void K(final double d2, final double d3) {
        View inflate = View.inflate(this, R.layout.dialog_payment_qris, null);
        this.d = inflate;
        TextView textView = (TextView) inflate.findViewById(R.id.tv_owner_bank_initial);
        ((TextView) this.d.findViewById(R.id.tv_label_admin)).setText("Tip");
        Y(textView, this.i);
        ((TextView) this.d.findViewById(R.id.tv_owner_bank_name)).setText(WordUtils.capitalizeFully(this.i));
        if (this.m.equals("QRIS")) {
            ((TextView) this.d.findViewById(R.id.merchant_tujuan_sub)).setText("ID: " + this.w);
        } else {
            ((TextView) this.d.findViewById(R.id.merchant_tujuan_sub)).setText("ID: " + this.h);
        }
        ((TextView) this.d.findViewById(R.id.merchant_tujuan_label)).setText("Nama Acquirer - " + this.p);
        ((TextView) this.d.findViewById(R.id.tv_nominal_transfer)).setText(Locales.moneyNoFraction(Var.toString(Double.valueOf(d2), "")));
        ((TextView) this.d.findViewById(R.id.tv_nominal_admin_va)).setText(Locales.moneyNoFraction(Var.toString(Double.valueOf(d3), "")));
        if (d3 == 0.0d) {
            this.d.findViewById(R.id.tv_nominal_admin_va).setVisibility(8);
            this.d.findViewById(R.id.tv_label_admin).setVisibility(8);
        }
        ((TextView) this.d.findViewById(R.id.button_nominal_transfer)).setText(Locales.moneyNoFraction(Var.toString(Double.valueOf(d2 + d3), "")));
        ((TextView) this.d.findViewById(R.id.sc_balance)).setText(Locales.moneyNoFraction(this.appSession.retrieve(AppSession.PROPERTY_BALANCE)));
        this.Z = DialogPlus.newDialog(this).setContentHolder(new ViewHolder(this.d)).setFooter(View.inflate(this, R.layout.component_dialog_space_footer, null)).setContentBackgroundResource(R.color.colorTransparent).setGravity(80).create();
        new Handler().postDelayed(new Runnable() {
            @Override
            public final void run() {
                QRPay2Activity.this.O();
            }
        }, 100L);
        View holderView = this.Z.getHolderView();
        holderView.findViewById(R.id.close_view).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                QRPay2Activity.this.P(view);
            }
        });
        holderView.findViewById(R.id.button_submit).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                QRPay2Activity.this.R(d2, d3, view);
            }
        });
        holderView.findViewById(R.id.button_label).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                QRPay2Activity.this.T(d2, d3, view);
            }
        });
        holderView.findViewById(R.id.button_nominal_transfer).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                QRPay2Activity.this.V(d2, d3, view);
            }
        });
    }

    public final void L(int i, Exception exc) {
        String str;
        String string = getString(R.string.title_warning);
        StringBuilder sb = new StringBuilder();
        sb.append("Transaksi pembayaran tidak valid #");
        sb.append(i);
        if (!ApiConfig.isLoggable() || exc == null) {
            str = "";
        } else {
            str = ", " + exc.getMessage();
        }
        sb.append(str);
        Affinity.info(this, -1, string, sb.toString(), new BBCallback() {
            @Override
            public final void do_callback(int i2, Object obj) {
                QRPay2Activity.this.W(i2, (Boolean) obj);
            }
        });
    }

    public final void M(String str) {
        Affinity.info(this, -1, "Informasi", str, new BBCallback() {
            @Override
            public final void do_callback(int i, Object obj) {
                QRPay2Activity.this.X(i, (Boolean) obj);
            }
        });
    }

    public final void N() {
        throw new UnsupportedOperationException("Method not decompiled: com.bm.sc.bebasbayar.ui.activity.cash.QRPay2Activity.N():void");
    }

    public final void Y(TextView textView, String str) {
        if (!str.contains(" ")) {
            if (str.length() > 0) {
                textView.setText(str.charAt(0) + "");
                return;
            }
            return;
        }
        String[] split = str.toUpperCase().trim().split("\\s+");
        try {
            if (split.length > 1) {
                if (split[1] == null || split[0] == null) {
                    StringBuilder sb = new StringBuilder();
                    String str2 = split[0];
                    Objects.requireNonNull(str2);
                    sb.append(str2.charAt(0));
                    sb.append("");
                    textView.setText(sb.toString());
                } else {
                    textView.setText(split[0].charAt(0) + "" + split[1].charAt(0));
                }
            } else if (split.length == 1) {
                textView.setText(split[0].charAt(0) + "");
            }
        } catch (Exception unused) {
            if (str.length() > 0) {
                textView.setText(str.charAt(0) + "");
            }
        }
    }

    public final void Z(String str, String str2, String str3) {
        this.isSudahDapatResponse = false;
        this.isAlreadyShowProgressReceiptPageTransaction = false;
        this.isSuksesOrPendingTransaction = true;
        new Handler().postDelayed(new d(str), Var.toInt(this.configSession.retrieveMap(ConfigSession.PROPERTY_CUSTOM_CONFIG, ConfigSession.KEY_SHOW_SUCCESS_PAYMENT_MILISECOND), 5000));
        AppSession appSession = new AppSession(this);
        QRISMessage qRISMessage = new QRISMessage(appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID), str3, appSession.retrieve(AppSession.PROPERTY_AUTH_TOKEN), this.x);
        qRISMessage.setIsPayment(true);
        qRISMessage.setRawData(Var.toString(this.B.get("RAW"), ""));
        qRISMessage.setNominal(Var.toDouble(str, 0.0d));
        qRISMessage.setNominalAdmin(Var.toDouble(str2, 0.0d));
        qRISMessage.setAdditional_dataValue(QRISMessage.MEMBER_ID_TUJUAN, Var.toString(this.B.get("search_id"), ""));
        qRISMessage.setIncludesValue(MPMessage.IncludeMessage.REFF_ID, Var.toString(this.B.get(DataMessage.ID_TRANSAKSI), ""));
        Device.getAddressLocation(this);
        qRISMessage.setAdditional_dataValue(109, Device.getLogDevice(this));
        MessageComposer messageComposer = new MessageComposer(1, "");
        messageComposer.setRequest_method(MessageComposer.POST);
        messageComposer.setData_type(1);
        messageComposer.setIs_credential(true);
        messageComposer.setIs_encrypted(true);
        messageComposer.setShowProgressRegular(true);
        messageComposer.setMessageProcess(new e());
        MessageSender messageSender = new MessageSender(this, messageComposer);
        messageSender.setRequestMessage(qRISMessage);
        messageSender.execute();
    }

    public void buildStrukTransaction(String str) {
        ReportingMessage reportingMessage = new ReportingMessage(this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID), this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_PIN), this.appSession.retrieve(AppSession.PROPERTY_AUTH_TOKEN));
        reportingMessage.setMsg_type("TRX");
        reportingMessage.setProcessing_code("ADMTRASI");
        reportingMessage.setIncludesValue("product_code", "CU");
        reportingMessage.setIncludesValue(MPMessage.IncludeMessage.REFF_ID, str);
        reportingMessage.setAdditional_dataValue(0, "0");
        MessageComposer messageComposer = new MessageComposer(7, "");
        messageComposer.setData_type(1);
        messageComposer.setRequest_method(MessageComposer.POST);
        messageComposer.setIs_credential(true);
        messageComposer.setIs_encrypted(true);
        messageComposer.setShowProgressRegular(true);
        messageComposer.setMessageProcess(new f(str));
        MessageSender messageSender = new MessageSender(this, messageComposer);
        messageSender.setRequestMessage(reportingMessage);
        messageSender.execute();
    }

    public void downloadStruk(String str, String str2) {
        Affinity.download_file(this, str, str2);
    }

    @Override
    public int getLayoutResource() {
        return R.layout.activity_qr_pay_2;
    }

    @Override
    public String getWikiNameSpace() {
        return null;
    }

    public boolean isEditing() {
        return this.W;
    }

    @Override
    public boolean isEligibleForFavorit() {
        return false;
    }

    @Override
    public void onClick(View view) {
        String var;
        if (view.getId() != 2131362377) {
            if (view.getId() != 2131362395) {
                if (view.getId() != 2131362439) {
                    super.onClick(view);
                    return;
                } else {
                    Affinity.launch(this, Deposit2Activity.class);
                    finish();
                    return;
                }
            }
            String var2 = Var.toString(new TCICOQRMessage((Map) this.A.get("data")).get(DataMessage.ID_TRANSAKSI), "");
            this.T = "SPEEDCASH - Struk " + var2 + ".pdf";
            this.U = this.configSession.retrieveMap(ConfigSession.PROPERTY_URL, ConfigSession.KEY_URL_INVOICE) + "?ispdf=pdf&url=" + URLEncoder.encode(this.configSession.retrieveMap(ConfigSession.PROPERTY_URL, ConfigSession.KEY_URL_INVOICE).replace("https", "http") + "invoice/" + (this.m.equals("QRIS") ? "qris" : !this.l.isEmpty() ? "scpibb" : TransferWithdrawActivity.RESULT_SCTI) + "/" + var2 + "?lite=true");
            if (Build.VERSION.SDK_INT >= 33) {
                if (Affinity.isPermissionGranted(this, "android.permission.READ_MEDIA_IMAGES")) {
                    downloadStruk(this.T, this.U);
                    return;
                } else {
                    ActivityCompat.requestPermissions(this, new String[]{"android.permission.READ_MEDIA_IMAGES", "android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"}, 446);
                    return;
                }
            }
            if (Affinity.isPermissionGranted(this, "android.permission.READ_EXTERNAL_STORAGE") || Affinity.isPermissionGranted(this, "android.permission.WRITE_EXTERNAL_STORAGE")) {
                downloadStruk(this.T, this.U);
                return;
            } else {
                ActivityCompat.requestPermissions(this, new String[]{"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"}, 446);
                return;
            }
        }
        Affinity.hideSoftKeyboard(this);
        if (this.g.equals("CHECK")) {
            String replace = ((EditText) this.O.findViewById(R.id.scti_input)).getText().toString().replace(".", "");
            if (replace.isEmpty() || Var.toInt(replace, 0) < 0) {
                Affinity.info(this, false, "Mohon isikan nilai nominal terlebih dahulu");
                this.R.dismiss();
                return;
            } else if (replace.isEmpty() || Var.toInt(replace, 0) == 0) {
                Affinity.info(this, false, "Mohon isikan nilai nominal terlebih dahulu");
                AlertDialog alertDialog = this.R;
                if (alertDialog != null) {
                    alertDialog.dismiss();
                    return;
                }
                return;
            }
        }
        Editable text = this.Q.getText();
        Objects.requireNonNull(text);
        String replace2 = text.toString().replace(".", "");
        String trim = this.K.getText().toString().trim();
        if (this.g.equals("CHECK")) {
            var = ((EditText) this.O.findViewById(R.id.scti_input)).getText().toString().replace(".", "");
            if (var.isEmpty() || Var.toInt(var, 0) < 0) {
                Affinity.info(this, false, "Mohon isikan nilai nominal terlebih dahulu");
                return;
            }
        } else {
            var = Var.toString(Double.valueOf(this.y), "0");
        }
        if ((replace2.equals("0") || replace2.equals("")) && Double.valueOf(this.n).doubleValue() > 1.0d) {
            this.o = this.n;
        } else if (Double.valueOf(this.n).doubleValue() >= 1.0d || Double.valueOf(this.n).doubleValue() <= 0.0d) {
            this.o = replace2;
        } else {
            this.o = trim;
        }
        if (!this.m.equals("QRIS")) {
            Affinity.info(this, false, "User Code Not QRIS");
        } else if (this.o.equals("")) {
            K(Double.parseDouble(var), 0.0d);
        } else {
            K(Double.parseDouble(var), Double.parseDouble(this.o));
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        getToolbar().setBackgroundColor(ContextCompat.getColor(this, R.color.colorBackground));
        if (getToolbar().getNavigationIcon() != null) {
            getToolbar().getNavigationIcon().setColorFilter(ContextCompat.getColor(this, R.color.black), PorterDuff.Mode.SRC_IN);
        }
        if (getToolbar() != null) {
            ActionBar supportActionBar = getSupportActionBar();
            Objects.requireNonNull(supportActionBar);
            supportActionBar.setTitle(Html.fromHtml("<font color='#000000'>Bayar Ke </font>"));
        }
        try {
            Bundle extras = getIntent().getExtras();
            Objects.requireNonNull(extras);
            QRMessage qRMessage = new QRMessage(Mapper.jsonToMap(extras.getString("bundle:body")));
            this.z = extras.getBoolean("isFromShare", false);
            TCICOQRMessage tCICOQRMessage = new TCICOQRMessage((Map) qRMessage.get("data"));
            this.B = tCICOQRMessage;
            this.g = Var.toString(tCICOQRMessage.get(DataMessage.ACTION), "");
            this.h = Var.toString(this.B.get("search_id"), "");
            if (this.g.equals("CHECK_BUY")) {
                this.h = Var.toString(this.B.get(DataMessage.ID_TRANSAKSI), "");
            }
            this.i = Var.toString(this.B.get("search_name"), "");
            Var.toString(this.B.get("image"), "");
            this.l = Var.toString(this.B.get("customer_info"), "");
            this.j = Var.toString(this.B.get("note"), "-");
            this.y = Var.toDouble(this.B.get("nominal"), 0.0d);
            this.m = Var.toString(qRMessage.get(QRMessage.USERCODE), "");
            Var.toString(qRMessage.get("rd"), "Bayar " + this.i);
            this.n = String.valueOf(Var.toDouble(this.B.get("fee"), 0.0d));
            this.p = Var.toString(this.B.get("acquirer_id"), "");
            this.q = Var.toString(this.B.get("terminal_id"), "");
            this.r = Var.toString(this.B.get("merchant_pan"), "");
            Var.toString(this.B.get("customer_pan"), "");
            this.s = Var.toString(this.B.get("terminal_location"), "");
            this.t = Var.toString(this.B.get("receipt_number"), "");
            this.u = Var.toString(this.B.get("source_of_fund"), "");
            Var.toString(this.B.get("transaction_date_time"), "");
            this.v = Var.toString(this.B.get("call_center"), "");
            this.w = Var.toString(this.B.get("merchant_id_qris"), "");
            this.x = Var.toString(this.B.get("product_code"), "");
            this.S = Var.toString(this.B.get(TCICOQRMessage.SETTING_TIPS), "");
            N();
        } catch (Exception e2) {
            FirebaseCrashlytics.getInstance().recordException(e2);
            if (ApiConfig.isLoggable()) {
                Log.wtf(getClass().getName(), e2);
            }
            L(1, e2);
        }
    }

    @Override
    public void onDialogClosed(BaseDialogFragment baseDialogFragment) {
        finish();
    }

    @Override
    public void onDialogClosing(BaseDialogFragment baseDialogFragment, Object obj) {
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMessageEvent(BusMessage busMessage) {
        if (busMessage.getEventType() == 1) {
            this.appSession.store(AppSession.PROPERTY_BALANCE, Var.toString(Double.valueOf(busMessage.getBalance()), "0"));
            TextView textView = (TextView) findViewById(R.id.qr_balance);
            if (textView != null) {
                textView.setText(Locales.money(this.appSession.retrieve(AppSession.PROPERTY_BALANCE)));
            }
        }
    }

    public void onPause() {
        super/*androidx.fragment.app.FragmentActivity*/.onPause();
        EventBus.getDefault().unregister(this);
    }

    @Override
    public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        if (i == 446 && iArr.length > 0 && iArr[0] == 0) {
            downloadStruk(this.T, this.U);
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        TextView textView = (TextView) findViewById(R.id.qr_balance);
        if (textView != null) {
            textView.setText(Locales.money(this.appSession.retrieve(AppSession.PROPERTY_BALANCE)));
        }
    }

    public void onStart() {
        super.onStart();
        if (EventBus.getDefault().isRegistered(this)) {
            return;
        }
        EventBus.getDefault().register(this);
    }

    public void setEditing(boolean z) {
        this.W = z;
    }

    public void setSuksesOrPendingTransaction(boolean z) {
        this.isSuksesOrPendingTransaction = z;
    }
}