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

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


package com.excelliance.kxqp.gs.coupon;

import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Log;
import com.excelliance.kxqp.avds.AvdIdManager;
import com.excelliance.kxqp.gs.coupon.a;
import com.excelliance.kxqp.gs.coupon.c;
import com.excelliance.kxqp.gs.discover.model.ResponseData;
import com.excelliance.kxqp.gs.g.aa;
import com.excelliance.kxqp.gs.i.e;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.by;
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 java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;

public class d extends com.excelliance.kxqp.gs.discover.a.a implements a.InterfaceC0158a, e {
    private a.b e;

    @Override
    protected int l_() {
        return 1;
    }

    public d(Context context, a.b bVar) {
        super(context);
        this.e = bVar;
    }

    @Override
    public void initData() {
        a(new com.excelliance.kxqp.gs.discover.a.d<c>() {
            @Override
            public ResponseData<c> a() {
                com.excelliance.kxqp.gs.discover.bbs.c cVar = new com.excelliance.kxqp.gs.discover.bbs.c(d.this.f4602b);
                JSONObject i = cn.i(d.this.f4602b);
                try {
                    i.put("type", 3);
                } catch (JSONException e) {
                    e.printStackTrace();
                }
                return cVar.a(i.toString(), "https://api.ourplay.com.cn/goneload/sharelist", new com.excelliance.kxqp.gs.discover.a.c<c>() {
                    @Override
                    public ResponseData<c> a(String str) {
                        try {
                            return (ResponseData) new Gson().a(str, new TypeToken<ResponseData<c>>() {
                            }.getType());
                        } catch (Exception e2) {
                            e2.printStackTrace();
                            Log.d(d.this.f4601a, "run/ex: " + e2.getMessage());
                            return null;
                        }
                    }
                });
            }
        }, new com.excelliance.kxqp.gs.discover.a.b<c>() {
            @Override
            public void a(c cVar, Object... objArr) {
                if (d.this.e != null) {
                    if (cVar != null) {
                        if (cVar.f4359a == null) {
                            cVar.f4359a = new ArrayList();
                        }
                        for (int i = 0; i < cVar.f4359a.size(); i++) {
                            cVar.f4359a.get(i).c = c.a.COMPLETED;
                        }
                        int size = cVar.f4359a.size();
                        int i2 = com.excelliance.kxqp.gs.util.b.aI(d.this.f4602b) ? 2 : 3;
                        for (int i3 = 0; i3 < i2 - size; i3++) {
                            c.b bVar = new c.b();
                            bVar.c = c.a.READY;
                            cVar.f4359a.add(bVar);
                        }
                    }
                    Log.d(d.this.f4601a, "onSuccess/couponModel: " + cVar);
                    d.this.e.a(cVar, true);
                }
            }

            @Override
            public void a(String str) {
                if (d.this.e != null) {
                    d.this.e.a((c) null, false);
                }
            }
        });
    }

    @Override
    public void a() {
        this.e = null;
    }

    @Override
    public void a(final int i) {
        a(new com.excelliance.kxqp.gs.discover.a.d<c.C0160c>() {
            @Override
            public ResponseData<c.C0160c> a() {
                JSONObject i2 = cn.i(d.this.f4602b);
                try {
                    i2.put("type", 3);
                    i2.put(AvdIdManager.REWARD, i);
                } catch (JSONException e) {
                    e.printStackTrace();
                }
                return new com.excelliance.kxqp.gs.discover.bbs.c(d.this.f4602b).a(i2.toString(), "https://api.ourplay.com.cn/goneload/getreward", new com.excelliance.kxqp.gs.discover.a.c<c.C0160c>() {
                    @Override
                    public ResponseData<c.C0160c> a(String str) {
                        try {
                            return (ResponseData) new Gson().a(str, new TypeToken<ResponseData<c.C0160c>>() {
                            }.getType());
                        } catch (Exception e2) {
                            Log.d(d.this.f4601a, "run/ex: " + e2.getMessage());
                            return null;
                        }
                    }
                });
            }
        }, new com.excelliance.kxqp.gs.discover.a.b<c.C0160c>() {
            @Override
            public void a(c.C0160c c0160c, Object... objArr) {
                if (d.this.e == null || d.this.f4602b == null) {
                    return;
                }
                if (c0160c != null && !TextUtils.isEmpty(c0160c.f4364a)) {
                    SharedPreferences sharedPreferences = d.this.f4602b.getSharedPreferences("USERINFO", 0);
                    aa.a(d.this.f4602b).a(c0160c.f4365b);
                    bx.a().b(sharedPreferences, "END_TIME", c0160c.f4364a);
                }
                d.this.e.a(i, true);
                by.a(d.this.f4602b, ".sp.common.disposable.flag.info").a("SP_KEY_COUPON_ACTIVITY_RECEIVE_STATUS", true);
            }

            @Override
            public void a(String str) {
                if (d.this.e == null || d.this.f4602b == null) {
                    return;
                }
                if (TextUtils.isEmpty(str)) {
                    str = "领取失败~";
                }
                cg.a(d.this.f4602b, str);
                d.this.e.a(i, false);
            }
        });
    }
}