OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 b.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.main;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Process;
import android.text.TextUtils;
import android.util.Log;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.Observer;
import com.excean.bytedancebi.manager.BiManager;
import com.excelliance.kxqp.GameUtil;
import com.excelliance.kxqp.SmtServService;
import com.excelliance.kxqp.VersionManager;
import com.excelliance.kxqp.api.ApiManager;
import com.excelliance.kxqp.api.f;
import com.excelliance.kxqp.bean.InviteAward;
import com.excelliance.kxqp.bitmap.bean.RankingItem;
import com.excelliance.kxqp.gs.bean.CityBean;
import com.excelliance.kxqp.gs.bean.ProxyConfigHelper;
import com.excelliance.kxqp.gs.bean.VipNotice;
import com.excelliance.kxqp.gs.discover.model.ResponseData;
import com.excelliance.kxqp.gs.discover.model.StorePopupBubbleInfo;
import com.excelliance.kxqp.gs.main.a;
import com.excelliance.kxqp.gs.service.ProxyDelayService;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.nyactivitys.e;
import com.excelliance.kxqp.gs.util.ViewSwitcher;
import com.excelliance.kxqp.gs.util.af;
import com.excelliance.kxqp.gs.util.aq;
import com.excelliance.kxqp.gs.util.as;
import com.excelliance.kxqp.gs.util.av;
import com.excelliance.kxqp.gs.util.ay;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bd;
import com.excelliance.kxqp.gs.util.bf;
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.ce;
import com.excelliance.kxqp.gs.util.cn;
import com.excelliance.kxqp.task.g.g;
import com.excelliance.kxqp.util.ai;
import com.excelliance.staticslio.StatisticsManager;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.umeng.analytics.pro.am;
import com.zero.support.core.task.Response;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class b implements a.InterfaceC0304a {
private a.b f7426a;
private Context f7427b;
private boolean c = false;
private Handler d;
@Override
public void b() {
}
public b(a.b bVar) {
this.f7426a = bVar;
HandlerThread handlerThread = new HandlerThread("GSMainPresenter", 10);
handlerThread.start();
this.d = new Handler(handlerThread.getLooper());
}
@Override
public void initData() {
tp.a(new Runnable() {
@Override
public void run() {
b.this.e();
}
}, 2000L);
}
public void e() {
this.d.post(new Runnable() {
@Override
public void run() {
b.this.f();
b.this.g();
b.this.k();
cn.h(b.this.f7427b);
String packageName = b.this.f7427b.getPackageName();
b.this.b(b.this.f7427b);
if (g.a(b.this.f7427b)) {
az.d("GSMainPresenter", "postPKGInfo_gs");
b.this.j();
}
b.this.h();
ProxyDelayService.a(b.this.f7427b);
try {
Intent intent = new Intent(b.this.f7427b, (Class<?>) SmtServService.class);
intent.setAction(packageName + ".check.black.list.game");
b.this.f7427b.startService(intent);
} catch (Exception e) {
e.printStackTrace();
}
b.this.i();
}
});
try {
Context applicationContext = this.f7427b.getApplicationContext();
String name = applicationContext.getClass().getName();
String name2 = applicationContext.getClass().getSuperclass().getName();
if (TextUtils.equals(name, "com.excelliance.kxqp.KXQPApplication") && TextUtils.equals(name2, "android.app.Application")) {
return;
}
tp.c(new Runnable() {
@Override
public void run() {
Process.killProcess(Process.myPid());
}
});
} catch (Exception unused) {
}
}
public void f() {
try {
Log.d("GSMainPresenter", "initSystemTime start currentTime:" + System.currentTimeMillis());
URLConnection openConnection = new URL("http://ourplay.com.cn/").openConnection();
openConnection.connect();
long date = openConnection.getDate();
Log.d("GSMainPresenter", "initSystemTime time:" + date + " currentTime:" + System.currentTimeMillis());
ce.a(this.f7427b, date);
} catch (Exception e) {
e.printStackTrace();
Log.d("GSMainPresenter", "initSystemTime start e:" + e.getMessage() + " currentTime:" + System.currentTimeMillis());
ce.b(this.f7427b);
}
}
public void g() {
int c = by.a(this.f7427b, "hello").c("statistics_version", 0);
by a2 = by.a(this.f7427b, "sp_config");
if (a2.b("sp_clear_register_info_", false).booleanValue()) {
return;
}
if (c < GameUtil.g(this.f7427b)) {
a2.a("reg_proxy_config");
}
a2.a("sp_clear_register_info_", true);
}
public void h() {
this.d.post(new Runnable() {
@Override
public void run() {
GameUtil intance = GameUtil.getIntance();
JSONObject jSONObject = new JSONObject();
try {
by a2 = by.a(b.this.f7427b, "sp_customization");
jSONObject.put("customizationAd", a2.b(am.aw, true).booleanValue() ? 1 : 0);
jSONObject.put("customizationGame", a2.b("game", true).booleanValue() ? 1 : 0);
jSONObject.put("customizationPush", a2.b("push", true).booleanValue() ? 1 : 0);
jSONObject.put("chid", "" + intance.h());
jSONObject.put("subchid", "" + intance.i());
jSONObject.put("vc", "" + GameUtil.g(b.this.f7427b));
jSONObject.put("uid", VersionManager.getInstance().f());
jSONObject.put("packageName", intance.B(b.this.f7427b));
jSONObject.put(RankingItem.KEY_VER_NAME, GameUtil.h(b.this.f7427b));
VersionManager versionManager = VersionManager.getInstance();
versionManager.a(b.this.f7427b);
jSONObject.put("compver", versionManager.l());
jSONObject.put("mainver", intance.m());
jSONObject.put("api", String.valueOf(Build.VERSION.SDK_INT));
jSONObject.put("release", Build.VERSION.RELEASE);
jSONObject.put("brand", URLEncoder.encode(Build.BRAND, "UTF-8").replaceAll("\\+", "%20"));
jSONObject.put("manufacturer", URLEncoder.encode(Build.MANUFACTURER, "UTF-8").replaceAll("\\+", "%20"));
jSONObject.put("model", URLEncoder.encode(Build.MODEL, "UTF-8").replaceAll("\\+", "%20"));
jSONObject.put("product", URLEncoder.encode(Build.PRODUCT, "UTF-8").replaceAll("\\+", "%20"));
String a3 = bd.a("https://sdk.ourplay.com.cn/vpn_first.php", jSONObject.toString());
az.d("GSMainPresenter", "initFirstReleaseApp response:" + a3);
JSONObject jSONObject2 = new JSONObject(a3);
int i = jSONObject2.getInt("number");
JSONArray jSONArray = jSONObject2.getJSONArray("pkgs");
StringBuffer stringBuffer = new StringBuffer();
for (int i2 = 0; i2 < jSONArray.length(); i2++) {
stringBuffer.append(jSONArray.getString(i2));
stringBuffer.append(StatisticsManager.COMMA);
}
by a4 = by.a(b.this.f7427b, "firstReleaseApp");
a4.a("markRunappMaxStartCount", i);
a4.a("markFirstReleasePkgs", stringBuffer.toString());
} catch (Exception e) {
az.d("GSMainPresenter", "initFirstReleaseApp ex:" + e.getMessage());
e.printStackTrace();
}
}
});
}
public void i() {
ViewSwitcher a2 = ViewSwitcher.a(this.f7427b);
boolean z = a2.a() && a2.e();
if (this.f7427b == null || !z) {
return;
}
try {
ResponseData a3 = new com.excelliance.kxqp.gs.discover.bbs.c(this.f7427b).a(f.a(this.f7427b).toString(), "https://api.ourplay.com.cn/v1/goneload/getuserdefined", new com.excelliance.kxqp.gs.discover.a.c<StorePopupBubbleInfo>() {
@Override
public ResponseData<StorePopupBubbleInfo> a(String str) {
return (ResponseData) new Gson().a(str, new TypeToken<ResponseData<StorePopupBubbleInfo>>() {
}.getType());
}
});
if (a3 != null) {
az.d("GSMainPresenter", "refreshStoreUpdate: responseData:" + a3.toString());
StorePopupBubbleInfo storePopupBubbleInfo = (StorePopupBubbleInfo) a3.data;
int i = storePopupBubbleInfo.count;
int c = by.a(this.f7427b, "sp_key_last_store_item_count").c("sp_key_last_store_item_count", 0);
long currentTimeMillis = System.currentTimeMillis() - by.a(this.f7427b, "sp_config").a("sp_key_last_time_show_store_update_bubble", (Long) 0L);
az.d("GSMainPresenter", "refreshStoreUpdate: showInterval:" + currentTimeMillis);
by.a(this.f7427b, "sp_key_last_store_item_count").a("sp_key_last_store_item_count", i);
if (i <= c || c <= 0 || storePopupBubbleInfo.isshow != 1 || currentTimeMillis <= 259200000) {
return;
}
tp.i(new Runnable() {
@Override
public void run() {
if (b.this.f7426a != null) {
b.this.f7426a.t();
by.a(b.this.f7427b, "sp_config").a("sp_key_last_time_show_store_update_bubble", System.currentTimeMillis());
}
}
});
}
} catch (Exception e) {
e.printStackTrace();
}
}
public void b(final Context context) {
if (e.b(context) && e.a(context) && !e.c(context)) {
this.d.post(new Runnable() {
@Override
public void run() {
int i;
String b2 = by.a(context, "sharePackageInfo").b("sharedJsonInfo", "");
az.d("GSMainPresenter", "uploadNewYearBindRid read apk jsonInfo:" + b2);
if (!cd.a(b2)) {
try {
i = new JSONObject(cn.a(b2)).optInt("NYShareUserId");
} catch (Exception e) {
e.printStackTrace();
}
az.d("GSMainPresenter", "uploadNewYearBindRid newYearBindRid:" + i);
if (i <= 0) {
JSONObject jSONObject = new JSONObject();
GameUtil intance = GameUtil.getIntance();
intance.q(context);
String F = intance.F(context);
com.excelliance.kxqp.api.c cVar = new com.excelliance.kxqp.api.c(context);
try {
jSONObject.put("NYShareUserId", i);
jSONObject.put(BiManager.UQID, F);
} catch (JSONException e2) {
e2.printStackTrace();
}
cVar.a(ApiManager.getInstance().c(context, 15000L, 15000L, "https://api.ourplay.com.cn/").a(jSONObject));
com.excelliance.kxqp.gs.appstore.model.ResponseData b3 = cVar.b();
az.d("GSMainPresenter", "uploadNewYearBindRid responseData: " + b3);
if (b3.data == 0 || b3.code != 0) {
return;
}
cn.c(b.this.f7427b, 4);
by.a(context, "sharePackageInfo").a("sp_key_newyear_action_friend_rid_upload", true);
return;
}
return;
}
i = 0;
az.d("GSMainPresenter", "uploadNewYearBindRid newYearBindRid:" + i);
if (i <= 0) {
}
}
});
}
}
public void j() {
az.d("GSMainPresenter", "postPKGInfo_gs");
new com.excelliance.kxqp.task.f.f(this.f7427b).b((com.excelliance.kxqp.gs.listener.g<String>) null);
}
public void k() {
this.d.post(new Runnable() {
@Override
public void run() {
Log.d("GSMainPresenter", String.format("GSMainPresenter/initProcessConfig run:thread(%s)", Thread.currentThread().getName()));
b.this.d(b.this.f7427b);
b.this.c(b.this.f7427b);
}
});
}
public void c(Context context) {
Log.d("GSMainPresenter", String.format("GSMainPresenter/initGameDomainConfig:thread(%s)", Thread.currentThread().getName()));
String c = as.c(context);
if (TextUtils.isEmpty(c)) {
return;
}
try {
JSONObject optJSONObject = new JSONObject(c).optJSONObject("data");
if (optJSONObject != null) {
JSONObject optJSONObject2 = optJSONObject.optJSONObject("game");
if (optJSONObject2 != null) {
new JSONArray();
JSONArray optJSONArray = optJSONObject2.optJSONArray("bypass_list");
new JSONArray();
JSONArray optJSONArray2 = optJSONObject2.optJSONArray("dl_list");
new JSONArray();
com.excelliance.kxqp.gs.k.a.a().a(optJSONArray, optJSONArray2, optJSONObject2.optJSONArray("si_list"), context);
}
JSONObject optJSONObject3 = optJSONObject.optJSONObject("special");
if (optJSONObject3 != null) {
if (optJSONObject3.has("flag")) {
int optInt = optJSONObject3.optInt("flag");
if (optInt > -1) {
by.a(context, "sp_movies_pre_setting").a("sp_key_write_dl_flag_for_vending", optInt);
com.excelliance.kxqp.wr.a.a().a(0, "com.android.vending", 140737488355328L, optInt != 1);
}
} else {
by.a(context, "sp_movies_pre_setting").a("sp_key_write_dl_flag_for_vending", 1);
com.excelliance.kxqp.wr.a.a().a(0, "com.android.vending", 140737488355328L, false);
}
new JSONArray();
JSONArray optJSONArray3 = optJSONObject3.optJSONArray("bypass_list");
new JSONArray();
JSONArray optJSONArray4 = optJSONObject3.optJSONArray("dl_list");
new JSONArray();
com.excelliance.kxqp.gs.k.g.a().a(optJSONArray3, optJSONArray4, optJSONObject3.optJSONArray("si_list"), context);
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
public void d(Context context) {
String str;
String str2;
boolean z = true;
Log.d("GSMainPresenter", String.format("GSMainPresenter/initProxyConfig:thread(%s)", Thread.currentThread().getName()));
az.d("GSMainPresenter", "initProxyConfig");
by a2 = by.a(context, "sp_total_info");
String str3 = "";
try {
long a3 = a2.a("sp_city_list_time_out", (Long) 0L);
long currentTimeMillis = System.currentTimeMillis();
int c = a2.c("markVipFlowVersion", 0);
int i = aq.i(this.f7427b);
if (i <= c) {
z = false;
}
by a4 = by.a(context, "sp_city_config");
if (a3 == 0 || currentTimeMillis - a3 > 100 || z) {
str = as.b(context);
try {
if (!TextUtils.isEmpty(str)) {
az.d("GSMainPresenter", "----city" + str);
a4.a("sp_city_config", str);
a2.a("sp_city_list_time_out", System.currentTimeMillis());
a2.a("markVipFlowVersion", i);
com.excelliance.kxqp.bitmap.ui.b.a().a("com.excelliance.kxqp.gs.dialog.refresh_city_list_action");
}
str3 = str;
} catch (Exception e) {
e = e;
e.getMessage();
str2 = str;
a(str2, context);
}
}
str2 = TextUtils.isEmpty(str3) ? a4.b("sp_city_config", "") : str3;
} catch (Exception e2) {
e = e2;
str = str3;
}
a(str2, context);
}
private void a(String str, Context context) {
Log.d("GSMainPresenter", String.format("GSMainPresenter/getProxyConfig:thread(%s) city(%s)", Thread.currentThread().getName(), str));
Intent intent = new Intent(context.getPackageName() + ".refresh.proxy.interface");
boolean e = bf.e(context);
az.d("GSMainPresenter", "getProxyConfig " + e);
if (!e) {
intent.putExtra("state", -3);
} else {
if (!TextUtils.isEmpty(str)) {
try {
List<CityBean> a2 = ay.a(str, !aq.v());
if (a2.size() > 0) {
int[] iArr = new int[a2.size()];
String[] strArr = new String[a2.size()];
for (int i = 0; i < a2.size(); i++) {
iArr[i] = 1;
strArr[i] = a2.get(i).getId();
}
String a3 = as.a(iArr, strArr, context);
if (TextUtils.isEmpty(a3)) {
String b2 = by.a(context, "sp_config").b("sp_config", "");
if (!TextUtils.isEmpty(b2)) {
a3 = com.excelliance.kxqp.gs.util.c.a(b2, "keics_e21p3kds8s");
}
}
Log.d("GSMainPresenter", String.format("GSMainPresenter/getProxyConfig:thread(%s) config(%s)", Thread.currentThread().getName(), a3));
if (!TextUtils.isEmpty(a3)) {
ProxyDelayService.c(this.f7427b);
long currentTimeMillis = System.currentTimeMillis();
com.excelliance.kxqp.gs.g.c.a().b(this.f7427b, "是");
int refreshConfig = ProxyConfigHelper.refreshConfig(context, a3, false);
az.d("GSMainPresenter", "getProxyConfig state " + refreshConfig + " needProxy: true");
if (refreshConfig == 0) {
String a4 = com.excelliance.kxqp.gs.util.c.a(by.a(context, "sp_config").b("sp_config", a3), "keics_e21p3kds8s");
az.d("GSMainPresenter", "decryptFromBase64: " + a4);
com.excelliance.kxqp.gs.g.c.a().b(this.f7427b, "是");
refreshConfig = ProxyConfigHelper.refreshConfig(context, a4, false);
} else {
by.a(context, "sp_config").a("sp_config", com.excelliance.kxqp.gs.util.c.a(a3));
}
intent.putExtra("state", refreshConfig);
long currentTimeMillis2 = System.currentTimeMillis() - currentTimeMillis;
if (currentTimeMillis2 < 500) {
Thread.sleep(500 - currentTimeMillis2);
}
} else {
intent.putExtra("state", 0);
}
} else {
intent.putExtra("state", 0);
}
} catch (Exception e2) {
e2.printStackTrace();
}
} else {
intent.putExtra("state", 0);
}
String a5 = as.a(context, (String) null, 0);
az.d("GSMainPresenter", "getRegProxyConfig: " + a5);
if (!TextUtils.isEmpty(a5)) {
by.a(context, "sp_config").a("reg_proxy_config", com.excelliance.kxqp.gs.util.c.a(a5));
ProxyConfigHelper.getInstance(context).refreshRegisterConfig(context, a5, false);
}
}
Log.d("GSMainPresenter", "getProxyConfig");
context.sendBroadcast(intent);
}
@Override
public void a() {
this.d.getLooper().quit();
this.f7426a = null;
}
public void a(Context context) {
this.f7427b = context;
}
@Override
public void a(final String str, final String str2, final Runnable runnable) {
this.d.post(new Runnable() {
@Override
public void run() {
try {
bx a2 = bx.a();
String a3 = a2.a(b.this.f7427b);
JSONObject jSONObject = new JSONObject();
jSONObject.put("rid", a3);
jSONObject.put("name", str);
jSONObject.put("idCard", str2);
jSONObject.put("aid", av.a().a(b.this.f7427b));
String c = bd.c("https://api.ourplay.com.cn/user/verify", jSONObject.toString());
Log.d("GSMainPresenter", "run: response:" + c);
if (TextUtils.isEmpty(c)) {
ai.a().a((Activity) b.this.f7427b, "");
ai.a().a(b.this.f7427b, "启动页");
return;
}
JSONObject jSONObject2 = new JSONObject(c);
int optInt = jSONObject2.optInt("code");
String optString = jSONObject2.optString("msg");
int optInt2 = jSONObject2.optJSONObject("data").optInt("isAdult");
if (optInt != 0) {
ai.a().a((Activity) b.this.f7427b, optString);
if (cd.a(optString)) {
ai.a().a(b.this.f7427b, "启动页");
return;
} else {
ai.a().a(b.this.f7427b, "启动页", optString);
return;
}
}
runnable.run();
if (a2.b(b.this.f7427b)) {
SharedPreferences sharedPreferences = b.this.f7427b.getSharedPreferences("USERINFO", 0);
bx a4 = bx.a();
a4.a(sharedPreferences, "USER_REAL_NAME_VERIFY", 1);
a4.a(sharedPreferences, "USER_IS_ADULT", optInt2);
a4.b(sharedPreferences, "USER_REAL_NAME", str);
a4.b(sharedPreferences, "USER_ID_NUMBER", str2);
} else {
SharedPreferences sharedPreferences2 = b.this.f7427b.getSharedPreferences("USERINFO", 0);
bx a5 = bx.a();
a5.a(sharedPreferences2, "DEVICE_ID_VERIFY", 1);
a5.b(sharedPreferences2, "DEVICE_REAL_NAME", str);
a5.b(sharedPreferences2, "DEVICE_ID_NUMBER", str2);
a5.a(sharedPreferences2, "DEVICE_IS_ADULT", optInt2);
}
ai.a();
ai.b(b.this.f7427b);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
@Override
public void c() {
((com.excelliance.kxqp.api.b) com.zero.support.core.api.a.a(com.excelliance.kxqp.api.b.class)).b().d().observe((LifecycleOwner) this.f7427b, new Observer<Response<VipNotice>>() {
@Override
public void onChanged(Response<VipNotice> response) {
List<VipNotice> list;
if (!response.c() || response.d() == null || (list = response.d().list) == null) {
return;
}
try {
com.excelliance.user.account.f.e.a("GSMainPresenter", ": " + response.d().list.size());
by.a(b.this.f7427b, "sp_config").a("sp_key_vip_notice", new Gson().a(list, new TypeToken<List<VipNotice>>() {
}.getType()));
af.a((FragmentActivity) b.this.f7427b, list, 1);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
@Override
public void d() {
((com.excelliance.kxqp.api.b) com.zero.support.core.api.a.a(com.excelliance.kxqp.api.b.class)).d().d().observe((LifecycleOwner) this.f7427b, new Observer<Response<InviteAward>>() {
@Override
public void onChanged(Response<InviteAward> response) {
com.excelliance.user.account.f.e.a("getVip", "GSMainPresenter/getMyVipAward " + response.toString());
if (response.c()) {
if (response.d() != null) {
String str = response.d().BeInviteUqid;
if (!cd.a(str)) {
com.excelliance.user.account.f.e.a("getVip", ": me String set..." + str);
b.this.f7426a.u();
return;
}
com.excelliance.user.account.f.e.a("getVip", ": friendUqid is null");
return;
}
return;
}
com.excelliance.user.account.f.e.b("GSMainPresenter", "me: " + response.e());
}
});
}
@Override
public void a(boolean z) {
this.f7426a.e(z);
}
}