MyRecorder v1.01.90.0219版本的 MD5 值为:c361f51174a0bf833abfa72929caf8d3
以下内容为反编译后的 m.java 源代码,内容仅作参考
package b1;
import ak.k0;
import ak.r;
import bk.x;
import com.facebook.gamingservices.cloudgaming.internal.SDKConstants;
import com.google.api.client.http.HttpStatusCodes;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CancellationException;
import nk.g0;
import nk.s;
import nk.t;
import yk.j0;
import yk.u;
import yk.w;
public final class m<T> implements b1.f<T> {
public static final a f4689k = new a(null);
public static final Set<String> f4690l = new LinkedHashSet();
public static final Object f4691m = new Object();
public final mk.a<File> f4692a;
public final b1.k<T> f4693b;
public final b1.b<T> f4694c;
public final j0 f4695d;
public final bl.b<T> f4696e;
public final String f4697f;
public final ak.l f4698g;
public final bl.j<b1.n<T>> f4699h;
public List<? extends mk.p<? super b1.i<T>, ? super ek.d<? super k0>, ? extends Object>> f4700i;
public final b1.l<b<T>> f4701j;
public static final class a {
public a() {
}
public a(nk.j jVar) {
this();
}
public final Set<String> a() {
return m.f4690l;
}
public final Object b() {
return m.f4691m;
}
}
public static abstract class b<T> {
public static final class a<T> extends b<T> {
public final b1.n<T> f4702a;
public a(b1.n<T> nVar) {
super(null);
this.f4702a = nVar;
}
public b1.n<T> a() {
return this.f4702a;
}
}
public static final class C0055b<T> extends b<T> {
public final mk.p<T, ek.d<? super T>, Object> f4703a;
public final u<T> f4704b;
public final b1.n<T> f4705c;
public final ek.g f4706d;
public C0055b(mk.p<? super T, ? super ek.d<? super T>, ? extends Object> pVar, u<T> uVar, b1.n<T> nVar, ek.g gVar) {
super(null);
s.h(pVar, "transform");
s.h(uVar, "ack");
s.h(gVar, "callerContext");
this.f4703a = pVar;
this.f4704b = uVar;
this.f4705c = nVar;
this.f4706d = gVar;
}
public final u<T> a() {
return this.f4704b;
}
public final ek.g b() {
return this.f4706d;
}
public b1.n<T> c() {
return this.f4705c;
}
public final mk.p<T, ek.d<? super T>, Object> d() {
return this.f4703a;
}
}
public b() {
}
public b(nk.j jVar) {
this();
}
}
public static final class c extends OutputStream {
public final FileOutputStream f4707a;
public c(FileOutputStream fileOutputStream) {
s.h(fileOutputStream, "fileOutputStream");
this.f4707a = fileOutputStream;
}
@Override
public void close() {
}
@Override
public void flush() {
this.f4707a.flush();
}
@Override
public void write(int i10) {
this.f4707a.write(i10);
}
@Override
public void write(byte[] bArr) {
s.h(bArr, "b");
this.f4707a.write(bArr);
}
@Override
public void write(byte[] bArr, int i10, int i11) {
s.h(bArr, "bytes");
this.f4707a.write(bArr, i10, i11);
}
}
public static final class d extends t implements mk.l<Throwable, k0> {
public final m<T> f4708a;
public d(m<T> mVar) {
super(1);
this.f4708a = mVar;
}
public final void a(Throwable th2) {
if (th2 != null) {
this.f4708a.f4699h.setValue(new b1.h(th2));
}
a aVar = m.f4689k;
Object b10 = aVar.b();
m<T> mVar = this.f4708a;
synchronized (b10) {
aVar.a().remove(mVar.q().getAbsolutePath());
k0 k0Var = k0.f364a;
}
}
@Override
public k0 invoke(Throwable th2) {
a(th2);
return k0.f364a;
}
}
public static final class e extends t implements mk.p<b<T>, Throwable, k0> {
public static final e f4709a = new e();
public e() {
super(2);
}
public final void a(b<T> bVar, Throwable th2) {
s.h(bVar, SDKConstants.PARAM_DEBUG_MESSAGE);
if (bVar instanceof b.C0055b) {
u<T> a10 = ((b.C0055b) bVar).a();
if (th2 == null) {
th2 = new CancellationException("DataStore scope was cancelled before updateData could complete");
}
a10.u(th2);
}
}
@Override
public k0 invoke(Object obj, Throwable th2) {
a((b) obj, th2);
return k0.f364a;
}
}
@gk.f(c = "androidx.datastore.core.SingleProcessDataStore$actor$3", f = "SingleProcessDataStore.kt", l = {239, 242}, m = "invokeSuspend")
public static final class f extends gk.l implements mk.p<b<T>, ek.d<? super k0>, Object> {
public int f4710e;
public Object f4711f;
public final m<T> f4712g;
public f(m<T> mVar, ek.d<? super f> dVar) {
super(2, dVar);
this.f4712g = mVar;
}
@Override
public final ek.d<k0> a(Object obj, ek.d<?> dVar) {
f fVar = new f(this.f4712g, dVar);
fVar.f4711f = obj;
return fVar;
}
@Override
public final Object m(Object obj) {
Object c10 = fk.c.c();
int i10 = this.f4710e;
if (i10 == 0) {
ak.s.b(obj);
b bVar = (b) this.f4711f;
if (bVar instanceof b.a) {
this.f4710e = 1;
if (this.f4712g.r((b.a) bVar, this) == c10) {
return c10;
}
} else if (bVar instanceof b.C0055b) {
this.f4710e = 2;
if (this.f4712g.s((b.C0055b) bVar, this) == c10) {
return c10;
}
}
} else if (i10 != 1 && i10 != 2) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
ak.s.b(obj);
}
return k0.f364a;
}
@Override
public final Object invoke(b<T> bVar, ek.d<? super k0> dVar) {
return ((f) a(bVar, dVar)).m(k0.f364a);
}
}
@gk.f(c = "androidx.datastore.core.SingleProcessDataStore$data$1", f = "SingleProcessDataStore.kt", l = {117}, m = "invokeSuspend")
public static final class g extends gk.l implements mk.p<bl.c<? super T>, ek.d<? super k0>, Object> {
public int f4713e;
public Object f4714f;
public final m<T> f4715g;
@gk.f(c = "androidx.datastore.core.SingleProcessDataStore$data$1$1", f = "SingleProcessDataStore.kt", l = {}, m = "invokeSuspend")
public static final class a extends gk.l implements mk.p<b1.n<T>, ek.d<? super Boolean>, Object> {
public int f4716e;
public Object f4717f;
public final b1.n<T> f4718g;
public a(b1.n<T> nVar, ek.d<? super a> dVar) {
super(2, dVar);
this.f4718g = nVar;
}
@Override
public final ek.d<k0> a(Object obj, ek.d<?> dVar) {
a aVar = new a(this.f4718g, dVar);
aVar.f4717f = obj;
return aVar;
}
@Override
public final Object m(Object obj) {
fk.c.c();
if (this.f4716e == 0) {
ak.s.b(obj);
b1.n<T> nVar = (b1.n) this.f4717f;
b1.n<T> nVar2 = this.f4718g;
boolean z7 = false;
if (!(nVar2 instanceof b1.c) && !(nVar2 instanceof b1.h) && nVar == nVar2) {
z7 = true;
}
return gk.b.a(z7);
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
@Override
public final Object invoke(b1.n<T> nVar, ek.d<? super Boolean> dVar) {
return ((a) a(nVar, dVar)).m(k0.f364a);
}
}
public static final class b implements bl.b<T> {
public final bl.b f4719a;
public static final class a implements bl.c<b1.n<T>> {
public final bl.c f4720a;
@gk.f(c = "androidx.datastore.core.SingleProcessDataStore$data$1$invokeSuspend$$inlined$map$1$2", f = "SingleProcessDataStore.kt", l = {137}, m = "emit")
public static final class C0056a extends gk.d {
public Object f4721d;
public int f4722e;
public C0056a(ek.d dVar) {
super(dVar);
}
@Override
public final Object m(Object obj) {
this.f4721d = obj;
this.f4722e |= Integer.MIN_VALUE;
return a.this.e(null, this);
}
}
public a(bl.c cVar) {
this.f4720a = cVar;
}
@Override
public Object e(Object obj, ek.d dVar) {
C0056a c0056a;
int i10;
if (dVar instanceof C0056a) {
c0056a = (C0056a) dVar;
int i11 = c0056a.f4722e;
if ((i11 & Integer.MIN_VALUE) != 0) {
c0056a.f4722e = i11 - Integer.MIN_VALUE;
Object obj2 = c0056a.f4721d;
Object c10 = fk.c.c();
i10 = c0056a.f4722e;
if (i10 != 0) {
ak.s.b(obj2);
bl.c cVar = this.f4720a;
b1.n nVar = (b1.n) obj;
if (nVar instanceof b1.j) {
throw ((b1.j) nVar).a();
}
if (nVar instanceof b1.h) {
throw ((b1.h) nVar).a();
}
if (!(nVar instanceof b1.c)) {
if (nVar instanceof b1.o) {
throw new IllegalStateException("This is a bug in DataStore. Please file a bug at: https://issuetracker.google.com/issues/new?component=907884&template=1466542".toString());
}
throw new ak.o();
}
Object b10 = ((b1.c) nVar).b();
c0056a.f4722e = 1;
if (cVar.e(b10, c0056a) == c10) {
return c10;
}
} else if (i10 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
ak.s.b(obj2);
}
return k0.f364a;
}
}
c0056a = new C0056a(dVar);
Object obj22 = c0056a.f4721d;
Object c102 = fk.c.c();
i10 = c0056a.f4722e;
if (i10 != 0) {
}
return k0.f364a;
}
}
public b(bl.b bVar) {
this.f4719a = bVar;
}
@Override
public Object a(bl.c cVar, ek.d dVar) {
Object a10 = this.f4719a.a(new a(cVar), dVar);
return a10 == fk.c.c() ? a10 : k0.f364a;
}
}
public g(m<T> mVar, ek.d<? super g> dVar) {
super(2, dVar);
this.f4715g = mVar;
}
@Override
public final ek.d<k0> a(Object obj, ek.d<?> dVar) {
g gVar = new g(this.f4715g, dVar);
gVar.f4714f = obj;
return gVar;
}
@Override
public final Object m(Object obj) {
Object c10 = fk.c.c();
int i10 = this.f4713e;
if (i10 == 0) {
ak.s.b(obj);
bl.c cVar = (bl.c) this.f4714f;
b1.n nVar = (b1.n) this.f4715g.f4699h.getValue();
if (!(nVar instanceof b1.c)) {
this.f4715g.f4701j.e(new b.a(nVar));
}
b bVar = new b(bl.d.a(this.f4715g.f4699h, new a(nVar, null)));
this.f4713e = 1;
if (bl.d.b(cVar, bVar, this) == c10) {
return c10;
}
} else if (i10 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
ak.s.b(obj);
}
return k0.f364a;
}
@Override
public final Object invoke(bl.c<? super T> cVar, ek.d<? super k0> dVar) {
return ((g) a(cVar, dVar)).m(k0.f364a);
}
}
public static final class h extends t implements mk.a<File> {
public final m<T> f4724a;
public h(m<T> mVar) {
super(0);
this.f4724a = mVar;
}
@Override
public final File invoke() {
File file = (File) this.f4724a.f4692a.invoke();
String absolutePath = file.getAbsolutePath();
a aVar = m.f4689k;
synchronized (aVar.b()) {
if (!(!aVar.a().contains(absolutePath))) {
throw new IllegalStateException(("There are multiple DataStores active for the same file: " + file + ". You should either maintain your DataStore as a singleton or confirm that there is no two DataStore's active on the same file (by confirming that the scope is cancelled).").toString());
}
Set<String> a10 = aVar.a();
s.g(absolutePath, "it");
a10.add(absolutePath);
}
return file;
}
}
@gk.f(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {276, 281, 284}, m = "handleUpdate")
public static final class i extends gk.d {
public Object f4725d;
public Object f4726e;
public Object f4727f;
public Object f4728g;
public final m<T> f4729h;
public int f4730i;
public i(m<T> mVar, ek.d<? super i> dVar) {
super(dVar);
this.f4729h = mVar;
}
@Override
public final Object m(Object obj) {
this.f4728g = obj;
this.f4730i |= Integer.MIN_VALUE;
return this.f4729h.s(null, this);
}
}
@gk.f(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {322, 348, 505}, m = "readAndInit")
public static final class j extends gk.d {
public Object f4731d;
public Object f4732e;
public Object f4733f;
public Object f4734g;
public Object f4735h;
public Object f4736i;
public Object f4737j;
public final m<T> f4738k;
public int f4739l;
public j(m<T> mVar, ek.d<? super j> dVar) {
super(dVar);
this.f4738k = mVar;
}
@Override
public final Object m(Object obj) {
this.f4737j = obj;
this.f4739l |= Integer.MIN_VALUE;
return this.f4738k.t(this);
}
}
public static final class k implements b1.i<T> {
public final hl.a f4740a;
public final g0 f4741b;
public final nk.j0<T> f4742c;
public final m<T> f4743d;
@gk.f(c = "androidx.datastore.core.SingleProcessDataStore$readAndInit$api$1", f = "SingleProcessDataStore.kt", l = {HttpStatusCodes.STATUS_CODE_SERVICE_UNAVAILABLE, 337, 339}, m = "updateData")
public static final class a extends gk.d {
public Object f4744d;
public Object f4745e;
public Object f4746f;
public Object f4747g;
public Object f4748h;
public Object f4749i;
public int f4751k;
public a(ek.d<? super a> dVar) {
super(dVar);
}
@Override
public final Object m(Object obj) {
this.f4749i = obj;
this.f4751k |= Integer.MIN_VALUE;
return k.this.a(null, this);
}
}
public k(hl.a aVar, g0 g0Var, nk.j0<T> j0Var, m<T> mVar) {
this.f4740a = aVar;
this.f4741b = g0Var;
this.f4742c = j0Var;
this.f4743d = mVar;
}
@Override
public Object a(mk.p<? super T, ? super ek.d<? super T>, ? extends Object> pVar, ek.d<? super T> dVar) {
a aVar;
int i10;
hl.a aVar2;
m mVar;
g0 g0Var;
nk.j0<T> j0Var;
hl.a aVar3;
hl.a aVar4;
m mVar2;
T t10;
nk.j0<T> j0Var2;
try {
if (dVar instanceof a) {
aVar = (a) dVar;
int i11 = aVar.f4751k;
if ((i11 & Integer.MIN_VALUE) != 0) {
aVar.f4751k = i11 - Integer.MIN_VALUE;
Object obj = aVar.f4749i;
Object c10 = fk.c.c();
i10 = aVar.f4751k;
if (i10 != 0) {
ak.s.b(obj);
aVar2 = this.f4740a;
g0 g0Var2 = this.f4741b;
nk.j0<T> j0Var3 = this.f4742c;
mVar = this.f4743d;
aVar.f4744d = pVar;
aVar.f4745e = aVar2;
aVar.f4746f = g0Var2;
aVar.f4747g = j0Var3;
aVar.f4748h = mVar;
aVar.f4751k = 1;
if (aVar2.a(null, aVar) == c10) {
return c10;
}
g0Var = g0Var2;
j0Var = j0Var3;
} else if (i10 != 1) {
if (i10 != 2) {
if (i10 == 3) {
t10 = (T) aVar.f4746f;
j0Var2 = (nk.j0) aVar.f4745e;
aVar3 = (hl.a) aVar.f4744d;
try {
ak.s.b(obj);
j0Var2.f48386a = t10;
j0Var = j0Var2;
T t11 = j0Var.f48386a;
aVar3.c(null);
return t11;
} catch (Throwable th2) {
th = th2;
aVar3.c(null);
throw th;
}
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
mVar2 = (m) aVar.f4746f;
j0Var = (nk.j0) aVar.f4745e;
aVar4 = (hl.a) aVar.f4744d;
try {
ak.s.b(obj);
if (!s.c(obj, j0Var.f48386a)) {
aVar3 = aVar4;
T t112 = j0Var.f48386a;
aVar3.c(null);
return t112;
}
aVar.f4744d = aVar4;
aVar.f4745e = j0Var;
aVar.f4746f = obj;
aVar.f4751k = 3;
if (mVar2.z(obj, aVar) == c10) {
return c10;
}
t10 = (T) obj;
j0Var2 = j0Var;
aVar3 = aVar4;
j0Var2.f48386a = t10;
j0Var = j0Var2;
T t1122 = j0Var.f48386a;
aVar3.c(null);
return t1122;
} catch (Throwable th3) {
th = th3;
aVar3 = aVar4;
aVar3.c(null);
throw th;
}
} else {
j0Var = (nk.j0) aVar.f4747g;
g0Var = (g0) aVar.f4746f;
mk.p<? super T, ? super ek.d<? super T>, ? extends Object> pVar2 = (mk.p) aVar.f4744d;
ak.s.b(obj);
aVar2 = (hl.a) aVar.f4745e;
mVar = (m) aVar.f4748h;
pVar = pVar2;
}
if (!g0Var.f48375a) {
throw new IllegalStateException("InitializerApi.updateData should not be called after initialization is complete.");
}
aVar.f4744d = aVar2;
aVar.f4745e = j0Var;
aVar.f4746f = mVar;
aVar.f4747g = null;
aVar.f4748h = null;
aVar.f4751k = 2;
Object invoke = pVar.invoke((T) j0Var.f48386a, aVar);
if (invoke == c10) {
return c10;
}
aVar4 = aVar2;
obj = invoke;
mVar2 = mVar;
if (!s.c(obj, j0Var.f48386a)) {
}
}
}
if (!g0Var.f48375a) {
}
} catch (Throwable th4) {
th = th4;
aVar3 = aVar2;
aVar3.c(null);
throw th;
}
aVar = new a(dVar);
Object obj2 = aVar.f4749i;
Object c102 = fk.c.c();
i10 = aVar.f4751k;
if (i10 != 0) {
}
}
}
@gk.f(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {302}, m = "readAndInitOrPropagateAndThrowFailure")
public static final class l extends gk.d {
public Object f4752d;
public Object f4753e;
public final m<T> f4754f;
public int f4755g;
public l(m<T> mVar, ek.d<? super l> dVar) {
super(dVar);
this.f4754f = mVar;
}
@Override
public final Object m(Object obj) {
this.f4753e = obj;
this.f4755g |= Integer.MIN_VALUE;
return this.f4754f.u(this);
}
}
@gk.f(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {311}, m = "readAndInitOrPropagateFailure")
public static final class C0057m extends gk.d {
public Object f4756d;
public Object f4757e;
public final m<T> f4758f;
public int f4759g;
public C0057m(m<T> mVar, ek.d<? super C0057m> dVar) {
super(dVar);
this.f4758f = mVar;
}
@Override
public final Object m(Object obj) {
this.f4757e = obj;
this.f4759g |= Integer.MIN_VALUE;
return this.f4758f.v(this);
}
}
@gk.f(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {381}, m = "readData")
public static final class n extends gk.d {
public Object f4760d;
public Object f4761e;
public Object f4762f;
public Object f4763g;
public final m<T> f4764h;
public int f4765i;
public n(m<T> mVar, ek.d<? super n> dVar) {
super(dVar);
this.f4764h = mVar;
}
@Override
public final Object m(Object obj) {
this.f4763g = obj;
this.f4765i |= Integer.MIN_VALUE;
return this.f4764h.w(this);
}
}
@gk.f(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {359, 362, 365}, m = "readDataOrHandleCorruption")
public static final class o extends gk.d {
public Object f4766d;
public Object f4767e;
public Object f4768f;
public final m<T> f4769g;
public int f4770h;
public o(m<T> mVar, ek.d<? super o> dVar) {
super(dVar);
this.f4769g = mVar;
}
@Override
public final Object m(Object obj) {
this.f4768f = obj;
this.f4770h |= Integer.MIN_VALUE;
return this.f4769g.x(this);
}
}
@gk.f(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {402, 410}, m = "transformAndWrite")
public static final class p extends gk.d {
public Object f4771d;
public Object f4772e;
public Object f4773f;
public Object f4774g;
public final m<T> f4775h;
public int f4776i;
public p(m<T> mVar, ek.d<? super p> dVar) {
super(dVar);
this.f4775h = mVar;
}
@Override
public final Object m(Object obj) {
this.f4774g = obj;
this.f4776i |= Integer.MIN_VALUE;
return this.f4775h.y(null, null, this);
}
}
@gk.f(c = "androidx.datastore.core.SingleProcessDataStore$transformAndWrite$newData$1", f = "SingleProcessDataStore.kt", l = {402}, m = "invokeSuspend")
public static final class q extends gk.l implements mk.p<j0, ek.d<? super T>, Object> {
public int f4777e;
public final mk.p<T, ek.d<? super T>, Object> f4778f;
public final T f4779g;
public q(mk.p<? super T, ? super ek.d<? super T>, ? extends Object> pVar, T t10, ek.d<? super q> dVar) {
super(2, dVar);
this.f4778f = pVar;
this.f4779g = t10;
}
@Override
public final ek.d<k0> a(Object obj, ek.d<?> dVar) {
return new q(this.f4778f, this.f4779g, dVar);
}
@Override
public Object invoke(j0 j0Var, Object obj) {
return r(j0Var, (ek.d) obj);
}
@Override
public final Object m(Object obj) {
Object c10 = fk.c.c();
int i10 = this.f4777e;
if (i10 == 0) {
ak.s.b(obj);
mk.p<T, ek.d<? super T>, Object> pVar = this.f4778f;
T t10 = this.f4779g;
this.f4777e = 1;
obj = pVar.invoke(t10, this);
if (obj == c10) {
return c10;
}
} else if (i10 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
ak.s.b(obj);
}
return obj;
}
public final Object r(j0 j0Var, ek.d<? super T> dVar) {
return ((q) a(j0Var, dVar)).m(k0.f364a);
}
}
@gk.f(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {426}, m = "writeData$datastore_core")
public static final class r extends gk.d {
public Object f4780d;
public Object f4781e;
public Object f4782f;
public Object f4783g;
public Object f4784h;
public Object f4785i;
public final m<T> f4786j;
public int f4787k;
public r(m<T> mVar, ek.d<? super r> dVar) {
super(dVar);
this.f4786j = mVar;
}
@Override
public final Object m(Object obj) {
this.f4785i = obj;
this.f4787k |= Integer.MIN_VALUE;
return this.f4786j.z(null, this);
}
}
static {
}
public m(mk.a<? extends File> aVar, b1.k<T> kVar, List<? extends mk.p<? super b1.i<T>, ? super ek.d<? super k0>, ? extends Object>> list, b1.b<T> bVar, j0 j0Var) {
s.h(aVar, "produceFile");
s.h(kVar, "serializer");
s.h(list, "initTasksList");
s.h(bVar, "corruptionHandler");
s.h(j0Var, "scope");
this.f4692a = aVar;
this.f4693b = kVar;
this.f4694c = bVar;
this.f4695d = j0Var;
this.f4696e = bl.d.e(new g(this, null));
this.f4697f = ".tmp";
this.f4698g = ak.m.b(new h(this));
this.f4699h = bl.m.a(b1.o.f4788a);
this.f4700i = x.o0(list);
this.f4701j = new b1.l<>(j0Var, new d(this), e.f4709a, new f(this, null));
}
@Override
public Object a(mk.p<? super T, ? super ek.d<? super T>, ? extends Object> pVar, ek.d<? super T> dVar) {
u b10 = w.b(null, 1, null);
this.f4701j.e(new b.C0055b(pVar, b10, this.f4699h.getValue(), dVar.getContext()));
return b10.q(dVar);
}
@Override
public bl.b<T> getData() {
return this.f4696e;
}
public final void p(File file) {
File parentFile = file.getCanonicalFile().getParentFile();
if (parentFile == null) {
return;
}
parentFile.mkdirs();
if (!parentFile.isDirectory()) {
throw new IOException(s.q("Unable to create parent directories of ", file));
}
}
public final File q() {
return (File) this.f4698g.getValue();
}
public final Object r(b.a<T> aVar, ek.d<? super k0> dVar) {
b1.n<T> value = this.f4699h.getValue();
if (!(value instanceof b1.c)) {
if (value instanceof b1.j) {
if (value == aVar.a()) {
Object v10 = v(dVar);
return v10 == fk.c.c() ? v10 : k0.f364a;
}
} else if (s.c(value, b1.o.f4788a)) {
Object v11 = v(dVar);
return v11 == fk.c.c() ? v11 : k0.f364a;
} else if (value instanceof b1.h) {
throw new IllegalStateException("Can't read in final state.".toString());
}
}
return k0.f364a;
}
public final Object s(b.C0055b<T> c0055b, ek.d<? super k0> dVar) {
i iVar;
Object c10;
int i10;
Object b10;
u<T> uVar;
u<T> a10;
b1.n<T> value;
m mVar;
Object y10;
b.C0055b<T> c0055b2;
b.C0055b<T> c0055b3;
if (dVar instanceof i) {
iVar = (i) dVar;
int i11 = iVar.f4730i;
if ((i11 & Integer.MIN_VALUE) != 0) {
iVar.f4730i = i11 - Integer.MIN_VALUE;
Object obj = iVar.f4728g;
c10 = fk.c.c();
i10 = iVar.f4730i;
boolean z7 = true;
if (i10 == 0) {
if (i10 == 1) {
c0055b3 = (u) iVar.f4725d;
} else if (i10 == 2) {
u<T> uVar2 = (u) iVar.f4727f;
mVar = (m) iVar.f4726e;
b.C0055b<T> c0055b4 = (b.C0055b) iVar.f4725d;
ak.s.b(obj);
a10 = uVar2;
c0055b2 = c0055b4;
} else if (i10 != 3) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
c0055b3 = (b.C0055b<T>) ((u) iVar.f4725d);
}
ak.s.b(obj);
c0055b = c0055b3;
b10 = ak.r.b(obj);
uVar = c0055b;
w.c(uVar, b10);
return k0.f364a;
}
ak.s.b(obj);
a10 = c0055b.a();
try {
r.a aVar = ak.r.f374b;
value = this.f4699h.getValue();
} catch (Throwable th2) {
th = th2;
c0055b = a10;
r.a aVar2 = ak.r.f374b;
b10 = ak.r.b(ak.s.a(th));
uVar = c0055b;
w.c(uVar, b10);
return k0.f364a;
}
if (value instanceof b1.c) {
mk.p<T, ek.d<? super T>, Object> d10 = c0055b.d();
ek.g b11 = c0055b.b();
iVar.f4725d = a10;
iVar.f4730i = 1;
y10 = y(d10, b11, iVar);
if (y10 == c10) {
return c10;
}
u<T> uVar3 = a10;
obj = y10;
c0055b = uVar3;
b10 = ak.r.b(obj);
uVar = c0055b;
w.c(uVar, b10);
return k0.f364a;
}
if (!(value instanceof b1.j)) {
z7 = value instanceof b1.o;
}
if (!z7) {
if (value instanceof b1.h) {
throw ((b1.h) value).a();
}
throw new ak.o();
} else if (value != c0055b.c()) {
throw ((b1.j) value).a();
} else {
iVar.f4725d = c0055b;
iVar.f4726e = this;
iVar.f4727f = a10;
iVar.f4730i = 2;
if (u(iVar) == c10) {
return c10;
}
mVar = this;
c0055b2 = c0055b;
}
mk.p<T, ek.d<? super T>, Object> d11 = c0055b2.d();
ek.g b12 = c0055b2.b();
iVar.f4725d = a10;
iVar.f4726e = null;
iVar.f4727f = null;
iVar.f4730i = 3;
y10 = mVar.y(d11, b12, iVar);
if (y10 == c10) {
return c10;
}
u<T> uVar32 = a10;
obj = y10;
c0055b = uVar32;
b10 = ak.r.b(obj);
uVar = c0055b;
w.c(uVar, b10);
return k0.f364a;
}
}
iVar = new i(this, dVar);
Object obj2 = iVar.f4728g;
c10 = fk.c.c();
i10 = iVar.f4730i;
boolean z72 = true;
if (i10 == 0) {
}
mk.p<T, ek.d<? super T>, Object> d112 = c0055b2.d();
ek.g b122 = c0055b2.b();
iVar.f4725d = a10;
iVar.f4726e = null;
iVar.f4727f = null;
iVar.f4730i = 3;
y10 = mVar.y(d112, b122, iVar);
if (y10 == c10) {
}
u<T> uVar322 = a10;
obj2 = y10;
c0055b = uVar322;
b10 = ak.r.b(obj2);
uVar = c0055b;
w.c(uVar, b10);
return k0.f364a;
}
public final Object t(ek.d<? super k0> dVar) {
j jVar;
int i10;
hl.a b10;
nk.j0 j0Var;
m<T> mVar;
nk.j0 j0Var2;
List<? extends mk.p<? super b1.i<T>, ? super ek.d<? super k0>, ? extends Object>> list;
m<T> mVar2;
nk.j0 j0Var3;
k kVar;
Iterator<T> it;
hl.a aVar;
g0 g0Var;
Object obj;
hl.a aVar2;
j jVar2;
m<T> mVar3;
nk.j0 j0Var4;
g0 g0Var2;
if (dVar instanceof j) {
jVar = (j) dVar;
int i11 = jVar.f4739l;
if ((i11 & Integer.MIN_VALUE) != 0) {
jVar.f4739l = i11 - Integer.MIN_VALUE;
T t10 = (T) jVar.f4737j;
Object c10 = fk.c.c();
i10 = jVar.f4739l;
if (i10 != 0) {
ak.s.b(t10);
if (!(s.c(this.f4699h.getValue(), b1.o.f4788a) || (this.f4699h.getValue() instanceof b1.j))) {
throw new IllegalStateException("Check failed.".toString());
}
b10 = hl.c.b(false, 1, null);
j0Var = new nk.j0();
jVar.f4731d = this;
jVar.f4732e = b10;
jVar.f4733f = j0Var;
jVar.f4734g = j0Var;
jVar.f4739l = 1;
t10 = (T) x(jVar);
if (t10 == c10) {
return c10;
}
mVar = this;
j0Var2 = j0Var;
} else if (i10 != 1) {
if (i10 != 2) {
if (i10 == 3) {
aVar2 = (hl.a) jVar.f4734g;
g0Var2 = (g0) jVar.f4733f;
j0Var4 = (nk.j0) jVar.f4732e;
mVar3 = (m) jVar.f4731d;
ak.s.b(t10);
try {
g0Var2.f48375a = true;
k0 k0Var = k0.f364a;
aVar2.c(null);
bl.j<b1.n<T>> jVar3 = mVar3.f4699h;
T t11 = j0Var4.f48386a;
jVar3.setValue(new b1.c(t11, t11 != null ? t11.hashCode() : 0));
return k0Var;
} catch (Throwable th2) {
aVar2.c(null);
throw th2;
}
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
it = (Iterator) jVar.f4736i;
kVar = (k) jVar.f4735h;
g0Var = (g0) jVar.f4734g;
j0Var3 = (nk.j0) jVar.f4733f;
aVar = (hl.a) jVar.f4732e;
mVar2 = (m) jVar.f4731d;
ak.s.b(t10);
while (it.hasNext()) {
jVar.f4731d = mVar2;
jVar.f4732e = aVar;
jVar.f4733f = j0Var3;
jVar.f4734g = g0Var;
jVar.f4735h = kVar;
jVar.f4736i = it;
jVar.f4739l = 2;
if (((mk.p) it.next()).invoke(kVar, jVar) == c10) {
return c10;
}
}
jVar2 = jVar;
obj = c10;
j0Var2 = j0Var3;
aVar2 = aVar;
mVar3 = mVar2;
mVar3.f4700i = null;
jVar2.f4731d = mVar3;
jVar2.f4732e = j0Var2;
jVar2.f4733f = g0Var;
jVar2.f4734g = aVar2;
jVar2.f4735h = null;
jVar2.f4736i = null;
jVar2.f4739l = 3;
if (aVar2.a(null, jVar2) == obj) {
return obj;
}
j0Var4 = j0Var2;
g0Var2 = g0Var;
g0Var2.f48375a = true;
k0 k0Var2 = k0.f364a;
aVar2.c(null);
bl.j<b1.n<T>> jVar32 = mVar3.f4699h;
T t112 = j0Var4.f48386a;
jVar32.setValue(new b1.c(t112, t112 != null ? t112.hashCode() : 0));
return k0Var2;
} else {
j0Var = (nk.j0) jVar.f4734g;
j0Var2 = (nk.j0) jVar.f4733f;
b10 = (hl.a) jVar.f4732e;
mVar = (m) jVar.f4731d;
ak.s.b(t10);
}
j0Var.f48386a = t10;
g0 g0Var3 = new g0();
k kVar2 = new k(b10, g0Var3, j0Var2, mVar);
list = mVar.f4700i;
if (list != null) {
obj = c10;
aVar2 = b10;
g0Var = g0Var3;
jVar2 = jVar;
mVar3 = mVar;
mVar3.f4700i = null;
jVar2.f4731d = mVar3;
jVar2.f4732e = j0Var2;
jVar2.f4733f = g0Var;
jVar2.f4734g = aVar2;
jVar2.f4735h = null;
jVar2.f4736i = null;
jVar2.f4739l = 3;
if (aVar2.a(null, jVar2) == obj) {
}
} else {
mVar2 = mVar;
j0Var3 = j0Var2;
kVar = kVar2;
it = list.iterator();
aVar = b10;
g0Var = g0Var3;
while (it.hasNext()) {
}
jVar2 = jVar;
obj = c10;
j0Var2 = j0Var3;
aVar2 = aVar;
mVar3 = mVar2;
mVar3.f4700i = null;
jVar2.f4731d = mVar3;
jVar2.f4732e = j0Var2;
jVar2.f4733f = g0Var;
jVar2.f4734g = aVar2;
jVar2.f4735h = null;
jVar2.f4736i = null;
jVar2.f4739l = 3;
if (aVar2.a(null, jVar2) == obj) {
}
}
}
}
jVar = new j(this, dVar);
T t102 = (T) jVar.f4737j;
Object c102 = fk.c.c();
i10 = jVar.f4739l;
if (i10 != 0) {
}
j0Var.f48386a = t102;
g0 g0Var32 = new g0();
k kVar22 = new k(b10, g0Var32, j0Var2, mVar);
list = mVar.f4700i;
if (list != null) {
}
}
public final Object u(ek.d<? super k0> dVar) {
l lVar;
int i10;
m<T> mVar;
if (dVar instanceof l) {
lVar = (l) dVar;
int i11 = lVar.f4755g;
if ((i11 & Integer.MIN_VALUE) != 0) {
lVar.f4755g = i11 - Integer.MIN_VALUE;
Object obj = lVar.f4753e;
Object c10 = fk.c.c();
i10 = lVar.f4755g;
if (i10 != 0) {
ak.s.b(obj);
try {
lVar.f4752d = this;
lVar.f4755g = 1;
if (t(lVar) == c10) {
return c10;
}
} catch (Throwable th2) {
th = th2;
mVar = this;
mVar.f4699h.setValue(new b1.j(th));
throw th;
}
} else if (i10 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
mVar = (m) lVar.f4752d;
try {
ak.s.b(obj);
} catch (Throwable th3) {
th = th3;
mVar.f4699h.setValue(new b1.j(th));
throw th;
}
}
return k0.f364a;
}
}
lVar = new l(this, dVar);
Object obj2 = lVar.f4753e;
Object c102 = fk.c.c();
i10 = lVar.f4755g;
if (i10 != 0) {
}
return k0.f364a;
}
public final Object v(ek.d<? super k0> dVar) {
C0057m c0057m;
int i10;
m<T> mVar;
if (dVar instanceof C0057m) {
c0057m = (C0057m) dVar;
int i11 = c0057m.f4759g;
if ((i11 & Integer.MIN_VALUE) != 0) {
c0057m.f4759g = i11 - Integer.MIN_VALUE;
Object obj = c0057m.f4757e;
Object c10 = fk.c.c();
i10 = c0057m.f4759g;
if (i10 != 0) {
ak.s.b(obj);
try {
c0057m.f4756d = this;
c0057m.f4759g = 1;
if (t(c0057m) == c10) {
return c10;
}
} catch (Throwable th2) {
th = th2;
mVar = this;
mVar.f4699h.setValue(new b1.j(th));
return k0.f364a;
}
} else if (i10 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
mVar = (m) c0057m.f4756d;
try {
ak.s.b(obj);
} catch (Throwable th3) {
th = th3;
mVar.f4699h.setValue(new b1.j(th));
return k0.f364a;
}
}
return k0.f364a;
}
}
c0057m = new C0057m(this, dVar);
Object obj2 = c0057m.f4757e;
Object c102 = fk.c.c();
i10 = c0057m.f4759g;
if (i10 != 0) {
}
return k0.f364a;
}
public final Object w(ek.d<? super T> dVar) {
?? r02;
int i10;
Throwable th2;
FileInputStream fileInputStream;
try {
if (dVar instanceof n) {
n nVar = (n) dVar;
int i11 = nVar.f4765i;
if ((i11 & Integer.MIN_VALUE) != 0) {
nVar.f4765i = i11 - Integer.MIN_VALUE;
r02 = nVar;
Object obj = r02.f4763g;
Object c10 = fk.c.c();
i10 = r02.f4765i;
if (i10 != 0) {
ak.s.b(obj);
try {
FileInputStream fileInputStream2 = new FileInputStream(q());
try {
r02.f4760d = this;
r02.f4761e = fileInputStream2;
r02.f4762f = null;
r02.f4765i = 1;
Object a10 = this.f4693b.a(fileInputStream2, r02);
if (a10 == c10) {
return c10;
}
th2 = null;
obj = a10;
fileInputStream = fileInputStream2;
} catch (Throwable th3) {
th = th3;
throw th;
}
} catch (FileNotFoundException e10) {
e = e10;
r02 = this;
if (r02.q().exists()) {
throw e;
}
return r02.f4693b.getDefaultValue();
}
} else if (i10 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
th2 = (Throwable) r02.f4762f;
?? r22 = (Closeable) r02.f4761e;
m mVar = (m) r02.f4760d;
try {
ak.s.b(obj);
fileInputStream = r22;
} catch (Throwable th4) {
th = th4;
throw th;
}
}
kk.c.a(fileInputStream, th2);
return obj;
}
}
if (i10 != 0) {
}
kk.c.a(fileInputStream, th2);
return obj;
} catch (FileNotFoundException e11) {
e = e11;
}
r02 = new n(this, dVar);
Object obj2 = r02.f4763g;
Object c102 = fk.c.c();
i10 = r02.f4765i;
}
public final Object x(ek.d<? super T> dVar) {
o oVar;
int i10;
m mVar;
Object a10;
b1.a aVar;
m mVar2;
b1.a aVar2;
if (dVar instanceof o) {
oVar = (o) dVar;
int i11 = oVar.f4770h;
if ((i11 & Integer.MIN_VALUE) != 0) {
oVar.f4770h = i11 - Integer.MIN_VALUE;
Object obj = oVar.f4768f;
Object c10 = fk.c.c();
i10 = oVar.f4770h;
if (i10 != 0) {
ak.s.b(obj);
try {
oVar.f4766d = this;
oVar.f4770h = 1;
obj = w(oVar);
if (obj == c10) {
return c10;
}
} catch (b1.a e10) {
e = e10;
mVar = this;
b1.b<T> bVar = mVar.f4694c;
oVar.f4766d = mVar;
oVar.f4767e = e;
oVar.f4770h = 2;
a10 = bVar.a(e, oVar);
if (a10 != c10) {
return c10;
}
m mVar3 = mVar;
aVar = e;
obj = a10;
mVar2 = mVar3;
oVar.f4766d = aVar;
oVar.f4767e = obj;
oVar.f4770h = 3;
if (mVar2.z(obj, oVar) != c10) {
}
}
} else if (i10 != 1) {
if (i10 != 2) {
if (i10 == 3) {
Object obj2 = oVar.f4767e;
aVar2 = (b1.a) oVar.f4766d;
try {
ak.s.b(obj);
return obj2;
} catch (IOException e11) {
e = e11;
ak.e.a(aVar2, e);
throw aVar2;
}
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
aVar = (b1.a) oVar.f4767e;
mVar2 = (m) oVar.f4766d;
ak.s.b(obj);
try {
oVar.f4766d = aVar;
oVar.f4767e = obj;
oVar.f4770h = 3;
return mVar2.z(obj, oVar) != c10 ? c10 : obj;
} catch (IOException e12) {
e = e12;
aVar2 = aVar;
ak.e.a(aVar2, e);
throw aVar2;
}
} else {
mVar = (m) oVar.f4766d;
try {
ak.s.b(obj);
} catch (b1.a e13) {
e = e13;
b1.b<T> bVar2 = mVar.f4694c;
oVar.f4766d = mVar;
oVar.f4767e = e;
oVar.f4770h = 2;
a10 = bVar2.a(e, oVar);
if (a10 != c10) {
}
}
}
return obj;
}
}
oVar = new o(this, dVar);
Object obj3 = oVar.f4768f;
Object c102 = fk.c.c();
i10 = oVar.f4770h;
if (i10 != 0) {
}
return obj3;
}
public final Object y(mk.p<? super T, ? super ek.d<? super T>, ? extends Object> pVar, ek.g gVar, ek.d<? super T> dVar) {
p pVar2;
T t10;
int i10;
b1.c cVar;
Object obj;
m<T> mVar;
m mVar2;
if (dVar instanceof p) {
pVar2 = (p) dVar;
int i11 = pVar2.f4776i;
if ((i11 & Integer.MIN_VALUE) != 0) {
pVar2.f4776i = i11 - Integer.MIN_VALUE;
t10 = (T) pVar2.f4774g;
Object c10 = fk.c.c();
i10 = pVar2.f4776i;
if (i10 != 0) {
ak.s.b(t10);
b1.c cVar2 = (b1.c) this.f4699h.getValue();
cVar2.a();
Object b10 = cVar2.b();
q qVar = new q(pVar, b10, null);
pVar2.f4771d = this;
pVar2.f4772e = cVar2;
pVar2.f4773f = b10;
pVar2.f4776i = 1;
Object g7 = yk.g.g(gVar, qVar, pVar2);
if (g7 == c10) {
return c10;
}
cVar = cVar2;
t10 = g7;
obj = b10;
mVar = this;
} else if (i10 != 1) {
if (i10 == 2) {
obj = pVar2.f4772e;
mVar2 = (m) pVar2.f4771d;
ak.s.b(t10);
mVar2.f4699h.setValue(new b1.c(obj, obj == null ? obj.hashCode() : 0));
return obj;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
obj = pVar2.f4773f;
cVar = (b1.c) pVar2.f4772e;
mVar = (m) pVar2.f4771d;
ak.s.b(t10);
}
cVar.a();
if (!s.c(obj, t10)) {
pVar2.f4771d = mVar;
pVar2.f4772e = t10;
pVar2.f4773f = null;
pVar2.f4776i = 2;
if (mVar.z(t10, pVar2) == c10) {
return c10;
}
obj = t10;
mVar2 = mVar;
mVar2.f4699h.setValue(new b1.c(obj, obj == null ? obj.hashCode() : 0));
}
return obj;
}
}
pVar2 = new p(this, dVar);
t10 = (T) pVar2.f4774g;
Object c102 = fk.c.c();
i10 = pVar2.f4776i;
if (i10 != 0) {
}
cVar.a();
if (!s.c(obj, t10)) {
}
return obj;
}
public final Object z(T t10, ek.d<? super k0> dVar) {
r rVar;
int i10;
File file;
m<T> mVar;
File file2;
FileOutputStream fileOutputStream;
Throwable th2;
FileOutputStream fileOutputStream2;
try {
if (dVar instanceof r) {
rVar = (r) dVar;
int i11 = rVar.f4787k;
if ((i11 & Integer.MIN_VALUE) != 0) {
rVar.f4787k = i11 - Integer.MIN_VALUE;
Object obj = rVar.f4785i;
Object c10 = fk.c.c();
i10 = rVar.f4787k;
if (i10 != 0) {
ak.s.b(obj);
p(q());
file = new File(s.q(q().getAbsolutePath(), this.f4697f));
try {
FileOutputStream fileOutputStream3 = new FileOutputStream(file);
try {
b1.k<T> kVar = this.f4693b;
c cVar = new c(fileOutputStream3);
rVar.f4780d = this;
rVar.f4781e = file;
rVar.f4782f = fileOutputStream3;
rVar.f4783g = null;
rVar.f4784h = fileOutputStream3;
rVar.f4787k = 1;
if (kVar.b(t10, cVar, rVar) == c10) {
return c10;
}
mVar = this;
file2 = file;
fileOutputStream = fileOutputStream3;
th2 = null;
fileOutputStream2 = fileOutputStream3;
} catch (Throwable th3) {
th = th3;
throw th;
}
} catch (IOException e10) {
e = e10;
if (file.exists()) {
file.delete();
}
throw e;
}
} else if (i10 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
fileOutputStream = (FileOutputStream) rVar.f4784h;
th2 = (Throwable) rVar.f4783g;
?? r22 = (Closeable) rVar.f4782f;
file2 = (File) rVar.f4781e;
mVar = (m) rVar.f4780d;
try {
ak.s.b(obj);
fileOutputStream2 = r22;
} catch (Throwable th4) {
th = th4;
throw th;
}
}
fileOutputStream.getFD().sync();
k0 k0Var = k0.f364a;
kk.c.a(fileOutputStream2, th2);
if (file2.renameTo(mVar.q())) {
throw new IOException("Unable to rename " + file2 + ".This likely means that there are multiple instances of DataStore for this file. Ensure that you are only creating a single instance of datastore for this file.");
}
return k0Var;
}
}
if (i10 != 0) {
}
fileOutputStream.getFD().sync();
k0 k0Var2 = k0.f364a;
kk.c.a(fileOutputStream2, th2);
if (file2.renameTo(mVar.q())) {
}
} catch (IOException e11) {
e = e11;
file = 1;
}
rVar = new r(this, dVar);
Object obj2 = rVar.f4785i;
Object c102 = fk.c.c();
i10 = rVar.f4787k;
}
}