酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319
以下内容为反编译后的 aa.java 源代码,内容仅作参考
package com.kugou.common.userCenter.protocol;
import android.text.TextUtils;
import android.text.format.Time;
import c.a.a.i;
import c.c.o;
import c.c.u;
import c.f;
import c.s;
import c.t;
import com.kugou.common.app.KGCommonApplication;
import com.kugou.common.config.c;
import com.kugou.common.network.v;
import com.kugou.common.userCenter.w;
import com.kugou.common.useraccount.utils.h;
import com.kugou.common.utils.as;
import com.kugou.common.utils.bq;
import com.kugou.common.utils.br;
import com.qq.e.comm.constants.Constants;
import com.tencent.open.SocialOperation;
import com.tencent.stat.DeviceInfo;
import com.wandoujia.upgradesdk.UpgradeManager;
import d.ab;
import d.z;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.Map;
import javax.annotation.Nullable;
import org.json.JSONArray;
import org.json.JSONObject;
public class aa {
public interface a {
@o
c.b<w> a(@u Map<String, String> map, @c.c.a z zVar);
}
public w a(String str, int i) {
w wVar = new w(str, i);
a aVar = (a) new t.a().b("SearchFriendProtocolV2").a(new b(wVar)).a(com.kugou.common.network.w.a(com.kugou.android.app.a.a.Ik, "http://extsearch.service.kugou.com/v2/user_search")).a(i.a()).b().a(a.class);
Map<String, String> a2 = a();
String a3 = a(bq.a(a2.get("clienttime"), 0), str, i);
a2.put(SocialOperation.GAME_SIGNATURE, com.kugou.common.network.w.a(br.aB(), a2, a3));
try {
s<w> a4 = aVar.a(a2, z.a(d.u.a("application/json"), a3)).a();
wVar.f = a4.a();
if (a4.c() && a4.d() != null) {
return a4.d();
}
} catch (Exception e2) {
e2.printStackTrace();
}
return wVar;
}
private static String a(long j, String str, int i) {
JSONObject jSONObject = new JSONObject();
try {
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("clienttime", j);
jSONObject2.put(UpgradeManager.PARAM_TOKEN, com.kugou.common.environment.a.j());
String a2 = h.a(jSONObject2.toString(), c.a().b(com.kugou.common.config.a.lq));
jSONObject.put("userid", com.kugou.common.environment.a.Y());
jSONObject.put("query", str);
jSONObject.put(Constants.PORTRAIT, a2);
return jSONObject.toString();
} catch (Exception e2) {
as.e(e2);
return "";
}
}
public static Map<String, String> a() {
String b2 = c.a().b(com.kugou.android.app.a.a.lo);
String valueOf = String.valueOf(br.F(KGCommonApplication.getContext()));
String j = br.j(KGCommonApplication.getContext());
Time time = new Time();
time.setToNow();
String valueOf2 = String.valueOf(time.toMillis(false) / 1000);
return v.a().a("appid", b2).a("clienttime", valueOf2).a("clientver", valueOf).a("dfid", com.kugou.common.q.b.a().cQ()).a(DeviceInfo.TAG_MID, j).a("uuid", com.kugou.common.q.b.a().ak()).a("plat", "1").b();
}
public static class b extends f.a {
w f52353a;
public b(w wVar) {
this.f52353a = wVar;
}
@Override
@Nullable
public f<ab, w> a(Type type, Annotation[] annotationArr, t tVar) {
return new f<ab, w>() {
@Override
@Nullable
public w a(ab abVar) throws IOException {
String f = abVar.f();
if (f != null) {
try {
JSONObject jSONObject = new JSONObject(f);
b.this.f52353a.g = jSONObject.optInt("error_code");
if (jSONObject.getInt("status") == 1) {
JSONObject jSONObject2 = jSONObject.getJSONObject("data");
b.this.f52353a.a(jSONObject2.getInt("is_end") == 0);
b.this.f52353a.b(jSONObject2.optInt("mobile_limit") == 1);
JSONArray optJSONArray = jSONObject2.optJSONArray("infos");
if (optJSONArray != null && optJSONArray.length() > 0) {
int length = optJSONArray.length();
for (int i = 0; i < length; i++) {
com.kugou.common.userCenter.v vVar = new com.kugou.common.userCenter.v();
JSONObject jSONObject3 = optJSONArray.getJSONObject(i);
vVar.a(jSONObject3.getLong("userid"));
vVar.a(jSONObject3.getString("pic"));
vVar.a(jSONObject3.optInt("search_type", -1));
JSONArray optJSONArray2 = jSONObject3.optJSONArray("values");
if (optJSONArray2 != null && optJSONArray2.length() > 0) {
int length2 = optJSONArray2.length();
for (int i2 = 0; i2 < length2; i2++) {
int optInt = optJSONArray2.getJSONObject(i2).optInt("type");
String optString = optJSONArray2.getJSONObject(i2).optString("value");
if (!TextUtils.isEmpty(optString)) {
vVar.a(optInt, optString);
}
}
}
b.this.f52353a.a(vVar);
}
}
b.this.f52353a.a(1);
} else if (jSONObject.getInt("error_code") == 20010) {
b.this.f52353a.a(1);
b.this.f52353a.b(0);
}
} catch (Exception e2) {
if (as.c()) {
as.e(e2);
}
}
}
return b.this.f52353a;
}
};
}
}
}