OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 c.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.ui.tencentpage;
import a.q;
import android.content.Context;
import android.util.Log;
import androidx.lifecycle.MutableLiveData;
import com.excean.bytedancebi.bean.BiEventDialogShow;
import com.excean.ggspace.main.R;
import com.excelliance.kxqp.api.ApiManager;
import com.excelliance.kxqp.bitmap.bean.RankingItem;
import com.excelliance.kxqp.bitmap.model.AppInfo;
import com.excelliance.kxqp.gs.appstore.model.ResponseData;
import com.excelliance.kxqp.gs.newappstore.a.a;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.tencentpage.result.TencentGame;
import com.excelliance.kxqp.gs.ui.tencentpage.result.ZmGame;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.cg;
import com.excelliance.kxqp.gs.view.zmbanner.c;
import com.excelliance.staticslio.StatisticsManager;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
public class c {
public static class a {
public static c f11335a = new c();
}
public TencentGame b(TencentGame tencentGame) {
return tencentGame;
}
private c() {
}
public static c a() {
return a.f11335a;
}
public void a(final Context context, MutableLiveData<List<AppInfo>> mutableLiveData, MutableLiveData<List<AppInfo>> mutableLiveData2) {
TreeMap<String, String> a2 = b.a();
a2.put("page_id", "0");
a2.put("page_size", "20");
q a3 = a(a2);
com.excelliance.kxqp.api.c cVar = new com.excelliance.kxqp.api.c(context);
cVar.a(ApiManager.getInstance().a(context, 15000L, 15000L, "https://cloud.tgpa.qq.com/").U(a3));
ResponseData b2 = cVar.b();
if (b2.code == 0) {
for (TencentGame tencentGame : (List) b2.data) {
if (tencentGame.sence == 201) {
String b3 = b(context, c(tencentGame));
if (!cd.a(b3)) {
List<AppInfo> d = d(b(b(tencentGame, b3.split(StatisticsManager.COMMA))));
if (mutableLiveData != null) {
mutableLiveData.postValue(d);
}
}
} else if (tencentGame.sence == 202) {
String b4 = b(context, c(tencentGame));
if (!cd.a(b4)) {
List<AppInfo> d2 = d(b(b(tencentGame, b4.split(StatisticsManager.COMMA))));
if (mutableLiveData2 != null) {
mutableLiveData2.postValue(d2);
}
}
}
}
return;
}
tp.i(new Runnable() {
@Override
public void run() {
cg.a(context, context.getString(R.string.connect_service_error));
BiEventDialogShow biEventDialogShow = new BiEventDialogShow();
biEventDialogShow.dialog_type = "toast";
biEventDialogShow.toast_name = context.getString(R.string.connect_service_error) + ":-1";
com.excelliance.kxqp.gs.g.c.a().a(biEventDialogShow);
}
});
}
public void b(final Context context, MutableLiveData<List<TencentGame.Banner>> mutableLiveData, MutableLiveData<List<c.a>> mutableLiveData2) {
q a2 = a(b.a());
com.excelliance.kxqp.api.c cVar = new com.excelliance.kxqp.api.c(context);
cVar.a(ApiManager.getInstance().a(context, 15000L, 15000L, "https://cloud.tgpa.qq.com/").V(a2));
ResponseData b2 = cVar.b();
if (b2.code == 0) {
boolean z = false;
for (TencentGame tencentGame : (List) b2.data) {
if (tencentGame.sence == 102) {
String b3 = b(context, a(tencentGame));
if (!cd.a(b3)) {
List<TencentGame.Banner> a3 = a(tencentGame, b3.split(StatisticsManager.COMMA));
a().a(context, "2", "102", "305", "1", a(a3));
mutableLiveData.postValue(a3);
z = true;
}
} else if (tencentGame.sence == 103) {
String b4 = b(context, a(tencentGame));
if (!cd.a(b4)) {
List<c.a> d = d(a(tencentGame, b4.split(StatisticsManager.COMMA)));
a().a(context, "2", "103", "305", "1", b(d));
mutableLiveData2.postValue(d);
}
}
}
if (z || mutableLiveData == null) {
return;
}
mutableLiveData.postValue(new ArrayList());
return;
}
tp.i(new Runnable() {
@Override
public void run() {
cg.a(context, context.getString(R.string.connect_service_error));
BiEventDialogShow biEventDialogShow = new BiEventDialogShow();
biEventDialogShow.dialog_type = "toast";
biEventDialogShow.toast_name = context.getString(R.string.connect_service_error) + ":-2";
com.excelliance.kxqp.gs.g.c.a().a(biEventDialogShow);
}
});
}
public String a(List<TencentGame.Banner> list) {
StringBuilder sb = new StringBuilder();
Iterator<TencentGame.Banner> it = list.iterator();
while (it.hasNext()) {
sb.append(it.next().id + StatisticsManager.COMMA);
}
return sb.substring(0, sb.length() - 1);
}
public String b(List<c.a> list) {
StringBuilder sb = new StringBuilder();
Iterator<c.a> it = list.iterator();
while (it.hasNext()) {
sb.append(it.next().f12386a + StatisticsManager.COMMA);
}
return sb.substring(0, sb.length() - 1);
}
public void a(final Context context, final String str, final String str2, final String str3, final String str4, final List<AppInfo> list) {
tp.f(new Runnable() {
@Override
public void run() {
q a2 = c.this.a(b.a(str, str2, str3, str4, c.this.c(list)));
com.excelliance.kxqp.api.c cVar = new com.excelliance.kxqp.api.c(context);
cVar.a(ApiManager.getInstance().a(context, 15000L, 15000L, "https://cloud.tgpa.qq.com/").W(a2));
cVar.b();
}
});
}
public void a(final Context context, final String str, final String str2, final String str3, final String str4, final String str5) {
tp.f(new Runnable() {
@Override
public void run() {
q a2 = c.this.a(b.a(str, str2, str3, str4, str5));
com.excelliance.kxqp.api.c cVar = new com.excelliance.kxqp.api.c(context);
cVar.a(ApiManager.getInstance().a(context, 15000L, 15000L, "https://cloud.tgpa.qq.com/").W(a2));
cVar.b();
}
});
}
public String c(List<AppInfo> list) {
StringBuilder sb = new StringBuilder();
if (list == null || list.size() == 0) {
return "";
}
if (list != null && list.size() != 0) {
Iterator<AppInfo> it = list.iterator();
while (it.hasNext()) {
sb.append(it.next().id + StatisticsManager.COMMA);
}
}
return sb.substring(0, sb.length() - 1);
}
public List<c.a> d(List<TencentGame.Banner> list) {
ArrayList arrayList = new ArrayList();
for (TencentGame.Banner banner : list) {
c.a aVar = new c.a();
aVar.e = banner.game_name;
aVar.d = c.b.APP_DETAIL;
aVar.c = banner.app_name;
aVar.f12387b = banner.picture_url;
aVar.m = 1;
aVar.n = banner.picture_url;
aVar.f12386a = banner.id;
arrayList.add(aVar);
}
return arrayList;
}
public List<TencentGame.Banner> a(TencentGame tencentGame, String[] strArr) {
ArrayList arrayList = new ArrayList();
for (String str : strArr) {
for (TencentGame.Banner banner : tencentGame.banners) {
if (str.equals(banner.app_name)) {
arrayList.add(banner);
}
}
}
return arrayList;
}
public List<String> a(TencentGame tencentGame) {
ArrayList arrayList = new ArrayList();
List<TencentGame.Banner> list = tencentGame.banners;
if (list == null || list.size() == 0) {
return arrayList;
}
Iterator<TencentGame.Banner> it = list.iterator();
while (it.hasNext()) {
arrayList.add(it.next().app_name);
}
return arrayList;
}
private List<String> c(TencentGame tencentGame) {
ArrayList arrayList = new ArrayList();
Iterator<TencentGame.Game> it = tencentGame.games.iterator();
while (it.hasNext()) {
arrayList.add(it.next().app_name);
}
return arrayList;
}
private TencentGame b(TencentGame tencentGame, String[] strArr) {
List<TencentGame.Game> list = tencentGame.games;
ArrayList arrayList = new ArrayList();
if (strArr == null || strArr.length == 0) {
return tencentGame;
}
for (String str : strArr) {
for (TencentGame.Game game : list) {
if (game.app_name.equals(str)) {
arrayList.add(game);
}
if (arrayList.size() == 10) {
break;
}
}
}
tencentGame.games = arrayList;
return tencentGame;
}
private String b(final Context context, List<String> list) {
StringBuilder sb = new StringBuilder();
if (list == null || list.size() == 0) {
return null;
}
Iterator<String> it = list.iterator();
while (it.hasNext()) {
sb.append(it.next());
sb.append(StatisticsManager.COMMA);
}
String substring = sb.substring(0, sb.length() - 1);
com.excelliance.kxqp.api.c cVar = new com.excelliance.kxqp.api.c(context);
cVar.a(ApiManager.getInstance().a(context, 15000L, 15000L, "https://api.ourplay.com.cn/").a(substring));
ResponseData b2 = cVar.b();
if (b2.code == 1) {
return ((ZmGame) b2.data).list;
}
tp.i(new Runnable() {
@Override
public void run() {
cg.a(context, context.getString(R.string.connect_service_error));
BiEventDialogShow biEventDialogShow = new BiEventDialogShow();
biEventDialogShow.dialog_type = "toast";
biEventDialogShow.toast_name = context.getString(R.string.connect_service_error) + ":-6";
com.excelliance.kxqp.gs.g.c.a().a(biEventDialogShow);
}
});
return null;
}
private List<AppInfo> d(TencentGame tencentGame) {
ArrayList arrayList = new ArrayList();
if (tencentGame == null) {
return arrayList;
}
for (TencentGame.Game game : tencentGame.games) {
AppInfo appInfo = new AppInfo(game.name, game.app_name, game.icon_url);
appInfo.id = game.id;
appInfo.desc = game.desc;
arrayList.add(appInfo);
}
return arrayList;
}
public static a.d a(Context context, List<AppInfo> list) {
a.d dVar = new a.d();
dVar.f7535a = context.getResources().getString(R.string.tencent_game_select);
dVar.f7536b = "1";
dVar.i = "tencent_game_list";
dVar.c = RankingItem.KEY_CATEGORY;
dVar.u = R.layout.discovery_item_tencent_game;
ArrayList arrayList = new ArrayList();
if (list == null || list.size() == 0) {
return null;
}
for (AppInfo appInfo : list) {
a.C0309a c0309a = new a.C0309a();
c0309a.f7533a = appInfo.name;
c0309a.d = appInfo.packageName;
c0309a.f7534b = appInfo.icon;
c0309a.k = appInfo.id;
c0309a.u = R.layout.item_tencent_game_list;
arrayList.add(c0309a);
}
dVar.d = arrayList;
return dVar;
}
public q a(TreeMap<String, String> treeMap) {
q.a aVar = new q.a();
StringBuffer stringBuffer = new StringBuffer();
for (Map.Entry<String, String> entry : treeMap.entrySet()) {
stringBuffer.append(entry.getKey());
stringBuffer.append("=");
stringBuffer.append(entry.getValue());
stringBuffer.append(com.alipay.sdk.sys.a.f472b);
}
String substring = stringBuffer.substring(0, stringBuffer.length() - 1);
Log.d("TencentRepo", "tencent sign data " + substring);
String a2 = a(substring);
Log.d("TencentRepo", "tencent sign result " + a2);
treeMap.put("api_sign", a2);
for (Map.Entry<String, String> entry2 : treeMap.entrySet()) {
aVar.a(entry2.getKey(), entry2.getValue());
}
q a3 = aVar.a();
Log.d("TencentRepo", "tencent FormBody contentType " + a3.a() + " data " + a3.toString());
return aVar.a();
}
public String a(String str) {
try {
return com.excelliance.kxqp.gs.ui.tencentpage.a.a(com.excelliance.kxqp.gs.ui.tencentpage.a.a(str, "yeRhO6acmPzYEvhCcyjHACxTVvYeG8hj"));
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
}