OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 c.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.ui.flow;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import com.bytedance.sdk.open.aweme.common.constants.ParamKeyConstants;
import com.excelliance.kxqp.GameUtil;
import com.excelliance.kxqp.gs.bean.FlowBean;
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.ui.flow.a;
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.cd;
import com.excelliance.kxqp.gs.util.cn;
import com.excelliance.kxqp.gs.util.w;
import com.excelliance.kxqp.sdk.StatisticsGS;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class c implements a.InterfaceC0361a {
private Context f9064a;
private com.excelliance.kxqp.gs.listener.g<String> f9065b;
public c(Context context) {
this.f9064a = context;
}
public c(Context context, com.excelliance.kxqp.gs.listener.g<String> gVar) {
this.f9064a = context;
this.f9065b = gVar;
}
public void b(final com.excelliance.kxqp.gs.listener.g<String> gVar) {
az.d("zch_flow", "enter initFlowData_flow");
final JSONObject i = cn.i(this.f9064a);
final String a2 = aq.a(this.f9064a, i);
tp.f(new Runnable() {
@Override
public void run() {
List<com.excelliance.kxqp.gs.ui.account.c> f;
SharedPreferences sharedPreferences = c.this.f9064a.getSharedPreferences("sp_flow_info", Build.VERSION.SDK_INT < 11 ? 0 : 4);
try {
i.put("rid", bx.a().a(c.this.f9064a));
i.put("account", bx.a().r(c.this.f9064a));
az.d("FlowPresenter", "requestParams:" + cn.b(i.toString()));
String a3 = bd.a("https://sdk.ourplay.com.cn/flow/flowIndex.php", i.toString());
az.d("FlowPresenter", "initFlowData encry response:" + a3);
String a4 = cn.a(a3);
az.d("FlowPresenter", "initFlowData response:" + a4);
if (!cd.a(a4)) {
JSONObject jSONObject = new JSONObject(a4);
int optInt = jSONObject.optInt("valve");
int optInt2 = jSONObject.optInt("code");
JSONObject jSONObject2 = jSONObject.getJSONObject("data");
bx a5 = bx.a();
a5.a(sharedPreferences, "markFlowReportValve", optInt);
b.f9061b = optInt;
b a6 = b.a(jSONObject2.toString());
if (GameUtil.b() && (f = as.f()) != null && f.size() > 0 && a6.r.f9063b == 0) {
StatisticsGS.getInstance().uploadUserAction(c.this.f9064a, 117);
a6.r.f9063b = 1;
}
if (a6.s != null && a6.s.f9063b == 1) {
c.this.f9064a.sendBroadcast(new Intent(c.this.f9064a.getPackageName() + ".switch.flow.fragment"));
}
a6.a();
a5.b(sharedPreferences, "markFlowConfig", jSONObject2.toString());
if (optInt2 != 0 && !cd.a(a2)) {
cn.c(c.this.f9064a, 0);
}
if (gVar == null || optInt2 == 0) {
return;
}
gVar.a(null, new Object[0]);
return;
}
if (gVar != null) {
gVar.a(w.e(c.this.f9064a, "init_flow_data_fail"));
}
} catch (Exception e) {
if (gVar != null) {
gVar.a(w.e(c.this.f9064a, "init_flow_data_fail"));
}
az.d("FlowPresenter", e.getMessage());
e.printStackTrace();
}
}
});
}
@Override
public void a(final int i, final int i2, final com.excelliance.kxqp.gs.listener.g<List<FlowBean>> gVar) {
gVar.a();
tp.f(new Runnable() {
@Override
public void run() {
JSONObject f = aq.f(c.this.f9064a);
try {
f.put("type", i);
f.put("account", i);
f.put("page", i2);
} catch (JSONException e) {
az.d("FlowPresenter", e.getMessage());
e.printStackTrace();
}
String a2 = bd.a("https://sdk.ourplay.com.cn/flow/flowGetDetail.php", f.toString());
az.d("FlowPresenter", "encry response:" + a2);
String a3 = cn.a(a2);
az.d("FlowPresenter", "response:" + a3);
try {
try {
} catch (JSONException e2) {
gVar.a(e2.getMessage());
e2.printStackTrace();
}
if (cd.a(a3)) {
gVar.a(w.e(c.this.f9064a, "server_error"));
gVar.g_();
return;
}
JSONObject jSONObject = new JSONObject(a3);
JSONArray jSONArray = jSONObject.getJSONArray("data");
int i3 = jSONObject.getInt("code");
String string = jSONObject.getString("msg");
if (i3 != 1) {
gVar.a(string);
gVar.g_();
return;
}
ArrayList arrayList = new ArrayList();
for (int i4 = 0; i4 < jSONArray.length(); i4++) {
JSONObject jSONObject2 = (JSONObject) jSONArray.get(i4);
FlowBean flowBean = new FlowBean();
flowBean.setDate(jSONObject2.getString("date"));
flowBean.setFlow(jSONObject2.getLong("flow"));
flowBean.setFrom(jSONObject2.getString(ParamKeyConstants.WebViewConstants.QUERY_FROM));
flowBean.setType(jSONObject2.getInt("type"));
arrayList.add(flowBean);
}
gVar.a(arrayList, new Object[0]);
} finally {
gVar.g_();
}
}
});
}
@Override
public void a(final int i, final int i2, final int i3, final com.excelliance.kxqp.gs.listener.g<List<FlowBean>> gVar) {
gVar.a();
tp.f(new Runnable() {
@Override
public void run() {
long j;
JSONObject f = aq.f(c.this.f9064a);
try {
f.put("type", i);
f.put("account", bx.a().r(c.this.f9064a));
f.put("page", i3);
f.put("dateType", i2);
} catch (JSONException e) {
az.d("FlowPresenter", e.getMessage());
e.printStackTrace();
}
az.d("FlowPresenter", "request:" + cn.b(f.toString()));
String a2 = bd.a("https://sdk.ourplay.com.cn/flow/flowUseDetail.php", f.toString());
az.d("FlowPresenter", "encry response:" + a2);
String a3 = cn.a(a2);
az.d("FlowPresenter", "response:" + a3);
try {
try {
} catch (JSONException e2) {
gVar.a(e2.getMessage());
e2.printStackTrace();
}
if (cd.a(a3)) {
gVar.a(w.e(c.this.f9064a, "server_error"));
return;
}
JSONObject jSONObject = new JSONObject(a3);
if (jSONObject.getInt("code") != 1) {
gVar.a(jSONObject.getString("msg"));
return;
}
JSONArray jSONArray = jSONObject.getJSONArray("data");
ArrayList arrayList = new ArrayList();
long j2 = 0;
for (int i4 = 0; i4 < jSONArray.length(); i4++) {
JSONObject jSONObject2 = (JSONObject) jSONArray.get(i4);
FlowBean flowBean = new FlowBean();
flowBean.setAppIcon(jSONObject2.getString("appIcon"));
flowBean.setAppName(jSONObject2.getString("appName"));
try {
j = Long.parseLong(jSONObject2.optString("flow"));
} catch (Exception e3) {
e3.printStackTrace();
j = 0;
}
flowBean.setFlow(j);
j2 += j;
arrayList.add(flowBean);
}
Iterator it = arrayList.iterator();
while (it.hasNext()) {
((FlowBean) it.next()).setTotalUseUpFlow(j2);
}
gVar.a(arrayList, new Object[0]);
} finally {
gVar.g_();
}
}
});
}
@Override
public void a(final int i, final String str, final String str2) {
tp.d(new Runnable() {
@Override
public void run() {
aw.a(c.this.f9064a, i, str, str2, "FlowPresenter", 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 (c.this.f9064a != null) {
if (c.this.f9064a instanceof MainActivity) {
((MainActivity) c.this.f9064a).startActivityForResult(intent, 1);
} else if (c.this.f9064a instanceof GoogleAccountManager) {
((GoogleAccountManager) c.this.f9064a).startActivityForResult(intent, 1);
}
}
}
});
}
});
}
@Override
public void a(final String str, final com.excelliance.kxqp.gs.listener.g<String> gVar) {
gVar.a();
tp.f(new Runnable() {
@Override
public void run() {
String a2;
JSONObject f = aq.f(c.this.f9064a);
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("FlowPresenter", e.getMessage());
e.printStackTrace();
}
if (cd.a(a2)) {
gVar.a(w.e(c.this.f9064a, "server_error"));
return;
}
az.d("FlowPresenter", "encry response:" + a2);
String a3 = cn.a(a2);
az.d("FlowPresenter", "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 a(final com.excelliance.kxqp.gs.listener.g<Long> gVar) {
tp.f(new Runnable() {
@Override
public void run() {
String a2;
gVar.a();
JSONObject f = aq.f(c.this.f9064a);
try {
try {
f.put("refer", 1);
az.d("FlowPresenter", "request:" + f.toString());
az.d("FlowPresenter", "encry request:" + cn.b(f.toString()));
a2 = bd.a("https://sdk.ourplay.com.cn/flow/flowTask.php", f.toString());
} catch (Exception e) {
gVar.a(w.e(c.this.f9064a, "sign_fail"));
az.d("FlowPresenter", e.getMessage());
e.printStackTrace();
}
if (cd.a(a2)) {
gVar.a(w.e(c.this.f9064a, "server_error"));
return;
}
az.d("FlowPresenter", "encry response:" + a2);
String a3 = cn.a(a2);
az.d("FlowPresenter", "response:" + a3);
JSONObject jSONObject = new JSONObject(a3);
int optInt = jSONObject.optInt("code");
JSONObject jSONObject2 = jSONObject.getJSONObject("data");
if (optInt != 1) {
gVar.a(w.e(c.this.f9064a, "sign_fail"));
} else {
gVar.a(Long.valueOf(jSONObject2.optLong("flow")), new Object[0]);
}
} finally {
gVar.g_();
}
}
});
}
@Override
public void a(final com.excelliance.kxqp.gs.listener.g<Long> gVar, final int i) {
tp.f(new Runnable() {
@Override
public void run() {
String a2;
gVar.a();
JSONObject f = aq.f(c.this.f9064a);
try {
try {
f.put("refer", i);
az.d("FlowPresenter", "encry request:" + cn.b(f.toString()));
a2 = bd.a("https://sdk.ourplay.com.cn/flow/flowTask.php", f.toString());
} catch (Exception e) {
if (c.this.f9064a != null) {
gVar.a(w.e(c.this.f9064a, "receive_fail"));
}
az.d("FlowPresenter", e.getMessage());
e.printStackTrace();
}
if (cd.a(a2)) {
gVar.a(w.e(c.this.f9064a, "server_error"));
return;
}
az.d("FlowPresenter", "encry response:" + a2);
String a3 = cn.a(a2);
az.d("FlowPresenter", "response:" + a3);
JSONObject jSONObject = new JSONObject(a3);
if (jSONObject.optInt("code") != 1) {
gVar.a(w.e(c.this.f9064a, "receive_fail"));
} else {
gVar.a(Long.valueOf(jSONObject.getJSONObject("data").optLong("flow")), new Object[0]);
}
} finally {
gVar.g_();
}
}
});
}
public void c(final com.excelliance.kxqp.gs.listener.g<Long> gVar) {
tp.f(new Runnable() {
@Override
public void run() {
String a2;
gVar.a();
JSONObject f = aq.f(c.this.f9064a);
try {
try {
f.put("refer", 2);
az.d("FlowPresenter", "encry request:" + cn.b(f.toString()));
a2 = bd.a("https://sdk.ourplay.com.cn/flow/flowTask.php", f.toString());
} catch (Exception e) {
gVar.a(w.e(c.this.f9064a, "receive_flow_fail"));
az.d("FlowPresenter", e.getMessage());
e.printStackTrace();
}
if (cd.a(a2)) {
gVar.a(w.e(c.this.f9064a, "server_error"));
return;
}
az.d("FlowPresenter", "encry response:" + a2);
String a3 = cn.a(a2);
az.d("FlowPresenter", "response:" + a3);
JSONObject jSONObject = new JSONObject(a3);
int optInt = jSONObject.optInt("code");
JSONObject jSONObject2 = jSONObject.getJSONObject("data");
if (optInt != 1) {
gVar.a(w.e(c.this.f9064a, "receive_flow_fail"));
} else {
gVar.a(Long.valueOf(jSONObject2.optLong("flow")), new Object[0]);
}
} finally {
gVar.g_();
}
}
});
}
@Override
public void a() {
this.f9065b = null;
}
@Override
public void initData() {
tp.a(new Runnable() {
@Override
public void run() {
c.this.b(c.this.f9065b);
}
}, 2000L);
}
}