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

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


package com.excelliance.kxqp.task.f;

import android.content.Context;
import android.content.Intent;
import com.excelliance.kxqp.gs.listener.g;
import com.excelliance.kxqp.gs.main.MainActivity;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.account.GoogleAccountManager;
import com.excelliance.kxqp.gs.util.aq;
import com.excelliance.kxqp.gs.util.as;
import com.excelliance.kxqp.gs.util.aw;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bd;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.by;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.cn;
import com.excelliance.kxqp.gs.util.w;
import com.excelliance.kxqp.task.e.a;
import com.excelliance.kxqp.task.g.f;
import com.excelliance.kxqp.task.model.GetData;
import com.excelliance.kxqp.task.model.TaskShareDownloadParams;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONObject;

public class f implements a.InterfaceC0506a {

    private Context f13186a;

    private g f13187b;

    public f(Context context) {
        this.f13186a = context;
    }

    public f(Context context, g<String> gVar) {
        this.f13186a = context;
        this.f13187b = gVar;
    }

    public void b(final g<String> gVar) {
        az.d("zch_task", "enter queryMoneyInfo()");
        tp.f(new Runnable() {
            @Override
            public void run() {
                String str = com.excelliance.kxqp.task.g.f.a((String) null).h;
                az.d("TaskPresenter", "更新任务信息" + str);
                f.this.b();
                az.d("TaskPresenter", "taskinfoid" + str);
                JSONObject i = cn.i(f.this.f13186a);
                try {
                    i.put("taskinfoid", str);
                    i.put("rid", bx.a().a(f.this.f13186a));
                    i.put("account", bx.a().r(f.this.f13186a));
                    az.d("TaskPresenter", "requestParams:" + i.toString());
                    az.d("TaskPresenter", "encry requestParams:" + cn.b(i.toString()));
                    String a2 = bd.a("http://api.ourplay.com.cn/task/index", i.toString());
                    az.d("TaskPresenter", "encry response:" + a2);
                    String a3 = cn.a(a2);
                    az.d("TaskPresenter", "response:" + a3);
                    if (!cd.a(a3)) {
                        JSONObject jSONObject = new JSONObject(a3);
                        JSONObject jSONObject2 = jSONObject.getJSONObject("data");
                        int optInt = jSONObject.optInt("code");
                        String optString = jSONObject.optString("msg");
                        com.excelliance.kxqp.task.g.f a4 = com.excelliance.kxqp.task.g.f.a(jSONObject2.toString());
                        List<com.excelliance.kxqp.gs.ui.account.c> f = as.f();
                        az.d("TaskPresenter", "list:" + f);
                        if (f != null && f.size() > 0 && com.excelliance.kxqp.task.g.f.INSTANCE.G.d == 0) {
                            com.excelliance.kxqp.task.g.f.INSTANCE.G.d = 1;
                        }
                        a4.a();
                        JSONObject optJSONObject = jSONObject2.optJSONObject("userdata");
                        f.a aVar = new f.a();
                        aVar.c = optJSONObject.optLong("totalmoneyk");
                        aVar.d = optJSONObject.optLong("totalusemoneyk");
                        aVar.e = optJSONObject.optLong("totaldiamond");
                        aVar.f = optJSONObject.optLong("totalusediamond");
                        aVar.f13239a = optJSONObject.optString("rank");
                        aVar.f13240b = optJSONObject.optString("ranknickname");
                        com.excelliance.kxqp.task.g.f.INSTANCE.a(f.this.f13186a, aVar);
                        az.d("TaskPresenter", "初始化流量信息成功!");
                        if (gVar == null || optInt == 0) {
                            return;
                        }
                        gVar.a(optString, new Object[0]);
                        return;
                    }
                    if (gVar != null) {
                        gVar.a(w.e(f.this.f13186a, "init_flow_data_fail"));
                    }
                } catch (Exception e) {
                    if (gVar != null) {
                        gVar.a(w.e(f.this.f13186a, "init_flow_data_fail"));
                    }
                    az.d("TaskPresenter", e.getMessage());
                    e.printStackTrace();
                }
            }
        });
    }

