酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319
以下内容为反编译后的 e.java 源代码,内容仅作参考
package com.kugou.android.app.home.channel.protocol;
import c.a.a.i;
import c.t;
import com.kugou.android.app.home.channel.entity.ChannelListResponse;
import com.kugou.android.app.home.channel.f.c;
import com.kugou.android.app.home.channel.f.d;
import com.kugou.android.app.home.channel.utils.b;
import com.kugou.common.config.ConfigKey;
import com.kugou.common.network.w;
import com.kugou.common.utils.ag;
import com.kugou.common.utils.as;
import com.kugou.common.utils.cz;
import com.kugou.framework.database.channel.entity.ChannelEntity;
import com.tencent.connect.common.Constants;
import d.ab;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import org.apache.commons.codec.net.StringEncodings;
import org.apache.http.HttpEntity;
import org.apache.http.entity.StringEntity;
import org.json.JSONArray;
import org.json.JSONObject;
public class e {
public static rx.e<ChannelListResponse> a(int i, int i2, int i3, String str) {
return a(false, 0L, i, i2, i3, str);
}
public static rx.e<ChannelListResponse> a(boolean z, long j, final int i, final int i2, int i3, String str) {
a aVar = new a(z, j, i, i2, i3, str);
String[] a2 = w.a(aVar.b(), aVar.j());
t b2 = new t.a().b(aVar.getRequestModuleName()).a(a2).a(c.b.a.a.a()).a(i.a()).a().b();
if (as.f54365e) {
for (String str2 : a2) {
as.f("ChannelAllListProtocol", String.format("url:%s", str2));
}
}
aVar.getGetRequestParams();
return ((bi) b2.a(bi.class)).a(aVar.d()).c(new rx.b.e<ab, rx.e<ChannelListResponse>>() {
@Override
public rx.e<ChannelListResponse> call(ab abVar) {
final String str3;
try {
str3 = abVar.f();
try {
return e.a(str3, new Runnable() {
@Override
public void run() {
if (i == 1 && i2 == 1) {
ag.b(str3, "Channel", "main-page-mine-channel");
}
}
});
} catch (Exception unused) {
return rx.e.a((Throwable) new c(str3));
}
} catch (Exception unused2) {
str3 = null;
}
}
});
}
public static rx.e<ChannelListResponse> a(String str, Runnable runnable) {
try {
as.f("lzq-young", str);
JSONObject jSONObject = new JSONObject(str);
int optInt = jSONObject.optInt("status");
int optInt2 = jSONObject.optInt("error_code");
ChannelListResponse channelListResponse = new ChannelListResponse();
channelListResponse.a(optInt);
channelListResponse.b(optInt2);
if (optInt == 1) {
ArrayList arrayList = new ArrayList();
JSONObject optJSONObject = jSONObject.optJSONObject("data");
if (optJSONObject != null) {
optJSONObject.optInt("total_ver");
optJSONObject.optLong("userid");
int optInt3 = optJSONObject.optInt("list_count");
int optInt4 = optJSONObject.optInt("is_end", 1);
JSONArray optJSONArray = optJSONObject.optJSONArray("info");
if (optJSONArray != null) {
for (int i = 0; i < optJSONArray.length(); i++) {
ChannelEntity c2 = b.c(optJSONArray.getJSONObject(i));
if (c2 != null) {
arrayList.add(c2);
}
}
}
if (cz.a(arrayList) && runnable != null) {
runnable.run();
}
channelListResponse.d(optInt3);
channelListResponse.e(optInt4);
channelListResponse.a(arrayList);
}
return rx.e.a(channelListResponse);
}
return rx.e.a((Throwable) new d(optInt2));
} catch (Exception unused) {
return rx.e.a((Throwable) new c(str));
}
}
public static class a extends ah {
private boolean f11514a;
private int f11515d;
private int f;
private int g;
private long h;
private String i;
@Override
public String getRequestModuleName() {
return "ChannelAllListRequestPackage";
}
@Override
public String getRequestType() {
return Constants.HTTP_GET;
}
a(boolean z, long j, int i, int i2, int i3, String str) {
this.f11514a = z;
if (z) {
this.h = j;
}
this.f11515d = i;
this.f = i2;
this.i = str;
this.g = i3;
}
@Override
public ConfigKey b() {
if (this.f11514a) {
return com.kugou.android.app.a.a.dv;
}
return com.kugou.android.app.a.a.ds;
}
public String j() {
return this.f11514a ? "https://gateway.kugou.com/youth/v2/channel/channel_all_list_other" : "https://gateway.kugou.com/youth/v2/channel/channel_all_list";
}
@Override
public void ab_() {
if (this.f11514a) {
com.kugou.common.userinfo.entity.c h = com.kugou.common.environment.a.h();
if (com.kugou.common.environment.a.u() && h.f54229a > 0) {
this.l.put("looker", Long.valueOf(h.f54229a));
}
this.l.put("userid", Long.valueOf(this.h));
}
this.l.put("new_version", this.i);
this.l.put("type", Integer.valueOf(this.f11515d));
this.l.put("page", Integer.valueOf(this.f));
this.l.put("pagesize", Integer.valueOf(this.g));
}
@Override
public HttpEntity getPostRequestEntity() {
try {
return new StringEntity(this.f11426e, StringEncodings.UTF8);
} catch (UnsupportedEncodingException e2) {
as.e(e2);
return null;
}
}
}
}