OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 CCVerifyCodeService.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.ui.conncode;
import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.util.Log;
import com.excelliance.kxqp.gs.bean.ResponseResult;
import com.excelliance.kxqp.gs.ui.conncode.e;
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.cn;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
public class CCVerifyCodeService extends IntentService {
public static final Map<String, Boolean> f8839a = new HashMap();
private e f8840b;
public CCVerifyCodeService() {
super("com.excelliance.kxqp.gs.ui.conncode.CCVerifyCodeService");
}
@Override
public void onStart(Intent intent, int i) {
super.onStart(intent, i);
Log.d("PollCCVerifyCode", "onStart: ");
a();
}
@Override
protected void onHandleIntent(Intent intent) {
Log.d("PollCCVerifyCode", "onHandleIntent: ");
if (TextUtils.equals(intent.getAction(), "com.excelliance.kxqp.gs.ui.conncode.CCVerifyCodeService.verify.code")) {
String stringExtra = intent.getStringExtra("phoneNumber");
if (!TextUtils.isEmpty(stringExtra)) {
f8839a.put(stringExtra, true);
a(stringExtra, 20);
} else {
a("", false);
}
}
}
private void a() {
synchronized (this) {
this.f8840b = null;
f8839a.clear();
}
}
private void a(String str, int i) {
az.d("PollCCVerifyCode", "pollVerifyCode pollCount:" + i);
Boolean bool = f8839a.get(str);
if (i <= 0 || bool == null || !bool.booleanValue()) {
return;
}
if (this.f8840b == null) {
ResponseResult<e> a2 = a(getApplicationContext());
if (a2 == null || a2.code != 1) {
a(str, i - 1);
return;
}
this.f8840b = a2.data;
}
if (this.f8840b == null) {
a(str, i - 1);
return;
}
List<e.a> a3 = this.f8840b.a();
if (a3 == null || a3.size() == 0) {
a("", false);
return;
}
e.a aVar = null;
Iterator<e.a> it = a3.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
e.a next = it.next();
if (next != null && TextUtils.equals(next.c(), str)) {
aVar = next;
break;
}
}
if (aVar == null) {
a("", false);
return;
}
JSONObject i2 = cn.i(getApplicationContext());
try {
i2.put("token", aVar.b());
i2.put("number", aVar.c());
} catch (JSONException e) {
e.printStackTrace();
}
az.d("PollCCVerifyCode", "pollVerifyCode request:" + i2.toString());
az.d("PollCCVerifyCode", "pollVerifyCode encrypt request:" + cn.b(i2.toString()));
if (i < 20) {
try {
Thread.sleep(3000L);
} catch (InterruptedException e2) {
e2.printStackTrace();
}
}
String a4 = bd.a("https://sdk.ourplay.com.cn/acc/ggpoll.php", i2.toString());
az.d("PollCCVerifyCode", "pollVerifyCode response:" + a4);
String a5 = cn.a(a4);
az.d("PollCCVerifyCode", "pollVerifyCode decrypt response:" + a5);
if (TextUtils.isEmpty(a5)) {
a(str, i - 1);
return;
}
ResponseResult<h> b2 = h.b(a5);
if (b2 == null || b2.code != 1) {
a(str, i - 1);
return;
}
h hVar = b2.data;
if (hVar == null || TextUtils.isEmpty(hVar.a())) {
a(str, i - 1);
return;
}
az.d("PollCCVerifyCode", "pollVerifyCode verifyCode:" + hVar);
a(hVar.a(), true);
}
private void a(String str, boolean z) {
String b2 = b(str, z);
Intent intent = new Intent("com.exce.wvRECEIVE_REGISTER_IDENTIFY_CODE");
intent.putExtra("identify_code", b2);
getApplicationContext().sendBroadcast(intent);
}
private String b(String str, boolean z) {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("identify_code", str);
jSONObject.put("usable", z);
} catch (JSONException e) {
e.printStackTrace();
}
return jSONObject.toString();
}
public static ResponseResult<e> a(Context context) {
JSONObject i = cn.i(context);
try {
i.put("account", bx.a().a(context));
i.put("gc", 2);
} catch (JSONException e) {
e.printStackTrace();
}
az.d("PollCCVerifyCode", "getConnNumber request:" + i.toString());
az.d("PollCCVerifyCode", "getConnNumber encrypt request:" + cn.b(i.toString()));
String a2 = bd.a("https://sdk.ourplay.com.cn/acc/ggcode.php", i.toString());
az.d("PollCCVerifyCode", "getConnNumber response:" + a2);
String a3 = cn.a(a2);
az.d("PollCCVerifyCode", "getConnNumber decrypt response:" + a3);
if (TextUtils.isEmpty(a3)) {
ResponseResult<e> responseResult = new ResponseResult<>();
responseResult.code = 0;
responseResult.msg = "server error";
return responseResult;
}
return e.b(a3);
}
}