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

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


package com.kugou.android.app.youngpush.protocol;

import android.support.v4.app.NotificationCompat;
import c.t;
import com.kugou.android.app.a.a;
import com.kugou.android.app.home.channel.f.d;
import com.kugou.android.app.home.channel.protocol.bi;
import com.kugou.android.common.entity.KGSong;
import com.kugou.common.app.KGCommonApplication;
import com.kugou.common.config.c;
import com.kugou.common.network.w;
import com.kugou.common.utils.as;
import com.kugou.common.utils.br;
import com.qq.e.comm.managers.plugin.PM;
import com.tencent.stat.DeviceInfo;
import com.tencent.tinker.android.dx.instruction.Opcodes;
import d.ab;
import d.u;
import d.z;
import java.util.LinkedHashMap;
import java.util.Map;
import kotlin.Metadata;
import kotlin.collections.x;
import kotlin.jvm.internal.g;
import kotlin.jvm.internal.i;
import kotlin.p;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.json.JSONArray;
import org.json.JSONObject;
import rx.e;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\bÆ\u0002\u0018\u00002\u00020\u0001:\u0001\u0013B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0014\u0010\t\u001a\b\u0012\u0004\u0012\u00020\u000b0\n2\u0006\u0010\f\u001a\u00020\u0004J\u0010\u0010\r\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u0010H\u0002J\u0016\u0010\u0011\u001a\b\u0012\u0004\u0012\u00020\u000b0\n2\b\u0010\u0012\u001a\u0004\u0018\u00010\u0004R\u0011\u0010\u0003\u001a\u00020\u00048F¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006R\u0014\u0010\u0007\u001a\u00020\u00048BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\b\u0010\u0006¨\u0006\u0014"}, d2 = {"Lcom/kugou/android/app/youngpush/protocol/ChannelRecommendSongByLabelProtocol;", "", "()V", "cacheKey", "", "getCacheKey", "()Ljava/lang/String;", "moduleName", "getModuleName", "getSong", "Lrx/Observable;", "Lcom/kugou/android/app/youngpush/protocol/ChannelRecommendSongByLabelProtocol$SongResponseBody;", "songId", "parseToKGSong", "Lcom/kugou/android/common/entity/KGSong;", "info", "Lorg/json/JSONObject;", "string2Response", "jsonString", "SongResponseBody", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
public final class ChannelRecommendSongByLabelProtocol {

    public static final ChannelRecommendSongByLabelProtocol f21173a = new ChannelRecommendSongByLabelProtocol();

    private final String a() {
        return "CommmonGetSongId";
    }

    private ChannelRecommendSongByLabelProtocol() {
    }

