OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 c.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.appstore.recommend.d;
import android.content.Context;
import android.os.Handler;
import android.os.HandlerThread;
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.c.d;
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.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 c extends com.excelliance.kxqp.gs.appstore.recommend.base.a<d.a> {
private Handler f4271b;
public c(Context context) {
super(context);
HandlerThread handlerThread = new HandlerThread("RecommendPresenter", 10);
handlerThread.start();
this.f4271b = new Handler(handlerThread.getLooper());
}
public void a(final int i) {
this.f4271b.post(new Runnable() {
@Override
public void run() {
az.d("RecommendPresenter", "queryList page =" + i);
if (c.this.b() != null) {
c.this.b().g();
}
JSONObject i2 = cn.i(c.this.getContext());
try {
i2.put("page", i);
i2.put(AvdSplashCallBackImp.KEY_PRICE, 1);
i2.put(AppAreaBean.AREAS, 1);
if (com.excelliance.kxqp.util.d.b.c) {
i2.put("supportMulti", 1);
}
if (com.excelliance.kxqp.gs.util.b.bh(c.this.getContext())) {
i2.put("isFromDomestic", "1");
}
} catch (JSONException e) {
az.d("RecommendPresenter", e.getMessage());
e.printStackTrace();
}
az.d("RecommendPresenter", "requestParams:" + i2);
az.d("RecommendPresenter", "encrypt requestParams:" + cn.b(i2.toString()));
String a2 = bd.a("http://api.ourplay.com.cn/gp/recommenduser", i2.toString());
az.d("RecommendPresenter", "encrypt response:" + a2);
ProxyDelayService.a("RecommendPresenter", "response :" + a2);
com.excelliance.kxqp.gs.appstore.recommend.a.d<List<com.excelliance.kxqp.gs.appstore.recommend.a.b>> a3 = com.excelliance.kxqp.gs.appstore.recommend.e.a.a(a2);
if (a3 == null || a3.a() != 1) {
if (c.this.b() != null) {
c.this.b().a("data error");
return;
}
return;
}
if (c.this.b() != null) {
Map<String, ExcellianceAppInfo> d = c.this.d();
if (a3.b() != null && a3.b().size() > 0) {
for (com.excelliance.kxqp.gs.appstore.recommend.a.b bVar : a3.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 a4 = j.a(c.this.getContext()).a(d, appInfo);
a4.setOnline(cVar.d());
a4.setLowGms(cVar.e());
cVar.a(a4);
cVar.a(a4);
az.d("RecommendPresenter", "aappinfo: " + cVar.f());
}
}
}
}
c.this.b().a((d.a) a3.b());
}
if (c.this.b() != null) {
c.this.b().k();
}
}
});
}
public void a(final int i, final String str, final int i2, final int i3, final String str2, final g gVar) {
this.f4271b.post(new Runnable() {
@Override
public void run() {
az.d("RecommendPresenter", "queryList page =" + i);
if (gVar != null) {
gVar.a();
}
JSONObject i4 = cn.i(c.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(c.this.getContext())) {
i4.put("isFromDomestic", "1");
}
} catch (JSONException e) {
az.d("RecommendPresenter", e.getMessage());
e.printStackTrace();
}
az.d("RecommendPresenter", "requestParams:" + i4);
az.d("RecommendPresenter", "encrypt requestParams:" + cn.b(i4.toString()));
String a2 = bd.a("http://api.ourplay.com.cnv1/gp/page", i4.toString());
az.d("RecommendPresenter", "encrypt response:" + a2);
ProxyDelayService.a("RecommendPresenter", "response :" + a2);
com.excelliance.kxqp.gs.appstore.recommend.a.d<com.excelliance.kxqp.gs.appstore.recommend.a.b> a3 = com.excelliance.kxqp.gs.appstore.recommend.e.a.a(a2, 0, i2, i3, str2);
if (a3 == null || a3.a() != 1) {
if (gVar != null) {
gVar.a("data error");
return;
}
return;
}
if (gVar != null) {
Map<String, ExcellianceAppInfo> d = c.this.d();
if (a3.b() != null && a3.b().e() != null && a3.b().e().size() > 0) {
for (com.excelliance.kxqp.gs.appstore.recommend.a.c cVar : a3.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 a4 = j.a(c.this.getContext()).a(d, appInfo);
a4.setOnline(cVar.d());
a4.setLowGms(cVar.e());
cVar.a(a4);
az.d("RecommendPresenter", "aappinfo: " + cVar.f());
}
}
gVar.a(a3.b(), new Object[0]);
}
if (gVar != null) {
gVar.g_();
}
}
});
}
public Map<String, ExcellianceAppInfo> d() {
HashMap hashMap = new HashMap();
for (ExcellianceAppInfo excellianceAppInfo : InitialData.a(getContext()).a()) {
hashMap.put(excellianceAppInfo.getAppPackageName(), excellianceAppInfo);
}
return hashMap;
}
public void c() {
this.f4271b.getLooper().quit();
}
}