涩里番 v4.2版本的 MD5 值为:b7af51031b798a68c7a3a9ba5a0dff66
以下内容为反编译后的 SplashViewModel.java 源代码,内容仅作参考
package com.qnmd.qz.ui.splash;
import android.os.Environment;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.t;
import androidx.lifecycle.v;
import androidx.lifecycle.w;
import com.alibaba.fastjson.support.retrofit.Retrofit2ConverterFactory;
import com.qnmd.library_base.base.BaseViewModel;
import com.qnmd.library_base.base.LoadingBean;
import com.qnmd.library_base.bean.GaoFang;
import com.qnmd.qz.bean.SystemInfoBean;
import com.qnmd.qz.bean.UserInfoBean;
import gc.p;
import gc.q;
import gf.a0;
import gf.d0;
import gf.f0;
import gf.y;
import java.io.File;
import java.net.CookieManager;
import java.net.CookiePolicy;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import kc.c;
import kotlin.Metadata;
import vb.l;
import ve.o;
import we.c0;
import we.z;
import wf.x;
import wf.z;
import y8.k;
import y8.l;
@Metadata(bv = {}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Lcom/qnmd/qz/ui/splash/SplashViewModel;", "Lcom/qnmd/library_base/base/BaseViewModel;", "<init>", "()V", "app_release"}, k = 1, mv = {1, 6, 0})
public final class SplashViewModel extends BaseViewModel {
public final vb.j f6191i = (vb.j) z2.b.I(b.f6201i);
public final vb.j f6192j = (vb.j) z2.b.I(j.f6222i);
public final w<UserInfoBean> f6193k;
public final LiveData<UserInfoBean> f6194l;
public final w<GaoFang> f6195m;
public final LiveData<GaoFang> f6196n;
public final vb.j f6197o;
public final String f6198p;
public String f6199q;
public static final class a extends hc.j implements gc.a<String> {
public static final a f6200i = new a();
public a() {
super(0);
}
@Override
public final String invoke() {
ha.b bVar = ha.b.f8931a;
String str = ha.b.f8932b.get(0);
return ((str == null || str.length() == 0) || hc.i.a(ha.b.f8932b.get(0), "null")) ? "" : af.j.m("channel://", ha.b.f8932b.get(0));
}
}
public static final class b extends hc.j implements gc.a<w<Boolean>> {
public static final b f6201i = new b();
public b() {
super(0);
}
@Override
public final w<Boolean> invoke() {
return new w<>(Boolean.FALSE);
}
}
@bc.e(c = "com.qnmd.qz.ui.splash.SplashViewModel$ping$1", f = "SplashViewModel.kt", l = {72, 74, 74}, m = "invokeSuspend")
public static final class c extends bc.i implements p<ye.c<? super GaoFang>, zb.d<? super l>, Object> {
public int f6202i;
public Object f6203j;
public final String f6204k;
public final String f6205l;
public final GaoFang f6206m;
public c(String str, String str2, GaoFang gaoFang, zb.d<? super c> dVar) {
super(2, dVar);
this.f6204k = str;
this.f6205l = str2;
this.f6206m = gaoFang;
}
@Override
public final zb.d<l> create(Object obj, zb.d<?> dVar) {
c cVar = new c(this.f6204k, this.f6205l, this.f6206m, dVar);
cVar.f6203j = obj;
return cVar;
}
@Override
public final Object invoke(ye.c<? super GaoFang> cVar, zb.d<? super l> dVar) {
return ((c) create(cVar, dVar)).invokeSuspend(l.f15974a);
}
@Override
public final Object invokeSuspend(Object obj) {
ye.c cVar;
ac.a aVar = ac.a.COROUTINE_SUSPENDED;
int i2 = this.f6202i;
if (i2 == 0) {
z.A0(obj);
cVar = (ye.c) this.f6203j;
l.a aVar2 = y8.l.f18133b;
y8.l lVar = y8.l.f18134c;
GaoFang gaoFang = new GaoFang(false, null, 3, null);
GaoFang gaoFang2 = this.f6206m;
String str = this.f6205l;
gaoFang.setGaoFang(gaoFang2.isGaoFang());
gaoFang.setUrl(str);
Objects.requireNonNull(lVar);
lVar.f18135a = gaoFang;
String str2 = this.f6204k;
hc.i.e(str2, "baseUrl");
z.a aVar3 = new z.a();
if (!o.X0(str2, '/')) {
str2 = af.j.n(str2, "/");
}
aVar3.b(str2);
aVar3.f17019e.add(new b8.c());
aVar3.a(Retrofit2ConverterFactory.create());
File downloadCacheDirectory = Environment.getDownloadCacheDirectory();
tf.a aVar4 = new tf.a(new y8.i());
aVar4.f15419b = 3;
new CookieManager().setCookiePolicy(CookiePolicy.ACCEPT_ALL);
y.a aVar5 = new y.a();
TimeUnit timeUnit = TimeUnit.SECONDS;
aVar5.a(5L);
aVar5.c(5L);
aVar5.b(5L);
File absoluteFile = downloadCacheDirectory.getAbsoluteFile();
hc.i.d(absoluteFile, "sdcache.absoluteFile");
aVar5.f8435k = new gf.c(absoluteFile);
aVar5.f8427c.add(aVar4);
aVar5.f8427c.add(new a9.a(lVar.f18135a));
aVar3.f17016b = new y(aVar5);
c0<f0> b10 = ((y8.h) aVar3.c().b()).b(this.f6205l, y8.a.f18066a.c(null));
this.f6203j = cVar;
this.f6202i = 1;
obj = b10.J(this);
if (obj == aVar) {
return aVar;
}
} else if (i2 != 1) {
if (i2 != 2 && i2 != 3) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
we.z.A0(obj);
return vb.l.f15974a;
} else {
cVar = (ye.c) this.f6203j;
we.z.A0(obj);
}
d0.a aVar6 = new d0.a();
aVar6.f8267c = 200;
aVar6.f8268d = "OK";
aVar6.f8266b = gf.z.HTTP_1_1;
a0.a aVar7 = new a0.a();
aVar7.h("http://localhost/");
aVar6.f8265a = aVar7.b();
if (x.b((f0) obj, aVar6.a()).a()) {
GaoFang gaoFang3 = this.f6206m;
this.f6203j = null;
this.f6202i = 2;
if (cVar.a(gaoFang3, this) == aVar) {
return aVar;
}
} else {
GaoFang gaoFang4 = new GaoFang(false, null, 3, null);
this.f6203j = null;
this.f6202i = 3;
if (cVar.a(gaoFang4, this) == aVar) {
return aVar;
}
}
return vb.l.f15974a;
}
}
@bc.e(c = "com.qnmd.qz.ui.splash.SplashViewModel$ping$2", f = "SplashViewModel.kt", l = {}, m = "invokeSuspend")
public static final class d extends bc.i implements q<ye.c<? super GaoFang>, Throwable, zb.d<? super vb.l>, Object> {
public final int f6207i;
public final p<Boolean, GaoFang, vb.l> f6208j;
public final GaoFang f6209k;
public final SplashViewModel f6210l;
public d(int i2, p<? super Boolean, ? super GaoFang, vb.l> pVar, GaoFang gaoFang, SplashViewModel splashViewModel, zb.d<? super d> dVar) {
super(3, dVar);
this.f6207i = i2;
this.f6208j = pVar;
this.f6209k = gaoFang;
this.f6210l = splashViewModel;
}
@Override
public final Object i(ye.c<? super GaoFang> cVar, Throwable th, zb.d<? super vb.l> dVar) {
d dVar2 = new d(this.f6207i, this.f6208j, this.f6209k, this.f6210l, dVar);
vb.l lVar = vb.l.f15974a;
dVar2.invokeSuspend(lVar);
return lVar;
}
@Override
public final Object invokeSuspend(Object obj) {
we.z.A0(obj);
int i2 = this.f6207i;
k kVar = k.f18128a;
if (i2 == k.f18131d.size() - 1) {
this.f6208j.invoke(Boolean.FALSE, this.f6209k);
} else {
this.f6210l.f(this.f6207i + 1, this.f6208j);
}
return vb.l.f15974a;
}
}
@bc.e(c = "com.qnmd.qz.ui.splash.SplashViewModel$ping$3", f = "SplashViewModel.kt", l = {}, m = "invokeSuspend")
public static final class e extends bc.i implements p<GaoFang, zb.d<? super vb.l>, Object> {
public Object f6211i;
public final p<Boolean, GaoFang, vb.l> f6212j;
public final GaoFang f6213k;
public final SplashViewModel f6214l;
public final int f6215m;
public e(p<? super Boolean, ? super GaoFang, vb.l> pVar, GaoFang gaoFang, SplashViewModel splashViewModel, int i2, zb.d<? super e> dVar) {
super(2, dVar);
this.f6212j = pVar;
this.f6213k = gaoFang;
this.f6214l = splashViewModel;
this.f6215m = i2;
}
@Override
public final zb.d<vb.l> create(Object obj, zb.d<?> dVar) {
e eVar = new e(this.f6212j, this.f6213k, this.f6214l, this.f6215m, dVar);
eVar.f6211i = obj;
return eVar;
}
@Override
public final Object invoke(GaoFang gaoFang, zb.d<? super vb.l> dVar) {
vb.l lVar = vb.l.f15974a;
((e) create(gaoFang, dVar)).invokeSuspend(lVar);
return lVar;
}
@Override
public final Object invokeSuspend(Object obj) {
we.z.A0(obj);
if (!hc.i.a(((GaoFang) this.f6211i).getUrl(), "")) {
this.f6212j.invoke(Boolean.TRUE, this.f6213k);
} else {
this.f6214l.f(this.f6215m + 1, this.f6212j);
}
return vb.l.f15974a;
}
}
@bc.e(c = "com.qnmd.qz.ui.splash.SplashViewModel$pingData$1$1", f = "SplashViewModel.kt", l = {33}, m = "invokeSuspend")
public static final class f extends bc.i implements p<t<GaoFang>, zb.d<? super vb.l>, Object> {
public int f6216i;
public Object f6217j;
public final GaoFang f6218k;
public f(GaoFang gaoFang, zb.d<? super f> dVar) {
super(2, dVar);
this.f6218k = gaoFang;
}
@Override
public final zb.d<vb.l> create(Object obj, zb.d<?> dVar) {
f fVar = new f(this.f6218k, dVar);
fVar.f6217j = obj;
return fVar;
}
@Override
public final Object invoke(t<GaoFang> tVar, zb.d<? super vb.l> dVar) {
return ((f) create(tVar, dVar)).invokeSuspend(vb.l.f15974a);
}
@Override
public final Object invokeSuspend(Object obj) {
ac.a aVar = ac.a.COROUTINE_SUSPENDED;
int i2 = this.f6216i;
if (i2 == 0) {
we.z.A0(obj);
GaoFang gaoFang = this.f6218k;
this.f6216i = 1;
if (((t) this.f6217j).a(gaoFang, this) == aVar) {
return aVar;
}
} else if (i2 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
we.z.A0(obj);
}
return vb.l.f15974a;
}
}
@bc.e(c = "com.qnmd.qz.ui.splash.SplashViewModel$requestUserData$1$1", f = "SplashViewModel.kt", l = {30}, m = "invokeSuspend")
public static final class g extends bc.i implements p<t<UserInfoBean>, zb.d<? super vb.l>, Object> {
public int f6219i;
public Object f6220j;
public final UserInfoBean f6221k;
public g(UserInfoBean userInfoBean, zb.d<? super g> dVar) {
super(2, dVar);
this.f6221k = userInfoBean;
}
@Override
public final zb.d<vb.l> create(Object obj, zb.d<?> dVar) {
g gVar = new g(this.f6221k, dVar);
gVar.f6220j = obj;
return gVar;
}
@Override
public final Object invoke(t<UserInfoBean> tVar, zb.d<? super vb.l> dVar) {
return ((g) create(tVar, dVar)).invokeSuspend(vb.l.f15974a);
}
@Override
public final Object invokeSuspend(Object obj) {
ac.a aVar = ac.a.COROUTINE_SUSPENDED;
int i2 = this.f6219i;
if (i2 == 0) {
we.z.A0(obj);
UserInfoBean userInfoBean = this.f6221k;
this.f6219i = 1;
if (((t) this.f6220j).a(userInfoBean, this) == aVar) {
return aVar;
}
} else if (i2 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
we.z.A0(obj);
}
return vb.l.f15974a;
}
}
public static final class h<I, O> implements k.a<UserInfoBean, LiveData<UserInfoBean>> {
@Override
public final LiveData<UserInfoBean> apply(UserInfoBean userInfoBean) {
return z2.a.p0(new g(userInfoBean, null));
}
}
public static final class i<I, O> implements k.a<GaoFang, LiveData<GaoFang>> {
@Override
public final LiveData<GaoFang> apply(GaoFang gaoFang) {
return z2.a.p0(new f(gaoFang, null));
}
}
public static final class j extends hc.j implements gc.a<w<SystemInfoBean>> {
public static final j f6222i = new j();
public j() {
super(0);
}
@Override
public final w<SystemInfoBean> invoke() {
return new w<>();
}
}
public SplashViewModel() {
w<UserInfoBean> wVar = new w<>();
this.f6193k = wVar;
h hVar = new h();
v vVar = new v();
vVar.m(wVar, new androidx.lifecycle.d0(hVar, vVar));
this.f6194l = vVar;
w<GaoFang> wVar2 = new w<>();
this.f6195m = wVar2;
i iVar = new i();
v vVar2 = new v();
vVar2.m(wVar2, new androidx.lifecycle.d0(iVar, vVar2));
this.f6196n = vVar2;
this.f6197o = (vb.j) z2.b.I(a.f6200i);
ha.b bVar = ha.b.f8931a;
this.f6198p = (String) wb.o.K0(ha.b.f8932b);
this.f6199q = "";
}
public static void g(SplashViewModel splashViewModel, boolean z10, int i2) {
String str = (i2 & 1) != 0 ? "线路检测中..." : null;
if ((i2 & 2) != 0) {
z10 = false;
}
Objects.requireNonNull(splashViewModel);
hc.i.e(str, "msg");
splashViewModel.getLoading().k(new LoadingBean(true, str, z10));
splashViewModel.f(0, new ca.i(splashViewModel));
}
public final String a() {
return (String) this.f6197o.getValue();
}
public final w<Boolean> c() {
return (w) this.f6191i.getValue();
}
public final w<SystemInfoBean> e() {
return (w) this.f6192j.getValue();
}
public final void f(int i2, p<? super Boolean, ? super GaoFang, vb.l> pVar) {
k kVar = k.f18128a;
GaoFang gaoFang = k.f18131d.get(i2);
hc.i.d(gaoFang, "NetConfig.baseUrls[index]");
GaoFang gaoFang2 = gaoFang;
String url = ve.k.L0(gaoFang2.getUrl(), "/") ? gaoFang2.getUrl() : af.j.n(gaoFang2.getUrl(), "/");
gaoFang2.setUrl(url);
a3.c.x(a3.c.v(this), null, new ye.d(new ye.h(new ye.e(new ye.i(new c(url, url + "ping/index", gaoFang2, null)), new d(i2, pVar, gaoFang2, this, null)), new e(pVar, gaoFang2, this, i2, null)), null), 3);
}
@Override
public final void onCreate() {
String str;
ha.b bVar = ha.b.f8931a;
CharSequence charSequence = (CharSequence) wb.o.K0(ha.b.f8932b);
if (charSequence == null || charSequence.length() == 0) {
k kVar = k.f18128a;
mc.h hVar = new mc.h(0, kVar.a().size());
c.a aVar = kc.c.f10385i;
str = kVar.a().get(n.b.V(hVar)).f18127b;
} else {
for (y8.j jVar : k.f18128a.a()) {
if (hc.i.a(jVar.f18126a, wb.o.K0(ha.b.f8932b))) {
str = jVar.f18127b;
}
}
throw new NoSuchElementException("Collection contains no element matching the predicate.");
}
k kVar2 = k.f18128a;
k.f18131d.add(0, new GaoFang(false, str, 1, null));
g(this, false, 3);
}
}