4399游戏盒 v7.2.1.31版本的 MD5 值为:951717f45e3fda95c8a358caf4ca93e1
以下内容为反编译后的 GrayscaleTest$syncGetGrayScaleConfig$2.java 源代码,内容仅作参考
package com.download.test;
import com.download.okhttp.OkHttpHelper;
import com.download.test.GTConfig;
import kotlin.Metadata;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.CoroutineScope;
import okhttp3.Request;
import okhttp3.ResponseBody;
import org.json.JSONArray;
import org.json.JSONObject;
import timber.log.Timber;
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u000e\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u0004\u0018\u00010\u0001*\u00020\u0002H\u008a@¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;", "invoke", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"}, k = 3, mv = {1, 1, 16})
@DebugMetadata(c = "com.download.test.GrayscaleTest$syncGetGrayScaleConfig$2", f = "GrayscaleTest.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
public final class GrayscaleTest$syncGetGrayScaleConfig$2 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
int label;
private CoroutineScope wz;
public GrayscaleTest$syncGetGrayScaleConfig$2(Continuation continuation) {
super(2, continuation);
}
@Override
public final Continuation<Unit> create(Object obj, Continuation<?> completion) {
Intrinsics.checkParameterIsNotNull(completion, "completion");
GrayscaleTest$syncGetGrayScaleConfig$2 grayscaleTest$syncGetGrayScaleConfig$2 = new GrayscaleTest$syncGetGrayScaleConfig$2(completion);
grayscaleTest$syncGetGrayScaleConfig$2.wz = (CoroutineScope) obj;
return grayscaleTest$syncGetGrayScaleConfig$2;
}
@Override
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
return ((GrayscaleTest$syncGetGrayScaleConfig$2) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override
public final Object invokeSuspend(Object obj) {
String string;
IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (this.label == 0) {
ResultKt.throwOnFailure(obj);
CoroutineScope coroutineScope = this.wz;
try {
ResponseBody body = OkHttpHelper.getInstance().newCall(new Request.Builder().get().url("https://sjbc.img4399.com/api/v1/gd/limit?packag=all&version=" + GrayscaleTest.INSTANCE.getVersionCode()).build()).execute().body();
if (body == null || (string = body.string()) == null) {
return null;
}
JSONObject jSONObject = new JSONObject(string);
if (100 == jSONObject.getInt("code")) {
JSONArray jSONArray = jSONObject.getJSONArray("result");
GrayscaleTest.INSTANCE.getGrayscaleTestConfig().clear();
int length = jSONArray.length();
for (int i = 0; i < length; i++) {
GTConfig.Companion companion = GTConfig.INSTANCE;
JSONObject jSONObject2 = jSONArray.getJSONObject(i);
Intrinsics.checkExpressionValueIsNotNull(jSONObject2, "appList.getJSONObject(index)");
GTConfig parse = companion.parse(jSONObject2);
GrayscaleTest.INSTANCE.getGrayscaleTestConfig().put(parse.getPkg(), parse);
Timber.d("灰度配置解析成功 " + parse, new Object[0]);
}
}
return Unit.INSTANCE;
} catch (Exception e) {
Timber.w(e, "请求灰度配置数据失败 ", new Object[0]);
return Unit.INSTANCE;
}
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}