package com.tencent.mm.plugin.remittance.ui;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.support.v4.widget.j;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.FrameLayout.LayoutParams;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ai.m;
import com.tencent.mm.g.a.fv;
import com.tencent.mm.g.a.fw;
import com.tencent.mm.g.a.vc;
import com.tencent.mm.g.b.a.bh;
import com.tencent.mm.model.ao;
import com.tencent.mm.plugin.remittance.model.BusiRemittanceResp;
import com.tencent.mm.plugin.remittance.model.g;
import com.tencent.mm.plugin.remittance.model.k;
import com.tencent.mm.plugin.remittance.model.l;
import com.tencent.mm.plugin.remittance.model.t;
import com.tencent.mm.plugin.report.service.h;
import com.tencent.mm.plugin.wallet_core.model.v;
import com.tencent.mm.pluginsdk.ui.applet.CdnImageView;
import com.tencent.mm.pluginsdk.wallet.PayInfo;
import com.tencent.mm.protocal.protobuf.abv;
import com.tencent.mm.protocal.protobuf.abw;
import com.tencent.mm.protocal.protobuf.chl;
import com.tencent.mm.protocal.protobuf.cz;
import com.tencent.mm.protocal.protobuf.lp;
import com.tencent.mm.protocal.protobuf.lu;
import com.tencent.mm.protocal.protobuf.lv;
import com.tencent.mm.sdk.b.a;
import com.tencent.mm.sdk.b.c;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.al;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.storage.ad;
import com.tencent.mm.ui.base.n;
import com.tencent.mm.ui.widget.picker.d.2;
import com.tencent.mm.ui.widget.picker.d.3;
import com.tencent.mm.wallet_core.d.d;
import com.tencent.mm.wallet_core.d.i;
import com.tencent.mm.wallet_core.ui.WalletBaseUI;
import com.tencent.mm.wallet_core.ui.e;
import com.tencent.mm.wallet_core.ui.formview.WalletFormView;
import com.tencent.sqlitelint.config.SharePluginInfo;
import com.tencent.ytcommon.BuildConfig;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.UUID;

public class RemittanceBusiUI extends WalletBaseUI {
    private String cEW;
    private int cKs = 0;
    private ScrollView nsk;
    private String oXY;
    private int obL;
    private String pQW;
    private int pQY;
    private String pRC;
    private boolean pRH = false;
    private bh pRJ;
    private boolean pRM;
    private boolean pRP;
    private c pRR = new 19(this);
    private LinearLayout pRm;
    private String pSD;
    private BusiRemittanceResp pSH;
    private TextView pSY;
    private TextView pSZ;
    private String pSy;
    private String pSz;
    private int pTA;
    private String pTB;
    private chl pTC;
    private String pTD;
    private int pTE = 0;
    private int pTF = 0;
    private int pTG = 0;
    private int pTH = 0;
    private String pTI;
    private b pTJ = new b();
    private String pTK = BuildConfig.FLAVOR;
    private String pTL = BuildConfig.FLAVOR;
    boolean pTM = false;
    private double pTN = -1.0d;
    private boolean pTO = false;
    g pTP = null;
    private a pTQ;
    private a pTR;
    private Map<String, cz> pTS = new HashMap();
    private Runnable pTT = new 9(this);
    private com.tencent.mm.wallet_core.d.c<l> pTU = new 14(this);
    private b pTV = new b();
    private boolean pTW = true;
    private double pTX = 0.0d;
    private String pTY;
    private String pTZ = BuildConfig.FLAVOR;
    private TextView pTa;
    private TextView pTb;
    private TextView pTc;
    private TextView pTd;
    private TextView pTe;
    private View pTf;
    private CdnImageView pTg;
    private WalletFormView pTh;
    private Button pTi;
    private LinearLayout pTj;
    private LinearLayout pTk;
    private TextView pTl;
    private View pTm;
    private TextView pTn;
    private String pTo;
    private double pTp;
    private String pTq;
    private String pTr;
    private String pTs;
    private String pTt;
    private String pTu;
    private int pTv;
    private String pTw;
    private boolean pTx;
    private String pTy;
    private int pTz;
    private c pUa = new 20(this);
    private c pUb = new c<fv>() {
        {
            AppMethodBeat.i(44913);
            this.xxI = fv.class.getName().hashCode();
            AppMethodBeat.o(44913);
        }

        public final /* synthetic */ boolean a(com.tencent.mm.sdk.b.b bVar) {
            AppMethodBeat.i(44914);
            RemittanceBusiUI.E(RemittanceBusiUI.this);
            AppMethodBeat.o(44914);
            return false;
        }
    };
    private c pUc = new c<vc>() {
        {
            AppMethodBeat.i(44915);
            this.xxI = vc.class.getName().hashCode();
            AppMethodBeat.o(44915);
        }

        public final /* synthetic */ boolean a(com.tencent.mm.sdk.b.b bVar) {
            AppMethodBeat.i(44916);
            vc vcVar = (vc) bVar;
            a.xxA.d(RemittanceBusiUI.this.pUc);
            if (vcVar.cRZ.result == -1) {
                RemittanceBusiUI.this.pTi.performClick();
            }
            AppMethodBeat.o(44916);
            return false;
        }
    };

    class b implements Runnable {
        public d pUr;

        b() {
        }

        public final void run() {
            AppMethodBeat.i(44932);
            RemittanceBusiUI.this.pTU.b(this.pUr);
            AppMethodBeat.o(44932);
        }
    }

    public void onWindowFocusChanged(boolean z) {
        super.onWindowFocusChanged(z);
        AppMethodBeat.at(this, z);
    }

    public RemittanceBusiUI() {
        AppMethodBeat.i(44933);
        AppMethodBeat.o(44933);
    }

    static /* synthetic */ boolean B(RemittanceBusiUI remittanceBusiUI) {
        AppMethodBeat.i(44971);
        boolean cfS = remittanceBusiUI.cfS();
        AppMethodBeat.o(44971);
        return cfS;
    }

    static /* synthetic */ void E(RemittanceBusiUI remittanceBusiUI) {
        AppMethodBeat.i(44978);
        remittanceBusiUI.cfT();
        AppMethodBeat.o(44978);
    }

    static /* synthetic */ boolean f(RemittanceBusiUI remittanceBusiUI) {
        AppMethodBeat.i(44961);
        boolean cNR = remittanceBusiUI.cNR();
        AppMethodBeat.o(44961);
        return cNR;
    }

    static /* synthetic */ void g(RemittanceBusiUI remittanceBusiUI) {
        AppMethodBeat.i(44962);
        remittanceBusiUI.cbv();
        AppMethodBeat.o(44962);
    }

    static /* synthetic */ void j(RemittanceBusiUI remittanceBusiUI) {
        AppMethodBeat.i(44964);
        remittanceBusiUI.cfI();
        AppMethodBeat.o(44964);
    }

