酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319

以下内容为反编译后的 e.java 源代码,内容仅作参考


package com.kugou.android.netmusic.search.protocol;

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.home.channel.entity.h;
import com.kugou.common.network.w;
import com.kugou.common.skinpro.d.b;
import com.kugou.common.skinpro.shadowframe.c;
import com.kugou.common.utils.bq;
import com.kugou.framework.netmusic.topic.TopicEntity;
import d.ab;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;
import rx.schedulers.Schedulers;

public class e {

    public interface a {
        @f
        rx.e<ab> a(@u Map<String, String> map);
    }

    public static rx.e<h<List<TopicEntity>>> a(String str, int i, int i2) {
        if (TextUtils.isEmpty(str)) {
            return rx.e.a((Throwable) new IllegalArgumentException("keyword is empty."));
        }
        a aVar = (a) new t.a().b("ChannelTodayFeatured").a(i.a()).a(w.a(com.kugou.android.app.a.a.gk, "https://youth.kugou.com/v1/search/topic")).a(c.b.a.a.a()).a().b().a(a.class);
        HashMap hashMap = new HashMap(12);
        hashMap.put("keyword", str);
        hashMap.put("page", Integer.toString(i));
        hashMap.put("position", Integer.toString(i2));
        w.b(hashMap, "");
        return aVar.a(hashMap).b(Schedulers.io()).c(new rx.b.e<ab, rx.e<h<List<TopicEntity>>>>() {
            @Override
            public rx.e<h<List<TopicEntity>>> call(ab abVar) {
                String str2;
                JSONArray optJSONArray;
                try {
                    str2 = abVar.f();
                    try {
                        h hVar = new h();
                        JSONObject jSONObject = new JSONObject(str2);
                        int i3 = jSONObject.getInt("status");
                        int optInt = jSONObject.optInt("error_code");
                        String optString = jSONObject.optString("error_msg");
                        hVar.a(i3);
                        hVar.b(optInt);
                        hVar.a(optString);
                        int a2 = b.a().a(c.HEADLINE_TEXT);
                        JSONObject optJSONObject = jSONObject.optJSONObject("data");
                        if (optJSONObject != null && (optJSONArray = optJSONObject.optJSONArray("list")) != null && optJSONArray.length() > 0) {
                            ArrayList arrayList = new ArrayList();
                            for (int i4 = 0; i4 < optJSONArray.length(); i4++) {
                                JSONObject jSONObject2 = optJSONArray.getJSONObject(i4);
                                if (jSONObject2 != null) {
                                    TopicEntity topicEntity = new TopicEntity();
                                    topicEntity.a(jSONObject2.optInt("topic_id"));
                                    topicEntity.a(bq.d("#" + jSONObject2.optString("topic_name"), a2).toString());
                                    topicEntity.d(jSONObject2.optString(RemoteMessageConst.Notification.ICON));
                                    topicEntity.b(jSONObject2.optInt("type"));
                                    topicEntity.c(jSONObject2.optInt("tag_nums"));
                                    if (topicEntity.getId() > 0) {
                                        arrayList.add(topicEntity);
                                    }
                                }
                            }
                            hVar.a((h) arrayList);
                        }
                        return rx.e.a(hVar);
                    } catch (Exception unused) {
                        return rx.e.a((Throwable) new com.kugou.android.app.home.channel.f.c(str2));
                    }
                } catch (Exception unused2) {
                    str2 = null;
                }
            }
        });
    }
}