OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 MedalSource.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.ui.medal.datasource;
import a.x;
import android.content.Context;
import com.excean.ggspace.main.R;
import com.excelliance.kxqp.api.c;
import com.excelliance.kxqp.gs.appstore.model.ResponseData;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.medal.a.m;
import com.excelliance.kxqp.gs.ui.medal.adapter.AvatarFrameAdapter;
import com.excelliance.kxqp.gs.ui.medal.adapter.MallGoodsAdapter;
import com.excelliance.kxqp.gs.ui.medal.adapter.TaskAdapter;
import com.excelliance.kxqp.gs.ui.medal.model.DecorationsResult;
import com.excelliance.kxqp.gs.ui.medal.model.GameFrameResult;
import com.excelliance.kxqp.gs.ui.medal.model.MallResult;
import com.excelliance.kxqp.gs.ui.medal.model.MedalTaskProgressResult;
import com.excelliance.kxqp.gs.ui.medal.model.PersonalGameResult;
import com.excelliance.kxqp.gs.ui.medal.model.WearResult;
import com.excelliance.kxqp.gs.util.az;
import com.google.gson.Gson;
import java.util.List;
import retrofit2.n;
public class MedalSource {
public static final String BASE_URL = "https://api.ourplay.com.cn/apiservice/";
private static final String BASE_URL_TEST = "http://api.gplayspace.cn/apiservicepsc/";
private static final boolean DEBUG = false;
private static final String TAG = "MedalSource";
private static final Gson gson = new Gson();
private static a service;
public static String getBaseUrl() {
return BASE_URL;
}
static a access$000() {
return fetchService();
}
private static a fetchService() {
if (service == null) {
synchronized (MedalSource.class) {
if (service == null) {
service = (a) new n.a().a(getBaseUrl()).a(new x.a().a(new com.quick.sdk.passport.a()).a()).a(retrofit2.b.a.a.a(gson)).a().a(a.class);
}
}
}
return service;
}
public static void receivePrize(final Context context, final int i, final TaskAdapter.b bVar) {
tp.f(new Runnable() {
@Override
public void run() {
c cVar = new c(context);
cVar.a(MedalSource.access$000().a(i));
ResponseData b2 = cVar.b();
az.d(MedalSource.TAG, "receivePrize: " + b2);
if (b2.code == 1) {
bVar.a(i);
return;
}
if (b2.code == 4) {
bVar.b(i);
} else if (b2.code == 5) {
bVar.a();
} else {
bVar.a(b2.msg);
}
}
});
}
public static ResponseData<MallResult> fetchMallInfo(Context context) {
c cVar = new c(context);
cVar.a(fetchService().a());
ResponseData<MallResult> b2 = cVar.b();
az.d(TAG, "fetchMallInfo: " + b2);
return b2;
}
public static void exchangeGoods(final Context context, final int i, final MallGoodsAdapter.c cVar) {
tp.f(new Runnable() {
@Override
public void run() {
c cVar2 = new c(context);
cVar2.a(MedalSource.access$000().b(i));
ResponseData b2 = cVar2.b();
az.d(MedalSource.TAG, "exchangeGoods: " + b2);
if (b2.code == 1) {
cVar.d();
} else if (b2.code == 4) {
cVar.c();
} else {
cVar.a(b2.code);
}
}
});
}
public static ResponseData<DecorationsResult> fetchAvatarFrame(Context context) {
c cVar = new c(context);
cVar.a(fetchService().b());
ResponseData<DecorationsResult> b2 = cVar.b();
az.d(TAG, "fetchAvatarFrame: " + b2);
return b2;
}
public static ResponseData<DecorationsResult> fetchMedal(Context context, String str, String str2) {
c cVar = new c(context);
cVar.a(fetchService().a(str, str2));
ResponseData<DecorationsResult> b2 = cVar.b();
az.d(TAG, "fetchMedal: " + b2);
return b2;
}
public static ResponseData<WearResult> changeWearState(Context context, int i, int i2, int i3) {
c cVar = new c(context);
cVar.a(fetchService().a(i, i2, i3));
ResponseData<WearResult> b2 = cVar.b();
az.d(TAG, "changeWearState: " + b2);
return b2;
}
public static void changeWearState(final Context context, final int i, final int i2, final int i3, final AvatarFrameAdapter.b bVar) {
tp.f(new Runnable() {
@Override
public void run() {
Context context2;
int i4;
c cVar = new c(context);
cVar.a(MedalSource.access$000().a(i, i2, i3));
ResponseData b2 = cVar.b();
az.d(MedalSource.TAG, "changeWearState: " + b2);
if (b2.code == 1) {
bVar.b(i3);
return;
}
if (i3 == 1) {
context2 = context;
i4 = R.string.wear_failure;
} else {
context2 = context;
i4 = R.string.take_off_failure;
}
bVar.a(context2.getString(i4));
}
});
}
private static void uploadMedalTaskProgress(final Context context, final String str, final int i, final String str2, final m.a aVar) {
az.d(TAG, "uploadMedalTaskProgress: time second = " + i + " pkg = " + str2 + " ctx = " + context);
tp.f(new Runnable() {
@Override
public void run() {
c cVar = new c(context);
cVar.a(MedalSource.access$000().a(str, i, str2));
ResponseData b2 = cVar.b();
az.d(MedalSource.TAG, "uploadMedalTaskProgress: " + b2);
if (aVar == null || b2.code != 1) {
return;
}
aVar.a();
}
});
}
public static void uploadLoginForMedal(Context context, m.a aVar) {
uploadMedalTaskProgress(context, "loginOurplay", 1, "", aVar);
}
public static void uploadPlayTimeForMedal(Context context, String str, int i) {
uploadMedalTaskProgress(context, "playGame", i, str, null);
}
public static List<DecorationsResult.MedalInfo.MedalTaskProgress> checkMedal(Context context) {
c cVar = new c(context);
cVar.a(fetchService().c());
ResponseData b2 = cVar.b();
az.d(TAG, "checkMedal: " + b2);
if (b2.code != 1 || b2.data == 0) {
return null;
}
return ((MedalTaskProgressResult) b2.data).medalList;
}
public static ResponseData<GameFrameResult> fetchGameFrame(Context context) {
c cVar = new c(context);
cVar.a(fetchService().d());
ResponseData<GameFrameResult> b2 = cVar.b();
az.d(TAG, "fetchGameFrame: " + b2);
return b2;
}
public static ResponseData<PersonalGameResult> fetchPersonalGame(Context context, String str, int i, int i2, int i3) {
c cVar = new c(context);
cVar.a(fetchService().a(str, i, i2, i3, com.excelliance.kxqp.gs.ui.medal.a.n.b(context)));
ResponseData<PersonalGameResult> b2 = cVar.b();
az.d(TAG, "fetchPersonalGame: " + b2);
return b2;
}
}