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

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


package com.excelliance.kxqp.gs.appstore.recommend.d;

import android.content.Context;
import com.excelliance.kxqp.avds.AvdSplashCallBackImp;
import com.excelliance.kxqp.bitmap.model.AppInfo;
import com.excelliance.kxqp.bitmap.ui.imp.j;
import com.excelliance.kxqp.gs.appstore.recommend.a.d;
import com.excelliance.kxqp.gs.appstore.recommend.c.b;
import com.excelliance.kxqp.gs.bean.AppAreaBean;
import com.excelliance.kxqp.gs.listener.g;
import com.excelliance.kxqp.gs.service.ProxyDelayService;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bd;
import com.excelliance.kxqp.gs.util.cn;
import com.excelliance.kxqp.platforms.ExcellianceAppInfo;
import com.excelliance.kxqp.ui.InitialData;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;

public class b extends com.excelliance.kxqp.gs.appstore.recommend.base.a<b.a> {
    public b(Context context) {
        super(context);
    }

    public void a(final int i, final int i2) {
        tp.f(new Runnable() {
            @Override
            public void run() {
                az.d("CategoryListPresenter", "queryList page =" + i);
                if (b.this.b() != null) {
                    b.this.b().g();
                }
                JSONObject i3 = cn.i(b.this.getContext());
                try {
                    i3.put("page", i);
                    i3.put("cat_id", i2);
                    i3.put(AvdSplashCallBackImp.KEY_PRICE, 1);
                    i3.put(AppAreaBean.AREAS, 1);
                    if (com.excelliance.kxqp.util.d.b.c) {
                        i3.put("supportMulti", 1);
                    }
                    if (com.excelliance.kxqp.gs.util.b.bh(b.this.getContext())) {
                        i3.put("isFromDomestic", "1");
                    }
                } catch (JSONException e) {
                    az.d("CategoryListPresenter", e.getMessage());
                    e.printStackTrace();
                }
                az.d("CategoryListPresenter", "requestParams:" + i3);
                az.d("CategoryListPresenter", "encrypt requestParams:" + cn.b(i3.toString()));
                String a2 = bd.a("http://api.ourplay.com.cn/gp/category", i3.toString());
                az.d("CategoryListPresenter", "encrypt response:" + a2);
                ProxyDelayService.a("CategoryListPresenter", "response :" + a2);
                d<List<com.excelliance.kxqp.gs.appstore.recommend.a.b>> b2 = com.excelliance.kxqp.gs.appstore.recommend.e.a.b(a2);
                if (b2 == null || b2.a() != 1) {
                    if (b.this.b() != null) {
                        b.this.b().a("data error");
                        return;
                    }
                    return;
                }
                if (b.this.b() != null) {
                    Map<String, ExcellianceAppInfo> c = b.this.c();
                    if (b2.b() != null && b2.b().size() > 0) {
                        for (com.excelliance.kxqp.gs.appstore.recommend.a.b bVar : b2.b()) {
                            if (bVar != null && bVar.e().size() > 0) {
                                for (com.excelliance.kxqp.gs.appstore.recommend.a.c cVar : bVar.e()) {
                                    AppInfo appInfo = new AppInfo(cVar.h(), cVar.i(), cVar.k());
                                    appInfo.size = cVar.a();
                                    appInfo.versionCode = cVar.b();
                                    appInfo.price = cVar.l();
                                    appInfo.area = cVar.c();
                                    ExcellianceAppInfo a3 = j.a(b.this.getContext()).a(c, appInfo);
                                    a3.setOnline(cVar.d());
                                    a3.setLowGms(cVar.e());
                                    cVar.a(a3);
                                    az.d("CategoryListPresenter", "aappinfo: " + cVar.f());
                                }
                            }
                        }
                    }
                    b.this.b().a((b.a) b2.b());
                }
                if (b.this.b() != null) {
                    b.this.b().k();
                }
            }
        });
    }

    public void a(final int i, final String str, final int i2, final int i3, final String str2, final g gVar) {
        tp.f(new Runnable() {
            @Override
            public void run() {
                az.d("CategoryListPresenter", "queryList page =" + i);
                if (gVar != null) {
                    gVar.a();
                }
                JSONObject i4 = cn.i(b.this.getContext());
                try {
                    i4.put("page", i);
                    i4.put("type", str);
                    i4.put("id", i2);
                    i4.put("dataVer", i3);
                    i4.put(AvdSplashCallBackImp.KEY_PRICE, 1);
                    i4.put(AppAreaBean.AREAS, 1);
                    if (com.excelliance.kxqp.util.d.b.c) {
                        i4.put("supportMulti", 1);
                    }
                    if (com.excelliance.kxqp.gs.util.b.bh(b.this.getContext())) {
                        i4.put("isFromDomestic", "1");
                    }
                } catch (JSONException e) {
                    az.d("CategoryListPresenter", e.getMessage());
                    e.printStackTrace();
                }
                az.d("CategoryListPresenter", "requestParams:" + i4);
                az.d("CategoryListPresenter", "encrypt requestParams:" + cn.b(i4.toString()));
                String a2 = bd.a("http://api.ourplay.com.cnv1/gp/page", i4.toString());
                az.d("CategoryListPresenter", "encrypt response:" + a2);
                ProxyDelayService.a("CategoryListPresenter", "response :" + a2);
                d<com.excelliance.kxqp.gs.appstore.recommend.a.b> c = com.excelliance.kxqp.gs.appstore.recommend.e.a.c(a2, 0, i2, i3, str2);
                if (c == null || c.a() != 1) {
                    if (gVar != null) {
                        gVar.a("data error");
                        return;
                    }
                    return;
                }
                if (gVar != null) {
                    Map<String, ExcellianceAppInfo> c2 = b.this.c();
                    if (c.b() != null && c.b().e() != null && c.b().e().size() > 0) {
                        for (com.excelliance.kxqp.gs.appstore.recommend.a.c cVar : c.b().e()) {
                            AppInfo appInfo = new AppInfo(cVar.h(), cVar.i(), cVar.k());
                            appInfo.size = cVar.a();
                            appInfo.versionCode = cVar.b();
                            appInfo.price = cVar.l();
                            appInfo.area = cVar.c();
                            ExcellianceAppInfo a3 = j.a(b.this.getContext()).a(c2, appInfo);
                            a3.setOnline(cVar.d());
                            a3.setLowGms(cVar.e());
                            cVar.a(a3);
                            cVar.a(a3);
                            az.d("CategoryListPresenter", "aappinfo: " + cVar.f());
                        }
                    }
                    gVar.a(c.b(), new Object[0]);
                }
                if (gVar != null) {
                    gVar.g_();
                }
            }
        });
    }

    public Map<String, ExcellianceAppInfo> c() {
        HashMap hashMap = new HashMap();
        for (ExcellianceAppInfo excellianceAppInfo : InitialData.a(getContext()).a()) {
            hashMap.put(excellianceAppInfo.getAppPackageName(), excellianceAppInfo);
        }
        return hashMap;
    }
}