    @Override
    public void a(final int i, final String str, final String str2) {
        tp.f(new Runnable() {
            @Override
            public void run() {
                aw.a(f.this.f13186a, i, str, str2, "TaskPresenter", new aw.a() {
                    @Override
                    public void a(Intent intent) {
                        com.excelliance.kxqp.gs.g.c.a().a((String) null, (String) null, (String) null, "调用登录google帐号api", (String) null);
                        if (f.this.f13186a instanceof MainActivity) {
                            ((MainActivity) f.this.f13186a).startActivityForResult(intent, 1);
                        } else if (f.this.f13186a instanceof GoogleAccountManager) {
                            ((GoogleAccountManager) f.this.f13186a).startActivityForResult(intent, 1);
                        }
                    }
                });
            }
        });
    }

    public void b() {
        az.d("zch_postPKGInfo", "enter postPKGInfo  ");
        boolean booleanValue = by.a(this.f13186a, "sp_total_info").b("goldminer2", false).booleanValue();
        az.d("zch_postPKGInfo", "gold_miner2 = " + booleanValue);
        if (booleanValue) {
            return;
        }
        if (com.excelliance.kxqp.task.g.f.INSTANCE != null && com.excelliance.kxqp.task.g.f.INSTANCE.y != null && com.excelliance.kxqp.task.g.f.INSTANCE.y.d == 2) {
            az.d("zch_postPKGInfo", "enter postPKGInfo1  ");
            return;
        }
        JSONObject i = cn.i(this.f13186a);
        TaskShareDownloadParams a2 = com.excelliance.kxqp.task.g.g.a(this.f13186a, i);
        try {
            i.put("tasktype", a2.getTasktype());
            i.put("taskinfoid", a2.getTaskinfoid());
            i.put("catid", a2.getCatid());
            az.d("TaskPresenter", "request:" + i.toString());
            String a3 = bd.a("http://api.ourplay.com.cn/task/task", i.toString());
            if (cd.a(a3)) {
                az.d("TaskPresenter", "respone is empFty");
                return;
            }
            az.d("TaskPresenter", "encry response:" + a3);
            String a4 = cn.a(a3);
            az.d("TaskPresenter", "response:" + a4);
            JSONObject jSONObject = new JSONObject(a4);
            int optInt = jSONObject.optInt("code");
            JSONObject optJSONObject = jSONObject.optJSONObject("data");
            if (optInt != 1) {
                az.d("TaskPresenter", "post gold miner2 fail");
            } else if (optJSONObject != null) {
                if (!cd.a(a2.getTaskinfoid())) {
                    cn.c(this.f13186a, 1);
                }
                by.a(this.f13186a, "sp_total_info").a("goldminer2", true);
            }
        } catch (Exception e) {
            az.d("TaskPresenter", "post gold miner2 fail");
            az.d("TaskPresenter", e.getMessage());
            e.printStackTrace();
        }
    }

    @Override
    public void a(final g<GetData<f.a>> gVar) {
        tp.f(new Runnable() {
            @Override
            public void run() {
                String a2;
                gVar.a();
                JSONObject e = com.excelliance.kxqp.task.g.g.e(f.this.f13186a);
                try {
                    try {
                        e.put("tasktype", 10);
                        e.put("rid", bx.a().a(f.this.f13186a));
                        e.put("account", bx.a().r(f.this.f13186a));
                        az.d("TaskPresenter", "request:" + e.toString());
                        a2 = bd.a("http://api.ourplay.com.cn/task/collectkb", e.toString());
                    } catch (Exception e2) {
                        gVar.a(w.e(f.this.f13186a, "sign_fail"));
                        az.d("TaskPresenter", e2.getMessage());
                        e2.printStackTrace();
                    }
                    if (cd.a(a2)) {
                        gVar.a(w.e(f.this.f13186a, "server_error"));
                        return;
                    }
                    az.d("TaskPresenter", "encry response:" + a2);
                    String a3 = cn.a(a2);
                    az.d("TaskPresenter", "response:" + a3);
                    JSONObject jSONObject = new JSONObject(a3);
                    int optInt = jSONObject.optInt("code");
                    JSONObject optJSONObject = jSONObject.optJSONObject("data");
                    if (optInt != 1) {
                        gVar.a(w.e(f.this.f13186a, "sign_fail"));
                    } else {
                        GetData getData = new GetData();
                        f.a aVar = new f.a();
                        getData.setGetMoney(Long.valueOf(optJSONObject.optLong("getnum")));
                        aVar.f13240b = optJSONObject.optString("ranknickname");
                        aVar.f13239a = optJSONObject.optString("rank");
                        aVar.c = optJSONObject.optLong("totalmoneyk");
                        aVar.d = optJSONObject.optLong("totalusemoneyk");
                        aVar.e = optJSONObject.optLong("totaldiamond");
                        aVar.f = optJSONObject.optLong("totalusediamond");
                        getData.setDetail(aVar);
                        gVar.a(getData, new Object[0]);
                    }
                } finally {
                    gVar.g_();
                }
            }
        });
    }