    static /* synthetic */ double n(RemittanceBusiUI remittanceBusiUI) {
        AppMethodBeat.i(44966);
        double cfR = remittanceBusiUI.cfR();
        AppMethodBeat.o(44966);
        return cfR;
    }

    private double cfR() {
        AppMethodBeat.i(44934);
        double d;
        if (this.pTx || this.pQY == 33) {
            d = this.pTp;
            AppMethodBeat.o(44934);
            return d;
        }
        this.pTp = bo.getDouble(this.pTh.getText(), 0.0d);
        d = this.pTp;
        AppMethodBeat.o(44934);
        return d;
    }

    public void onCreate(Bundle bundle) {
        AppMethodBeat.i(44935);
        super.onCreate(bundle);
        h.pYm.e(15235, new Object[]{Integer.valueOf(1)});
        getSupportActionBar().setBackgroundDrawable(new ColorDrawable(getResources().getColor(2131690389)));
        View customView = getSupportActionBar().getCustomView();
        if (customView != null) {
            customView = customView.findViewById(16908308);
            if (customView != null && (customView instanceof TextView)) {
                ((TextView) customView).setTextColor(getResources().getColor(2131689761));
            }
        }
        if (VERSION.SDK_INT >= 21) {
            Window window = getWindow();
            window.addFlags(j.INVALID_ID);
            window.setStatusBarColor(getResources().getColor(2131690389));
        }
        if (com.tencent.mm.compatible.util.d.iW(21)) {
            if (com.tencent.mm.compatible.util.d.iW(23)) {
                getWindow().getDecorView().setSystemUiVisibility(8192);
            } else {
                getWindow().setStatusBarColor(Color.parseColor("#E5E5E5"));
            }
        }
        setBackBtn(new 12(this), 2131230737);
        nf(1633);
        nf(1241);
        nf(2677);
        nf(2504);
        nf(2702);
        nf(2682);
        com.tencent.mm.wallet_core.d.c cVar = this.pTU;
        i iVar = this.Ahr;
        cVar.rtType = 2682;
        cVar.Agk = iVar;
        iVar.Agq.put(Integer.valueOf(2682), cVar);
        setMMTitle(2131302373);
        setBackBtn(new 1(this));
        this.cEW = UUID.randomUUID().toString();
        com.tencent.mm.plugin.wallet.pay.a.b.acq(this.cEW);
        this.pQY = getIntent().getIntExtra("pay_scene", 31);
        this.pTo = getIntent().getStringExtra("scan_remittance_id");
        this.pTp = getIntent().getDoubleExtra("fee", 0.0d);
        this.pTq = getIntent().getStringExtra("receiver_name");
        this.pTr = getIntent().getStringExtra("receiver_true_name");
        this.pTs = getIntent().getStringExtra("receiver_true_name_busi");
        this.obL = getIntent().getIntExtra("pay_channel", 0);
        this.pTt = getIntent().getStringExtra(SharePluginInfo.ISSUE_KEY_DESC);
        this.pTv = getIntent().getIntExtra("busi_type", 0);
        this.pQW = getIntent().getStringExtra("mch_name");
        this.pTy = getIntent().getStringExtra("mch_type");
        this.pTA = getIntent().getIntExtra("mch_time", 0);
        this.pTw = getIntent().getStringExtra("mch_info");
        this.pTz = getIntent().getIntExtra("get_pay_wifi", 0);
        this.pRC = getIntent().getStringExtra("rcvr_open_id");
        this.pTu = getIntent().getStringExtra("rcvr_ticket");
        this.pTI = getIntent().getStringExtra("receiver_tips");
        this.pSH = (BusiRemittanceResp) getIntent().getParcelableExtra("BusiRemittanceResp");
        if (this.pSH != null) {
            boolean z = this.pQY == 32 && (this.pSH.pOF == 1 || (this.pSH != null && this.pSH.pOD.size() > 0));
            this.pTM = z;
        }
        if (this.pTp > 0.0d) {
            this.pTx = true;
        } else {
            this.pTx = false;
        }
        if (this.pTv == 0) {
            ab.w("MicroMsg.RemittanceBusiUI", "wrong busi type!");
            finish();
        }
        h.pYm.e(15386, new Object[]{Integer.valueOf(1), Integer.valueOf(2)});
        this.pTQ = new a(this, 28, 28, 2.0f);
        this.pTR = new a(this, 50, 50, 8.0f);
        initView();
        cbv();
        AppMethodBeat.o(44935);
    }

    public void onResume() {
        AppMethodBeat.i(44936);
        super.onResume();
        e.cfP().eL(this);
        AppMethodBeat.o(44936);
    }

    public final void initView() {
        AppMethodBeat.i(44937);
        this.nsk = (ScrollView) findViewById(2131820884);
        this.pSY = (TextView) findViewById(2131826999);
        this.pSZ = (TextView) findViewById(2131827000);
        this.pTa = (TextView) findViewById(2131827005);
        this.pTb = (TextView) findViewById(2131827007);
        this.pTc = (TextView) findViewById(2131827018);
        this.pTd = (TextView) findViewById(2131827019);
        this.pTg = (CdnImageView) findViewById(2131823740);
        this.pTh = (WalletFormView) findViewById(2131827002);
        this.pTi = (Button) findViewById(2131827016);
        this.pTj = (LinearLayout) findViewById(2131827004);
        this.pRm = (LinearLayout) findViewById(2131827001);
        this.pTk = (LinearLayout) findViewById(2131827017);
        this.pTe = (TextView) findViewById(2131827011);
        this.pTf = findViewById(2131827008);
        this.pTl = (TextView) findViewById(2131827006);
        this.pTm = findViewById(2131827013);
        this.pTn = (TextView) findViewById(2131827015);
        if (this.pTx) {
            if (!bo.isNullOrNil(this.pTt)) {
                this.pTa.setText(com.tencent.mm.pluginsdk.ui.e.j.b(this, this.pTt, this.pTa.getTextSize()));
            }
            this.pTb.setText(e.F(this.pTp));
            this.pTj.setVisibility(0);
            this.pRm.setVisibility(8);
        } else {
            boolean z;
            if (this.pSH != null) {
                boolean z2;
                if (this.pSH.pOD.size() > 0) {
                    z2 = false;
                } else {
                    z2 = true;
                }
                z = (this.pSH.pOE == null || this.pSH.pOE.vPg.size() <= 0) ? z2 : false;
            } else {
                z = true;
            }
            a(this.pTh, 2, false, z, true);
            this.pTh.a(new 23(this));
            this.pTj.setVisibility(8);
            this.pRm.setVisibility(0);
        }
        if (com.tencent.mm.kernel.g.RK()) {
            com.tencent.mm.kernel.g.RQ();
            ad aoO = ((com.tencent.mm.plugin.messenger.foundation.a.j) com.tencent.mm.kernel.g.K(com.tencent.mm.plugin.messenger.foundation.a.j.class)).XM().aoO(this.pTq);
            if (aoO == null || ((int) aoO.ewQ) == 0) {
                ao.a.flu.a(this.pTq, BuildConfig.FLAVOR, new 25(this));
            }
        }
        cfI();
        this.pTk.setOnClickListener(new 26(this));
        this.pTi.setOnClickListener(new 27(this));
        this.nsk.setOnTouchListener(new 28(this));
        this.obM = new 29(this);
        if (!(this.pSH == null || this.pSH.pOE == null)) {
            this.pTJ.pQH = this.pSH.pOE;
            this.pTJ.VR(this.pSH.pOE.vPi);
        }
        if (cfS()) {
            h.pYm.e(15235, new Object[]{Integer.valueOf(2)});
        }
        AppMethodBeat.o(44937);
    }

