酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319
以下内容为反编译后的 GetStationMainContentProtocol.java 源代码,内容仅作参考
package com.kugou.android.station.protocol;
import android.support.v4.app.NotificationCompat;
import c.t;
import com.kugou.android.app.home.channel.protocol.bi;
import com.kugou.android.station.create.entity.AnLiStationEntity;
import com.kugou.android.station.create.entity.StationEntity;
import com.kugou.android.topic2.detail.base.CommonListResponse;
import com.kugou.common.app.KGCommonApplication;
import com.kugou.common.base.g.d;
import com.kugou.common.config.c;
import com.kugou.common.network.v;
import com.kugou.common.network.w;
import com.kugou.common.q.b;
import com.kugou.common.utils.br;
import com.kugou.framework.database.channel.entity.ChannelEntity;
import com.tencent.open.SocialOperation;
import com.tencent.stat.DeviceInfo;
import com.wandoujia.upgradesdk.UpgradeManager;
import d.ab;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import kotlin.Metadata;
import kotlin.collections.h;
import kotlin.jvm.internal.i;
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 = {"\u00004\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J<\u0010\u0005\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\b0\u00070\u00062\u0006\u0010\t\u001a\u00020\u00042\b\b\u0002\u0010\n\u001a\u00020\u000b2\n\b\u0002\u0010\f\u001a\u0004\u0018\u00010\r2\n\b\u0002\u0010\u000e\u001a\u0004\u0018\u00010\u000fR\u000e\u0010\u0003\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000¨\u0006\u0010"}, d2 = {"Lcom/kugou/android/station/protocol/GetStationMainContentProtocol;", "", "()V", "MODULE_NAME", "", "get", "Lrx/Observable;", "Lcom/kugou/android/topic2/detail/base/CommonListResponse;", "Lcom/kugou/android/station/create/entity/AnLiStationEntity;", "id", "isDraft", "", "channelEntity", "Lcom/kugou/framework/database/channel/entity/ChannelEntity;", "pageKey", "Lcom/kugou/common/base/uistructure/PageKey;", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
public final class GetStationMainContentProtocol {
public static final GetStationMainContentProtocol f40513a = new GetStationMainContentProtocol();
private GetStationMainContentProtocol() {
}
@NotNull
public static e a(GetStationMainContentProtocol getStationMainContentProtocol, String str, int i, ChannelEntity channelEntity, d dVar, int i2, Object obj) {
if ((i2 & 2) != 0) {
i = 0;
}
if ((i2 & 4) != 0) {
channelEntity = (ChannelEntity) null;
}
if ((i2 & 8) != 0) {
dVar = (d) null;
}
return getStationMainContentProtocol.a(str, i, channelEntity, dVar);
}
@NotNull
public final e<CommonListResponse<AnLiStationEntity>> a(@NotNull String str, int i, @Nullable ChannelEntity channelEntity, @Nullable d dVar) {
i.b(str, "id");
t b2 = new t.a().b("CHANNEL_STATION").a(c.a.a.i.a()).a(w.a(com.kugou.android.app.a.a.uY, "https://youth.kugou.com/api/amway/v2/index")).a(c.b.a.a.a()).a().b();
HashMap hashMap = new HashMap();
hashMap.put("appid", Integer.valueOf(c.a().d(com.kugou.android.app.a.a.lo)));
hashMap.put("clientver", Integer.valueOf(br.F(KGCommonApplication.getContext())));
hashMap.put("clienttime", Long.valueOf(br.d() / 1000));
String j = br.j(KGCommonApplication.getContext());
i.a((Object) j, "SystemUtils.getMid(KGCom…Application.getContext())");
hashMap.put(DeviceInfo.TAG_MID, j);
b a2 = b.a();
i.a((Object) a2, "CommonSettingPrefs.getInstance()");
String cS = a2.cS();
i.a((Object) cS, "CommonSettingPrefs.getIn…deviceFingerIdDateNotNull");
hashMap.put("dfid", cS);
b a3 = b.a();
i.a((Object) a3, "CommonSettingPrefs.getInstance()");
String ak = a3.ak();
i.a((Object) ak, "CommonSettingPrefs.getInstance().uuid");
hashMap.put("uuid", ak);
if (com.kugou.common.environment.a.u()) {
hashMap.put("userid", Long.valueOf(com.kugou.common.environment.a.Y()));
String j2 = com.kugou.common.environment.a.j();
i.a((Object) j2, "CommonEnvManager.getToken()");
hashMap.put(UpgradeManager.PARAM_TOKEN, j2);
}
v.b(hashMap, dVar);
hashMap.put("global_collection_id", str);
hashMap.put("is_draft", Integer.valueOf(i));
String a4 = w.a(w.c(hashMap));
i.a((Object) a4, "Utils.getSign(Utils.map2SortString(params))");
hashMap.put(SocialOperation.GAME_SIGNATURE, a4);
e c2 = ((bi) b2.a(bi.class)).a(hashMap).c(new a(channelEntity));
i.a((Object) c2, "request.create(IChannelC…)\n }\n }");
return c2;
}
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0018\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a>\u0012\u0018\u0012\u0016\u0012\u0004\u0012\u00020\u0003 \u0004*\n\u0012\u0004\u0012\u00020\u0003\u0018\u00010\u00020\u0002 \u0004*\u001e\u0012\u0018\u0012\u0016\u0012\u0004\u0012\u00020\u0003 \u0004*\n\u0012\u0004\u0012\u00020\u0003\u0018\u00010\u00020\u0002\u0018\u00010\u00010\u00012\u000e\u0010\u0005\u001a\n \u0004*\u0004\u0018\u00010\u00060\u0006H\n¢\u0006\u0002\b\u0007"}, d2 = {"<anonymous>", "Lrx/Observable;", "Lcom/kugou/android/topic2/detail/base/CommonListResponse;", "Lcom/kugou/android/station/create/entity/AnLiStationEntity;", "kotlin.jvm.PlatformType", "responseBody", "Lokhttp3/ResponseBody;", NotificationCompat.CATEGORY_CALL}, k = 3, mv = {1, 1, 15})
public static final class a<T, R> implements rx.b.e<T, e<? extends R>> {
final ChannelEntity f40514a;
a(ChannelEntity channelEntity) {
this.f40514a = channelEntity;
}
@Override
public final e<CommonListResponse<AnLiStationEntity>> call(ab abVar) {
String str = (String) null;
try {
String f = abVar.f();
JSONObject jSONObject = new JSONObject(f != null ? f : "");
int optInt = jSONObject.optInt("status");
JSONObject optJSONObject = jSONObject.optJSONObject("data");
if (optInt == 1 && optJSONObject != null) {
JSONArray optJSONArray = optJSONObject.optJSONArray("area_list");
ArrayList arrayList = new ArrayList();
if (optJSONArray != null) {
int length = optJSONArray.length();
for (int i = 0; i < length; i++) {
AnLiStationEntity a2 = com.kugou.android.station.create.entity.a.a(optJSONArray.getJSONObject(i), this.f40514a);
if (a2 != null) {
arrayList.add(a2);
}
}
}
h.c((List) arrayList);
CommonListResponse commonListResponse = new CommonListResponse(1, arrayList, 1, arrayList.size(), null, 16, null);
commonListResponse.a(optInt);
String optString = optJSONObject.optString("channel_tab_name");
i.a((Object) optString, "data.optString(\"channel_tab_name\")");
commonListResponse.a(new StationEntity(optString, optJSONObject.optInt("has_draft")));
return e.a(commonListResponse);
}
return e.a((Throwable) new com.kugou.android.app.home.channel.f.c(f));
} catch (Exception e2) {
e2.printStackTrace();
return e.a((Throwable) new com.kugou.android.app.home.channel.f.c(str));
}
}
}
}