    @Override
    public void a(int i, String str, final g<f.b> gVar) {
        az.d("zch_install", "enter postDownLoadAPP  " + str);
        if (com.excelliance.kxqp.task.g.g.a(str)) {
            return;
        }
        az.d("zch_install", "enter postDownLoadAPP1  " + str);
        az.d("zch_install", "first_download_app = " + by.a(this.f13186a, "sp_total_info").b("firstdownloadapp", false).booleanValue());
        if (com.excelliance.kxqp.task.g.f.INSTANCE != null && com.excelliance.kxqp.task.g.f.INSTANCE.H != null && com.excelliance.kxqp.task.g.f.INSTANCE.H.d == 2) {
            az.d("zch_install", "enter postDownLoadAPP2  " + str);
            return;
        }
        tp.f(new Runnable() {
            @Override
            public void run() {
                JSONObject e = com.excelliance.kxqp.task.g.g.e(f.this.f13186a);
                try {
                    e.put("tasktype", 23);
                    az.d("TaskPresenter", "request:" + e.toString());
                    String a2 = bd.a("http://api.ourplay.com.cn/task/task", e.toString());
                    if (cd.a(a2)) {
                        az.d("TaskPresenter", "respone is empty");
                        return;
                    }
                    az.d("TaskPresenter", "encry response:" + a2);
                    String a3 = cn.a(a2);
                    az.d("TaskPresenter", "response:" + a3);
                    JSONObject jSONObject = new JSONObject(a3);
                    int optInt = jSONObject.optInt("code");
                    JSONObject optJSONObject = jSONObject.optJSONObject("data");
                    if (optInt != 1) {
                        az.d("TaskPresenter", "post download app fail");
                    } else if (optJSONObject != null) {
                        f.b bVar = new f.b();
                        bVar.d = optJSONObject.optInt("state");
                        by.a(f.this.f13186a, "sp_total_info").a("firstdownloadapp", true);
                        gVar.a(bVar, new Object[0]);
                    }
                } catch (Exception e2) {
                    az.d("TaskPresenter", "post download app fail");
                    az.d("TaskPresenter", e2.getMessage());
                    e2.printStackTrace();
                }
            }
        });
    }