    private void cfI() {
        AppMethodBeat.i(44938);
        al.d(new 30(this));
        AppMethodBeat.o(44938);
    }

    private boolean cfS() {
        AppMethodBeat.i(44939);
        if (this.pTf == null) {
            AppMethodBeat.o(44939);
            return false;
        } else if (this.pSH != null) {
            boolean z;
            ab.i("MicroMsg.RemittanceBusiUI", "tryShowFavor ");
            if (this.pSH.pOE == null || this.pSH.pOE.vPh.size() <= 0) {
                z = false;
            } else {
                z = true;
            }
            if (this.pSH.pOD.size() > 0) {
                z = true;
            }
            if (this.pTJ.cfu().size() > 0) {
                z = true;
            }
            if (z) {
                this.pTm.setVisibility(0);
                this.pTQ.update();
                this.pTf.setVisibility(0);
                this.pTe.setText(this.pSH.pOz);
                this.pTe.setTextColor(-7829368);
                this.pTn.setText(e.F(cfR()));
                abv abv = this.pTJ.pQG;
                if (abv != null) {
                    this.pTe.setTextColor(-30434);
                    this.pTe.setText(abv.pOz);
                    this.pTn.setText(e.F(((double) abv.wjf) / 100.0d));
                } else {
                    String cfv = this.pTJ.cfv();
                    if (!bo.isNullOrNil(cfv)) {
                        this.pTe.setTextColor(-7829368);
                        this.pTe.setText(cfv);
                    }
                }
                findViewById(2131827010).setOnClickListener(new 2(this));
                AppMethodBeat.o(44939);
                return true;
            }
            this.pTf.setVisibility(8);
            this.pTR.update();
            this.pTm.setVisibility(8);
            AppMethodBeat.o(44939);
            return false;
        } else {
            AppMethodBeat.o(44939);
            return false;
        }
    }

    private void cS(final List<abw> list) {
        AppMethodBeat.i(44940);
        final com.tencent.mm.ui.widget.picker.d dVar = new com.tencent.mm.ui.widget.picker.d(this);
        ArrayList arrayList = new ArrayList();
        abv abv = this.pTJ.pQG;
        HashSet hashSet = new HashSet();
        final HashSet hashSet2 = new HashSet();
        if (this.pTJ.cfx() && abv != null) {
            Iterator it = abv.vPg.iterator();
            while (it.hasNext()) {
                hashSet.add(Long.valueOf(((abw) it.next()).wjm));
            }
        }
        int i = 0;
        for (abw abw : list) {
            if (hashSet.contains(Long.valueOf(abw.wjm))) {
                arrayList.add(Integer.valueOf(i));
            }
            i++;
        }
        String string = getString(2131302422);
        if (string != null && string.length() > 0) {
            dVar.zSw.setVisibility(0);
            dVar.rMl.setText(string);
        }
        dVar.zSx = arrayList;
        dVar.rBl = new 6(this, list, hashSet2);
        dVar.rBm = new n.d() {
            public final void onMMMenuItemSelected(MenuItem menuItem, int i) {
                int i2 = 1;
                int i3 = 0;
                AppMethodBeat.i(44899);
                if (hashSet2.contains(Integer.valueOf(i))) {
                    AppMethodBeat.o(44899);
                    return;
                }
                if (i < list.size()) {
                    h.pYm.e(15235, new Object[]{Integer.valueOf(4)});
                    abw abw = (abw) list.get(i);
                    com.tencent.mm.ui.widget.picker.d dVar = dVar;
                    List dLn;
                    if (dVar.zSy != null) {
                        dLn = dVar.zSy.dLn();
                    } else {
                        dLn = new ArrayList();
                    }
                    boolean contains = dLn.contains(Integer.valueOf(i));
                    if (contains) {
                        i2 = 0;
                    }
                    LinkedList linkedList = new LinkedList();
                    for (Integer intValue : dLn) {
                        int intValue2 = intValue.intValue();
                        if (intValue2 < list.size() && !(i2 == 0 && i == intValue2)) {
                            linkedList.add((abw) list.get(intValue2));
                        }
                    }
                    if (i2 != 0) {
                        linkedList.add(abw);
                    }
                    b A = RemittanceBusiUI.this.pTJ;
                    if (i2 == 0) {
                        abw = null;
                    }
                    A.a(linkedList, abw);
                    abv abv = RemittanceBusiUI.this.pTJ.pQG;
                    HashSet hashSet = new HashSet();
                    if (abv != null) {
                        Iterator it = abv.vPg.iterator();
                        while (it.hasNext()) {
                            hashSet.add(Long.valueOf(((abw) it.next()).wjm));
                        }
                    }
                    HashMap hashMap = new HashMap();
                    for (abw abw2 : list) {
                        if (hashSet.contains(Long.valueOf(abw2.wjm))) {
                            hashMap.put(Integer.valueOf(i3), Boolean.TRUE);
                        } else {
                            hashMap.put(Integer.valueOf(i3), Boolean.FALSE);
                        }
                        if (i3 == i) {
                            hashMap.put(Integer.valueOf(i3), Boolean.valueOf(contains));
                        }
                        i3++;
                    }
                    com.tencent.mm.ui.widget.picker.d dVar2 = dVar;
                    if (dVar2.zSy != null) {
                        dVar2.zSy.zSB = hashMap;
                        dVar2.zSy.notifyDataSetChanged();
                    }
                }
                AppMethodBeat.o(44899);
            }
        };
        dVar.zSz = new 8(this);
        if (dVar.rBl != null) {
            dVar.rBl.a(dVar.rBn);
        }
        dVar.zSy = new com.tencent.mm.ui.widget.picker.d.a(dVar, dVar.mContext);
        dVar.zSy.dLm();
        dVar.zSv.setAdapter(dVar.zSy);
        dVar.grC.setOnClickListener(new 2(dVar));
        dVar.jAH.setOnClickListener(new 3(dVar));
        if (dVar.zaW != null) {
            if (dVar.rBn != null && dVar.rBn.size() > 3) {
                LayoutParams layoutParams = (LayoutParams) dVar.iym.getLayoutParams();
                layoutParams.height = dVar.zaX;
                dVar.iym.setLayoutParams(layoutParams);
            }
            dVar.zaW.show();
        }
        AppMethodBeat.o(44940);
    }

