OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046

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


package com.excelliance.kxqp.gs.ui.membershipvouchers;

import android.content.Context;
import android.os.Handler;
import android.os.HandlerThread;
import com.excean.ggspace.main.R;
import com.excelliance.kxqp.gs.bean.VipGoodsBean;
import com.excelliance.kxqp.gs.discover.bbs.c;
import com.excelliance.kxqp.gs.discover.model.ResponseData;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.membershipvouchers.a;
import com.excelliance.kxqp.gs.ui.pay.VipFragment;
import com.excelliance.kxqp.gs.util.ad;
import com.excelliance.kxqp.gs.util.bz;
import com.excelliance.kxqp.gs.util.cg;
import com.excelliance.kxqp.gs.util.cn;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.json.JSONObject;

public class b implements a.InterfaceC0419a {

    a.b f10557a;

    private final Handler f10558b;
    private Context c;

    @Override
    public void initData() {
    }

    public b(Context context, a.b bVar) {
        this.c = context;
        this.f10557a = bVar;
        HandlerThread handlerThread = new HandlerThread("MembershipVouchersPresenter", 10);
        handlerThread.start();
        this.f10558b = new Handler(handlerThread.getLooper());
    }

    public void a(final String str) {
        this.f10558b.post(new Runnable() {
            @Override
            public void run() {
                try {
                    if (b.this.c == null) {
                        return;
                    }
                    c cVar = new c(b.this.c);
                    JSONObject i = cn.i(b.this.c);
                    i.put("code", str);
                    ResponseData a2 = cVar.a(i.toString(), "https://api.ourplay.com.cn/coupon/exchange", new com.excelliance.kxqp.gs.discover.a.c<VipGoodsBean>() {
                        @Override
                        public ResponseData<VipGoodsBean> a(String str2) {
                            try {
                                return (ResponseData) new Gson().a(str2, new TypeToken<ResponseData<VipGoodsBean>>() {
                                }.getType());
                            } catch (Exception e) {
                                e.printStackTrace();
                                return null;
                            }
                        }
                    });
                    if (b.this.c == null) {
                        return;
                    }
                    if (a2 != null) {
                        cg.a(b.this.c, a2.msg, 48, 0, ad.a(b.this.c, 60.0f));
                        if (a2.code == 0) {
                            bz.a().a(b.this.c, 162000, 4, "兑换成功");
                            b.this.a((VipGoodsBean) a2.data);
                            if (b.this.f10557a != null) {
                                tp.i(new Runnable() {
                                    @Override
                                    public void run() {
                                        b.this.f10557a.b();
                                    }
                                });
                            }
                        }
                    } else {
                        cg.a(b.this.c, b.this.c.getString(R.string.data_parsing_error), 48, 0, ad.a(b.this.c, 60.0f));
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    if (b.this.c != null) {
                        cg.a(b.this.c, b.this.c.getString(R.string.server_error), 48, 0, ad.a(b.this.c, 60.0f));
                    }
                }
            }
        });
    }

    public void a(VipGoodsBean vipGoodsBean) {
        if (vipGoodsBean == null) {
            return;
        }
        cn.a(this.c, vipGoodsBean.unit, vipGoodsBean.length, vipGoodsBean.title);
        com.excelliance.kxqp.bitmap.ui.b.a().a(new VipFragment.c("refresh_accelerate_ui"));
    }

    public void a() {
        this.f10558b.getLooper().quit();
        this.c = null;
        this.f10557a = null;
    }
}