OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 b.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.ui.login;
import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
import android.text.TextUtils;
import android.util.Log;
import com.excelliance.kxqp.GameUtil;
import com.excelliance.kxqp.gs.bean.AppInfo;
import com.excelliance.kxqp.gs.bean.DeviceInfo;
import com.excelliance.kxqp.gs.bean.RegisterInfo;
import com.excelliance.kxqp.gs.bean.UserInfo;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.login.a;
import com.excelliance.kxqp.gs.util.UserUtil;
import com.excelliance.kxqp.gs.util.aq;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bd;
import com.excelliance.kxqp.gs.util.bp;
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.cg;
import com.excelliance.kxqp.gs.util.cn;
import com.excelliance.kxqp.gs.util.t;
import com.excelliance.kxqp.gs.util.w;
import com.excelliance.kxqp.sdk.StatisticsBase;
import com.excelliance.kxqp.sdk.StatisticsGS;
import com.excelliance.kxqp.task.g.g;
import com.tencent.tauth.IUiListener;
import com.tencent.tauth.UiError;
import com.zero.support.core.api.u;
import com.zero.support.core.api.v;
import org.json.JSONException;
import org.json.JSONObject;
public class b implements a.InterfaceC0414a {
private Context f10263a;
private a.b f10264b;
private final Handler c;
private final Handler d;
private final c e;
private com.excelliance.kxqp.gs.ui.login.a.a f;
@Override
public void initData() {
}
public b(Context context, a.b bVar, com.excelliance.kxqp.gs.ui.login.a.a aVar) {
HandlerThread handlerThread = new HandlerThread(getClass().getSimpleName() + "word_hander");
handlerThread.start();
this.d = new Handler(context.getMainLooper());
this.c = new Handler(handlerThread.getLooper());
this.f10263a = context;
this.f10264b = bVar;
this.e = c.a(this.f10263a);
this.f = aVar;
}
@Override
public void a() {
this.f.b(new IUiListener() {
@Override
public void onComplete(Object obj) {
JSONObject jSONObject;
Log.d("LoginPresenter", "onComplete: " + obj);
try {
jSONObject = new JSONObject(obj.toString());
} catch (JSONException e) {
e.printStackTrace();
jSONObject = null;
}
if (jSONObject == null) {
return;
}
az.d("LoginPresenter", "qqInfo:" + jSONObject.toString());
String optString = jSONObject.optString("openid");
final JSONObject i = cn.i(b.this.f10263a);
try {
i.put("tid", optString);
i.put("type", 3);
} catch (JSONException e2) {
e2.printStackTrace();
}
b.this.f.c(new IUiListener() {
@Override
public void onCancel() {
}
@Override
public void onComplete(Object obj2) {
az.d("LoginPresenter", "getQQUserInfo()" + obj2);
JSONObject jSONObject2 = (JSONObject) obj2;
String optString2 = jSONObject2.optString("nickname");
String optString3 = jSONObject2.optString("figureurl");
try {
i.put("nickname", optString2);
i.put("avatarurl", optString3);
} catch (JSONException e3) {
e3.printStackTrace();
}
b.this.a("", i, 3);
}
@Override
public void onError(UiError uiError) {
b.this.a("", i, 3);
}
});
}
@Override
public void onError(UiError uiError) {
Log.d("LoginPresenter", "onError: " + uiError.errorDetail);
}
@Override
public void onCancel() {
Log.d("LoginPresenter", "onCancel: ");
}
});
}
@Override
public void b() {
this.f.a(new IUiListener() {
@Override
public void onCancel() {
}
@Override
public void onError(UiError uiError) {
}
@Override
public void onComplete(Object obj) {
Log.d("LoginPresenter", "onComplete: " + obj + " thread:" + Thread.currentThread().getName());
final String valueOf = String.valueOf(obj);
new Runnable() {
@Override
public void run() {
JSONObject f = aq.f(b.this.f10263a);
try {
f.put("code", valueOf);
String a2 = bd.a("https://sdk.ourplay.com.cn/flow/wechatInfo.php", f.toString());
if (cd.a(a2)) {
b.this.a(w.e(b.this.f10263a, "server_error"));
return;
}
az.d("LoginPresenter", "encry response:" + a2);
String a3 = cn.a(a2);
az.d("LoginPresenter", "response:" + a3);
JSONObject jSONObject = new JSONObject(a3).getJSONObject("data");
String string = jSONObject.getString("wxid");
String string2 = jSONObject.getString("wxname");
String string3 = jSONObject.getString("wxicon");
JSONObject i = cn.i(b.this.f10263a);
try {
i.put("tid", string);
i.put("nickname", string2);
i.put("avatarurl", string3);
i.put("type", 4);
} catch (JSONException e) {
e.printStackTrace();
}
b.this.a("", i, 4);
} catch (Exception e2) {
az.d("LoginPresenter", e2.getMessage());
b.this.a(e2.getMessage());
e2.printStackTrace();
}
}
}.run();
}
});
}
@Override
public void a(final String str, final String str2) {
if (TextUtils.isEmpty(str)) {
cg.a(this.f10263a, "请输入验证码~");
return;
}
String string = this.f10263a.getSharedPreferences("MSG_INDENTIFY_CODE", Build.VERSION.SDK_INT < 11 ? 0 : 4).getString("MSG_CODE_" + str2 + 4, null);
StringBuilder sb = new StringBuilder();
sb.append("code:");
sb.append(string);
az.d("LoginPresenter", sb.toString());
if (!str.equals(string)) {
cg.a(this.f10263a, "验证码错误~");
} else {
tp.f(new Runnable() {
@Override
public void run() {
JSONObject i = cn.i(b.this.f10263a);
try {
i.put("phone_number", str2);
i.put("verify_code", str);
i.put("type", 2);
} catch (JSONException e) {
e.printStackTrace();
}
Log.d("LoginPresenter", "request : " + i.toString());
Log.d("LoginPresenter", "encrypt request : " + com.excelliance.kxqp.gs.util.c.a(i.toString()));
b.this.a(str2, i, 2);
}
});
}
}
public void a(final String str) {
this.d.post(new Runnable() {
@Override
public void run() {
cg.a(b.this.f10263a, str);
}
});
}
@Override
public void b(final String str, final String str2) {
this.c.post(new Runnable() {
@Override
public void run() {
if (str.length() < 6 || str.length() > 20) {
b.this.a(w.e(b.this.f10263a, "user_account_pwd_error"));
return;
}
if (!bx.a(str)) {
b.this.a(w.e(b.this.f10263a, "user_account_pwd_error"));
return;
}
if (str2.length() < 6 || str2.length() > 20) {
b.this.a(w.e(b.this.f10263a, "user_pwd_be_error"));
}
if (!bx.b(str2)) {
b.this.a(w.e(b.this.f10263a, "user_pwd_be_error"));
} else {
b.this.d.post(new Runnable() {
@Override
public void run() {
if (b.this.f10264b != null) {
b.this.f10264b.c();
}
}
});
final String requestParamsForLogin = UserUtil.getInstance().getRequestParamsForLogin(b.this.f10263a, str, str2, 1);
tp.f(new Runnable() {
@Override
public void run() {
try {
b.this.a(str, new JSONObject(requestParamsForLogin), 1);
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
}
});
}
@Override
public void c(String str, String str2) {
GameUtil.getIntance();
if (!GameUtil.isNetworkConnected(this.f10263a)) {
cg.a(this.f10263a, w.e(this.f10263a, "network_unavailable"));
return;
}
if (TextUtils.isEmpty(str2)) {
cg.a(this.f10263a, w.e(this.f10263a, "user_input_phone_number"));
return;
}
if (!bx.a(str2)) {
cg.a(this.f10263a, w.e(this.f10263a, "user_input_legal_phone_number"));
return;
}
if (TextUtils.isEmpty(str)) {
cg.a(this.f10263a, w.e(this.f10263a, "user_input_indentify_code"));
return;
}
by a2 = by.a(this.f10263a, "MSG_INDENTIFY_CODE");
String b2 = a2.b("MSG_CODE_" + str2 + 3, "");
long a3 = a2.a("MSG_TIME_" + str2 + 3, (Long) 0L);
int currentTimeMillis = (int) ((System.currentTimeMillis() - a3) / 60000);
Log.d("LoginPresenter", "oldTime: " + a3);
Log.d("LoginPresenter", "diffTime: " + currentTimeMillis);
if (currentTimeMillis > 30 && a3 != 0) {
cg.a(this.f10263a, w.e(this.f10263a, "user_get_code_has_died"));
} else if (!TextUtils.equals(b2, str)) {
cg.a(this.f10263a, w.e(this.f10263a, "user_get_code_error"));
} else {
this.f10264b.c();
tp.f(new AnonymousClass7(str2));
}
}
public class AnonymousClass7 implements Runnable {
final String f10284a;
AnonymousClass7(String str) {
this.f10284a = str;
}
@Override
public void run() {
String b2 = b.this.b(this.f10284a);
String a2 = com.excelliance.kxqp.gs.util.c.a(b2);
String c = bd.c("https://sdk.ourplay.com.cn/account/bindmobile.php", a2);
az.d("LoginPresenter", "bindPhoneParams:" + b2);
az.d("LoginPresenter", "content:" + a2);
az.d("LoginPresenter", "response:" + c);
c.a(b.this.f10263a).a(this.f10284a, c, new com.excelliance.kxqp.gs.listener.c<String>() {
@Override
public void a(String str, Object... objArr) {
b.this.a(str);
if (b.this.f10264b != null) {
b.this.d.post(new Runnable() {
@Override
public void run() {
b.this.f10264b.g();
b.this.f10264b.f();
}
});
}
}
@Override
public void a2(String str, Object... objArr) {
b.this.a(str);
b.this.f10264b.f();
}
});
}
}
public String b(String str) {
RegisterInfo registerInfo = new RegisterInfo();
registerInfo.appInfo = new AppInfo();
registerInfo.deviceInfo = new DeviceInfo();
registerInfo.userInfo = new UserInfo();
GameUtil intance = GameUtil.getIntance();
registerInfo.appInfo.chid = intance.h();
registerInfo.appInfo.subChid = intance.i();
registerInfo.appInfo.pkgName = this.f10263a.getPackageName();
registerInfo.deviceInfo.aid = intance.r(this.f10263a);
registerInfo.deviceInfo.andVer = intance.p();
registerInfo.deviceInfo.sdkVer = intance.o();
registerInfo.deviceInfo.imei = intance.v(this.f10263a);
registerInfo.deviceInfo.imsi = intance.w(this.f10263a);
registerInfo.deviceInfo.model = intance.q();
registerInfo.deviceInfo.screen = intance.y(this.f10263a);
registerInfo.deviceInfo.netType = intance.z(this.f10263a);
registerInfo.deviceInfo.memInfo = intance.d();
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("phoneNum", str);
int b2 = bx.a().b(by.a(this.f10263a, "USERINFO").c(), "USER_ID");
if (b2 != 0) {
jSONObject.put("rid", b2);
jSONObject.put("chid", registerInfo.appInfo.chid);
jSONObject.put("subchid", registerInfo.appInfo.subChid);
jSONObject.put("pkgName", registerInfo.appInfo.pkgName);
jSONObject.put("aid", registerInfo.deviceInfo.aid);
jSONObject.put("andVer", registerInfo.deviceInfo.andVer);
jSONObject.put("sdkVer", registerInfo.deviceInfo.sdkVer);
jSONObject.put("imei", registerInfo.deviceInfo.imei);
jSONObject.put("imsi", registerInfo.deviceInfo.imsi);
jSONObject.put("model", registerInfo.deviceInfo.model);
jSONObject.put("screen", registerInfo.deviceInfo.screen);
jSONObject.put("netType", registerInfo.deviceInfo.netType);
jSONObject.put("memInfo", registerInfo.deviceInfo.memInfo);
return jSONObject.toString();
}
Log.d("LoginPresenter", "userId = " + b2);
return null;
} catch (Exception e) {
e.printStackTrace();
Log.d("LoginPresenter", "excepiton = " + e.getMessage());
return null;
}
}
@Override
public void a(final int i, final String str) {
if (TextUtils.isEmpty(str)) {
cg.a(this.f10263a, w.e(this.f10263a, "user_input_phone_number"));
return;
}
bx.a();
if (!bx.a(str)) {
cg.a(this.f10263a, w.e(this.f10263a, "user_input_legal_phone_number"));
return;
}
GameUtil.getIntance();
if (!GameUtil.isNetworkConnected(this.f10263a)) {
cg.a(this.f10263a, w.e(this.f10263a, "network_unavailable"));
} else {
tp.f(new Runnable() {
@Override
public void run() {
JSONObject i2 = cn.i(b.this.f10263a);
try {
i2.put("phoneNum", str);
i2.put("position", 4);
} catch (JSONException e) {
e.printStackTrace();
}
az.d("LoginPresenter", "request : " + i2.toString());
az.d("LoginPresenter", "encrypt request : " + com.excelliance.kxqp.gs.util.c.a(i2.toString()));
String a2 = bp.a(((v) com.zero.support.core.api.a.a(v.class)).a(new u("https://sdk.ourplay.com.cn/account/sendmsgnew.php", i2.toString())).c().a().d(), t.f12027a, "utf-8");
az.d("LoginPresenter", "response:" + a2);
if (!TextUtils.isEmpty(a2)) {
b.this.d.post(new Runnable() {
@Override
public void run() {
if (b.this.f10264b != null) {
b.this.f10264b.a(true, str, i);
}
}
});
new com.excelliance.kxqp.gs.ui.login.b.b(b.this.f10263a).a(a2, str, i, new com.excelliance.kxqp.gs.listener.c<String>() {
@Override
public void a(String str2, Object... objArr) {
cg.a(b.this.f10263a, "发送成功!");
}
@Override
public void a2(String str2, Object... objArr) {
cg.a(b.this.f10263a, str2);
}
});
} else {
cg.a(b.this.f10263a, w.e(b.this.f10263a, "user_get_indentify_code_failed"));
Log.d("LoginPresenter", "response is null");
b.this.d.post(new Runnable() {
@Override
public void run() {
if (b.this.f10264b != null) {
b.this.f10264b.a(false, str, i);
}
}
});
}
}
});
}
}
@Override
public void c() {
this.c.getLooper().quit();
this.f10264b = null;
this.f10263a = null;
}
public void a(final String str, JSONObject jSONObject, int i) {
final String str2;
try {
jSONObject.put("login_type", i);
} catch (JSONException e) {
e.printStackTrace();
}
az.d("LoginPresenter", "request:" + jSONObject.toString());
String a2 = com.excelliance.kxqp.gs.util.c.a(jSONObject.toString());
az.d("LoginPresenter", "encrypt request:" + a2);
this.d.post(new Runnable() {
@Override
public void run() {
if (b.this.f10264b != null) {
b.this.f10264b.c();
}
}
});
String c = bd.c("https://sdk.ourplay.com.cn/account/login.php", a2);
az.d("LoginPresenter", "response:" + c);
if (!TextUtils.isEmpty(c)) {
try {
str2 = com.excelliance.kxqp.gs.util.c.a(c, t.f12027a);
} catch (Exception e2) {
az.d("LoginPresenter", "ex:" + e2.getMessage());
str2 = "";
}
Log.d("LoginPresenter", "decrypt = " + str2);
this.d.post(new Runnable() {
@Override
public void run() {
if (b.this.f10264b != null) {
b.this.f10264b.f();
b.this.e.update(str2, str, "", new com.excelliance.kxqp.gs.listener.c<Object>() {
@Override
public void a(Object obj, Object... objArr) {
StatisticsGS.getInstance().uploadUserAction(b.this.f10263a, StatisticsBase.UA_ACCOUNT_LOGIN, 1, 1);
g.a().b(b.this.f10263a);
aq.a().g(b.this.f10263a);
cg.a(b.this.f10263a, w.e(b.this.f10263a, "login_success"));
b.this.f10264b.a(true, TextUtils.isEmpty(obj.toString()));
}
@Override
public void a(String str3, Object... objArr) {
cg.a(b.this.f10263a, str3);
b.this.f10264b.a(false, false);
}
});
}
}
});
return;
}
a(w.e(this.f10263a, "server_exception"));
this.d.post(new Runnable() {
@Override
public void run() {
if (b.this.f10264b != null) {
b.this.f10264b.f();
b.this.f10264b.a(false, false);
}
}
});
}
}