酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319
以下内容为反编译后的 CheckOperateProtocol.java 源代码,内容仅作参考
package com.kugou.android.app.home.channel.protocol;
import android.support.v4.app.NotificationCompat;
import c.t;
import com.huawei.hms.push.constant.RemoteMessageConst;
import com.kugou.android.app.home.channel.entity.CommonResponse;
import com.kugou.android.app.home.channel.entity.Privilege;
import com.kugou.android.app.home.channel.f.c;
import com.kugou.common.network.w;
import com.kugou.common.utils.as;
import com.sina.weibo.sdk.web.WebPicUploadResult;
import d.ab;
import java.util.LinkedHashMap;
import kotlin.Metadata;
import kotlin.jvm.internal.i;
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\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\"\u0010\u0003\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00060\u00050\u00042\u0006\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nJ\u001c\u0010\u000b\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00060\u00050\u00042\u0006\u0010\f\u001a\u00020\rH\u0002¨\u0006\u000e"}, d2 = {"Lcom/kugou/android/app/home/channel/protocol/CheckOperateProtocol;", "", "()V", "check", "Lrx/Observable;", "Lcom/kugou/android/app/home/channel/entity/CommonResponse;", "Lcom/kugou/android/app/home/channel/entity/Privilege;", RemoteMessageConst.Notification.CHANNEL_ID, "", "eventType", "", "parseBody", "responseBody", "Lokhttp3/ResponseBody;", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
public final class CheckOperateProtocol {
public static final CheckOperateProtocol f11435a = new CheckOperateProtocol();
private CheckOperateProtocol() {
}
@NotNull
public final e<CommonResponse<Privilege>> a(@NotNull String str, int i) {
i.b(str, RemoteMessageConst.Notification.CHANNEL_ID);
bi biVar = (bi) new t.a().b("CheckOperateProtocol").a(c.a.a.i.a()).a(w.a(com.kugou.android.app.a.a.EB, "https://youth.kugou.com/v1/privilege/operate")).a(c.b.a.a.a()).a().b().a(bi.class);
LinkedHashMap linkedHashMap = new LinkedHashMap();
linkedHashMap.put("event_type", String.valueOf(i));
linkedHashMap.put("global_collection_id", str);
w.b(linkedHashMap, "");
e c2 = biVar.b(linkedHashMap).c(a.f11436a);
i.a((Object) c2, "viewInterface\n …onseBody)\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\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u00020\u00012\u000e\u0010\u0004\u001a\n \u0006*\u0004\u0018\u00010\u00050\u0005H\n¢\u0006\u0002\b\u0007"}, d2 = {"<anonymous>", "Lrx/Observable;", "Lcom/kugou/android/app/home/channel/entity/CommonResponse;", "Lcom/kugou/android/app/home/channel/entity/Privilege;", "responseBody", "Lokhttp3/ResponseBody;", "kotlin.jvm.PlatformType", NotificationCompat.CATEGORY_CALL}, k = 3, mv = {1, 1, 15})
static final class a<T, R> implements rx.b.e<ab, e<CommonResponse<Privilege>>> {
public static final a f11436a = new a();
a() {
}
@Override
@NotNull
public final e<CommonResponse<Privilege>> call(ab abVar) {
CheckOperateProtocol checkOperateProtocol = CheckOperateProtocol.f11435a;
i.a((Object) abVar, "responseBody");
return checkOperateProtocol.a(abVar);
}
}
public final e<CommonResponse<Privilege>> a(ab abVar) {
try {
CommonResponse commonResponse = new CommonResponse(0, 0, null, false, null, 31, null);
String f = abVar.f();
as.f("lzq-young", f);
JSONObject jSONObject = new JSONObject(f);
commonResponse.a(jSONObject.getInt("status"));
commonResponse.b(jSONObject.getInt("error_code"));
String string = jSONObject.getString("error_msg");
i.a((Object) string, "jsonObject.getString(\"error_msg\")");
commonResponse.a(string);
JSONObject optJSONObject = jSONObject.optJSONObject("data");
if (optJSONObject != null) {
int optInt = optJSONObject.optInt("privilege");
String optString = optJSONObject.optString("code_tip");
int optInt2 = optJSONObject.optInt(WebPicUploadResult.RESP_UPLOAD_PIC_PARAM_CODE);
i.a((Object) optString, "message");
commonResponse.a((CommonResponse) new Privilege(optInt, optString, optInt2));
}
e<CommonResponse<Privilege>> a2 = e.a(commonResponse);
i.a((Object) a2, "Observable.just(response)");
return a2;
} catch (Exception unused) {
e<CommonResponse<Privilege>> a3 = e.a((Throwable) new c(null));
i.a((Object) a3, "Observable.error<CommonR…nnelParseException(null))");
return a3;
}
}
}