QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

以下内容为反编译后的 OpenPlatformRechargeViewNew.java 源代码,内容仅作参考


package com.tencent.mtt.browser.openplatform.view;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.ValueCallback;
import com.tencent.mtt.R;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.browser.openplatform.MTT.GQBInfo;
import com.tencent.mtt.browser.openplatform.MTT.PaymentCreateSigRsp;
import com.tencent.mtt.browser.openplatform.OpenPlatformInterconnectService;
import com.tencent.mtt.browser.openplatform.facade.IRechargeResult;
import com.tencent.mtt.browser.openplatform.facade.IShowRechargePanelResult;
import com.tencent.mtt.browser.openplatform.module.ShowRechargePanelResult;
import com.tencent.mtt.browser.openplatform.recharge.PaymentRechargeUtil;
import com.tencent.mtt.uifw2.base.ui.widget.flex.FlexLayout;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.toast.MttToaster;
import com.tencent.mtt.view.widget.QBLoadingView;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.util.ArrayList;
import qb.a.e;
import qb.a.f;
import qb.usercenter.BuildConfig;

public class OpenPlatformRechargeViewNew extends FlexLayout implements Handler.Callback, View.OnClickListener, PaymentRechargeUtil.GetAppSignCallBack {
    public static final int j = MttResources.g(f.ch);

    ArrayList<OpenPlatformRechargeBtn> f43652a;

    public FlexLayout.FlexLayoutParams f43653b;

    public FlexLayout.FlexLayoutParams f43654c;

    public FlexLayout.FlexLayoutParams f43655d;
    public FlexLayout.FlexLayoutParams e;
    public FlexLayout.FlexLayoutParams f;
    public FlexLayout.FlexLayoutParams g;
    public FlexLayout.FlexLayoutParams h;
    QBTextView i;
    public FlexLayout.FlexLayoutParams k;
    QBLoadingView l;
    public boolean m;
    View.OnClickListener n;
    private int o;
    private PaymentCreateSigRsp p;
    private Handler q;
    private ValueCallback<IShowRechargePanelResult> r;

    public OpenPlatformRechargeViewNew(Context context, ValueCallback<IShowRechargePanelResult> valueCallback) {
        super(context);
        this.f43652a = new ArrayList<>();
        this.o = 2;
        this.m = false;
        this.n = null;
        this.p = null;
        this.q = new Handler(Looper.getMainLooper(), this);
        FlexLayout.a(context, this, BuildConfig.FLEXLAYOUT_NAMESPACE);
        this.r = valueCallback;
        b();
    }

    private void b() {
        ViewGroup.LayoutParams[] layoutParamsArr = {this.f43653b, this.f43654c, this.f43655d, this.e, this.f, this.g};
        for (int i = 0; i < 6; i++) {
            OpenPlatformRechargeBtn openPlatformRechargeBtn = new OpenPlatformRechargeBtn(getContext(), i);
            this.f43652a.add(openPlatformRechargeBtn);
            addView(openPlatformRechargeBtn, layoutParamsArr[i]);
            openPlatformRechargeBtn.setOnClickListener(this);
        }
        this.l = new QBLoadingView(getContext(), (byte) 2, (byte) 3, (byte) 2);
        this.l.setVisibility(8);
        addView(this.l, this.k);
        this.i = new QBTextView(getContext());
        this.i.setTextSize(MttResources.h(f.cP));
        this.i.setTextColorNormalIds(e.N);
        this.i.setText(MttResources.l(R.string.d4));
        addView(this.i, this.h);
    }

    private PaymentCreateSigRsp c() {
        ArrayList arrayList = new ArrayList();
        for (int i = 1; i <= 6; i++) {
            GQBInfo gQBInfo = new GQBInfo();
            gQBInfo.sGQBId = "com.tencent.mtt.GQB__60";
            gQBInfo.iPrice = i * 6;
            gQBInfo.sMdsPayItem = "com.tencent.mttlite.GQB__60*1*60";
            gQBInfo.iGoodsNum = gQBInfo.iPrice * 10;
            gQBInfo.sMdsPayInfo = "60*Q米";
            arrayList.add(gQBInfo);
        }
        return new PaymentCreateSigRsp(0, "", "", "", arrayList);
    }

    public void a() {
    }

    @Override
    public void a(int i) {
        this.q.sendEmptyMessage(2);
    }

    @Override
    public void a(PaymentCreateSigRsp paymentCreateSigRsp) {
        Message obtainMessage = this.q.obtainMessage(1);
        obtainMessage.obj = paymentCreateSigRsp;
        this.p = paymentCreateSigRsp;
        obtainMessage.sendToTarget();
    }

    public void b(int i) {
        this.o = i;
        int i2 = this.o;
        if (i2 != 1 && i2 == 2) {
            this.l.setVisibility(0);
        }
    }

    public void b(PaymentCreateSigRsp paymentCreateSigRsp) {
        ArrayList<GQBInfo> arrayList = paymentCreateSigRsp.vGQBList;
        int min = Math.min(arrayList.size(), this.f43652a.size());
        for (int i = 0; i < min; i++) {
            this.f43652a.get(i).a(arrayList.get(i));
        }
    }

    @Override
    public boolean handleMessage(Message message) {
        PaymentCreateSigRsp paymentCreateSigRsp;
        int i = message.what;
        if (i == 1) {
            paymentCreateSigRsp = (PaymentCreateSigRsp) message.obj;
            if (paymentCreateSigRsp.iResult != 0) {
                paymentCreateSigRsp = c();
            }
        } else {
            if (i != 2) {
                return false;
            }
            paymentCreateSigRsp = c();
        }
        b(paymentCreateSigRsp);
        this.l.setVisibility(8);
        return false;
    }

    @Override
    public void onClick(View view) {
        EventCollector.getInstance().onViewClickedBefore(view);
        this.m = true;
        if (view instanceof OpenPlatformRechargeBtn) {
            GQBInfo gQBInfo = ((OpenPlatformRechargeBtn) view).l;
            if (gQBInfo == null || this.p == null) {
                MttToaster.show("网络异常", 0);
            } else {
                new OpenPlatformInterconnectService(getContext()).a("2513472833", this.p.sAppSig, this.p.sAppSigData, "1450008581", (gQBInfo.iPrice * 10) + "", "https://wallet.html5.qq.com/pay?from=center", new ValueCallback<IRechargeResult>() {
                    @Override
                    public void onReceiveValue(IRechargeResult iRechargeResult) {
                        if (iRechargeResult == null || OpenPlatformRechargeViewNew.this.r == null) {
                            return;
                        }
                        OpenPlatformRechargeViewNew.this.r.onReceiveValue(new ShowRechargePanelResult(iRechargeResult.f43420a, iRechargeResult.f43421b));
                    }
                }, (String) null);
            }
        }
        View.OnClickListener onClickListener = this.n;
        if (onClickListener != null) {
            onClickListener.onClick(view);
        }
        EventCollector.getInstance().onViewClicked(view);
    }

    public void setItemBtnClickListener(View.OnClickListener onClickListener) {
        this.n = onClickListener;
    }

    public void setItemId(int i) {
        for (int i2 = 0; i2 < this.f43652a.size(); i2++) {
            this.f43652a.get(i2).setId(i);
        }
    }
}