    private void a(com.tencent.mm.plugin.remittance.model.c cVar, com.tencent.mm.plugin.remittance.model.d dVar, int i) {
        AppMethodBeat.i(44941);
        if (this.pTM) {
            this.pTn.setText(e.F(cfR()));
            al.af(this.pTT);
            this.pTp = cfR();
            long round = Math.round(this.pTp * 100.0d);
            if (round <= 0) {
                this.pTJ.cft();
                this.pTe.setTextColor(-7829368);
                this.pTe.setText(this.pSH.pOz);
                if (this.pTP != null) {
                    this.pTP.pOQ = true;
                }
                AppMethodBeat.o(44941);
                return;
            }
            this.pTP = new g((int) round, this.obL, this.pSH.pOA, this.pTt, this.pQW, this.pSH.pOB, this.pRC, this.pTq, this.pSH.pOC, cVar == null ? 0 : 1, cVar, dVar);
            al.n(this.pTT, (long) i);
        }
        AppMethodBeat.o(44941);
    }

    public void onDestroy() {
        AppMethodBeat.i(44942);
        super.onDestroy();
        a.xxA.d(this.pRR);
        a.xxA.d(this.pUc);
        a.xxA.d(this.pUa);
        this.pUb.dead();
        ng(1633);
        ng(1241);
        ng(2677);
        ng(2504);
        ng(2702);
        ng(2682);
        com.tencent.mm.plugin.wallet.pay.a.b.acr(this.cEW);
        AppMethodBeat.o(44942);
    }

    public final boolean c(int i, int i2, String str, m mVar) {
        AppMethodBeat.i(44943);
        if (mVar instanceof com.tencent.mm.plugin.remittance.model.i) {
            com.tencent.mm.plugin.remittance.model.i iVar = (com.tencent.mm.plugin.remittance.model.i) mVar;
            if (i != 0 || i2 != 0) {
                ab.e("MicroMsg.RemittanceBusiUI", "net error: %s", new Object[]{mVar});
            } else if (iVar.pOT.kdT == 0) {
                boolean z;
                this.pSy = iVar.pOT.vFb;
                this.oXY = iVar.pOT.vFc;
                this.pSD = iVar.pOT.vFd;
                this.pTK = iVar.pOT.vPD;
                this.pTL = iVar.pOT.vPC;
                this.pTB = iVar.pOT.vPI;
                this.pTC = iVar.pOT.vPH;
                this.pTE = iVar.pOT.vPL;
                this.pTF = iVar.pOT.vPJ;
                this.pTG = iVar.pOT.vPK;
                ab.i("MicroMsg.RemittanceBusiUI", "touch_challenge %s need_change_auth_key %s", new Object[]{iVar.pOT.vPM, Integer.valueOf(iVar.pOT.vPN)});
                if (iVar.pOT.vPM != null) {
                    v.tCn.msn = iVar.pOT.vPM.dlY();
                }
                v vVar = v.tCn;
                if (iVar.pOT.vPN == 1) {
                    z = true;
                } else {
                    z = false;
                }
                vVar.mso = z;
                if (!a(iVar)) {
                    d(iVar);
                }
            } else {
                ab.e("MicroMsg.RemittanceBusiUI", "place order response: %s, %s", new Object[]{Integer.valueOf(iVar.pOT.kdT), iVar.pOT.kdU});
                if (iVar.pOT.vPB == null || bo.isNullOrNil(iVar.pOT.vPB.nZb)) {
                    e cfP = e.cfP();
                    String str2 = iVar.pOT.kdU;
                    String str3 = BuildConfig.FLAVOR;
                    10 10 = new 10(this, mVar);
                    ab.w("MicroMsg.RemittanceBusiDialogMgr", "showAlert3() msg:%s, title:%s", new Object[]{bo.nullAsNil(str2), bo.nullAsNil(str3)});
                    Context context = (Context) cfP.bSI.get();
                    if (context == null) {
                        ab.i("MicroMsg.RemittanceBusiDialogMgr", "getContext() == null");
                    } else {
                        com.tencent.mm.ui.base.h.a(context, str2, str3, 10);
                    }
                } else {
                    a(iVar);
                }
                if (iVar.pOT.vPE == 1) {
                    a(null, null, 0);
                }
            }
        } else if (mVar instanceof com.tencent.mm.plugin.remittance.model.h) {
            ab.i("MicroMsg.RemittanceBusiUI", "pay check callback");
            AppMethodBeat.o(44943);
            return true;
        } else if (mVar instanceof g) {
            ab.i("MicroMsg.RemittanceBusiUI", "onSceneEnd %s errType %s errCode %s", new Object[]{mVar, Integer.valueOf(i), Integer.valueOf(i2)});
            g gVar = (g) mVar;
            if (!gVar.pOP.equals(this.pTP.pOP) || gVar.pOQ) {
                gVar.pOO = true;
                ab.e("MicroMsg.RemittanceBusiUI", "ignore this getFavor new coming soon %s", new Object[]{Boolean.valueOf(gVar.pOQ)});
                AppMethodBeat.o(44943);
                return true;
            }
            com.tencent.mm.plugin.remittance.model.d dVar;
            if (i != 0 || i2 != 0) {
                this.pTJ.cft();
                if (!(this.pSH == null || bo.isNullOrNil(this.pSH.pOz))) {
                    this.pTe.setText(this.pSH.pOz);
                }
                this.pTe.setTextColor(-7829368);
                this.pTe.setText(getString(2131302367));
                dVar = gVar.pON;
                if (dVar != null) {
                    dVar.a(i, i2, gVar);
                }
            } else if (gVar.pOL.kdT == 0) {
                this.pTJ.pQH = gVar.pOL.pOE;
                this.pTJ.VR(gVar.pOL.pOE.vPi);
                cfS();
                com.tencent.mm.plugin.remittance.model.c cVar = gVar.pOM;
                ab.i("MicroMsg.RemittanceBusiUI", "GetFavorAfterAction %s", new Object[]{cVar});
                if (cVar != null) {
                    cVar.cR(this.pTJ.cfu());
                }
            } else {
                this.pTJ.cft();
                this.pTe.setTextColor(-7829368);
                this.pTe.setText(gVar.pOL.kdU);
                dVar = gVar.pON;
                if (dVar != null) {
                    dVar.a(i, i2, gVar);
                }
            }
            gVar.pOO = true;
            AppMethodBeat.o(44943);
            return true;
        } else if (mVar instanceof l) {
            l lVar = (l) mVar;
            ab.i("MicroMsg.RemittanceBusiUI", "NetSceneBusiF2fZeroCallback getHasRetried %s", new Object[]{Boolean.valueOf(lVar.pOZ)});
            if (i != 0 || i2 != 0) {
                e.cfP().a(getString(2131305389), new 13(this));
            } else if (lVar.pOY.kdT == 0) {
                cfU();
            } else {
                cfT();
                e.cfP().a(lVar.pOY.kdU, new 11(this));
            }
        }
        AppMethodBeat.o(44943);
        return false;
    }

