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

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


package com.kugou.android.app.home.channel.protocol;

import android.text.TextUtils;
import c.a.a.i;
import c.t;
import com.kugou.android.app.a.a;
import com.kugou.android.app.home.channel.entity.j;
import com.kugou.common.app.KGCommonApplication;
import com.kugou.common.config.c;
import com.kugou.common.musicfees.mediastore.entity.CExtraInfo;
import com.kugou.common.network.w;
import com.kugou.common.q.b;
import com.kugou.common.utils.as;
import com.kugou.common.utils.br;
import com.kugou.framework.database.contribution.entity.ContributionEntity;
import com.tencent.open.SocialOperation;
import com.tencent.stat.DeviceInfo;
import com.wandoujia.upgradesdk.UpgradeManager;
import d.ab;
import java.util.ArrayList;
import java.util.HashMap;
import org.json.JSONArray;
import org.json.JSONObject;
import rx.e;

public class bx {
    private static String a() {
        return "UserContribution";
    }

    public static e<j> a(String str, String str2, String str3, final int i) {
        t b2 = new t.a().b(a()).a(i.a()).a(w.a(a.sN, "https://youth.kugou.com/api/channel/v1/get_similar_song")).a(c.b.a.a.a()).a().b();
        HashMap hashMap = new HashMap();
        hashMap.put("appid", Integer.valueOf(c.a().d(a.lo)));
        hashMap.put("clientver", Integer.valueOf(br.F(KGCommonApplication.getContext())));
        hashMap.put("clienttime", Long.valueOf(br.d() / 1000));
        hashMap.put(DeviceInfo.TAG_MID, br.j(KGCommonApplication.getContext()));
        hashMap.put("dfid", b.a().cS());
        hashMap.put("uuid", b.a().ak());
        if (com.kugou.common.environment.a.u()) {
            hashMap.put("userid", Long.valueOf(com.kugou.common.environment.a.Y()));
            hashMap.put(UpgradeManager.PARAM_TOKEN, com.kugou.common.environment.a.j());
        }
        hashMap.put("page", Integer.valueOf(i));
        hashMap.put("pagesize", 20);
        if (!TextUtils.isEmpty(str3)) {
            hashMap.put("fileid", str3);
        }
        if (!TextUtils.isEmpty(str)) {
            hashMap.put("mixsongid", str);
        }
        if (!TextUtils.isEmpty(str2)) {
            hashMap.put("audio_id", str2);
        }
        hashMap.put(SocialOperation.GAME_SIGNATURE, w.a(w.c(hashMap)));
        return ((bi) b2.a(bi.class)).a(hashMap).c(new rx.b.e<ab, e<j>>() {
            @Override
            public e<j> call(ab abVar) {
                String str4;
                try {
                    str4 = abVar.f();
                    try {
                        return bx.a(i, str4);
                    } catch (Exception unused) {
                        return e.a((Throwable) new com.kugou.android.app.home.channel.f.c(str4));
                    }
                } catch (Exception unused2) {
                    str4 = null;
                }
            }
        });
    }

    public static e<j> a(int i, String str) {
        try {
            as.f("SongContributionListProtocol", str);
            JSONObject jSONObject = new JSONObject(str);
            int optInt = jSONObject.optInt("status");
            int optInt2 = jSONObject.optInt("error_code");
            j jVar = new j();
            jVar.a(optInt);
            jVar.b(optInt2);
            jVar.a(jSONObject.optString("error_msg"));
            jVar.a(new ArrayList());
            if (optInt == 1) {
                JSONObject optJSONObject = jSONObject.optJSONObject("data");
                ArrayList arrayList = new ArrayList();
                if (optJSONObject != null) {
                    JSONArray optJSONArray = optJSONObject.optJSONArray("list");
                    if (optJSONArray != null) {
                        for (int i2 = 0; i2 < optJSONArray.length(); i2++) {
                            ContributionEntity a2 = ContributionEntity.a(optJSONArray.getJSONObject(i2));
                            if (a2.f57766e != null) {
                                a2.f57766e.bm = 1027;
                                a2.f57766e.z("/关联帖子");
                                a2.f57766e.a(CExtraInfo.a("137", true));
                            }
                            arrayList.add(a2);
                        }
                    }
                    jVar.d(optJSONObject.optInt("total"));
                    jVar.e(optJSONObject.optInt("is_end"));
                }
                jVar.a(arrayList);
                jVar.f(i);
            }
            return e.a(jVar);
        } catch (Exception unused) {
            return e.a((Throwable) new com.kugou.android.app.home.channel.f.c(str));
        }
    }
}