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

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


package com.kugou.android.topic2.create.protocol;

import android.support.v4.app.NotificationCompat;
import c.t;
import com.huawei.hms.push.constant.RemoteMessageConst;
import com.kugou.android.app.home.channel.protocol.bi;
import com.kugou.android.app.home.contribution.photo.ImageData;
import com.kugou.android.topic2.detail.base.UGCTopic;
import com.kugou.common.app.KGCommonApplication;
import com.kugou.common.config.c;
import com.kugou.common.network.w;
import com.kugou.common.q.b;
import com.kugou.common.utils.br;
import com.tencent.open.SocialOperation;
import com.tencent.stat.DeviceInfo;
import com.wandoujia.upgradesdk.UpgradeManager;
import d.ab;
import d.u;
import d.z;
import java.util.HashMap;
import kotlin.Metadata;
import kotlin.jvm.internal.i;
import kotlin.text.f;
import org.jetbrains.annotations.NotNull;
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\b\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u001a\u0010\t\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\f0\u000b0\n2\u0006\u0010\r\u001a\u00020\fR\u000e\u0010\u0003\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\u0007X\u0082T¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Lcom/kugou/android/topic2/create/protocol/CreateTopicProtocol;", "", "()V", "ERR_RISK", "", "ERR_TEXT_ILLEGAL", "MODULE_NAME", "", "PIC_URL_PREVIEW", "create", "Lrx/Observable;", "Lcom/kugou/common/entity/CommonResponse;", "Lcom/kugou/android/topic2/detail/base/UGCTopic;", "topic", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
public final class CreateTopicProtocol {

    public static final CreateTopicProtocol f42235a = new CreateTopicProtocol();

    private CreateTopicProtocol() {
    }

    @NotNull
    public final e<com.kugou.common.entity.e<UGCTopic>> a(@NotNull UGCTopic uGCTopic) {
        String str;
        i.b(uGCTopic, "topic");
        t b2 = new t.a().b("topic_create").a(c.a.a.i.a()).a(w.a(com.kugou.android.app.a.a.ti, "https://youth.kugou.com/api/topic/v1/add_topic")).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);
        }
        hashMap.put("global_collection_id", uGCTopic.getChannelId());
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("topic_name", uGCTopic.getName());
        jSONObject.put("brief", uGCTopic.getIntro());
        StringBuilder sb = new StringBuilder();
        sb.append("https://youthimgbssdl.kugou.com/");
        ImageData imageData = uGCTopic.getImageData();
        if (imageData == null || (str = imageData.getName()) == null) {
            str = "";
        }
        sb.append(f.a(str, "https://youthimgbssdl.kugou.com/", "", false, 4, (Object) null));
        jSONObject.put(RemoteMessageConst.Notification.ICON, sb.toString());
        jSONObject.put("type", uGCTopic.getType());
        jSONObject.put("adder", com.kugou.common.environment.a.A());
        jSONObject.put("is_open", uGCTopic.getOpenContribution() ? 1 : 0);
        String a4 = w.a(w.c(hashMap) + jSONObject.toString());
        i.a((Object) a4, "Utils.getSign(Utils.map2…arams) + body.toString())");
        hashMap.put(SocialOperation.GAME_SIGNATURE, a4);
        e c2 = ((bi) b2.a(bi.class)).b(hashMap, z.a(u.a("application/json"), jSONObject.toString())).c(new a(uGCTopic));
        i.a((Object) c2, "request.create(IChannelC…          }\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/common/entity/CommonResponse;", "Lcom/kugou/android/topic2/detail/base/UGCTopic;", "kotlin.jvm.PlatformType", "responseBody", "Lokhttp3/ResponseBody;", NotificationCompat.CATEGORY_CALL}, k = 3, mv = {1, 1, 15})
    static final class a<T, R> implements rx.b.e<T, e<? extends R>> {

        final UGCTopic f42236a;

        a(UGCTopic uGCTopic) {
            this.f42236a = uGCTopic;
        }

        @Override
        public final e<com.kugou.common.entity.e<UGCTopic>> call(ab abVar) {
            String str;
            com.kugou.common.entity.e eVar = new com.kugou.common.entity.e();
            String str2 = (String) null;
            try {
                JSONObject jSONObject = new JSONObject(abVar.f());
                int optInt = jSONObject.optInt("status");
                eVar.a(optInt);
                eVar.b(jSONObject.optInt("error_code"));
                eVar.a(jSONObject.optString("error_msg"));
                JSONObject optJSONObject = jSONObject.optJSONObject("data");
                if (optInt == 1 && optJSONObject != null) {
                    this.f42236a.setId(optJSONObject.optInt("topic_id"));
                    UGCTopic uGCTopic = this.f42236a;
                    StringBuilder sb = new StringBuilder();
                    sb.append("https://youthimgbssdl.kugou.com/");
                    ImageData imageData = this.f42236a.getImageData();
                    if (imageData == null || (str = imageData.getName()) == null) {
                        str = "";
                    }
                    sb.append((Object) str);
                    uGCTopic.setIcon(sb.toString());
                    eVar.a((com.kugou.common.entity.e) this.f42236a);
                }
                return e.a(eVar);
            } catch (Exception unused) {
                return e.a((Throwable) new com.kugou.android.app.home.channel.f.c(str2));
            }
        }
    }
}