    public void onActivityResult(int i, int i2, Intent intent) {
        boolean z = true;
        AppMethodBeat.i(44944);
        ab.i("MicroMsg.RemittanceBusiUI", "onActivityResult requestCode %s resultCode %s %s", new Object[]{Integer.valueOf(i), Integer.valueOf(i2), intent});
        if (i == 3) {
            if (i2 != -1) {
                z = false;
            }
            a(z, intent);
        } else if (i == 1) {
            if (i2 != -1) {
                z = false;
            }
            a(z, intent);
        } else if (i == 2) {
            if (i2 == -1) {
                this.pTD = intent.getStringExtra("INTENT_RESULT_TOKEN");
                this.pTN = 0.0d;
                ab.i("MicroMsg.RemittanceBusiUI", "onActivityResult _result_token: %s", new Object[]{r2});
                p(false, intent.getStringExtra("INTENT_REQKEY"));
            } else {
                cfT();
            }
        }
        super.onActivityResult(i, i2, intent);
        AppMethodBeat.o(44944);
    }

    private void a(boolean z, Intent intent) {
        AppMethodBeat.i(44945);
        if (z) {
            String stringExtra = intent.getStringExtra("key_trans_id");
            double doubleExtra = intent.getDoubleExtra("key_total_fee", -1.0d);
            String stringExtra2 = intent.getStringExtra("key_reqKey");
            ab.i("MicroMsg.RemittanceBusiUI", "onActivityResult _transId: %s _totalFee: %s", new Object[]{stringExtra, Double.valueOf(doubleExtra)});
            if (bo.isNullOrNil(this.oXY)) {
                this.oXY = stringExtra;
            }
            if (doubleExtra >= 0.0d) {
                this.pTN = doubleExtra;
            }
            if (this.pRH) {
                h.pYm.e(15386, new Object[]{Integer.valueOf(3), Integer.valueOf(2)});
            }
            cfU();
            VU(stringExtra2);
        } else if (com.tencent.mm.plugin.wallet_core.utils.c.aw(intent)) {
            finish();
            AppMethodBeat.o(44945);
            return;
        } else if (com.tencent.mm.plugin.wallet_core.utils.c.ax(intent)) {
            AppMethodBeat.o(44945);
            return;
        } else {
            ab.i("MicroMsg.RemittanceBusiUI", "do NetSceneBusiF2fUnlockFavor");
            cfT();
        }
        c(z, intent);
        AppMethodBeat.o(44945);
    }

    private void c(boolean z, Intent intent) {
        AppMethodBeat.i(44946);
        this.pTW = false;
        if (z) {
            ab.i("MicroMsg.RemittanceBusiUI", "savePayInfo isOk = true");
            this.cKs = 1;
        } else if (intent == null) {
            AppMethodBeat.o(44946);
            return;
        } else {
            this.cKs = intent.getIntExtra("key_pay_reslut_type", 3);
            this.pTX = this.pTp;
            this.pTY = this.pSz;
            this.pTZ = this.pSy;
        }
        ab.i("MicroMsg.RemittanceBusiUI", "savePayInfo() mLastPayResult:%s mLastTotalAmt:%s mLastPayerDesc:%s mLastF2fId:%s", new Object[]{Double.valueOf(this.pTX), Double.valueOf(this.pTX), this.pTY, this.pTZ});
        AppMethodBeat.o(44946);
    }

    private void p(boolean z, String str) {
        AppMethodBeat.i(44947);
        ab.i("MicroMsg.RemittanceBusiUI", "doBusiZeroCallback %s", new Object[]{Boolean.valueOf(z)});
        cz czVar = (cz) this.pTS.get(str);
        if (czVar == null) {
            AppMethodBeat.o(44947);
            return;
        }
        int i;
        chl chl = this.pTC;
        String str2 = this.pTB;
        if (z) {
            i = 1;
        } else {
            i = 0;
        }
        l lVar = new l(chl, czVar, str2, i, this.pTD, str);
        if (z) {
            lVar.pOZ = true;
            com.tencent.mm.kernel.g.RQ();
            com.tencent.mm.kernel.g.RO().eJo.a(lVar, 0);
            AppMethodBeat.o(44947);
            return;
        }
        this.pTH = 0;
        a(lVar, true, false);
        AppMethodBeat.o(44947);
    }

    private void cfT() {
        AppMethodBeat.i(44948);
        ab.i("MicroMsg.RemittanceBusiUI", "unLockFavorimp");
        abv abv = this.pTJ.pQG;
        if (abv == null) {
            ab.i("MicroMsg.RemittanceBusiUI", "do NetSceneBusiF2fUnlockFavor FavorComposeInfo is null");
            AppMethodBeat.o(44948);
            return;
        }
        int round = (int) Math.round(this.pTp * 100.0d);
        cz czVar = new cz();
        czVar.cIb = this.obL;
        czVar.vFb = this.pSy;
        czVar.vFc = this.oXY;
        czVar.pOA = this.pSH.pOA;
        czVar.scene = this.pQY;
        czVar.vFd = this.pSD;
        czVar.vFe = abv;
        czVar.vFf = this.pTq;
        czVar.pPZ = this.pRC;
        czVar.vFg = round;
        a(new k(czVar, this.pTK), false, false);
        AppMethodBeat.o(44948);
    }

    public final int getLayoutId() {
        return 2130970509;
    }

    private void a(int i, lp lpVar, boolean z, fw fwVar, String str, String str2) {
        String str3;
        AppMethodBeat.i(44949);
        int i2 = 0;
        if (!this.pTW) {
            boolean C = bo.C(Double.valueOf(this.pTX), Double.valueOf(this.pTp));
            boolean isEqual = bo.isEqual(this.pTY, this.pSz);
            if (!C) {
                i2 = 1;
            }
            if (!isEqual) {
                i2 |= 2;
            }
        }
        String str4 = this.pRC;
        String str5 = this.pTo;
        int i3 = this.pQY;
        String str6 = this.pTt;
        String str7 = this.pSz;
        int i4 = this.obL;
        String str8 = this.pTu;
        String str9 = this.pTy;
        int i5 = this.pTA;
        int i6 = this.pTz;
        String str10 = this.pTq;
        abv abv = this.pTJ.pQG;
        if (lpVar == null) {
            str3 = BuildConfig.FLAVOR;
        } else {
            str3 = lpVar.vPj;
        }
        com.tencent.mm.plugin.remittance.model.i iVar = new com.tencent.mm.plugin.remittance.model.i(str4, str5, i3, str6, str7, i, i4, str8, str9, i5, i6, str10, abv, str3, this.pSH.pOA, str, this.pQW, str2, this.pTr, this.pTZ, this.cKs, i2);
        if (z) {
            int i7;
            iVar.pOV = fwVar;
            lu luVar = (lu) iVar.gme.fsG.fsP;
            if (fwVar.czT.czW == 1) {
                i7 = 1;
            } else {
                i7 = 0;
            }
            luVar.vPw = i7;
        }
        a(iVar, true, false);
        AppMethodBeat.o(44949);
    }