    @Override
    public void a(final g<GetData<f.a>> gVar, final int i) {
        tp.f(new Runnable() {
            @Override
            public void run() {
                String a2;
                gVar.a();
                JSONObject e = com.excelliance.kxqp.task.g.g.e(f.this.f13186a);
                try {
                    try {
                        e.put("tasktype", i);
                        az.d("TaskPresenter", "request:" + e.toString());
                        a2 = bd.a("http://api.ourplay.com.cn/task/collectkb", e.toString());
                    } catch (Exception e2) {
                        gVar.a(w.e(f.this.f13186a, "sign_fail"));
                        az.d("TaskPresenter", e2.getMessage());
                        e2.printStackTrace();
                    }
                    if (cd.a(a2)) {
                        gVar.a(w.e(f.this.f13186a, "server_error"));
                        return;
                    }
                    az.d("TaskPresenter", "encry response:" + a2);
                    String a3 = cn.a(a2);
                    az.d("TaskPresenter", "response:" + a3);
                    JSONObject jSONObject = new JSONObject(a3);
                    int optInt = jSONObject.optInt("code");
                    JSONObject optJSONObject = jSONObject.optJSONObject("data");
                    if (optInt != 1) {
                        gVar.a(w.e(f.this.f13186a, "sign_fail"));
                    } else {
                        GetData getData = new GetData();
                        f.a aVar = new f.a();
                        getData.setGetMoney(Long.valueOf(optJSONObject.optLong("getnum")));
                        aVar.f13240b = optJSONObject.optString("ranknickname");
                        aVar.f13239a = optJSONObject.optString("rank");
                        aVar.c = optJSONObject.optLong("totalmoneyk");
                        aVar.d = optJSONObject.optLong("totalusemoneyk");
                        aVar.e = optJSONObject.optLong("totaldiamond");
                        aVar.f = optJSONObject.optLong("totalusediamond");
                        getData.setDetail(aVar);
                        gVar.a(getData, new Object[0]);
                    }
                } finally {
                    gVar.g_();
                }
            }
        });
    }

    @Override
    public void a(final String str, final g<String> gVar) {
        gVar.a();
        tp.f(new Runnable() {
            @Override
            public void run() {
                String a2;
                JSONObject f = aq.f(f.this.f13186a);
                try {
                    try {
                        f.put("code", str);
                        a2 = bd.a("https://sdk.ourplay.com.cn/flow/wechatInfo.php", f.toString());
                    } catch (Exception e) {
                        gVar.a(e.getMessage());
                        az.d("TaskPresenter", e.getMessage());
                        e.printStackTrace();
                    }
                    if (cd.a(a2)) {
                        gVar.a(w.e(f.this.f13186a, "server_error"));
                        return;
                    }
                    az.d("TaskPresenter", "encry response:" + a2);
                    String a3 = cn.a(a2);
                    az.d("TaskPresenter", "response:" + a3);
                    JSONObject jSONObject = new JSONObject(a3).getJSONObject("data");
                    gVar.a(jSONObject.getString("wxid"), jSONObject.getString("wxname"), jSONObject.getString("wxicon"));
                } finally {
                    gVar.g_();
                }
            }
        });
    }

    @Override
    public void b(final int i, String str, final g<List<f.b>> gVar) {
        if (com.excelliance.kxqp.task.g.g.b(str)) {
            return;
        }
        tp.f(new Runnable() {
            @Override
            public void run() {
                JSONObject e = com.excelliance.kxqp.task.g.g.e(f.this.f13186a);
                try {
                    e.put("tasktype", 11);
                    az.d("TaskPresenter", "request:" + e.toString());
                    String a2 = bd.a("http://api.ourplay.com.cn/task/task", e.toString());
                    if (cd.a(a2)) {
                        az.d("TaskPresenter", "respone is empty");
                        return;
                    }
                    az.d("TaskPresenter", "encry response:" + a2);
                    String a3 = cn.a(a2);
                    az.d("TaskPresenter", "response:" + a3);
                    JSONObject jSONObject = new JSONObject(a3);
                    int optInt = jSONObject.optInt("code");
                    JSONObject optJSONObject = jSONObject.optJSONObject("data");
                    if (optInt != 1) {
                        az.d("TaskPresenter", "post start app fail");
                        return;
                    }
                    if (optJSONObject != null) {
                        ArrayList arrayList = new ArrayList();
                        f.b bVar = new f.b();
                        bVar.d = optJSONObject.optInt("state");
                        arrayList.add(bVar);
                        if (i == 0) {
                            f.b bVar2 = new f.b();
                            bVar2.d = optJSONObject.optInt("state");
                            arrayList.add(bVar2);
                        }
                        gVar.a(arrayList, new Object[0]);
                    }
                } catch (Exception e2) {
                    az.d("TaskPresenter", "post start app fail");
                    az.d("TaskPresenter", e2.getMessage());
                    e2.printStackTrace();
                }
            }
        });
    }

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

    @Override
    public void initData() {
        b(this.f13187b);
    }
}