酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.kugou.android.app.channeldecor.b;
import android.text.TextUtils;
import c.a.a.i;
import c.c.f;
import c.c.u;
import c.t;
import com.huawei.hms.push.constant.RemoteMessageConst;
import com.kugou.android.app.channeldecor.entity.ChannelDecorInfo;
import com.kugou.android.app.home.channel.entity.h;
import com.kugou.android.app.home.channel.f.c;
import com.kugou.android.app.home.channel.f.d;
import com.kugou.common.musicfees.mediastore.entity.CExtraInfo;
import com.kugou.common.network.w;
import com.kugou.framework.database.contribution.entity.ContributionEntity;
import com.kugou.framework.netmusic.topic.TopicEntity;
import com.tencent.connect.common.Constants;
import d.ab;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;
import rx.e;
public class a {
public interface InterfaceC0090a {
@f
e<ab> a(@u Map<String, String> map);
}
public static e<h<ChannelDecorInfo>> a() {
if (com.kugou.common.environment.a.Z()) {
return e.a((Throwable) new c("not login"));
}
InterfaceC0090a interfaceC0090a = (InterfaceC0090a) new t.a().b("ChannelTodayFeatured").a(i.a()).a(w.a(com.kugou.android.app.a.a.xf, "https://youth.kugou.com/v1/channel_dress/get_channel_dress_info")).a(c.b.a.a.a()).a().b().a(InterfaceC0090a.class);
HashMap hashMap = new HashMap(12);
w.b(hashMap, "");
return interfaceC0090a.a(hashMap).c(new rx.b.e<ab, e<h<ChannelDecorInfo>>>() {
@Override
public e<h<ChannelDecorInfo>> call(ab abVar) {
String str;
try {
str = abVar.f();
try {
JSONObject jSONObject = new JSONObject(str);
h hVar = new h();
JSONObject optJSONObject = jSONObject.optJSONObject("data");
hVar.a(jSONObject.optInt("status"));
hVar.b(jSONObject.optInt("error_code"));
if (optJSONObject != null) {
ChannelDecorInfo channelDecorInfo = new ChannelDecorInfo();
JSONObject optJSONObject2 = optJSONObject.optJSONObject("channel_info");
if (optJSONObject2 != null) {
int optInt = optJSONObject2.optInt("channel_style", 1);
if (optInt == 0) {
optInt = 1;
}
channelDecorInfo.b(optJSONObject2.optString("channel_name"));
channelDecorInfo.a(optJSONObject2.optString("global_collection_id"));
channelDecorInfo.c(optJSONObject2.optString("channel_cover"));
channelDecorInfo.a(optJSONObject2.optLong("userid"));
channelDecorInfo.a(optInt);
JSONObject optJSONObject3 = optJSONObject.optJSONObject("post_info");
if (optJSONObject3 != null) {
ContributionEntity a2 = ContributionEntity.a(optJSONObject3);
if (!TextUtils.isEmpty(a2.l)) {
channelDecorInfo.a(a2);
}
if (a2.f57766e != null) {
a2.f57766e.a(CExtraInfo.b(Constants.VIA_REPORT_TYPE_JOININ_GROUP));
}
}
JSONArray optJSONArray = optJSONObject.optJSONArray("topic_list");
if (optJSONArray != null && optJSONArray.length() > 0) {
ArrayList arrayList = new ArrayList();
for (int i = 0; i < optJSONArray.length(); i++) {
JSONObject jSONObject2 = optJSONArray.getJSONObject(i);
if (jSONObject2 != null) {
TopicEntity topicEntity = new TopicEntity();
topicEntity.a(jSONObject2.optInt("topic_id"));
topicEntity.a(jSONObject2.optString("topic_name"));
topicEntity.b(jSONObject2.optString("add_time"));
topicEntity.d(jSONObject2.optString(RemoteMessageConst.Notification.ICON));
topicEntity.c(jSONObject2.optString("brief"));
topicEntity.b(jSONObject2.optInt("type"));
if (topicEntity.getId() > 0) {
arrayList.add(topicEntity);
}
}
}
channelDecorInfo.a(arrayList);
}
JSONArray optJSONArray2 = optJSONObject.optJSONArray("post_list");
if (optJSONArray2 != null && optJSONArray2.length() > 0) {
ArrayList arrayList2 = new ArrayList();
for (int i2 = 0; i2 < optJSONArray2.length(); i2++) {
JSONObject jSONObject3 = optJSONArray2.getJSONObject(i2);
if (jSONObject3 != null) {
ContributionEntity a3 = ContributionEntity.a(jSONObject3);
a3.l = jSONObject3.optString("title");
if (!TextUtils.isEmpty(a3.l)) {
arrayList2.add(a3);
}
}
}
channelDecorInfo.b(arrayList2);
}
JSONObject optJSONObject4 = optJSONObject.optJSONObject("special_info");
if (optJSONObject4 != null) {
com.kugou.android.netmusic.bills.classfication.entity.e fromJsonObject = com.kugou.android.netmusic.bills.classfication.entity.e.fromJsonObject(optJSONObject4);
JSONArray optJSONArray3 = optJSONObject4.optJSONArray("song_list");
if (optJSONArray3 != null && optJSONArray3.length() > 0) {
fromJsonObject.songSongList = new ArrayList();
for (int i3 = 0; i3 < optJSONArray3.length(); i3++) {
JSONObject optJSONObject5 = optJSONArray3.optJSONObject(i3);
String optString = optJSONObject5.optString("song_name");
String optString2 = optJSONObject5.optString("singer_name");
if (!TextUtils.isEmpty(optString) && !TextUtils.isEmpty(optString2)) {
fromJsonObject.songSongList.add(String.format("%s - %s", optString, optString2));
}
}
}
channelDecorInfo.a(fromJsonObject);
}
}
hVar.a((h) channelDecorInfo);
}
if (hVar.c() == 0) {
return e.a((Throwable) new d(hVar.d()));
}
return e.a(hVar);
} catch (Exception unused) {
return e.a((Throwable) new c(str));
}
} catch (Exception unused2) {
str = null;
}
}
});
}
}