奈斯漫画.apk(点击下载) / LaunchVModel$getApiDomain$1.java
package com.nice.comic.watch.ui.launch.vm;
import androidx.core.app.NotificationCompat;
import androidx.lifecycle.ViewModelKt;
import java.io.IOException;
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.Function0;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.Job;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
/* access modifiers changed from: package-private */
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H@"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;"}, k = 3, mv = {1, 6, 0}, xi = 48)
@DebugMetadata(c = "com.nice.comic.watch.ui.launch.vm.LaunchVModel$getApiDomain$1", f = "LaunchVModel.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
/* compiled from: LaunchVModel.kt */
public final class LaunchVModel$getApiDomain$1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
final /* synthetic */ Function0<Unit> $failed;
final /* synthetic */ Function0<Unit> $successCall;
int label;
final /* synthetic */ LaunchVModel this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
LaunchVModel$getApiDomain$1(LaunchVModel launchVModel, Function0<Unit> function0, Function0<Unit> function02, Continuation<? super LaunchVModel$getApiDomain$1> continuation) {
super(2, continuation);
this.this$0 = launchVModel;
this.$failed = function0;
this.$successCall = function02;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
return new LaunchVModel$getApiDomain$1(this.this$0, this.$failed, this.$successCall, continuation);
}
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
return ((LaunchVModel$getApiDomain$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (this.label == 0) {
ResultKt.throwOnFailure(obj);
Call newCall = new OkHttpClient().newCall(new Request.Builder().url("https://jacknc.oss-cn-shanghai.aliyuncs.com/api.json.txt").get().build());
final LaunchVModel launchVModel = this.this$0;
final Function0<Unit> function0 = this.$failed;
final Function0<Unit> function02 = this.$successCall;
newCall.enqueue(new Callback() {
/* class com.nice.comic.watch.ui.launch.vm.LaunchVModel$getApiDomain$1.AnonymousClass1 */
@Override // okhttp3.Callback
public void onFailure(Call call, IOException iOException) {
Intrinsics.checkNotNullParameter(call, NotificationCompat.CATEGORY_CALL);
Intrinsics.checkNotNullParameter(iOException, "e");
launchVModel.getCancel(call, function0);
}
@Override // okhttp3.Callback
public void onResponse(Call call, Response response) {
Intrinsics.checkNotNullParameter(call, NotificationCompat.CATEGORY_CALL);
Intrinsics.checkNotNullParameter(response, "response");
Job unused = BuildersKt__Builders_commonKt.launch$default(ViewModelKt.getViewModelScope(launchVModel), Dispatchers.getIO(), null, new LaunchVModel$getApiDomain$1$1$onResponse$1(response, launchVModel, function0, function02, call, null), 2, null);
}
});
return Unit.INSTANCE;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}