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

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


package com.kugou.android.splash.e;

import android.text.TextUtils;
import android.util.Base64;
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.KGApplication;
import com.kugou.common.network.w;
import com.kugou.common.utils.ag;
import com.kugou.common.utils.as;
import com.kugou.common.utils.br;
import com.kugou.common.utils.cj;
import com.kugou.common.utils.cz;
import com.qq.e.comm.constants.Constants;
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.JSONException;
import org.json.JSONObject;

public class c {

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

    public static rx.e<List<com.kugou.android.splash.c.a.c>> a() {
        a aVar = (a) new t.a().b("Splash").a(i.a()).a(w.a(com.kugou.android.app.a.a.gr, "https://genesisapi.kugou.com/v1/content/list")).a(c.b.a.a.a()).a().b().a(a.class);
        int h = cj.h(KGApplication.getContext());
        HashMap hashMap = new HashMap(10);
        hashMap.put(Constants.KEYS.BIZ, "youth_start_page");
        hashMap.put("f_plat", "android");
        hashMap.put("page", "1");
        hashMap.put("pagesize", com.tencent.connect.common.Constants.VIA_REPORT_TYPE_SHARE_TO_QQ);
        hashMap.put("f_max_clientver", String.format(">= %s", Integer.valueOf(h)));
        hashMap.put("f_min_clientver", String.format("<= %s", Integer.valueOf(h)));
        w.a(hashMap);
        return aVar.a(hashMap).c(new rx.b.e<ab, rx.e<List<com.kugou.android.splash.c.a.c>>>() {
            @Override
            public rx.e<List<com.kugou.android.splash.c.a.c>> call(ab abVar) {
                try {
                    String f = abVar.f();
                    List<com.kugou.android.splash.c.a.c> a2 = c.a(f);
                    if (as.f54365e) {
                        as.f("user-ep-splash", String.format("content:%s", f));
                    }
                    if (cz.a(a2)) {
                        ag.b(f, "Splash", "boot-splash");
                    }
                    return rx.e.a(a2);
                } catch (Exception e2) {
                    return rx.e.a((Throwable) e2);
                }
            }
        });
    }

    public static List<com.kugou.android.splash.c.a.c> a(String str) {
        JSONObject optJSONObject;
        String str2;
        try {
            int i = 1;
            float f = r0[0] / (br.t(KGApplication.getContext())[1] == 0 ? 1.0f : r0[1]);
            int i2 = 2;
            int[] iArr = new int[2];
            if (Math.abs(f - 0.5625f) > Math.abs(f - 0.46153846f)) {
                iArr[0] = 1080;
                iArr[1] = 2340;
            } else {
                iArr[0] = 720;
                iArr[1] = 1280;
            }
            JSONObject jSONObject = new JSONObject(str);
            if (jSONObject.optInt("status") != 1 || (optJSONObject = jSONObject.optJSONObject("data")) == null) {
                return null;
            }
            JSONArray optJSONArray = optJSONObject.optJSONArray("list");
            if (optJSONArray != null && optJSONArray.length() > 0) {
                ArrayList arrayList = new ArrayList();
                int i3 = 0;
                while (i3 < optJSONArray.length()) {
                    JSONObject jSONObject2 = optJSONArray.getJSONObject(i3);
                    long j = 0;
                    try {
                        j = Long.parseLong(jSONObject2.optString("id"));
                    } catch (NumberFormatException e2) {
                        e2.printStackTrace();
                    }
                    com.kugou.android.splash.c.a.c cVar = new com.kugou.android.splash.c.a.c();
                    cVar.g(i);
                    cVar.e(j);
                    Object[] objArr = new Object[i2];
                    objArr[0] = Integer.valueOf(iArr[0]);
                    objArr[i] = Integer.valueOf(iArr[i]);
                    cVar.j(jSONObject2.optString(String.format("pic_%sx%s", objArr)));
                    cVar.d(jSONObject2.optString("timing_released_at"));
                    cVar.e(jSONObject2.optString("timing_unreleased_at"));
                    cVar.i(jSONObject2.optString("title"));
                    cVar.e(Math.max(5, jSONObject2.optInt("display_duration")));
                    int optInt = jSONObject2.optInt("min_clientver");
                    int optInt2 = jSONObject2.optInt("max_clientver");
                    int h = cj.h(KGApplication.getContext());
                    if (com.kugou.android.splash.a.a.a(cVar.s(), cVar.t()) && h <= optInt2 && h >= optInt) {
                        cVar.h(10);
                        cVar.c(2);
                        cVar.f(3);
                        String optString = jSONObject2.optString("jump_extra_type");
                        JSONObject optJSONObject2 = jSONObject2.optJSONObject("jump_extra");
                        str2 = "";
                        if ("youth_start_page_h5".equals(optString)) {
                            str2 = optJSONObject2 != null ? optJSONObject2.optString("url") : "";
                            if (!TextUtils.isEmpty(str2)) {
                                JSONObject jSONObject3 = new JSONObject();
                                jSONObject3.put("title", cVar.z());
                                jSONObject3.put("jumpUrl", str2);
                                cVar.b(new String(Base64.encode(jSONObject3.toString().getBytes(), 0)));
                                cVar.c("EmbededPage");
                            }
                        } else if ("youth_channel_recommend".equals(optString)) {
                            cVar.c("youth_channel_recommend");
                        } else if ("youth_channel_page".equals(optString)) {
                            cVar.c("youth_channel_page");
                            if (optJSONObject2 != null) {
                                str2 = optJSONObject2.optString("channelid");
                            }
                            JSONObject jSONObject4 = new JSONObject();
                            jSONObject4.put(RemoteMessageConst.Notification.CHANNEL_ID, str2);
                            cVar.b(new String(Base64.encode(jSONObject4.toString().getBytes(), 0)));
                        } else if ("youth_file_song_play_page".equals(optString)) {
                            cVar.c("youth_file_song_play_page");
                            String optString2 = optJSONObject2 == null ? "" : optJSONObject2.optString("fileid");
                            if (optJSONObject2 != null) {
                                str2 = optJSONObject2.optString("channelid");
                            }
                            JSONObject jSONObject5 = new JSONObject();
                            jSONObject5.put("fileId", optString2);
                            jSONObject5.put(RemoteMessageConst.Notification.CHANNEL_ID, str2);
                            cVar.b(new String(Base64.encode(jSONObject5.toString().getBytes(), 0)));
                        } else if ("youth_song_play_page".equals(optString)) {
                            String optString3 = optJSONObject2 == null ? "" : optJSONObject2.optString("mixsongid");
                            if (optJSONObject2 != null) {
                                str2 = optJSONObject2.optString("musichash");
                            }
                            JSONObject jSONObject6 = new JSONObject();
                            jSONObject6.put("hashValue", str2);
                            jSONObject6.put("album_audio_id", optString3);
                            cVar.b(new String(Base64.encode(jSONObject6.toString().getBytes(), 0)));
                            cVar.c("youth_song_play_page");
                            arrayList.add(cVar);
                            i3++;
                            i = 1;
                            i2 = 2;
                        }
                        arrayList.add(cVar);
                        i3++;
                        i = 1;
                        i2 = 2;
                    }
                    i3++;
                    i = 1;
                    i2 = 2;
                }
                return arrayList;
            }
            return null;
        } catch (JSONException e3) {
            e3.printStackTrace();
            return null;
        }
    }
}