酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319
以下内容为反编译后的 SearchSpecialProtocol.java 源代码,内容仅作参考
package com.kugou.android.topic2.search;
import android.support.v4.app.NotificationCompat;
import android.text.TextUtils;
import c.t;
import com.kugou.android.app.home.channel.protocol.bi;
import com.kugou.android.topic2.detail.base.CommonListResponse;
import com.kugou.common.app.KGCommonApplication;
import com.kugou.common.network.w;
import com.kugou.common.utils.as;
import com.kugou.common.utils.bq;
import com.kugou.common.utils.br;
import d.ab;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import kotlin.Metadata;
import kotlin.collections.h;
import kotlin.jvm.internal.i;
import kotlin.text.f;
import org.jetbrains.annotations.NotNull;
import org.json.JSONArray;
import org.json.JSONObject;
import rx.e;
@Metadata(bv = {1, 0, 3}, d1 = {"\u00006\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0016\u0010\u0007\u001a\b\u0012\u0004\u0012\u00020\t0\b2\u0006\u0010\n\u001a\u00020\u000bH\u0002J\"\u0010\f\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\t0\u000e0\r2\u0006\u0010\u000f\u001a\u00020\u00042\u0006\u0010\u0010\u001a\u00020\u0011R\u0014\u0010\u0003\u001a\u00020\u00048BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006¨\u0006\u0012"}, d2 = {"Lcom/kugou/android/topic2/search/SearchSpecialProtocol;", "", "()V", "moduleName", "", "getModuleName", "()Ljava/lang/String;", "createFromJson", "", "Lcom/kugou/android/netmusic/bills/classfication/entity/SpecialBills;", "jsonObject", "Lorg/json/JSONObject;", "getList", "Lrx/Observable;", "Lcom/kugou/android/topic2/detail/base/CommonListResponse;", "keyword", "curPage", "", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
public final class SearchSpecialProtocol {
public static final SearchSpecialProtocol f42627a = new SearchSpecialProtocol();
private final String a() {
return "search-special";
}
private SearchSpecialProtocol() {
}
@NotNull
public final e<CommonListResponse<com.kugou.android.netmusic.bills.classfication.entity.e>> a(@NotNull String str, int i) {
i.b(str, "keyword");
t b2 = new t.a().b(a()).a(c.a.a.i.a()).a(w.a(com.kugou.android.app.a.a.iH, "http://mobilecdn.kugou.com/api/v3/search/special")).a(c.b.a.a.a()).a().b();
HashMap hashMap = new HashMap();
hashMap.put("page", Integer.valueOf(i));
hashMap.put("keyword", str);
hashMap.put("pagesize", 20);
hashMap.put("sver", 2);
hashMap.put("version", Integer.valueOf(br.F(KGCommonApplication.getContext())));
hashMap.put("highlight", "em");
hashMap.put("filter", "0");
hashMap.put("with_res_tag", "1");
e c2 = ((bi) b2.a(bi.class)).a(hashMap).c(a.f42628a);
i.a((Object) c2, "request.create(IChannelC… }\n })");
return c2;
}
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0018\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a>\u0012\u0018\u0012\u0016\u0012\u0004\u0012\u00020\u0003 \u0004*\n\u0012\u0004\u0012\u00020\u0003\u0018\u00010\u00020\u0002 \u0004*\u001e\u0012\u0018\u0012\u0016\u0012\u0004\u0012\u00020\u0003 \u0004*\n\u0012\u0004\u0012\u00020\u0003\u0018\u00010\u00020\u0002\u0018\u00010\u00010\u00012\u000e\u0010\u0005\u001a\n \u0004*\u0004\u0018\u00010\u00060\u0006H\n¢\u0006\u0002\b\u0007"}, d2 = {"<anonymous>", "Lrx/Observable;", "Lcom/kugou/android/topic2/detail/base/CommonListResponse;", "Lcom/kugou/android/netmusic/bills/classfication/entity/SpecialBills;", "kotlin.jvm.PlatformType", "responseBody", "Lokhttp3/ResponseBody;", NotificationCompat.CATEGORY_CALL}, k = 3, mv = {1, 1, 15})
static final class a<T, R> implements rx.b.e<ab, e<CommonListResponse<com.kugou.android.netmusic.bills.classfication.entity.e>>> {
public static final a f42628a = new a();
a() {
}
@Override
public final e<CommonListResponse<com.kugou.android.netmusic.bills.classfication.entity.e>> call(ab abVar) {
String f;
String str = (String) null;
try {
f = abVar.f();
} catch (Exception e2) {
e = e2;
}
try {
i.a((Object) f, "jsonString");
f = f.a(f, "<!--KG_TAG_RES_START-->", "", false, 4, (Object) null);
String a2 = f.a(f, "<!--KG_TAG_RES_END-->", "", false, 4, (Object) null);
as.f("lzq-young", a2);
JSONObject jSONObject = new JSONObject(a2);
int optInt = jSONObject.optInt("status");
int optInt2 = jSONObject.optInt("error_code");
CommonListResponse commonListResponse = new CommonListResponse(0, null, 0, 0, null, 31, null);
commonListResponse.a(optInt);
commonListResponse.b(optInt2);
int i = 1;
if (optInt == 1) {
commonListResponse.g(jSONObject.optJSONObject("data").getInt("total"));
if (commonListResponse.getTotalCount() != 0) {
i = 0;
}
commonListResponse.a((List) SearchSpecialProtocol.f42627a.a(jSONObject));
commonListResponse.e(i);
return e.a(commonListResponse);
}
return e.a((Throwable) new com.kugou.android.app.home.channel.f.d(optInt2));
} catch (Exception e3) {
str = f;
e = e3;
e.printStackTrace();
return e.a((Throwable) new com.kugou.android.app.home.channel.f.c(str));
}
}
}
public final List<com.kugou.android.netmusic.bills.classfication.entity.e> a(JSONObject jSONObject) {
try {
ArrayList arrayList = new ArrayList(0);
JSONObject jSONObject2 = jSONObject.getJSONObject("data");
if (!jSONObject2.isNull("info")) {
JSONArray jSONArray = jSONObject2.getJSONArray("info");
int length = jSONArray.length();
int a2 = com.kugou.common.skinpro.d.b.a().a(com.kugou.common.skinpro.shadowframe.c.HEADLINE_TEXT);
for (int i = 0; i < length; i++) {
com.kugou.android.netmusic.bills.classfication.entity.e eVar = new com.kugou.android.netmusic.bills.classfication.entity.e();
try {
JSONObject jSONObject3 = jSONArray.getJSONObject(i);
if (jSONObject3 != null && !jSONObject3.isNull("specialname") && !jSONObject3.isNull("specialid")) {
String optString = jSONObject3.optString("specialname", "");
eVar.b(jSONObject3.getInt("specialid"));
eVar.b(bq.s(optString));
eVar.c(jSONObject3.getString("singername"));
eVar.g(jSONObject3.getString("imgurl"));
eVar.d(jSONObject3.getString("intro"));
eVar.e(jSONObject3.getString("publishtime"));
eVar.setUserid(jSONObject3.getLong("suid"));
eVar.d(jSONObject3.getInt("slid"));
Long valueOf = Long.valueOf(jSONObject3.optString("playcount"));
i.a((Object) valueOf, "java.lang.Long.valueOf(d…a.optString(\"playcount\"))");
eVar.a(valueOf.longValue());
eVar.e(jSONObject3.getInt("collectcount"));
eVar.f(jSONObject3.optInt("songcount"));
eVar.g(a2);
eVar.a(jSONObject3.optInt("verified"));
eVar.a(jSONObject3.optString("nickname"));
eVar.setGlobal_collection_id(jSONObject3.optString("gid"));
if (!TextUtils.isEmpty(optString)) {
eVar.a(bq.d(optString, a2));
}
com.kugou.framework.musicfees.a.i.a(jSONObject3, eVar);
arrayList.add(eVar);
}
} catch (Exception unused) {
}
}
}
return arrayList;
} catch (Exception e2) {
as.e(e2);
return h.a();
}
}
}