    @NotNull
    public final e<SongResponseBody> a(@NotNull String str) {
        i.b(str, "songId");
        t b2 = new t.a().b(a()).a(c.a.a.i.a()).a(w.a(a.th, "http://openapi.kugou.com/kmr/v1/audio")).a(c.b.a.a.a()).a().b();
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.put("appid", String.valueOf(c.a().d(a.lo)));
        linkedHashMap.put("clientver", String.valueOf(br.F(KGCommonApplication.getContext())));
        linkedHashMap.put("clienttime", String.valueOf(br.d() / 1000));
        String j = br.j(KGCommonApplication.getContext());
        i.a((Object) j, "SystemUtils.getMid(KGCom…Application.getContext())");
        linkedHashMap.put(DeviceInfo.TAG_MID, j);
        com.kugou.common.q.b a2 = com.kugou.common.q.b.a();
        i.a((Object) a2, "CommonSettingPrefs.getInstance()");
        String cS = a2.cS();
        i.a((Object) cS, "CommonSettingPrefs.getIn…deviceFingerIdDateNotNull");
        linkedHashMap.put("dfid", cS);
        com.kugou.common.q.b a3 = com.kugou.common.q.b.a();
        i.a((Object) a3, "CommonSettingPrefs.getInstance()");
        String ak = a3.ak();
        i.a((Object) ak, "CommonSettingPrefs.getInstance().uuid");
        linkedHashMap.put("uuid", ak);
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("fields", "base,audio_info");
        JSONObject jSONObject2 = new JSONObject();
        jSONObject2.put("entity_id", str);
        JSONArray jSONArray = new JSONArray();
        jSONArray.put(jSONObject2);
        jSONObject.put("data", jSONArray);
        Map<String, Object> a4 = x.a(p.a("KG-TID", Integer.valueOf(Opcodes.SHL_LONG)));
        String jSONObject3 = jSONObject.toString();
        i.a((Object) jSONObject3, "body.toString()");
        Map<String, String> b3 = w.b(linkedHashMap, jSONObject3);
        i.a((Object) b3, "Utils.generateCommon(params, bodyStr)");
        e c2 = ((bi) b2.a(bi.class)).a(a4, b3, z.a(u.a("application/json"), jSONObject3)).c(b.f21177a);
        i.a((Object) c2, "request\n            .cre…         }\n            })");
        return c2;
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0014\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u0016\u0012\u0004\u0012\u00020\u0002 \u0003*\n\u0012\u0004\u0012\u00020\u0002\u0018\u00010\u00010\u00012\u000e\u0010\u0004\u001a\n \u0003*\u0004\u0018\u00010\u00050\u0005H\n¢\u0006\u0002\b\u0006"}, d2 = {"<anonymous>", "Lrx/Observable;", "Lcom/kugou/android/app/youngpush/protocol/ChannelRecommendSongByLabelProtocol$SongResponseBody;", "kotlin.jvm.PlatformType", "responseBody", "Lokhttp3/ResponseBody;", NotificationCompat.CATEGORY_CALL}, k = 3, mv = {1, 1, 15})
    static final class b<T, R> implements rx.b.e<ab, e<SongResponseBody>> {

        public static final b f21177a = new b();

        b() {
        }

        @Override
        public final e<SongResponseBody> call(ab abVar) {
            String str = (String) null;
            try {
                str = abVar.f();
                return ChannelRecommendSongByLabelProtocol.f21173a.b(str);
            } catch (Exception unused) {
                return e.a((Throwable) new com.kugou.android.app.home.channel.f.c(str));
            }
        }
    }

    @NotNull
    public final e<SongResponseBody> b(@Nullable String str) {
        try {
            as.f("lzq-young", str);
            JSONObject jSONObject = new JSONObject(str);
            int optInt = jSONObject.optInt("status");
            int optInt2 = jSONObject.optInt("error_code");
            SongResponseBody songResponseBody = new SongResponseBody(optInt, optInt2, null, 4, null);
            if (optInt == 1) {
                JSONObject optJSONObject = jSONObject.optJSONObject("data");
                i.a((Object) optJSONObject, "data");
                songResponseBody.a(a(optJSONObject));
                e<SongResponseBody> a2 = e.a(songResponseBody);
                i.a((Object) a2, "Observable.just(response)");
                return a2;
            }
            e<SongResponseBody> a3 = e.a((Throwable) new d(optInt2));
            i.a((Object) a3, "Observable.error(Channel…nseException(error_code))");
            return a3;
        } catch (Exception unused) {
            e<SongResponseBody> a4 = e.a((Throwable) new com.kugou.android.app.home.channel.f.c(str));
            i.a((Object) a4, "Observable.error(Channel…rseException(jsonString))");
            return a4;
        }
    }

    private final KGSong a(JSONObject jSONObject) {
        KGSong kGSong = new KGSong("推送");
        JSONObject optJSONObject = jSONObject.optJSONObject(PM.BASE);
        kGSong.i(optJSONObject.optString("album_name"));
        kGSong.j(optJSONObject.optString("author_name"));
        kGSong.l(optJSONObject.optLong("audio_id"));
        kGSong.Z(optJSONObject.optString("publish_date"));
        kGSong.f(optJSONObject.optInt("album_id"));
        kGSong.l(optJSONObject.optString("songname") + " - " + optJSONObject.optString("author_name"));
        JSONObject optJSONObject2 = jSONObject.optJSONObject("audio_info");
        kGSong.e(optJSONObject2.optString("hash"));
        kGSong.l(optJSONObject2.optInt("bitrate"));
        kGSong.w(optJSONObject2.optInt("filesize_320"));
        kGSong.w(optJSONObject2.optString("hash_320"));
        kGSong.p(optJSONObject2.optString("extnamme"));
        return kGSong;
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\r\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0000\b\u0086\b\u0018\u00002\u00020\u0001B!\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0003\u0012\n\b\u0002\u0010\u0005\u001a\u0004\u0018\u00010\u0006¢\u0006\u0002\u0010\u0007J\t\u0010\u000f\u001a\u00020\u0003HÆ\u0003J\t\u0010\u0010\u001a\u00020\u0003HÆ\u0003J\u000b\u0010\u0011\u001a\u0004\u0018\u00010\u0006HÆ\u0003J)\u0010\u0012\u001a\u00020\u00002\b\b\u0002\u0010\u0002\u001a\u00020\u00032\b\b\u0002\u0010\u0004\u001a\u00020\u00032\n\b\u0002\u0010\u0005\u001a\u0004\u0018\u00010\u0006HÆ\u0001J\u0013\u0010\u0013\u001a\u00020\u00142\b\u0010\u0015\u001a\u0004\u0018\u00010\u0001HÖ\u0003J\t\u0010\u0016\u001a\u00020\u0003HÖ\u0001J\t\u0010\u0017\u001a\u00020\u0018HÖ\u0001R\u001c\u0010\u0005\u001a\u0004\u0018\u00010\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\b\u0010\t\"\u0004\b\n\u0010\u000bR\u0011\u0010\u0004\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\f\u0010\rR\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u000e\u0010\r¨\u0006\u0019"}, d2 = {"Lcom/kugou/android/app/youngpush/protocol/ChannelRecommendSongByLabelProtocol$SongResponseBody;", "", "status", "", "error_code", "data", "Lcom/kugou/android/common/entity/KGSong;", "(IILcom/kugou/android/common/entity/KGSong;)V", "getData", "()Lcom/kugou/android/common/entity/KGSong;", "setData", "(Lcom/kugou/android/common/entity/KGSong;)V", "getError_code", "()I", "getStatus", "component1", "component2", "component3", "copy", "equals", "", "other", "hashCode", "toString", "", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
    public static final class SongResponseBody {

        private final int status;

        private final int error_code;

        @Nullable
        private KGSong data;

        public boolean equals(@Nullable Object other) {
            if (this != other) {
                if (other instanceof SongResponseBody) {
                    SongResponseBody songResponseBody = (SongResponseBody) other;
                    if (this.status == songResponseBody.status) {
                        if (!(this.error_code == songResponseBody.error_code) || !i.a(this.data, songResponseBody.data)) {
                        }
                    }
                }
                return false;
            }
            return true;
        }

        public int hashCode() {
            int hashCode;
            int hashCode2;
            hashCode = Integer.valueOf(this.status).hashCode();
            hashCode2 = Integer.valueOf(this.error_code).hashCode();
            int i = ((hashCode * 31) + hashCode2) * 31;
            KGSong kGSong = this.data;
            return i + (kGSong != null ? kGSong.hashCode() : 0);
        }

        @NotNull
        public String toString() {
            return "SongResponseBody(status=" + this.status + ", error_code=" + this.error_code + ", data=" + this.data + ")";
        }

        public SongResponseBody(int i, int i2, @Nullable KGSong kGSong) {
            this.status = i;
            this.error_code = i2;
            this.data = kGSong;
        }

        public SongResponseBody(int i, int i2, KGSong kGSong, int i3, g gVar) {
            this(i, i2, (i3 & 4) != 0 ? (KGSong) null : kGSong);
        }

        public final int getStatus() {
            return this.status;
        }

        public final void a(@Nullable KGSong kGSong) {
            this.data = kGSong;
        }

        @Nullable
        public final KGSong getData() {
            return this.data;
        }
    }
}