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

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


package com.kugou.android.app.common.comment.protocol;

import c.t;
import com.kugou.android.app.a.a;
import com.kugou.android.app.common.comment.entity.CommentEntity;
import com.kugou.common.entity.f;
import com.kugou.common.network.w;
import com.kugou.common.userCenter.r;
import com.kugou.common.utils.as;
import d.ab;
import d.u;
import d.z;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import kotlin.Metadata;
import kotlin.jvm.internal.i;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.json.JSONArray;
import org.json.JSONObject;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u001c\u0010\u0003\u001a\n\u0012\u0004\u0012\u00020\u0005\u0018\u00010\u00042\f\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004J&\u0010\u0007\u001a\n\u0012\u0004\u0012\u00020\u0005\u0018\u00010\u00042\u0006\u0010\b\u001a\u00020\t2\f\u0010\n\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004H\u0002¨\u0006\u000b"}, d2 = {"Lcom/kugou/android/app/common/comment/protocol/BatchFillCommentTalentInfoProtocol;", "", "()V", "get", "Ljava/util/ArrayList;", "Lcom/kugou/android/app/common/comment/entity/CommentEntity;", "list", "parseBody", "responseBody", "Lokhttp3/ResponseBody;", "users", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
public final class BatchFillCommentTalentInfoProtocol {

    public static final BatchFillCommentTalentInfoProtocol f4984a = new BatchFillCommentTalentInfoProtocol();

    private BatchFillCommentTalentInfoProtocol() {
    }

    @Nullable
    public final ArrayList<CommentEntity> a(@NotNull ArrayList<CommentEntity> arrayList) {
        i.b(arrayList, "list");
        f fVar = (f) new t.a().b("BatchFillCommentTalentInfoProtocol").a(c.a.a.i.a()).a(w.a(a.FD, "https://youth.kugou.com/v1/talent/get_talent_info")).a(c.b.a.a.a()).a().b().a(f.class);
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.put("apiver", "2");
        JSONObject jSONObject = new JSONObject();
        JSONArray jSONArray = new JSONArray();
        Iterator<T> it = arrayList.iterator();
        while (it.hasNext()) {
            jSONArray.put(((CommentEntity) it.next()).f5165b);
        }
        jSONObject.put("user_list", jSONArray);
        String jSONObject2 = jSONObject.toString();
        i.a((Object) jSONObject2, "jsonObject.toString()");
        w.b(linkedHashMap, jSONObject2);
        ab d2 = fVar.a(linkedHashMap, z.a(u.a("application/json"), jSONObject2)).a().d();
        if (d2 == null) {
            return null;
        }
        i.a((Object) d2, "responseBody.body() ?: return null");
        return a(d2, arrayList);
    }

    private final ArrayList<CommentEntity> a(ab abVar, ArrayList<CommentEntity> arrayList) {
        try {
            String f = abVar.f();
            as.f("lzq-young", f);
            JSONObject optJSONObject = new JSONObject(f).optJSONObject("data");
            JSONArray optJSONArray = optJSONObject != null ? optJSONObject.optJSONArray("list") : null;
            LinkedHashMap linkedHashMap = new LinkedHashMap();
            if (optJSONArray != null) {
                int length = optJSONArray.length();
                for (int i = 0; i < length; i++) {
                    JSONObject jSONObject = optJSONArray.getJSONObject(i);
                    i.a((Object) jSONObject, "getJSONObject(index)");
                    r rVar = new r();
                    rVar.f52531c = jSONObject.optString("icon_after_id", "");
                    rVar.A = jSONObject.optString("icon_after_avatar", "");
                    rVar.B = jSONObject.optString("title", "");
                    rVar.C = jSONObject.optInt("title_id");
                    rVar.D = jSONObject.optString("jump_url");
                    long optLong = jSONObject.optLong("userid");
                    rVar.b(optLong);
                    linkedHashMap.put(Long.valueOf(optLong), rVar);
                }
            }
            for (CommentEntity commentEntity : arrayList) {
                String str = commentEntity.f5165b;
                i.a((Object) str, "it.user_id");
                r rVar2 = (r) linkedHashMap.get(Long.valueOf(Long.parseLong(str)));
                if (rVar2 != null) {
                    commentEntity.talentIconAfterAvatar = rVar2.A;
                    commentEntity.talentIconAfterId = rVar2.f52531c;
                    commentEntity.talentTitle = rVar2.B;
                    commentEntity.titleId = rVar2.C;
                    commentEntity.jumpUrl = rVar2.D;
                }
            }
            return arrayList;
        } catch (Exception unused) {
            return null;
        }
    }
}