    private void cfU() {
        AppMethodBeat.i(44950);
        ab.i("MicroMsg.RemittanceBusiUI", "goto busi result");
        Intent intent = new Intent(this, RemittanceBusiResultUI.class);
        intent.putExtra("key_pay_desc", this.pSz);
        intent.putExtra("key_rcv_desc", this.pTt);
        if (this.pSH != null) {
            intent.putExtra("BusiRemittanceResp", this.pSH);
        }
        intent.putExtra("key_mch_name", this.pQW);
        intent.putExtra("key_rcver_name", this.pTq);
        intent.putExtra("key_rcver_true_name", this.pTr);
        if (this.pTN >= 0.0d) {
            intent.putExtra("key_money", this.pTN);
        } else {
            intent.putExtra("key_money", this.pTp);
        }
        intent.putExtra("key_f2f_id", this.pSy);
        intent.putExtra("key_trans_id", this.oXY);
        intent.putExtra("key_check_sign", this.pSD);
        intent.putExtra("key_rcvr_open_id", this.pRC);
        intent.putExtra("key_channel", this.obL);
        if (this.pSH != null) {
            intent.putExtra("key_succ_show_avatar_type", this.pSH.pOG);
            intent.putExtra("key_succ_show_avatar_show", this.pSH.pOx);
            intent.putExtra("key_succ_show_avatar_url", this.pSH.pOy);
        }
        if (this.pSH != null) {
            intent.putExtra("key_scan_sceen", this.pSH.pOA);
        }
        intent.putExtra("key_succ_page_extend", this.pTL);
        abv abv = this.pTJ.pQG;
        int round = (int) Math.round(this.pTp * 100.0d);
        cz czVar = new cz();
        czVar.cIb = this.obL;
        czVar.vFb = this.pSy;
        czVar.vFc = this.oXY;
        czVar.pOA = this.pSH.pOA;
        czVar.scene = this.pQY;
        czVar.vFd = this.pSD;
        czVar.vFe = abv;
        czVar.vFf = this.pTq;
        czVar.pPZ = this.pRC;
        czVar.vFg = round;
        try {
            intent.putExtra("AfterPlaceOrderCommReq", czVar.toByteArray());
        } catch (Exception e) {
            ab.printErrStackTrace("MicroMsg.RemittanceBusiUI", e, BuildConfig.FLAVOR, new Object[0]);
        }
        startActivity(intent);
        finish();
        AppMethodBeat.o(44950);
    }

    private boolean a(com.tencent.mm.plugin.remittance.model.i iVar) {
        AppMethodBeat.i(44951);
        boolean z = false;
        if (!this.pRM) {
            z = b(iVar);
        }
        if (!z) {
            z = c(iVar);
        }
        AppMethodBeat.o(44951);
        return z;
    }

    private boolean b(com.tencent.mm.plugin.remittance.model.i iVar) {
        AppMethodBeat.i(44952);
        if (bo.isNullOrNil(iVar.pOT.vPA)) {
            AppMethodBeat.o(44952);
            return false;
        }
        this.pRM = true;
        aY(1, iVar.pOT.vFb);
        e.cfP().a(iVar.pOT.vPA, getString(2131297031), getString(2131302363), getString(2131296868), new 15(this, iVar), new 16(this, iVar));
        AppMethodBeat.o(44952);
        return true;
    }

    private void aY(int i, String str) {
        AppMethodBeat.i(138551);
        this.pRJ = new bh();
        this.pRJ.cVR = 1;
        this.pRJ.cVS = (long) i;
        this.pRJ.gd(str);
        this.pRJ.ajK();
        AppMethodBeat.o(138551);
    }

    public void onNewIntent(Intent intent) {
        AppMethodBeat.i(44954);
        ab.v("MicroMsg.RemittanceBusiUI", "onNewIntent");
        AppMethodBeat.o(44954);
    }

    private boolean c(com.tencent.mm.plugin.remittance.model.i iVar) {
        AppMethodBeat.i(44955);
        if (iVar.pOT.vPB != null) {
            this.pRP = true;
            e.cfP().a(iVar.pOT.kdU, BuildConfig.FLAVOR, iVar.pOT.vPB.nZc, iVar.pOT.vPB.nZb, new 17(this, iVar), new 18(this));
            AppMethodBeat.o(44955);
            return true;
        }
        AppMethodBeat.o(44955);
        return false;
    }

    private void d(com.tencent.mm.plugin.remittance.model.i iVar) {
        AppMethodBeat.i(44956);
        ab.i("MicroMsg.RemittanceBusiUI", "do start pay zero_pay_flag: %s", new Object[]{Integer.valueOf(iVar.pOT.vPF)});
        int round = (int) Math.round(this.pTp * 100.0d);
        cz czVar = new cz();
        czVar.cIb = this.obL;
        czVar.vFb = this.pSy;
        czVar.vFc = this.oXY;
        czVar.pOA = this.pSH.pOA;
        czVar.scene = this.pQY;
        czVar.vFd = this.pSD;
        czVar.vFe = this.pTJ.pQG;
        czVar.vFf = this.pTq;
        czVar.pPZ = this.pRC;
        czVar.vFg = round;
        this.pTS.put(iVar.pOT.cBT, czVar);
        if (iVar.pOT.vPF == 1) {
            a(iVar.pOT);
            AppMethodBeat.o(44956);
            return;
        }
        PayInfo payInfo = new PayInfo();
        payInfo.czZ = iVar.pOT.cBT;
        payInfo.cIf = this.pQY;
        if (this.obL > 0) {
            payInfo.cIb = this.obL;
        }
        Bundle bundle = new Bundle();
        bundle.putString("extinfo_key_1", this.pTq);
        bundle.putString("extinfo_key_2", this.pTr);
        bundle.putString("extinfo_key_3", this.pTt);
        bundle.putString("extinfo_key_5", getIntent().getStringExtra("receiver_tips"));
        bundle.putString("extinfo_key_7", this.pSz);
        bundle.putString("extinfo_key_19", iVar.pOT.pPJ);
        payInfo.vwh = bundle;
        payInfo.pPV = 1;
        Intent intent = new Intent();
        if (iVar.pOT.pPG == 1) {
            bundle.putInt("extinfo_key_15", iVar.pOT.vPO);
            bundle.putString("extinfo_key_17", iVar.pOT.pPH);
            bundle.putString("extinfo_key_18", iVar.pOT.pPI);
            intent.putExtra("key_pay_info", payInfo);
            intent.putExtra("from_patch_ui", true);
            intent.putExtra("key_rcvr_open_id", this.pRC);
            intent.putExtra("key_mch_info", this.pTw);
            intent.putExtra("key_mch_photo", this.pSH.pOy);
            intent.putExtra("key_transfer_qrcode_id", this.pTo);
            intent.putExtra("get_dynamic_code_sign", iVar.pOT.pPH);
            intent.putExtra("get_dynamic_code_extend", iVar.pOT.pPI);
            intent.putExtra("dynamic_code_spam_wording", iVar.pOT.pPK);
            intent.putExtra("dynamic_code_amount", iVar.pOT.vPO);
            intent.putExtra("show_paying_wording", iVar.pOT.pPJ);
            intent.putExtra("show_avatar_type", this.pSH.pOG == 1);
            h.pYm.e(15386, new Object[]{Integer.valueOf(2), Integer.valueOf(2)});
            this.pRR.dnU();
            this.pUa.dnU();
            this.pUb.dnU();
            com.tencent.mm.bp.d.b(this, "remittance", ".ui.RemittanceF2fDynamicCodeUI", intent, 3);
            AppMethodBeat.o(44956);
            return;
        }
        if (bo.isNullOrNil(iVar.pOU)) {
            this.pRH = false;
        } else {
            this.pRH = true;
        }
        payInfo.vwp = this.cEW;
        payInfo.aPn = this.pRH;
        if (iVar.pOV == null || iVar.pOV.czT.czX == null) {
            com.tencent.mm.pluginsdk.wallet.h.a(this, false, BuildConfig.FLAVOR, payInfo, this.pTr, intent, 1);
            AppMethodBeat.o(44956);
            return;
        }
        com.tencent.mm.pluginsdk.wallet.h.a(iVar.pOV.czT.czX, false, BuildConfig.FLAVOR, payInfo, this.pTr, intent, iVar.pOV.czT.czV);
        AppMethodBeat.o(44956);
    }

