PhotoRoom v4.8.2版本的 MD5 值为:c40a01bb3380c0f75c0cb6ac6760f295
以下内容为反编译后的 s.java 源代码,内容仅作参考
package com.shakebugs.shake.internal;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.shakebugs.shake.internal.domain.models.AppRegister;
import com.shakebugs.shake.internal.domain.models.Auth;
public final class s implements e0 {
@v30.r
private final d f37793a;
@v30.r
private final e f37794b;
@v30.r
private final h0<Boolean> f37795c;
@v30.r
private final h0<Boolean> f37796d;
public static final class a extends kotlin.coroutines.jvm.internal.d {
int f37797h;
Object f37798i;
int f37800k;
a(ux.d dVar) {
super(dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
this.f37798i = obj;
this.f37800k |= LinearLayoutManager.INVALID_OFFSET;
return s.this.a(null, null, this);
}
}
public static final class b extends kotlin.coroutines.jvm.internal.d {
Object f37801h;
int f37802i;
Object f37803j;
int f37805l;
b(ux.d dVar) {
super(dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
this.f37803j = obj;
this.f37805l |= LinearLayoutManager.INVALID_OFFSET;
return s.this.a(null, this);
}
}
public s(@v30.r d authApi, @v30.r e shakeApi, @v30.r h0<Boolean> registeredStorage, @v30.r h0<Boolean> archivedStorage) {
kotlin.jvm.internal.t.i(authApi, "authApi");
kotlin.jvm.internal.t.i(shakeApi, "shakeApi");
kotlin.jvm.internal.t.i(registeredStorage, "registeredStorage");
kotlin.jvm.internal.t.i(archivedStorage, "archivedStorage");
this.f37793a = authApi;
this.f37794b = shakeApi;
this.f37795c = registeredStorage;
this.f37796d = archivedStorage;
}
@Override
@v30.s
public Object a(@v30.r AppRegister appRegister, @v30.r ux.d<? super Boolean> dVar) {
b bVar;
Object e11;
int i11;
int i12;
s sVar;
retrofit2.t tVar;
if (dVar instanceof b) {
bVar = (b) dVar;
int i13 = bVar.f37805l;
if ((i13 & LinearLayoutManager.INVALID_OFFSET) != 0) {
bVar.f37805l = i13 - LinearLayoutManager.INVALID_OFFSET;
Object obj = bVar.f37803j;
e11 = vx.d.e();
i11 = bVar.f37805l;
if (i11 != 0) {
px.n0.b(obj);
try {
com.shakebugs.shake.internal.utils.m.a("Registering app...");
e eVar = this.f37794b;
bVar.f37801h = this;
bVar.f37802i = 0;
bVar.f37805l = 1;
obj = eVar.a(appRegister, bVar);
if (obj == e11) {
return e11;
}
sVar = this;
i12 = 0;
} catch (Exception e12) {
e = e12;
i12 = 0;
com.shakebugs.shake.internal.utils.m.b(kotlin.jvm.internal.t.r("Failed to register app. ", e.getMessage()));
return kotlin.coroutines.jvm.internal.b.a(i12 != 0);
}
} else if (i11 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
i12 = bVar.f37802i;
sVar = (s) bVar.f37801h;
try {
px.n0.b(obj);
} catch (Exception e13) {
e = e13;
com.shakebugs.shake.internal.utils.m.b(kotlin.jvm.internal.t.r("Failed to register app. ", e.getMessage()));
return kotlin.coroutines.jvm.internal.b.a(i12 != 0);
}
}
tVar = (retrofit2.t) obj;
if (!tVar.e()) {
com.shakebugs.shake.internal.utils.m.c("App registered successfully.");
com.shakebugs.shake.internal.a.d(false);
com.shakebugs.shake.internal.a.g(true);
sVar.f37796d.a(kotlin.coroutines.jvm.internal.b.a(false));
sVar.f37795c.a(kotlin.coroutines.jvm.internal.b.a(true));
i12 = 1;
} else if (tVar.b() == 404) {
com.shakebugs.shake.internal.utils.m.d(kotlin.jvm.internal.t.r("App is archived. ", new retrofit2.j(tVar).getMessage()));
com.shakebugs.shake.internal.a.d(true);
com.shakebugs.shake.internal.a.g(true);
sVar.f37796d.a(kotlin.coroutines.jvm.internal.b.a(true));
sVar.f37795c.a(kotlin.coroutines.jvm.internal.b.a(true));
} else {
com.shakebugs.shake.internal.utils.m.b(kotlin.jvm.internal.t.r("Failed to register app. ", new retrofit2.j(tVar).getMessage()));
}
return kotlin.coroutines.jvm.internal.b.a(i12 != 0);
}
}
bVar = new b(dVar);
Object obj2 = bVar.f37803j;
e11 = vx.d.e();
i11 = bVar.f37805l;
if (i11 != 0) {
}
tVar = (retrofit2.t) obj2;
if (!tVar.e()) {
}
return kotlin.coroutines.jvm.internal.b.a(i12 != 0);
}
@Override
@v30.s
public Object a(@v30.r String str, @v30.r String str2, @v30.r ux.d<? super Boolean> dVar) {
a aVar;
Object e11;
int i11;
int i12;
retrofit2.t tVar;
Integer d11;
int intValue;
if (dVar instanceof a) {
aVar = (a) dVar;
int i13 = aVar.f37800k;
if ((i13 & LinearLayoutManager.INVALID_OFFSET) != 0) {
aVar.f37800k = i13 - LinearLayoutManager.INVALID_OFFSET;
Object obj = aVar.f37798i;
e11 = vx.d.e();
i11 = aVar.f37800k;
if (i11 != 0) {
px.n0.b(obj);
try {
com.shakebugs.shake.internal.utils.m.a("Authenticating...");
d dVar2 = this.f37793a;
aVar.f37797h = 0;
aVar.f37800k = 1;
obj = dVar2.a("client_credentials", str, str2, aVar);
if (obj == e11) {
return e11;
}
i12 = 0;
} catch (Exception e12) {
e = e12;
i12 = 0;
com.shakebugs.shake.internal.utils.m.b(kotlin.jvm.internal.t.r("Failed to fetch access token. ", e.getMessage()));
return kotlin.coroutines.jvm.internal.b.a(i12 != 0);
}
} else if (i11 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
i12 = aVar.f37797h;
try {
px.n0.b(obj);
} catch (Exception e13) {
e = e13;
com.shakebugs.shake.internal.utils.m.b(kotlin.jvm.internal.t.r("Failed to fetch access token. ", e.getMessage()));
return kotlin.coroutines.jvm.internal.b.a(i12 != 0);
}
}
tVar = (retrofit2.t) obj;
if (!tVar.e()) {
Auth auth = (Auth) tVar.a();
String accessToken = auth == null ? null : auth.getAccessToken();
Auth auth2 = (Auth) tVar.a();
try {
if (auth2 != null && (d11 = kotlin.coroutines.jvm.internal.b.d(auth2.getExpiresIn())) != null) {
intValue = d11.intValue();
long currentTimeMillis = System.currentTimeMillis();
com.shakebugs.shake.internal.a.a(accessToken);
com.shakebugs.shake.internal.a.a(currentTimeMillis);
com.shakebugs.shake.internal.a.a(intValue);
com.shakebugs.shake.internal.utils.m.a("Authenticated successfully");
i12 = 1;
}
com.shakebugs.shake.internal.utils.m.a("Authenticated successfully");
i12 = 1;
} catch (Exception e14) {
e = e14;
i12 = 1;
com.shakebugs.shake.internal.utils.m.b(kotlin.jvm.internal.t.r("Failed to fetch access token. ", e.getMessage()));
return kotlin.coroutines.jvm.internal.b.a(i12 != 0);
}
intValue = 60;
long currentTimeMillis2 = System.currentTimeMillis();
com.shakebugs.shake.internal.a.a(accessToken);
com.shakebugs.shake.internal.a.a(currentTimeMillis2);
com.shakebugs.shake.internal.a.a(intValue);
} else if (tVar.b() == 401) {
com.shakebugs.shake.internal.utils.m.b(kotlin.jvm.internal.t.r("Wrong client id or client secret. To find the correct values visit http://app.shakebugs.com. ", new retrofit2.j(tVar).getMessage()));
} else {
com.shakebugs.shake.internal.utils.m.b(kotlin.jvm.internal.t.r("Failed to fetch access token. ", new retrofit2.j(tVar).getMessage()));
}
return kotlin.coroutines.jvm.internal.b.a(i12 != 0);
}
}
aVar = new a(dVar);
Object obj2 = aVar.f37798i;
e11 = vx.d.e();
i11 = aVar.f37800k;
if (i11 != 0) {
}
tVar = (retrofit2.t) obj2;
if (!tVar.e()) {
}
return kotlin.coroutines.jvm.internal.b.a(i12 != 0);
}
}