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

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


package com.kugou.android.musiccircle.e;

import com.kugou.android.app.KGApplication;
import com.kugou.android.musiccircle.bean.DynamicEntity;
import com.kugou.android.musiccircle.bean.DynamicStatus;
import com.kugou.common.utils.ba;
import com.kugou.common.utils.br;
import com.qq.e.comm.constants.TangramHippyConstants;
import com.sina.weibo.sdk.auth.Oauth2AccessToken;
import com.tencent.connect.common.Constants;
import com.tencent.stat.DeviceInfo;
import com.wandoujia.upgradesdk.UpgradeManager;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class aa {

    public class a {

        public ArrayList<DynamicStatus> f27220a = null;

        public ArrayList<DynamicEntity> f27221b = null;

        public a() {
        }
    }

    public a a(ArrayList<DynamicEntity> arrayList) throws com.kugou.android.splash.d.a, com.kugou.android.app.fanxing.b.b.c, com.kugou.android.app.fanxing.b.b.b {
        if (arrayList == null || arrayList.size() < 1) {
            return null;
        }
        ArrayList arrayList2 = new ArrayList();
        Iterator<DynamicEntity> it = arrayList.iterator();
        while (it.hasNext()) {
            DynamicEntity next = it.next();
            HashMap hashMap = new HashMap();
            hashMap.put("user_id", next.f5165b);
            hashMap.put("hash", next.hash);
            hashMap.put("bid", Integer.valueOf(next.bid));
            hashMap.put("s", next.aY_);
            try {
                hashMap.put("time", Long.valueOf(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(next.h).getTime() / 1000));
                hashMap.put("dt", next.dt);
                hashMap.put("chash", next.chash);
                hashMap.put("id", next.f5164a);
                hashMap.put("special_child_id", next.i);
                hashMap.put("special_id", next.specialId);
                hashMap.put("cas", Long.valueOf(new JSONObject(next.fileid).optLong("cas")));
                arrayList2.add(hashMap);
            } catch (Exception unused) {
            }
        }
        HashMap hashMap2 = new HashMap();
        hashMap2.put(Oauth2AccessToken.KEY_UID, Long.valueOf(com.kugou.common.environment.a.h().f54229a));
        hashMap2.put(DeviceInfo.TAG_MID, br.j(KGApplication.getContext()));
        hashMap2.put(UpgradeManager.PARAM_TOKEN, com.kugou.common.environment.a.h().f54230b);
        int F = br.F(KGApplication.getContext());
        hashMap2.put("clientver", Integer.valueOf(F));
        long currentTimeMillis = System.currentTimeMillis() / 1000;
        hashMap2.put("clienttime", Long.valueOf(currentTimeMillis));
        hashMap2.put("appid", Long.valueOf(br.as()));
        hashMap2.put("key", ba.c(br.a(Long.valueOf(br.as()), com.kugou.common.config.c.a().b(com.kugou.android.app.a.a.lp), Integer.valueOf(F), Long.valueOf(currentTimeMillis))));
        hashMap2.put(DeviceInfo.TAG_VERSION, "0");
        hashMap2.put("feed", arrayList2);
        com.kugou.android.share.countersign.d.j jVar = new com.kugou.android.share.countersign.d.j(hashMap2, Constants.HTTP_POST, "http://musichubservice.kugou.com/v3/getstatusinfo");
        jVar.a(2);
        try {
            com.kugou.common.network.f.d().a(jVar, jVar);
            try {
                JSONObject jSONObject = new JSONObject(jVar.a());
                if (jSONObject.optInt("status") == 1) {
                    JSONArray optJSONArray = jSONObject.optJSONArray("list");
                    a aVar = new a();
                    if (optJSONArray != null) {
                        ArrayList<DynamicStatus> arrayList3 = new ArrayList<>();
                        int length = optJSONArray.length();
                        if (length > 0) {
                            for (int i = 0; i < length; i++) {
                                JSONObject optJSONObject = optJSONArray.optJSONObject(i);
                                DynamicStatus dynamicStatus = new DynamicStatus();
                                dynamicStatus.setChash(optJSONObject.optString("chash"));
                                dynamicStatus.setReplyNum(optJSONObject.optInt("reply_num"));
                                dynamicStatus.setStatus(optJSONObject.optInt("status"));
                                JSONObject optJSONObject2 = optJSONObject.optJSONObject("like");
                                com.kugou.android.app.common.comment.entity.c cVar = new com.kugou.android.app.common.comment.entity.c();
                                if (optJSONObject2 != null) {
                                    cVar.f5174b = optJSONObject2.optBoolean("haslike");
                                    cVar.f5173a = optJSONObject2.optInt(TangramHippyConstants.COUNT);
                                }
                                dynamicStatus.setCommentLikeEntity(cVar);
                                arrayList3.add(dynamicStatus);
                            }
                            aVar.f27220a = arrayList3;
                        }
                    }
                    JSONArray optJSONArray2 = jSONObject.optJSONArray("extraFeeds");
                    if (optJSONArray2 != null) {
                        ArrayList<DynamicEntity> arrayList4 = new ArrayList<>();
                        int length2 = optJSONArray2.length();
                        if (length2 > 0) {
                            for (int i2 = 0; i2 < length2; i2++) {
                                JSONObject optJSONObject3 = optJSONArray2.optJSONObject(i2);
                                DynamicEntity dynamicEntity = new DynamicEntity();
                                com.kugou.android.app.common.comment.protocol.o.i(dynamicEntity, optJSONObject3);
                                arrayList4.add(dynamicEntity);
                            }
                        }
                        aVar.f27221b = arrayList4;
                    }
                    return aVar;
                }
                throw new com.kugou.android.app.fanxing.b.b.b(jSONObject.optInt("err_code"), "");
            } catch (JSONException e2) {
                throw new com.kugou.android.app.fanxing.b.b.c(e2.getMessage());
            }
        } catch (Exception e3) {
            throw new com.kugou.android.splash.d.a(e3.getMessage());
        }
    }
}