    private void a(lv lvVar) {
        AppMethodBeat.i(44957);
        ab.i("MicroMsg.RemittanceBusiUI", "resp.payer_need_auth_flag %s", new Object[]{Integer.valueOf(lvVar.vPG)});
        if (lvVar.vPG == 1) {
            Bundle bundle = new Bundle();
            a.xxA.c(this.pUc);
            bundle.putString("realname_verify_process_jump_activity", ".ui.RemittanceBusiUI");
            bundle.putString("realname_verify_process_jump_plugin", "remittance");
            bundle.putInt("real_name_verify_mode", 0);
            bundle.putInt("entry_scene", this.pQY);
            com.tencent.mm.wallet_core.a.a(this, com.tencent.mm.plugin.wallet_core.id_verify.a.class, bundle);
            AppMethodBeat.o(44957);
            return;
        }
        String str;
        Intent intent = new Intent();
        String str2 = BuildConfig.FLAVOR;
        if (bo.isNullOrNil(this.pTI)) {
            String string = getString(2131305241);
            if (bo.isNullOrNil(this.pTq)) {
                ab.e("MicroMsg.RemittanceBusiUI", "userName is null ,scene is MMPAY_PAY_SCENE_TRANSFER");
                str = str2;
            } else {
                com.tencent.mm.kernel.g.RQ();
                ad aoM = ((com.tencent.mm.plugin.messenger.foundation.a.j) com.tencent.mm.kernel.g.K(com.tencent.mm.plugin.messenger.foundation.a.j.class)).XM().aoM(this.pTq);
                if (aoM != null) {
                    Object[] objArr = new Object[1];
                    objArr[0] = e.atA(aoM.Oj()) + (bo.isNullOrNil(this.pTr) ? BuildConfig.FLAVOR : "(" + this.pTr + ")");
                    str = bo.t(string, objArr);
                } else {
                    ab.e("MicroMsg.RemittanceBusiUI", "can not found contact for user::" + this.pTq);
                    str = str2;
                }
            }
        } else {
            str = this.pTI;
        }
        intent.putExtra("INTENT_TITLE", str);
        intent.putExtra("INTENT_CAN_TOUCH", this.pTE);
        intent.putExtra("INTENT_PAYFEE", e.F(0.0d));
        intent.putExtra("INTENT_REQKEY", lvVar.cBT);
        try {
            intent.putExtra("INTENT_TOKENMESS", lvVar.vPH.toByteArray());
            com.tencent.mm.bp.d.b(this.mController.ylL, "wallet", "com.tencent.mm.plugin.wallet.pay.ui.WalletPayCustomUI", intent, 2);
            AppMethodBeat.o(44957);
        } catch (Exception e) {
            ab.printErrStackTrace("MicroMsg.RemittanceBusiUI", e, BuildConfig.FLAVOR, new Object[0]);
            AppMethodBeat.o(44957);
        }
    }

    private void VU(String str) {
        AppMethodBeat.i(44958);
        ab.i("MicroMsg.RemittanceBusiUI", "do pay check: %s", new Object[]{str});
        cz czVar = (cz) this.pTS.get(str);
        if (czVar == null) {
            AppMethodBeat.o(44958);
            return;
        }
        if (!bo.isNullOrNil(this.oXY)) {
            czVar.vFc = this.oXY;
        }
        a(new com.tencent.mm.plugin.remittance.model.h(czVar, this.pTK), false, false);
        AppMethodBeat.o(44958);
    }

    private void cbv() {
        AppMethodBeat.i(44959);
        this.pTp = cfR();
        if (this.pTp <= 0.0d) {
            findViewById(2131827010).setClickable(false);
            findViewById(2131827010).setEnabled(false);
            findViewById(2131827010).setOnClickListener(null);
            this.pTi.setClickable(false);
            this.pTi.setEnabled(false);
            this.pTe.setTextColor(getResources().getColor(2131690312));
            AppMethodBeat.o(44959);
            return;
        }
        this.pTe.setTextColor(-7829368);
        findViewById(2131827010).setEnabled(true);
        findViewById(2131827010).setClickable(true);
        this.pTi.setClickable(true);
        this.pTi.setEnabled(true);
        findViewById(2131827010).setOnClickListener(new OnClickListener() {
            public final void onClick(View view) {
                AppMethodBeat.i(44918);
                h.pYm.e(15235, new Object[]{Integer.valueOf(3)});
                RemittanceBusiUI.z(RemittanceBusiUI.this);
                AppMethodBeat.o(44918);
            }
        });
        AppMethodBeat.o(44959);
    }

    static /* synthetic */ void e(RemittanceBusiUI remittanceBusiUI) {
        AppMethodBeat.i(44960);
        ab.i("MicroMsg.RemittanceBusiUI", "do cancel pay");
        remittanceBusiUI.a(new t(remittanceBusiUI.pTq, remittanceBusiUI.pTo, remittanceBusiUI.pTu, remittanceBusiUI.pRC), false, false);
        AppMethodBeat.o(44960);
    }

