十八摸 v1.2.0版本的 MD5 值为:124d0569983b1a978779bc818002364d
以下内容为反编译后的 BaseViewModel$tryCatch$2.java 源代码,内容仅作参考
package com.caoliu.lib_common.base;
import app.a.module_stream.Cdo;
import com.blankj.utilcode.util.GsonUtils;
import com.blankj.utilcode.util.SPUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.bumptech.glide.load.engine.Cfinal;
import com.caoliu.lib_common.Cgoto;
import com.caoliu.lib_common.ExKt;
import com.caoliu.lib_common.entity.RefreshBaseUrl;
import com.caoliu.lib_common.entity.VersionEvent;
import com.caoliu.lib_common.entity.VersionResponse;
import com.caoliu.lib_common.manager.BaseRetrofitKt;
import com.caoliu.lib_common.manager.Cif;
import com.caoliu.lib_common.repository.MineRepository;
import com.caoliu.lib_common.repository.MineRepositoryKt;
import com.caoliu.lib_http.APIException;
import d6.Cthrow;
import d6.Cwhile;
import i.Cnew;
import i.Ctry;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeoutException;
import kotlin.Cclass;
import kotlin.coroutines.intrinsics.CoroutineSingletons;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlinx.coroutines.Cfinally;
import z5.Cfor;
@Cfor(c = "com.caoliu.lib_common.base.BaseViewModel$tryCatch$2", f = "BaseViewModel.kt", l = {131, 208, 168, 208, 177, 208, 208}, m = "invokeSuspend")
public final class BaseViewModel$tryCatch$2 extends SuspendLambda implements Cthrow<Cfinally, kotlin.coroutines.Cfor<? super Cclass>, Object> {
public final Cwhile<Cfinally, APIException, kotlin.coroutines.Cfor<? super Cclass>, Object> $catchBlock;
public final Cthrow<Cfinally, kotlin.coroutines.Cfor<? super Cclass>, Object> $finallyBlock;
public final boolean $handleCancellationExceptionManually;
public final Cthrow<Cfinally, kotlin.coroutines.Cfor<? super Cclass>, Object> $tryBlock;
private Object L$0;
public Object L$1;
public Object L$2;
public int label;
public final BaseViewModel this$0;
@Cfor(c = "com.caoliu.lib_common.base.BaseViewModel$tryCatch$2$1", f = "BaseViewModel.kt", l = {138, 139}, m = "invokeSuspend")
public static final class AnonymousClass1 extends SuspendLambda implements Cthrow<Cfinally, kotlin.coroutines.Cfor<? super Cclass>, Object> {
public final Cwhile<Cfinally, APIException, kotlin.coroutines.Cfor<? super Cclass>, Object> $catchBlock;
public final Cthrow<Cfinally, kotlin.coroutines.Cfor<? super Cclass>, Object> $finallyBlock;
public final boolean $handleCancellationExceptionManually;
public final Cthrow<Cfinally, kotlin.coroutines.Cfor<? super Cclass>, Object> $tryBlock;
public int label;
public final BaseViewModel this$0;
public AnonymousClass1(BaseViewModel baseViewModel, Cthrow<? super Cfinally, ? super kotlin.coroutines.Cfor<? super Cclass>, ? extends Object> cthrow, Cwhile<? super Cfinally, ? super APIException, ? super kotlin.coroutines.Cfor<? super Cclass>, ? extends Object> cwhile, Cthrow<? super Cfinally, ? super kotlin.coroutines.Cfor<? super Cclass>, ? extends Object> cthrow2, boolean z6, kotlin.coroutines.Cfor<? super AnonymousClass1> cfor) {
super(2, cfor);
this.this$0 = baseViewModel;
this.$tryBlock = cthrow;
this.$catchBlock = cwhile;
this.$finallyBlock = cthrow2;
this.$handleCancellationExceptionManually = z6;
}
@Override
public final kotlin.coroutines.Cfor<Cclass> create(Object obj, kotlin.coroutines.Cfor<?> cfor) {
return new AnonymousClass1(this.this$0, this.$tryBlock, this.$catchBlock, this.$finallyBlock, this.$handleCancellationExceptionManually, cfor);
}
@Override
public final Object invoke(Cfinally cfinally, kotlin.coroutines.Cfor<? super Cclass> cfor) {
return ((AnonymousClass1) create(cfinally, cfor)).invokeSuspend(Cclass.f12043do);
}
@Override
public final Object invokeSuspend(Object obj) {
CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
int i7 = this.label;
if (i7 == 0) {
Cdo.m(obj);
MineRepository m1533do = MineRepositoryKt.m1533do();
this.label = 1;
if (MineRepository.m1494throws(m1533do, "", false, this, 2) == coroutineSingletons) {
return coroutineSingletons;
}
} else if (i7 != 1) {
if (i7 != 2) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
Cdo.m(obj);
return Cclass.f12043do;
} else {
Cdo.m(obj);
}
BaseViewModel baseViewModel = this.this$0;
Cthrow<Cfinally, kotlin.coroutines.Cfor<? super Cclass>, Object> cthrow = this.$tryBlock;
Cwhile<Cfinally, APIException, kotlin.coroutines.Cfor<? super Cclass>, Object> cwhile = this.$catchBlock;
Cthrow<Cfinally, kotlin.coroutines.Cfor<? super Cclass>, Object> cthrow2 = this.$finallyBlock;
boolean z6 = this.$handleCancellationExceptionManually;
this.label = 2;
if (BaseViewModel.m1339do(baseViewModel, cthrow, cwhile, cthrow2, z6, this) == coroutineSingletons) {
return coroutineSingletons;
}
return Cclass.f12043do;
}
}
@Cfor(c = "com.caoliu.lib_common.base.BaseViewModel$tryCatch$2$2", f = "BaseViewModel.kt", l = {}, m = "invokeSuspend")
public static final class AnonymousClass2 extends SuspendLambda implements Cthrow<Cfinally, kotlin.coroutines.Cfor<? super Cclass>, Object> {
public int label;
public final BaseViewModel this$0;
public AnonymousClass2(BaseViewModel baseViewModel, kotlin.coroutines.Cfor<? super AnonymousClass2> cfor) {
super(2, cfor);
this.this$0 = baseViewModel;
}
@Override
public final kotlin.coroutines.Cfor<Cclass> create(Object obj, kotlin.coroutines.Cfor<?> cfor) {
return new AnonymousClass2(this.this$0, cfor);
}
@Override
public final Object invoke(Cfinally cfinally, kotlin.coroutines.Cfor<? super Cclass> cfor) {
return ((AnonymousClass2) create(cfinally, cfor)).invokeSuspend(Cclass.f12043do);
}
@Override
public final Object invokeSuspend(Object obj) {
CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
if (this.label == 0) {
Cdo.m(obj);
final List<String> m1429do = Cgoto.m1429do("https://d3w1ry862pohtf.cloudfront.net/sf15/domain/NuMUaLs6", 5000);
if (((ArrayList) m1429do).isEmpty()) {
m1429do = Cgoto.m1429do("https://storagesf.s3.ap-southeast-1.amazonaws.com/sf15/domain/NuMUaLs6", 5000);
}
final BaseViewModel baseViewModel = this.this$0;
Objects.requireNonNull(baseViewModel);
if (m1429do.isEmpty()) {
baseViewModel.f2656if.setValue(new APIException(500, "服务器异常"));
} else if (m1429do.size() <= baseViewModel.f2655for) {
baseViewModel.f2656if.setValue(new APIException(500, "服务器异常"));
} else {
ExKt.m1311protected(0L, new d6.Cdo<Cclass>() {
{
super(0);
}
@Override
public Cclass invoke() {
invoke2();
return Cclass.f12043do;
}
public final void invoke2() {
int i7 = BaseViewModel.this.f2655for;
Cif cif = Cif.f3021for;
if (cif.f3012do != null) {
String str = m1429do.get(i7);
Cfinal.m1144throw(str, "<set-?>");
e3.Cif.f9951import = str;
BaseViewModel.this.f2655for++;
Object m6163if = cif.m1438if(str).m6163if(Ctry.class);
Cfinal.m1142super(m6163if, "NetManager.createRetrofi…ate(VideoApi::class.java)");
Ctry ctry = i.Cdo.f11139do;
i.Cdo.f11139do = (Ctry) m6163if;
Object m6163if2 = cif.m1438if(e3.Cif.f9951import).m6163if(i.Cfor.class);
Cfinal.m1142super(m6163if2, "NetManager.createRetrofi…eate(FileApi::class.java)");
i.Cdo.f11141if = (i.Cfor) m6163if2;
Object m6163if3 = cif.m1438if(e3.Cif.f9951import).m6163if(Cnew.class);
Cfinal.m1142super(m6163if3, "NetManager.createRetrofi…te(SquareApi::class.java)");
i.Cdo.f11140for = (Cnew) m6163if3;
Object m6163if4 = cif.m1438if(e3.Cif.f9951import).m6163if(i.Cif.class);
Cfinal.m1142super(m6163if4, "NetManager.createRetrofi…e(CommentApi::class.java)");
i.Cdo.f11142new = (i.Cif) m6163if4;
r6.Cfor.m6108if().m6110case(new RefreshBaseUrl(e3.Cif.f9951import));
BaseViewModel.this.f2658try = false;
return;
}
Cfinal.g("retrofit");
throw null;
}
}, 1);
}
return Cclass.f12043do;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}
public BaseViewModel$tryCatch$2(Cthrow<? super Cfinally, ? super kotlin.coroutines.Cfor<? super Cclass>, ? extends Object> cthrow, BaseViewModel baseViewModel, boolean z6, Cwhile<? super Cfinally, ? super APIException, ? super kotlin.coroutines.Cfor<? super Cclass>, ? extends Object> cwhile, Cthrow<? super Cfinally, ? super kotlin.coroutines.Cfor<? super Cclass>, ? extends Object> cthrow2, kotlin.coroutines.Cfor<? super BaseViewModel$tryCatch$2> cfor) {
super(2, cfor);
this.$tryBlock = cthrow;
this.this$0 = baseViewModel;
this.$handleCancellationExceptionManually = z6;
this.$catchBlock = cwhile;
this.$finallyBlock = cthrow2;
}
@Override
public final kotlin.coroutines.Cfor<Cclass> create(Object obj, kotlin.coroutines.Cfor<?> cfor) {
BaseViewModel$tryCatch$2 baseViewModel$tryCatch$2 = new BaseViewModel$tryCatch$2(this.$tryBlock, this.this$0, this.$handleCancellationExceptionManually, this.$catchBlock, this.$finallyBlock, cfor);
baseViewModel$tryCatch$2.L$0 = obj;
return baseViewModel$tryCatch$2;
}
@Override
public final Object invoke(Cfinally cfinally, kotlin.coroutines.Cfor<? super Cclass> cfor) {
return ((BaseViewModel$tryCatch$2) create(cfinally, cfor)).invokeSuspend(Cclass.f12043do);
}
@Override
public final Object invokeSuspend(Object obj) {
Exception exc;
APIException aPIException;
Cfinally cfinally;
Cthrow<Cfinally, kotlin.coroutines.Cfor<? super Cclass>, Object> cthrow;
CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
String str = "";
try {
try {
} catch (APIException e7) {
BaseViewModel.m1340if(this.this$0, false, false, null, false, false, null, false, 126, null);
int code = e7.getCode();
if (code == 6) {
SPUtils.getInstance().put("token", str);
BaseRetrofitKt.m1436do(new AnonymousClass1(this.this$0, this.$tryBlock, this.$catchBlock, this.$finallyBlock, this.$handleCancellationExceptionManually, null));
} else if (code != 404) {
this.this$0.f2656if.setValue(e7);
} else {
try {
VersionResponse versionResponse = (VersionResponse) GsonUtils.fromJson(e7.getMsg(), (Class<Object>) VersionResponse.class);
r6.Cfor m6108if = r6.Cfor.m6108if();
Cfinal.m1142super(versionResponse, "d");
m6108if.m6110case(new VersionEvent(versionResponse));
} catch (Exception e8) {
e8.printStackTrace();
}
}
if (this.$handleCancellationExceptionManually) {
Cwhile<Cfinally, APIException, kotlin.coroutines.Cfor<? super Cclass>, Object> cwhile = this.$catchBlock;
this.L$0 = cfinally;
this.label = 3;
if (cwhile.invoke(cfinally, e7, this) == coroutineSingletons) {
return coroutineSingletons;
}
} else {
throw e7;
}
} catch (Exception e9) {
e9.printStackTrace();
BaseViewModel.m1340if(this.this$0, false, false, null, false, false, null, false, 126, null);
APIException aPIException2 = new APIException(500, str);
this.this$0.f2656if.setValue(aPIException2);
Cwhile<Cfinally, APIException, kotlin.coroutines.Cfor<? super Cclass>, Object> cwhile2 = this.$catchBlock;
this.L$0 = cfinally;
this.L$1 = e9;
this.L$2 = aPIException2;
this.label = 5;
if (cwhile2.invoke(cfinally, aPIException2, this) == coroutineSingletons) {
return coroutineSingletons;
}
exc = e9;
aPIException = aPIException2;
}
switch (this.label) {
case 0:
Cdo.m(obj);
cfinally = (Cfinally) this.L$0;
Cthrow<Cfinally, kotlin.coroutines.Cfor<? super Cclass>, Object> cthrow2 = this.$tryBlock;
this.L$0 = cfinally;
this.label = 1;
if (cthrow2.invoke(cfinally, this) == coroutineSingletons) {
return coroutineSingletons;
}
cthrow = this.$finallyBlock;
this.L$0 = null;
str = 2;
str = 2;
this.label = 2;
if (cthrow.invoke(cfinally, this) == coroutineSingletons) {
return coroutineSingletons;
}
return Cclass.f12043do;
case 1:
cfinally = (Cfinally) this.L$0;
Cdo.m(obj);
cthrow = this.$finallyBlock;
this.L$0 = null;
str = 2;
str = 2;
this.label = 2;
if (cthrow.invoke(cfinally, this) == coroutineSingletons) {
}
return Cclass.f12043do;
case 2:
case 4:
case 6:
Cdo.m(obj);
return Cclass.f12043do;
case 3:
cfinally = (Cfinally) this.L$0;
Cdo.m(obj);
Cthrow<Cfinally, kotlin.coroutines.Cfor<? super Cclass>, Object> cthrow3 = this.$finallyBlock;
this.L$0 = null;
this.label = 4;
if (cthrow3.invoke(cfinally, this) == coroutineSingletons) {
return coroutineSingletons;
}
return Cclass.f12043do;
case 5:
aPIException = (APIException) this.L$2;
exc = (Exception) this.L$1;
cfinally = (Cfinally) this.L$0;
Cdo.m(obj);
BaseViewModel baseViewModel = this.this$0;
if (!baseViewModel.f2658try) {
baseViewModel.f2658try = true;
int i7 = baseViewModel.f2657new - 1;
baseViewModel.f2657new = i7;
if (i7 >= 0) {
ExKt.m1310private(new AnonymousClass2(baseViewModel, null));
} else {
baseViewModel.f2656if.setValue(aPIException);
}
}
if (!(exc instanceof UnknownHostException) && (exc instanceof TimeoutException)) {
ToastUtils.showShort("网络超时", new Object[0]);
}
Cthrow<Cfinally, kotlin.coroutines.Cfor<? super Cclass>, Object> cthrow4 = this.$finallyBlock;
this.L$0 = null;
this.L$1 = null;
this.L$2 = null;
this.label = 6;
if (cthrow4.invoke(cfinally, this) == coroutineSingletons) {
return coroutineSingletons;
}
return Cclass.f12043do;
case 7:
Throwable th = (Throwable) this.L$0;
Cdo.m(obj);
throw th;
default:
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
} catch (Throwable th2) {
Cthrow<Cfinally, kotlin.coroutines.Cfor<? super Cclass>, Object> cthrow5 = this.$finallyBlock;
this.L$0 = th2;
this.L$1 = null;
this.L$2 = null;
this.label = 7;
if (cthrow5.invoke(cfinally, this) == coroutineSingletons) {
return coroutineSingletons;
}
throw th2;
}
}
}