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

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


package com.kugou.android.netmusic.bills.singer.detail.a;

import android.text.TextUtils;
import c.a.a.i;
import c.f;
import c.t;
import com.kugou.android.common.entity.KGSong;
import com.kugou.common.network.v;
import com.kugou.common.network.w;
import com.kugou.common.utils.as;
import com.kugou.common.utils.br;
import com.kugou.framework.netmusic.bills.a.m;
import com.kugou.framework.scan.ScanUtil;
import d.ab;
import d.u;
import d.z;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class c {
    public static m.f a(String str, String str2, boolean z, long j, int i, int i2, com.kugou.common.base.g.d dVar) {
        c.b<m.f> b2 = b(str, str2, z, j, i, i2, dVar);
        if (b2 != null) {
            try {
                m.f d2 = b2.a().d();
                return d2 == null ? new m.f() : d2;
            } catch (Exception e2) {
                e2.printStackTrace();
                return new m.f();
            }
        }
        return new m.f();
    }

    public static c.b<m.f> b(String str, String str2, boolean z, long j, int i, int i2, com.kugou.common.base.g.d dVar) {
        String str3;
        d dVar2 = (d) new t.a().b("singer_song_stick").a(new a(str, str2)).a(i.a()).a(w.a(com.kugou.android.app.a.a.f4153e, "http://openapi.kugou.com/kmr/v1/audio_group/author")).a().b().a(d.class);
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("area_code", com.kugou.common.environment.a.ay());
            jSONObject.put("author_id", Long.toString(j));
            jSONObject.put("sort", z ? "1" : "2");
            if (!z) {
                jSONObject.put("fields", "musical");
                jSONObject.put("identity", "3");
            }
            jSONObject.put("page", Integer.toString(i));
            jSONObject.put("pagesize", Integer.toString(Math.min(i2, 50)));
            v.a(jSONObject, dVar);
            str3 = jSONObject.toString();
        } catch (JSONException e2) {
            e2.printStackTrace();
            str3 = "";
        }
        return dVar2.a(w.b(null, str3), z.a(u.a("application/json"), str3));
    }

    public static class a extends f.a {

        private String f33253a;

        private String f33254b;

        public a(String str, String str2) {
            this.f33253a = str;
            this.f33254b = str2;
        }

        @Override
        public c.f<ab, m.f> a(Type type, Annotation[] annotationArr, t tVar) {
            return new c.f<ab, m.f>() {
                @Override
                public m.f a(ab abVar) throws IOException {
                    m.f fVar = new m.f();
                    a.this.a(fVar, abVar.f());
                    return fVar;
                }
            };
        }

        public void a(m.f fVar, String str) {
            if (fVar == null || TextUtils.isEmpty(str)) {
                return;
            }
            try {
                JSONObject jSONObject = new JSONObject(str);
                int optInt = jSONObject.optInt("status", 0);
                fVar.f60167b = jSONObject.optInt("error_code");
                if (optInt != 1) {
                    fVar.f60168c = jSONObject.optString("error_message");
                    return;
                }
                fVar.f60166a = true;
                fVar.f60169d = jSONObject.optInt("total");
                JSONArray optJSONArray = jSONObject.optJSONArray("data");
                if (optJSONArray == null || optJSONArray.length() <= 0) {
                    return;
                }
                fVar.f60170e = new ArrayList<>(optJSONArray.length());
                for (int i = 0; i < optJSONArray.length(); i++) {
                    JSONObject optJSONObject = optJSONArray.optJSONObject(i);
                    if (optJSONObject != null) {
                        KGSong kGSong = new KGSong(this.f33253a);
                        kGSong.j(optJSONObject.optLong("album_audio_id", 0L));
                        kGSong.ae(optJSONObject.optInt("identity", 0));
                        kGSong.f(optJSONObject.optInt("album_id"));
                        kGSong.b(optJSONObject.optString("album_id"));
                        kGSong.l(optJSONObject.optLong("audio_id"));
                        kGSong.j(optJSONObject.optString("author_name"));
                        kGSong.l(optJSONObject.optString("author_name") + " - " + optJSONObject.optString("audio_name"));
                        kGSong.Z(optJSONObject.optString("publish_date"));
                        kGSong.x(kGSong.v());
                        kGSong.o(optJSONObject.optInt("has_obbligato", 0));
                        kGSong.B(optJSONObject.optString("topic"));
                        kGSong.n(optJSONObject.optString("mvhash"));
                        kGSong.C(this.f33254b);
                        kGSong.H(300);
                        kGSong.b(1);
                        kGSong.k(br.d());
                        kGSong.e(optJSONObject.optString("hash"));
                        kGSong.l(optJSONObject.optInt("bitrate"));
                        kGSong.p(optJSONObject.optString("extname"));
                        kGSong.e(optJSONObject.optLong("duration_128"));
                        kGSong.d(optJSONObject.optLong("filesize_128"));
                        kGSong.w(optJSONObject.optString("hash_320"));
                        kGSong.w(optJSONObject.optInt("filesize_320"));
                        kGSong.y(optJSONObject.optString("hash_flac"));
                        kGSong.C(optJSONObject.optInt("filesize_flac"));
                        kGSong.T(optJSONObject.optInt("fail_process_128", 0));
                        kGSong.a(optJSONObject.optInt("privilege_128"), optJSONObject.optInt("privilege_320"), optJSONObject.optInt("privilege_flac"));
                        kGSong.ak(optJSONObject.optInt("privilege"));
                        kGSong.V(optJSONObject.optInt("pay_type"));
                        kGSong.U(optJSONObject.optInt("old_cpy", -1));
                        kGSong.s(optJSONObject.optInt("m4afilesize"));
                        kGSong.F(optJSONObject.optInt("feetype", 0));
                        try {
                            if (optJSONObject.optInt("inlist", 1) == 0) {
                                kGSong.N(-1);
                            } else {
                                kGSong.N(1);
                            }
                        } catch (Exception e2) {
                            e2.printStackTrace();
                        }
                        com.kugou.framework.musicfees.a.i.a(optJSONObject, kGSong);
                        if (as.f54365e) {
                            as.c("cwt log 是否在版权列表中:" + String.valueOf(kGSong.aC()));
                        }
                        fVar.f60170e.add(kGSong);
                    }
                }
                ScanUtil.a((List<KGSong>) fVar.f60170e, false);
            } catch (Exception unused) {
                fVar.f60166a = false;
            }
        }
    }
}