    static /* synthetic */ void m(RemittanceBusiUI remittanceBusiUI) {
        AppMethodBeat.i(44965);
        if (bo.isNullOrNil(remittanceBusiUI.pSz)) {
            remittanceBusiUI.pTc.setText(BuildConfig.FLAVOR);
            remittanceBusiUI.pTd.setText(2131302362);
            AppMethodBeat.o(44965);
            return;
        }
        remittanceBusiUI.pTc.setText(remittanceBusiUI.getString(2131302375, new Object[]{remittanceBusiUI.pSz}));
        remittanceBusiUI.pTd.setText(2131302420);
        AppMethodBeat.o(44965);
    }

    static /* synthetic */ void p(RemittanceBusiUI remittanceBusiUI) {
        AppMethodBeat.i(44967);
        ab.i("MicroMsg.RemittanceBusiUI", "do place order");
        if (remittanceBusiUI.pSH == null) {
            ab.e("MicroMsg.RemittanceBusiUI", "doPlaceOrder busi_resp is null");
            AppMethodBeat.o(44967);
            return;
        }
        if (!remittanceBusiUI.pTx) {
            remittanceBusiUI.aoB();
        }
        remittanceBusiUI.a((int) Math.round(remittanceBusiUI.pTp * 100.0d), remittanceBusiUI.pTJ.pQH, false, null, BuildConfig.FLAVOR, BuildConfig.FLAVOR);
        AppMethodBeat.o(44967);
    }

    static /* synthetic */ void z(RemittanceBusiUI remittanceBusiUI) {
        AppMethodBeat.i(44969);
        List list = null;
        if (remittanceBusiUI.pQY == 33) {
            if (remittanceBusiUI.pSH.pOE != null) {
                list = remittanceBusiUI.pSH.pOE.vPg;
            }
        } else if (remittanceBusiUI.pTJ.cfw()) {
            list = remittanceBusiUI.pTJ.cfu();
            if (list.size() == 0) {
                ab.i("MicroMsg.RemittanceBusiUI", "can not find favor %s", new Object[]{Integer.valueOf(list.size())});
                AppMethodBeat.o(44969);
                return;
            }
        } else {
            list = remittanceBusiUI.pSH.pOD;
        }
        remittanceBusiUI.pTp = remittanceBusiUI.cfR();
        if (((int) Math.round(remittanceBusiUI.pTp * 100.0d)) <= 0) {
            remittanceBusiUI.cS(list);
            AppMethodBeat.o(44969);
        } else if (!remittanceBusiUI.pTJ.cfw()) {
            remittanceBusiUI.a(new 4(remittanceBusiUI), new 5(remittanceBusiUI), 0);
            AppMethodBeat.o(44969);
        } else if (remittanceBusiUI.pTP == null) {
            remittanceBusiUI.cS(list);
            AppMethodBeat.o(44969);
        } else if (remittanceBusiUI.pTP.pOO) {
            remittanceBusiUI.cS(list);
            AppMethodBeat.o(44969);
        } else {
            remittanceBusiUI.pTP.pOM = new 3(remittanceBusiUI);
            AppMethodBeat.o(44969);
        }
    }

    static /* synthetic */ void C(RemittanceBusiUI remittanceBusiUI) {
        boolean z = true;
        AppMethodBeat.i(44972);
        if (remittanceBusiUI.pSH == null) {
            ab.e("MicroMsg.RemittanceBusiUI", "busi_resp is null");
            if (remittanceBusiUI.pTP != null) {
                remittanceBusiUI.pTP.pOQ = true;
            }
            AppMethodBeat.o(44972);
            return;
        }
        remittanceBusiUI.pTp = remittanceBusiUI.cfR();
        ab.i("MicroMsg.RemittanceBusiUI", "update updateBilling %s", new Object[]{Integer.valueOf((int) Math.round(remittanceBusiUI.pTp * 100.0d))});
        if (((int) Math.round(remittanceBusiUI.pTp * 100.0d)) <= 0) {
            remittanceBusiUI.pTP.pOQ = true;
            remittanceBusiUI.pTJ.cft();
            remittanceBusiUI.pTe.setTextColor(-7829368);
            remittanceBusiUI.pTe.setText(remittanceBusiUI.pSH.pOz);
            if (remittanceBusiUI.pTP != null) {
                remittanceBusiUI.pTP.pOQ = true;
            }
            AppMethodBeat.o(44972);
            return;
        }
        remittanceBusiUI.pTe.setText(2131302368);
        g gVar = remittanceBusiUI.pTP;
        if (remittanceBusiUI.pTP.pOM == null) {
            z = false;
        }
        remittanceBusiUI.a(gVar, z, false);
        AppMethodBeat.o(44972);
    }

    static /* synthetic */ boolean a(RemittanceBusiUI remittanceBusiUI, int i, int i2, l lVar) {
        long j = 0;
        AppMethodBeat.i(44973);
        if (remittanceBusiUI.pTF == 0) {
            AppMethodBeat.o(44973);
            return false;
        } else if (remittanceBusiUI.pTH >= remittanceBusiUI.pTF) {
            ab.i("MicroMsg.RemittanceBusiUI", "mZero_start_time %s >= mZero_try_time %s say bye bye", new Object[]{Integer.valueOf(remittanceBusiUI.pTH), Integer.valueOf(remittanceBusiUI.pTF)});
            AppMethodBeat.o(44973);
            return false;
        } else {
            remittanceBusiUI.pTV.pUr = lVar;
            b bVar;
            if (i != 0 || i2 != 0) {
                remittanceBusiUI.pTH++;
                ab.i("MicroMsg.RemittanceBusiUI", "mZero_try_interval_ms  mZero_start_time %s mZero_try_interval_ms %s", new Object[]{Integer.valueOf(remittanceBusiUI.pTH), Integer.valueOf(remittanceBusiUI.pTG)});
                al.af(remittanceBusiUI.pTV);
                bVar = remittanceBusiUI.pTV;
                if (remittanceBusiUI.pTG >= 0) {
                    j = (long) remittanceBusiUI.pTG;
                }
                al.n(bVar, j);
                AppMethodBeat.o(44973);
                return true;
            } else if (lVar.pOY.kdT == 0) {
                AppMethodBeat.o(44973);
                return false;
            } else if (lVar.pOY.kdT == 0 || !lVar.lSR) {
                AppMethodBeat.o(44973);
                return false;
            } else {
                remittanceBusiUI.pTH++;
                ab.i("MicroMsg.RemittanceBusiUI", "mZero_try_interval_ms  mZero_start_time %s mZero_try_interval_ms %s", new Object[]{Integer.valueOf(remittanceBusiUI.pTH), Integer.valueOf(remittanceBusiUI.pTG)});
                al.af(remittanceBusiUI.pTV);
                bVar = remittanceBusiUI.pTV;
                if (remittanceBusiUI.pTG >= 0) {
                    j = (long) remittanceBusiUI.pTG;
                }
                al.n(bVar, j);
                AppMethodBeat.o(44973);
                return true;
            }
        }
    }
}
