Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
package androidx.datastore.core;
import java.io.IOException;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class CorruptionException extends IOException {
public /* synthetic */ CorruptionException(String str, Throwable th, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(str, (i & 2) != 0 ? null : th);
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public CorruptionException(String message, Throwable th) {
super(message, th);
Intrinsics.checkNotNullParameter(message, "message");
}
}

View File

@@ -0,0 +1,8 @@
package androidx.datastore.core;
import kotlin.coroutines.Continuation;
/* loaded from: classes.dex */
public interface CorruptionHandler<T> {
Object handleCorruption(CorruptionException corruptionException, Continuation continuation);
}

View File

@@ -0,0 +1,28 @@
package androidx.datastore.core;
/* loaded from: classes.dex */
final class Data<T> extends State<T> {
private final int hashCode;
private final T value;
public final int getHashCode() {
return this.hashCode;
}
public final T getValue() {
return this.value;
}
public Data(T t, int i) {
super(null);
this.value = t;
this.hashCode = i;
}
public final void checkHashCode() {
T t = this.value;
if (!((t != null ? t.hashCode() : 0) == this.hashCode)) {
throw new IllegalStateException("Data in DataStore was mutated but DataStore is only compatible with Immutable types.".toString());
}
}
}

View File

@@ -0,0 +1,12 @@
package androidx.datastore.core;
import kotlin.coroutines.Continuation;
/* loaded from: classes.dex */
public interface DataMigration<T> {
Object cleanUp(Continuation continuation);
Object migrate(T t, Continuation continuation);
Object shouldMigrate(T t, Continuation continuation);
}

View File

@@ -0,0 +1,62 @@
package androidx.datastore.core;
import androidx.datastore.core.DataMigrationInitializer;
import java.util.List;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
@DebugMetadata(c = "androidx.datastore.core.DataMigrationInitializer$Companion$getInitializer$1", f = "DataMigrationInitializer.kt", l = {33}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class DataMigrationInitializer$Companion$getInitializer$1 extends SuspendLambda implements Function2 {
final /* synthetic */ List<DataMigration<T>> $migrations;
/* synthetic */ Object L$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
/* JADX WARN: Multi-variable type inference failed */
public DataMigrationInitializer$Companion$getInitializer$1(List<? extends DataMigration<T>> list, Continuation continuation) {
super(2, continuation);
this.$migrations = list;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
DataMigrationInitializer$Companion$getInitializer$1 dataMigrationInitializer$Companion$getInitializer$1 = new DataMigrationInitializer$Companion$getInitializer$1(this.$migrations, continuation);
dataMigrationInitializer$Companion$getInitializer$1.L$0 = obj;
return dataMigrationInitializer$Companion$getInitializer$1;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(InitializerApi<T> initializerApi, Continuation continuation) {
return ((DataMigrationInitializer$Companion$getInitializer$1) create(initializerApi, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
Object runMigrations;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
InitializerApi initializerApi = (InitializerApi) this.L$0;
DataMigrationInitializer.Companion companion = DataMigrationInitializer.Companion;
List<DataMigration<T>> list = this.$migrations;
this.label = 1;
runMigrations = companion.runMigrations(list, initializerApi, this);
if (runMigrations == coroutine_suspended) {
return coroutine_suspended;
}
} else if (i == 1) {
ResultKt.throwOnFailure(obj);
} else {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
return Unit.INSTANCE;
}
}

View File

@@ -0,0 +1,31 @@
package androidx.datastore.core;
import androidx.datastore.core.DataMigrationInitializer;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
@DebugMetadata(c = "androidx.datastore.core.DataMigrationInitializer$Companion", f = "DataMigrationInitializer.kt", l = {42, 57}, m = "runMigrations")
/* loaded from: classes.dex */
public final class DataMigrationInitializer$Companion$runMigrations$1<T> extends ContinuationImpl {
Object L$0;
Object L$1;
int label;
/* synthetic */ Object result;
final /* synthetic */ DataMigrationInitializer.Companion this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public DataMigrationInitializer$Companion$runMigrations$1(DataMigrationInitializer.Companion companion, Continuation continuation) {
super(continuation);
this.this$0 = companion;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object runMigrations;
this.result = obj;
this.label |= Integer.MIN_VALUE;
runMigrations = this.this$0.runMigrations(null, null, this);
return runMigrations;
}
}

View File

@@ -0,0 +1,53 @@
package androidx.datastore.core;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function1;
@DebugMetadata(c = "androidx.datastore.core.DataMigrationInitializer$Companion$runMigrations$2$1$1", f = "DataMigrationInitializer.kt", l = {45}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class DataMigrationInitializer$Companion$runMigrations$2$1$1 extends SuspendLambda implements Function1 {
final /* synthetic */ DataMigration<T> $migration;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public DataMigrationInitializer$Companion$runMigrations$2$1$1(DataMigration<T> dataMigration, Continuation continuation) {
super(1, continuation);
this.$migration = dataMigration;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Continuation continuation) {
return new DataMigrationInitializer$Companion$runMigrations$2$1$1(this.$migration, continuation);
}
@Override // kotlin.jvm.functions.Function1
public final Object invoke(Continuation continuation) {
return ((DataMigrationInitializer$Companion$runMigrations$2$1$1) create(continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
DataMigration<T> dataMigration = this.$migration;
this.label = 1;
if (dataMigration.cleanUp(this) == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
return Unit.INSTANCE;
}
}

View File

@@ -0,0 +1,147 @@
package androidx.datastore.core;
import java.util.List;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
@DebugMetadata(c = "androidx.datastore.core.DataMigrationInitializer$Companion$runMigrations$2", f = "DataMigrationInitializer.kt", l = {44, 46}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class DataMigrationInitializer$Companion$runMigrations$2 extends SuspendLambda implements Function2 {
final /* synthetic */ List<Function1> $cleanUps;
final /* synthetic */ List<DataMigration<T>> $migrations;
/* synthetic */ Object L$0;
Object L$1;
Object L$2;
Object L$3;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
/* JADX WARN: Multi-variable type inference failed */
public DataMigrationInitializer$Companion$runMigrations$2(List<? extends DataMigration<T>> list, List<Function1> list2, Continuation continuation) {
super(2, continuation);
this.$migrations = list;
this.$cleanUps = list2;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
DataMigrationInitializer$Companion$runMigrations$2 dataMigrationInitializer$Companion$runMigrations$2 = new DataMigrationInitializer$Companion$runMigrations$2(this.$migrations, this.$cleanUps, continuation);
dataMigrationInitializer$Companion$runMigrations$2.L$0 = obj;
return dataMigrationInitializer$Companion$runMigrations$2;
}
@Override // kotlin.jvm.functions.Function2
public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2) {
return invoke((DataMigrationInitializer$Companion$runMigrations$2) obj, (Continuation) obj2);
}
public final Object invoke(T t, Continuation continuation) {
return ((DataMigrationInitializer$Companion$runMigrations$2) create(t, continuation)).invokeSuspend(Unit.INSTANCE);
}
/* JADX WARN: Removed duplicated region for block: B:16:0x0074 */
/* JADX WARN: Removed duplicated region for block: B:20:0x0090 */
/* JADX WARN: Removed duplicated region for block: B:22:0x0093 A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:9:0x0050 */
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object invokeSuspend(java.lang.Object r11) {
/*
r10 = this;
java.lang.Object r0 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r1 = r10.label
r2 = 2
r3 = 1
if (r1 == 0) goto L3a
if (r1 == r3) goto L24
if (r1 != r2) goto L1c
java.lang.Object r1 = r10.L$1
java.util.Iterator r1 = (java.util.Iterator) r1
java.lang.Object r4 = r10.L$0
java.util.List r4 = (java.util.List) r4
kotlin.ResultKt.throwOnFailure(r11)
r7 = r10
goto L8e
L1c:
java.lang.IllegalStateException r11 = new java.lang.IllegalStateException
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
r11.<init>(r0)
throw r11
L24:
java.lang.Object r1 = r10.L$3
java.lang.Object r4 = r10.L$2
androidx.datastore.core.DataMigration r4 = (androidx.datastore.core.DataMigration) r4
java.lang.Object r5 = r10.L$1
java.util.Iterator r5 = (java.util.Iterator) r5
java.lang.Object r6 = r10.L$0
java.util.List r6 = (java.util.List) r6
kotlin.ResultKt.throwOnFailure(r11)
r7 = r10
r9 = r6
r6 = r4
r4 = r9
goto L6c
L3a:
kotlin.ResultKt.throwOnFailure(r11)
java.lang.Object r11 = r10.L$0
java.util.List<androidx.datastore.core.DataMigration<T>> r1 = r10.$migrations
java.lang.Iterable r1 = (java.lang.Iterable) r1
java.util.List<kotlin.jvm.functions.Function1> r4 = r10.$cleanUps
java.util.Iterator r1 = r1.iterator()
r5 = r10
L4a:
boolean r6 = r1.hasNext()
if (r6 == 0) goto L93
java.lang.Object r6 = r1.next()
androidx.datastore.core.DataMigration r6 = (androidx.datastore.core.DataMigration) r6
r5.L$0 = r4
r5.L$1 = r1
r5.L$2 = r6
r5.L$3 = r11
r5.label = r3
java.lang.Object r7 = r6.shouldMigrate(r11, r5)
if (r7 != r0) goto L67
return r0
L67:
r9 = r1
r1 = r11
r11 = r7
r7 = r5
r5 = r9
L6c:
java.lang.Boolean r11 = (java.lang.Boolean) r11
boolean r11 = r11.booleanValue()
if (r11 == 0) goto L90
androidx.datastore.core.DataMigrationInitializer$Companion$runMigrations$2$1$1 r11 = new androidx.datastore.core.DataMigrationInitializer$Companion$runMigrations$2$1$1
r8 = 0
r11.<init>(r6, r8)
r4.add(r11)
r7.L$0 = r4
r7.L$1 = r5
r7.L$2 = r8
r7.L$3 = r8
r7.label = r2
java.lang.Object r11 = r6.migrate(r1, r7)
if (r11 != r0) goto L91
return r0
L8e:
r5 = r7
goto L4a
L90:
r11 = r1
L91:
r1 = r5
goto L8e
L93:
return r11
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.datastore.core.DataMigrationInitializer$Companion$runMigrations$2.invokeSuspend(java.lang.Object):java.lang.Object");
}
}

View File

@@ -0,0 +1,136 @@
package androidx.datastore.core;
import java.util.List;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class DataMigrationInitializer<T> {
public static final Companion Companion = new Companion(null);
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final <T> Function2 getInitializer(List<? extends DataMigration<T>> migrations) {
Intrinsics.checkNotNullParameter(migrations, "migrations");
return new DataMigrationInitializer$Companion$getInitializer$1(migrations, null);
}
/* JADX INFO: Access modifiers changed from: private */
/* JADX WARN: Removed duplicated region for block: B:16:0x0071 */
/* JADX WARN: Removed duplicated region for block: B:27:0x009c */
/* JADX WARN: Removed duplicated region for block: B:29:0x009f */
/* JADX WARN: Removed duplicated region for block: B:39:0x0046 */
/* JADX WARN: Removed duplicated region for block: B:8:0x0024 */
/* JADX WARN: Type inference failed for: r9v3, types: [T, java.lang.Throwable] */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:29:0x0088 -> B:13:0x006b). Please report as a decompilation issue!!! */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:30:0x008b -> B:13:0x006b). Please report as a decompilation issue!!! */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final <T> java.lang.Object runMigrations(java.util.List<? extends androidx.datastore.core.DataMigration<T>> r7, androidx.datastore.core.InitializerApi<T> r8, kotlin.coroutines.Continuation r9) {
/*
r6 = this;
boolean r0 = r9 instanceof androidx.datastore.core.DataMigrationInitializer$Companion$runMigrations$1
if (r0 == 0) goto L13
r0 = r9
androidx.datastore.core.DataMigrationInitializer$Companion$runMigrations$1 r0 = (androidx.datastore.core.DataMigrationInitializer$Companion$runMigrations$1) r0
int r1 = r0.label
r2 = -2147483648(0xffffffff80000000, float:-0.0)
r3 = r1 & r2
if (r3 == 0) goto L13
int r1 = r1 - r2
r0.label = r1
goto L18
L13:
androidx.datastore.core.DataMigrationInitializer$Companion$runMigrations$1 r0 = new androidx.datastore.core.DataMigrationInitializer$Companion$runMigrations$1
r0.<init>(r6, r9)
L18:
java.lang.Object r9 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 2
r4 = 1
if (r2 == 0) goto L46
if (r2 == r4) goto L3e
if (r2 != r3) goto L36
java.lang.Object r7 = r0.L$1
java.util.Iterator r7 = (java.util.Iterator) r7
java.lang.Object r8 = r0.L$0
kotlin.jvm.internal.Ref$ObjectRef r8 = (kotlin.jvm.internal.Ref.ObjectRef) r8
kotlin.ResultKt.throwOnFailure(r9) // Catch: java.lang.Throwable -> L34
goto L6b
L34:
r9 = move-exception
goto L84
L36:
java.lang.IllegalStateException r7 = new java.lang.IllegalStateException
java.lang.String r8 = "call to 'resume' before 'invoke' with coroutine"
r7.<init>(r8)
throw r7
L3e:
java.lang.Object r7 = r0.L$0
java.util.List r7 = (java.util.List) r7
kotlin.ResultKt.throwOnFailure(r9)
goto L60
L46:
kotlin.ResultKt.throwOnFailure(r9)
java.util.ArrayList r9 = new java.util.ArrayList
r9.<init>()
androidx.datastore.core.DataMigrationInitializer$Companion$runMigrations$2 r2 = new androidx.datastore.core.DataMigrationInitializer$Companion$runMigrations$2
r5 = 0
r2.<init>(r7, r9, r5)
r0.L$0 = r9
r0.label = r4
java.lang.Object r7 = r8.updateData(r2, r0)
if (r7 != r1) goto L5f
return r1
L5f:
r7 = r9
L60:
kotlin.jvm.internal.Ref$ObjectRef r8 = new kotlin.jvm.internal.Ref$ObjectRef
r8.<init>()
java.lang.Iterable r7 = (java.lang.Iterable) r7
java.util.Iterator r7 = r7.iterator()
L6b:
boolean r9 = r7.hasNext()
if (r9 == 0) goto L96
java.lang.Object r9 = r7.next()
kotlin.jvm.functions.Function1 r9 = (kotlin.jvm.functions.Function1) r9
r0.L$0 = r8 // Catch: java.lang.Throwable -> L34
r0.L$1 = r7 // Catch: java.lang.Throwable -> L34
r0.label = r3 // Catch: java.lang.Throwable -> L34
java.lang.Object r9 = r9.invoke(r0) // Catch: java.lang.Throwable -> L34
if (r9 != r1) goto L6b
return r1
L84:
T r2 = r8.element
if (r2 != 0) goto L8b
r8.element = r9
goto L6b
L8b:
kotlin.jvm.internal.Intrinsics.checkNotNull(r2)
T r2 = r8.element
java.lang.Throwable r2 = (java.lang.Throwable) r2
kotlin.ExceptionsKt.addSuppressed(r2, r9)
goto L6b
L96:
T r7 = r8.element
java.lang.Throwable r7 = (java.lang.Throwable) r7
if (r7 != 0) goto L9f
kotlin.Unit r7 = kotlin.Unit.INSTANCE
return r7
L9f:
throw r7
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.datastore.core.DataMigrationInitializer.Companion.runMigrations(java.util.List, androidx.datastore.core.InitializerApi, kotlin.coroutines.Continuation):java.lang.Object");
}
}
}

View File

@@ -0,0 +1,12 @@
package androidx.datastore.core;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.flow.Flow;
/* loaded from: classes.dex */
public interface DataStore<T> {
Flow getData();
Object updateData(Function2 function2, Continuation continuation);
}

View File

@@ -0,0 +1,63 @@
package androidx.datastore.core;
import androidx.datastore.core.handlers.NoOpCorruptionHandler;
import androidx.datastore.core.handlers.ReplaceFileCorruptionHandler;
import java.util.List;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.CoroutineScopeKt;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.SupervisorKt;
/* loaded from: classes.dex */
public final class DataStoreFactory {
public static final DataStoreFactory INSTANCE = new DataStoreFactory();
public final <T> DataStore<T> create(Serializer<T> serializer, ReplaceFileCorruptionHandler<T> replaceFileCorruptionHandler, List<? extends DataMigration<T>> migrations, Function0 produceFile) {
Intrinsics.checkNotNullParameter(serializer, "serializer");
Intrinsics.checkNotNullParameter(migrations, "migrations");
Intrinsics.checkNotNullParameter(produceFile, "produceFile");
return create$default(this, serializer, replaceFileCorruptionHandler, migrations, null, produceFile, 8, null);
}
public final <T> DataStore<T> create(Serializer<T> serializer, ReplaceFileCorruptionHandler<T> replaceFileCorruptionHandler, Function0 produceFile) {
Intrinsics.checkNotNullParameter(serializer, "serializer");
Intrinsics.checkNotNullParameter(produceFile, "produceFile");
return create$default(this, serializer, replaceFileCorruptionHandler, null, null, produceFile, 12, null);
}
public final <T> DataStore<T> create(Serializer<T> serializer, Function0 produceFile) {
Intrinsics.checkNotNullParameter(serializer, "serializer");
Intrinsics.checkNotNullParameter(produceFile, "produceFile");
return create$default(this, serializer, null, null, null, produceFile, 14, null);
}
private DataStoreFactory() {
}
public static /* synthetic */ DataStore create$default(DataStoreFactory dataStoreFactory, Serializer serializer, ReplaceFileCorruptionHandler replaceFileCorruptionHandler, List list, CoroutineScope coroutineScope, Function0 function0, int i, Object obj) {
ReplaceFileCorruptionHandler replaceFileCorruptionHandler2 = (i & 2) != 0 ? null : replaceFileCorruptionHandler;
if ((i & 4) != 0) {
list = CollectionsKt__CollectionsKt.emptyList();
}
List list2 = list;
if ((i & 8) != 0) {
coroutineScope = CoroutineScopeKt.CoroutineScope(Dispatchers.getIO().plus(SupervisorKt.SupervisorJob$default(null, 1, null)));
}
return dataStoreFactory.create(serializer, replaceFileCorruptionHandler2, list2, coroutineScope, function0);
}
public final <T> DataStore<T> create(Serializer<T> serializer, ReplaceFileCorruptionHandler<T> replaceFileCorruptionHandler, List<? extends DataMigration<T>> migrations, CoroutineScope scope, Function0 produceFile) {
Intrinsics.checkNotNullParameter(serializer, "serializer");
Intrinsics.checkNotNullParameter(migrations, "migrations");
Intrinsics.checkNotNullParameter(scope, "scope");
Intrinsics.checkNotNullParameter(produceFile, "produceFile");
if (replaceFileCorruptionHandler == null) {
replaceFileCorruptionHandler = (ReplaceFileCorruptionHandler<T>) new NoOpCorruptionHandler();
}
return new SingleProcessDataStore(produceFile, serializer, CollectionsKt__CollectionsJVMKt.listOf(DataMigrationInitializer.Companion.getInitializer(migrations)), replaceFileCorruptionHandler, scope);
}
}

View File

@@ -0,0 +1,19 @@
package androidx.datastore.core;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
final class Final<T> extends State<T> {
private final Throwable finalException;
public final Throwable getFinalException() {
return this.finalException;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public Final(Throwable finalException) {
super(null);
Intrinsics.checkNotNullParameter(finalException, "finalException");
this.finalException = finalException;
}
}

View File

@@ -0,0 +1,9 @@
package androidx.datastore.core;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function2;
/* loaded from: classes.dex */
public interface InitializerApi<T> {
Object updateData(Function2 function2, Continuation continuation);
}

View File

@@ -0,0 +1,19 @@
package androidx.datastore.core;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
final class ReadException<T> extends State<T> {
private final Throwable readException;
public final Throwable getReadException() {
return this.readException;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public ReadException(Throwable readException) {
super(null);
Intrinsics.checkNotNullParameter(readException, "readException");
this.readException = readException;
}
}

View File

@@ -0,0 +1,14 @@
package androidx.datastore.core;
import java.io.InputStream;
import java.io.OutputStream;
import kotlin.coroutines.Continuation;
/* loaded from: classes.dex */
public interface Serializer<T> {
T getDefaultValue();
Object readFrom(InputStream inputStream, Continuation continuation);
Object writeTo(T t, OutputStream outputStream, Continuation continuation);
}

View File

@@ -0,0 +1,128 @@
package androidx.datastore.core;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.CoroutineScope;
@DebugMetadata(c = "androidx.datastore.core.SimpleActor$offer$2", f = "SimpleActor.kt", l = {122, 122}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class SimpleActor$offer$2 extends SuspendLambda implements Function2 {
Object L$0;
int label;
final /* synthetic */ SimpleActor<T> this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SimpleActor$offer$2(SimpleActor<T> simpleActor, Continuation continuation) {
super(2, continuation);
this.this$0 = simpleActor;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new SimpleActor$offer$2(this.this$0, continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((SimpleActor$offer$2) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
/* JADX WARN: Removed duplicated region for block: B:10:0x005a A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:12:0x005b */
/* JADX WARN: Removed duplicated region for block: B:15:0x006b A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:16:0x006c */
/* JADX WARN: Removed duplicated region for block: B:17:0x007a */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:16:0x006c -> B:6:0x006e). Please report as a decompilation issue!!! */
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object invokeSuspend(java.lang.Object r8) {
/*
r7 = this;
java.lang.Object r0 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r1 = r7.label
r2 = 2
r3 = 1
if (r1 == 0) goto L26
if (r1 == r3) goto L1b
if (r1 != r2) goto L13
kotlin.ResultKt.throwOnFailure(r8)
r8 = r7
goto L6e
L13:
java.lang.IllegalStateException r8 = new java.lang.IllegalStateException
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
r8.<init>(r0)
throw r8
L1b:
java.lang.Object r1 = r7.L$0
kotlin.jvm.functions.Function2 r1 = (kotlin.jvm.functions.Function2) r1
kotlin.ResultKt.throwOnFailure(r8)
r4 = r1
r1 = r0
r0 = r7
goto L60
L26:
kotlin.ResultKt.throwOnFailure(r8)
androidx.datastore.core.SimpleActor<T> r8 = r7.this$0
java.util.concurrent.atomic.AtomicInteger r8 = androidx.datastore.core.SimpleActor.access$getRemainingMessages$p(r8)
int r8 = r8.get()
if (r8 <= 0) goto L37
r8 = r3
goto L38
L37:
r8 = 0
L38:
if (r8 == 0) goto L7d
r8 = r7
L3b:
androidx.datastore.core.SimpleActor<T> r1 = r8.this$0
kotlinx.coroutines.CoroutineScope r1 = androidx.datastore.core.SimpleActor.access$getScope$p(r1)
kotlinx.coroutines.CoroutineScopeKt.ensureActive(r1)
androidx.datastore.core.SimpleActor<T> r1 = r8.this$0
kotlin.jvm.functions.Function2 r1 = androidx.datastore.core.SimpleActor.access$getConsumeMessage$p(r1)
androidx.datastore.core.SimpleActor<T> r4 = r8.this$0
kotlinx.coroutines.channels.Channel r4 = androidx.datastore.core.SimpleActor.access$getMessageQueue$p(r4)
r8.L$0 = r1
r8.label = r3
java.lang.Object r4 = r4.receive(r8)
if (r4 != r0) goto L5b
return r0
L5b:
r6 = r0
r0 = r8
r8 = r4
r4 = r1
r1 = r6
L60:
r5 = 0
r0.L$0 = r5
r0.label = r2
java.lang.Object r8 = r4.invoke(r8, r0)
if (r8 != r1) goto L6c
return r1
L6c:
r8 = r0
r0 = r1
L6e:
androidx.datastore.core.SimpleActor<T> r1 = r8.this$0
java.util.concurrent.atomic.AtomicInteger r1 = androidx.datastore.core.SimpleActor.access$getRemainingMessages$p(r1)
int r1 = r1.decrementAndGet()
if (r1 != 0) goto L3b
kotlin.Unit r8 = kotlin.Unit.INSTANCE
return r8
L7d:
java.lang.IllegalStateException r8 = new java.lang.IllegalStateException
java.lang.String r0 = "Check failed."
java.lang.String r0 = r0.toString()
r8.<init>(r0)
throw r8
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.datastore.core.SimpleActor$offer$2.invokeSuspend(java.lang.Object):java.lang.Object");
}
}

View File

@@ -0,0 +1,81 @@
package androidx.datastore.core;
import java.util.concurrent.atomic.AtomicInteger;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.Job;
import kotlinx.coroutines.channels.Channel;
import kotlinx.coroutines.channels.ChannelKt;
import kotlinx.coroutines.channels.ChannelResult;
import kotlinx.coroutines.channels.ClosedSendChannelException;
/* loaded from: classes.dex */
public final class SimpleActor<T> {
private final Function2 consumeMessage;
private final Channel messageQueue;
private final AtomicInteger remainingMessages;
private final CoroutineScope scope;
public SimpleActor(CoroutineScope scope, final Function1 onComplete, final Function2 onUndeliveredElement, Function2 consumeMessage) {
Intrinsics.checkNotNullParameter(scope, "scope");
Intrinsics.checkNotNullParameter(onComplete, "onComplete");
Intrinsics.checkNotNullParameter(onUndeliveredElement, "onUndeliveredElement");
Intrinsics.checkNotNullParameter(consumeMessage, "consumeMessage");
this.scope = scope;
this.consumeMessage = consumeMessage;
this.messageQueue = ChannelKt.Channel$default(Integer.MAX_VALUE, null, null, 6, null);
this.remainingMessages = new AtomicInteger(0);
Job job = (Job) scope.getCoroutineContext().get(Job.Key);
if (job == null) {
return;
}
job.invokeOnCompletion(new Function1() { // from class: androidx.datastore.core.SimpleActor.1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Object invoke(Object obj) {
invoke((Throwable) obj);
return Unit.INSTANCE;
}
public final void invoke(Throwable th) {
Unit unit;
Function1.this.invoke(th);
((SimpleActor) this).messageQueue.close(th);
do {
Object m4131getOrNullimpl = ChannelResult.m4131getOrNullimpl(((SimpleActor) this).messageQueue.mo4125tryReceivePtdJZtk());
if (m4131getOrNullimpl == null) {
unit = null;
} else {
onUndeliveredElement.invoke(m4131getOrNullimpl, th);
unit = Unit.INSTANCE;
}
} while (unit != null);
}
});
}
public final void offer(T t) {
Object mo4126trySendJP2dKIU = this.messageQueue.mo4126trySendJP2dKIU(t);
if (mo4126trySendJP2dKIU instanceof ChannelResult.Closed) {
Throwable m4130exceptionOrNullimpl = ChannelResult.m4130exceptionOrNullimpl(mo4126trySendJP2dKIU);
if (m4130exceptionOrNullimpl != null) {
throw m4130exceptionOrNullimpl;
}
throw new ClosedSendChannelException("Channel was closed normally");
}
if (!ChannelResult.m4134isSuccessimpl(mo4126trySendJP2dKIU)) {
throw new IllegalStateException("Check failed.".toString());
}
if (this.remainingMessages.getAndIncrement() == 0) {
BuildersKt__Builders_commonKt.launch$default(this.scope, null, null, new SimpleActor$offer$2(this, null), 3, null);
}
}
}

View File

@@ -0,0 +1,67 @@
package androidx.datastore.core;
import androidx.datastore.core.SingleProcessDataStore;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
@DebugMetadata(c = "androidx.datastore.core.SingleProcessDataStore$actor$3", f = "SingleProcessDataStore.kt", l = {239, 242}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class SingleProcessDataStore$actor$3 extends SuspendLambda implements Function2 {
/* synthetic */ Object L$0;
int label;
final /* synthetic */ SingleProcessDataStore<T> this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SingleProcessDataStore$actor$3(SingleProcessDataStore<T> singleProcessDataStore, Continuation continuation) {
super(2, continuation);
this.this$0 = singleProcessDataStore;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
SingleProcessDataStore$actor$3 singleProcessDataStore$actor$3 = new SingleProcessDataStore$actor$3(this.this$0, continuation);
singleProcessDataStore$actor$3.L$0 = obj;
return singleProcessDataStore$actor$3;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(SingleProcessDataStore.Message<T> message, Continuation continuation) {
return ((SingleProcessDataStore$actor$3) create(message, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
Object handleUpdate;
Object handleRead;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
SingleProcessDataStore.Message message = (SingleProcessDataStore.Message) this.L$0;
if (message instanceof SingleProcessDataStore.Message.Read) {
this.label = 1;
handleRead = this.this$0.handleRead((SingleProcessDataStore.Message.Read) message, this);
if (handleRead == coroutine_suspended) {
return coroutine_suspended;
}
} else if (message instanceof SingleProcessDataStore.Message.Update) {
this.label = 2;
handleUpdate = this.this$0.handleUpdate((SingleProcessDataStore.Message.Update) message, this);
if (handleUpdate == coroutine_suspended) {
return coroutine_suspended;
}
}
} else if (i == 1 || i == 2) {
ResultKt.throwOnFailure(obj);
} else {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
return Unit.INSTANCE;
}
}

View File

@@ -0,0 +1,234 @@
package androidx.datastore.core;
import androidx.datastore.core.SingleProcessDataStore;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.Boxing;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.flow.Flow;
import kotlinx.coroutines.flow.FlowCollector;
import kotlinx.coroutines.flow.FlowKt;
import kotlinx.coroutines.flow.MutableStateFlow;
@DebugMetadata(c = "androidx.datastore.core.SingleProcessDataStore$data$1", f = "SingleProcessDataStore.kt", l = {117}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class SingleProcessDataStore$data$1 extends SuspendLambda implements Function2 {
private /* synthetic */ Object L$0;
int label;
final /* synthetic */ SingleProcessDataStore<T> this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SingleProcessDataStore$data$1(SingleProcessDataStore<T> singleProcessDataStore, Continuation continuation) {
super(2, continuation);
this.this$0 = singleProcessDataStore;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
SingleProcessDataStore$data$1 singleProcessDataStore$data$1 = new SingleProcessDataStore$data$1(this.this$0, continuation);
singleProcessDataStore$data$1.L$0 = obj;
return singleProcessDataStore$data$1;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(FlowCollector flowCollector, Continuation continuation) {
return ((SingleProcessDataStore$data$1) create(flowCollector, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
MutableStateFlow mutableStateFlow;
MutableStateFlow mutableStateFlow2;
SimpleActor simpleActor;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
FlowCollector flowCollector = (FlowCollector) this.L$0;
mutableStateFlow = ((SingleProcessDataStore) this.this$0).downstreamFlow;
State state = (State) mutableStateFlow.getValue();
if (!(state instanceof Data)) {
simpleActor = ((SingleProcessDataStore) this.this$0).actor;
simpleActor.offer(new SingleProcessDataStore.Message.Read(state));
}
mutableStateFlow2 = ((SingleProcessDataStore) this.this$0).downstreamFlow;
final Flow dropWhile = FlowKt.dropWhile(mutableStateFlow2, new AnonymousClass1(state, null));
Flow flow = new Flow() { // from class: androidx.datastore.core.SingleProcessDataStore$data$1$invokeSuspend$$inlined$map$1
/* renamed from: androidx.datastore.core.SingleProcessDataStore$data$1$invokeSuspend$$inlined$map$1$2, reason: invalid class name */
public static final class AnonymousClass2 implements FlowCollector {
final /* synthetic */ FlowCollector $this_unsafeFlow$inlined;
@DebugMetadata(c = "androidx.datastore.core.SingleProcessDataStore$data$1$invokeSuspend$$inlined$map$1$2", f = "SingleProcessDataStore.kt", l = {137}, m = "emit")
/* renamed from: androidx.datastore.core.SingleProcessDataStore$data$1$invokeSuspend$$inlined$map$1$2$1, reason: invalid class name */
public static final class AnonymousClass1 extends ContinuationImpl {
Object L$0;
int label;
/* synthetic */ Object result;
public AnonymousClass1(Continuation continuation) {
super(continuation);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return AnonymousClass2.this.emit(null, this);
}
}
public AnonymousClass2(FlowCollector flowCollector) {
this.$this_unsafeFlow$inlined = flowCollector;
}
/* JADX WARN: Removed duplicated region for block: B:15:0x0031 */
/* JADX WARN: Removed duplicated region for block: B:8:0x0023 */
@Override // kotlinx.coroutines.flow.FlowCollector
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public java.lang.Object emit(java.lang.Object r5, kotlin.coroutines.Continuation r6) {
/*
r4 = this;
boolean r0 = r6 instanceof androidx.datastore.core.SingleProcessDataStore$data$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1
if (r0 == 0) goto L13
r0 = r6
androidx.datastore.core.SingleProcessDataStore$data$1$invokeSuspend$$inlined$map$1$2$1 r0 = (androidx.datastore.core.SingleProcessDataStore$data$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1) r0
int r1 = r0.label
r2 = -2147483648(0xffffffff80000000, float:-0.0)
r3 = r1 & r2
if (r3 == 0) goto L13
int r1 = r1 - r2
r0.label = r1
goto L18
L13:
androidx.datastore.core.SingleProcessDataStore$data$1$invokeSuspend$$inlined$map$1$2$1 r0 = new androidx.datastore.core.SingleProcessDataStore$data$1$invokeSuspend$$inlined$map$1$2$1
r0.<init>(r6)
L18:
java.lang.Object r6 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 1
if (r2 == 0) goto L31
if (r2 != r3) goto L29
kotlin.ResultKt.throwOnFailure(r6)
goto L53
L29:
java.lang.IllegalStateException r5 = new java.lang.IllegalStateException
java.lang.String r6 = "call to 'resume' before 'invoke' with coroutine"
r5.<init>(r6)
throw r5
L31:
kotlin.ResultKt.throwOnFailure(r6)
kotlinx.coroutines.flow.FlowCollector r6 = r4.$this_unsafeFlow$inlined
androidx.datastore.core.State r5 = (androidx.datastore.core.State) r5
boolean r2 = r5 instanceof androidx.datastore.core.ReadException
if (r2 != 0) goto L73
boolean r2 = r5 instanceof androidx.datastore.core.Final
if (r2 != 0) goto L6c
boolean r2 = r5 instanceof androidx.datastore.core.Data
if (r2 == 0) goto L56
androidx.datastore.core.Data r5 = (androidx.datastore.core.Data) r5
java.lang.Object r5 = r5.getValue()
r0.label = r3
java.lang.Object r5 = r6.emit(r5, r0)
if (r5 != r1) goto L53
return r1
L53:
kotlin.Unit r5 = kotlin.Unit.INSTANCE
return r5
L56:
boolean r5 = r5 instanceof androidx.datastore.core.UnInitialized
if (r5 == 0) goto L66
java.lang.IllegalStateException r5 = new java.lang.IllegalStateException
java.lang.String r6 = "This is a bug in DataStore. Please file a bug at: https://issuetracker.google.com/issues/new?component=907884&template=1466542"
java.lang.String r6 = r6.toString()
r5.<init>(r6)
throw r5
L66:
kotlin.NoWhenBranchMatchedException r5 = new kotlin.NoWhenBranchMatchedException
r5.<init>()
throw r5
L6c:
androidx.datastore.core.Final r5 = (androidx.datastore.core.Final) r5
java.lang.Throwable r5 = r5.getFinalException()
throw r5
L73:
androidx.datastore.core.ReadException r5 = (androidx.datastore.core.ReadException) r5
java.lang.Throwable r5 = r5.getReadException()
throw r5
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.datastore.core.SingleProcessDataStore$data$1$invokeSuspend$$inlined$map$1.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
}
}
@Override // kotlinx.coroutines.flow.Flow
public Object collect(FlowCollector flowCollector2, Continuation continuation) {
Object coroutine_suspended2;
Object collect = Flow.this.collect(new AnonymousClass2(flowCollector2), continuation);
coroutine_suspended2 = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
return collect == coroutine_suspended2 ? collect : Unit.INSTANCE;
}
};
this.label = 1;
if (FlowKt.emitAll(flowCollector, flow, this) == coroutine_suspended) {
return coroutine_suspended;
}
} else if (i == 1) {
ResultKt.throwOnFailure(obj);
} else {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
return Unit.INSTANCE;
}
@DebugMetadata(c = "androidx.datastore.core.SingleProcessDataStore$data$1$1", f = "SingleProcessDataStore.kt", l = {}, m = "invokeSuspend")
/* renamed from: androidx.datastore.core.SingleProcessDataStore$data$1$1, reason: invalid class name */
public static final class AnonymousClass1 extends SuspendLambda implements Function2 {
final /* synthetic */ State<T> $currentDownStreamFlowState;
/* synthetic */ Object L$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public AnonymousClass1(State<T> state, Continuation continuation) {
super(2, continuation);
this.$currentDownStreamFlowState = state;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
AnonymousClass1 anonymousClass1 = new AnonymousClass1(this.$currentDownStreamFlowState, continuation);
anonymousClass1.L$0 = obj;
return anonymousClass1;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(State<T> state, Continuation continuation) {
return ((AnonymousClass1) create(state, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (this.label == 0) {
ResultKt.throwOnFailure(obj);
State state = (State) this.L$0;
State state2 = this.$currentDownStreamFlowState;
boolean z = false;
if (!(state2 instanceof Data) && !(state2 instanceof Final) && state == state2) {
z = true;
}
return Boxing.boxBoolean(z);
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}
}

View File

@@ -0,0 +1,31 @@
package androidx.datastore.core;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
@DebugMetadata(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {276, 281, 284}, m = "handleUpdate")
/* loaded from: classes.dex */
public final class SingleProcessDataStore$handleUpdate$1 extends ContinuationImpl {
Object L$0;
Object L$1;
Object L$2;
int label;
/* synthetic */ Object result;
final /* synthetic */ SingleProcessDataStore<T> this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SingleProcessDataStore$handleUpdate$1(SingleProcessDataStore<T> singleProcessDataStore, Continuation continuation) {
super(continuation);
this.this$0 = singleProcessDataStore;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object handleUpdate;
this.result = obj;
this.label |= Integer.MIN_VALUE;
handleUpdate = this.this$0.handleUpdate(null, this);
return handleUpdate;
}
}

View File

@@ -0,0 +1,34 @@
package androidx.datastore.core;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
@DebugMetadata(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {322, 348, 505}, m = "readAndInit")
/* loaded from: classes.dex */
public final class SingleProcessDataStore$readAndInit$1 extends ContinuationImpl {
Object L$0;
Object L$1;
Object L$2;
Object L$3;
Object L$4;
Object L$5;
int label;
/* synthetic */ Object result;
final /* synthetic */ SingleProcessDataStore<T> this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SingleProcessDataStore$readAndInit$1(SingleProcessDataStore<T> singleProcessDataStore, Continuation continuation) {
super(continuation);
this.this$0 = singleProcessDataStore;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object readAndInit;
this.result = obj;
this.label |= Integer.MIN_VALUE;
readAndInit = this.this$0.readAndInit(this);
return readAndInit;
}
}

View File

@@ -0,0 +1,32 @@
package androidx.datastore.core;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import org.apache.http.HttpStatus;
@DebugMetadata(c = "androidx.datastore.core.SingleProcessDataStore$readAndInit$api$1", f = "SingleProcessDataStore.kt", l = {HttpStatus.SC_SERVICE_UNAVAILABLE, 337, 339}, m = "updateData")
/* loaded from: classes.dex */
public final class SingleProcessDataStore$readAndInit$api$1$updateData$1 extends ContinuationImpl {
Object L$0;
Object L$1;
Object L$2;
Object L$3;
Object L$4;
int label;
/* synthetic */ Object result;
final /* synthetic */ SingleProcessDataStore$readAndInit$api$1 this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SingleProcessDataStore$readAndInit$api$1$updateData$1(SingleProcessDataStore$readAndInit$api$1 singleProcessDataStore$readAndInit$api$1, Continuation continuation) {
super(continuation);
this.this$0 = singleProcessDataStore$readAndInit$api$1;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return this.this$0.updateData(null, this);
}
}

View File

@@ -0,0 +1,39 @@
package androidx.datastore.core;
import kotlin.jvm.internal.Ref;
import kotlinx.coroutines.sync.Mutex;
/* JADX INFO: Add missing generic type declarations: [T] */
/* loaded from: classes.dex */
public final class SingleProcessDataStore$readAndInit$api$1<T> implements InitializerApi<T> {
final /* synthetic */ Ref.ObjectRef<T> $initData;
final /* synthetic */ Ref.BooleanRef $initializationComplete;
final /* synthetic */ Mutex $updateLock;
final /* synthetic */ SingleProcessDataStore<T> this$0;
public SingleProcessDataStore$readAndInit$api$1(Mutex mutex, Ref.BooleanRef booleanRef, Ref.ObjectRef<T> objectRef, SingleProcessDataStore<T> singleProcessDataStore) {
this.$updateLock = mutex;
this.$initializationComplete = booleanRef;
this.$initData = objectRef;
this.this$0 = singleProcessDataStore;
}
/* JADX WARN: Removed duplicated region for block: B:30:0x00ba A[Catch: all -> 0x0056, TRY_LEAVE, TryCatch #0 {all -> 0x0056, blocks: (B:27:0x0052, B:28:0x00b2, B:30:0x00ba), top: B:26:0x0052 }] */
/* JADX WARN: Removed duplicated region for block: B:35:0x00d0 */
/* JADX WARN: Removed duplicated region for block: B:42:0x009a A[Catch: all -> 0x00d7, TRY_LEAVE, TryCatch #1 {all -> 0x00d7, blocks: (B:40:0x0096, B:42:0x009a, B:46:0x00da, B:47:0x00e1), top: B:39:0x0096 }] */
/* JADX WARN: Removed duplicated region for block: B:46:0x00da A[Catch: all -> 0x00d7, TRY_ENTER, TryCatch #1 {all -> 0x00d7, blocks: (B:40:0x0096, B:42:0x009a, B:46:0x00da, B:47:0x00e1), top: B:39:0x0096 }] */
/* JADX WARN: Removed duplicated region for block: B:50:0x0076 */
/* JADX WARN: Removed duplicated region for block: B:8:0x0026 */
@Override // androidx.datastore.core.InitializerApi
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public java.lang.Object updateData(kotlin.jvm.functions.Function2 r11, kotlin.coroutines.Continuation r12) {
/*
Method dump skipped, instructions count: 230
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.datastore.core.SingleProcessDataStore$readAndInit$api$1.updateData(kotlin.jvm.functions.Function2, kotlin.coroutines.Continuation):java.lang.Object");
}
}

View File

@@ -0,0 +1,29 @@
package androidx.datastore.core;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
@DebugMetadata(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {302}, m = "readAndInitOrPropagateAndThrowFailure")
/* loaded from: classes.dex */
public final class SingleProcessDataStore$readAndInitOrPropagateAndThrowFailure$1 extends ContinuationImpl {
Object L$0;
int label;
/* synthetic */ Object result;
final /* synthetic */ SingleProcessDataStore<T> this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SingleProcessDataStore$readAndInitOrPropagateAndThrowFailure$1(SingleProcessDataStore<T> singleProcessDataStore, Continuation continuation) {
super(continuation);
this.this$0 = singleProcessDataStore;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object readAndInitOrPropagateAndThrowFailure;
this.result = obj;
this.label |= Integer.MIN_VALUE;
readAndInitOrPropagateAndThrowFailure = this.this$0.readAndInitOrPropagateAndThrowFailure(this);
return readAndInitOrPropagateAndThrowFailure;
}
}

View File

@@ -0,0 +1,29 @@
package androidx.datastore.core;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
@DebugMetadata(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {311}, m = "readAndInitOrPropagateFailure")
/* loaded from: classes.dex */
public final class SingleProcessDataStore$readAndInitOrPropagateFailure$1 extends ContinuationImpl {
Object L$0;
int label;
/* synthetic */ Object result;
final /* synthetic */ SingleProcessDataStore<T> this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SingleProcessDataStore$readAndInitOrPropagateFailure$1(SingleProcessDataStore<T> singleProcessDataStore, Continuation continuation) {
super(continuation);
this.this$0 = singleProcessDataStore;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object readAndInitOrPropagateFailure;
this.result = obj;
this.label |= Integer.MIN_VALUE;
readAndInitOrPropagateFailure = this.this$0.readAndInitOrPropagateFailure(this);
return readAndInitOrPropagateFailure;
}
}

View File

@@ -0,0 +1,31 @@
package androidx.datastore.core;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
@DebugMetadata(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {381}, m = "readData")
/* loaded from: classes.dex */
public final class SingleProcessDataStore$readData$1 extends ContinuationImpl {
Object L$0;
Object L$1;
Object L$2;
int label;
/* synthetic */ Object result;
final /* synthetic */ SingleProcessDataStore<T> this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SingleProcessDataStore$readData$1(SingleProcessDataStore<T> singleProcessDataStore, Continuation continuation) {
super(continuation);
this.this$0 = singleProcessDataStore;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object readData;
this.result = obj;
this.label |= Integer.MIN_VALUE;
readData = this.this$0.readData(this);
return readData;
}
}

View File

@@ -0,0 +1,30 @@
package androidx.datastore.core;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
@DebugMetadata(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {359, 362, 365}, m = "readDataOrHandleCorruption")
/* loaded from: classes.dex */
public final class SingleProcessDataStore$readDataOrHandleCorruption$1 extends ContinuationImpl {
Object L$0;
Object L$1;
int label;
/* synthetic */ Object result;
final /* synthetic */ SingleProcessDataStore<T> this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SingleProcessDataStore$readDataOrHandleCorruption$1(SingleProcessDataStore<T> singleProcessDataStore, Continuation continuation) {
super(continuation);
this.this$0 = singleProcessDataStore;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object readDataOrHandleCorruption;
this.result = obj;
this.label |= Integer.MIN_VALUE;
readDataOrHandleCorruption = this.this$0.readDataOrHandleCorruption(this);
return readDataOrHandleCorruption;
}
}

View File

@@ -0,0 +1,31 @@
package androidx.datastore.core;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
@DebugMetadata(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {402, 410}, m = "transformAndWrite")
/* loaded from: classes.dex */
public final class SingleProcessDataStore$transformAndWrite$1 extends ContinuationImpl {
Object L$0;
Object L$1;
Object L$2;
int label;
/* synthetic */ Object result;
final /* synthetic */ SingleProcessDataStore<T> this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SingleProcessDataStore$transformAndWrite$1(SingleProcessDataStore<T> singleProcessDataStore, Continuation continuation) {
super(continuation);
this.this$0 = singleProcessDataStore;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object transformAndWrite;
this.result = obj;
this.label |= Integer.MIN_VALUE;
transformAndWrite = this.this$0.transformAndWrite(null, null, this);
return transformAndWrite;
}
}

View File

@@ -0,0 +1,58 @@
package androidx.datastore.core;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.CoroutineScope;
@DebugMetadata(c = "androidx.datastore.core.SingleProcessDataStore$transformAndWrite$newData$1", f = "SingleProcessDataStore.kt", l = {402}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class SingleProcessDataStore$transformAndWrite$newData$1 extends SuspendLambda implements Function2 {
final /* synthetic */ T $curData;
final /* synthetic */ Function2 $transform;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SingleProcessDataStore$transformAndWrite$newData$1(Function2 function2, T t, Continuation continuation) {
super(2, continuation);
this.$transform = function2;
this.$curData = t;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new SingleProcessDataStore$transformAndWrite$newData$1(this.$transform, this.$curData, continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((SingleProcessDataStore$transformAndWrite$newData$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
Function2 function2 = this.$transform;
Object obj2 = this.$curData;
this.label = 1;
obj = function2.invoke(obj2, this);
if (obj == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
return obj;
}
}

View File

@@ -0,0 +1,31 @@
package androidx.datastore.core;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
@DebugMetadata(c = "androidx.datastore.core.SingleProcessDataStore", f = "SingleProcessDataStore.kt", l = {426}, m = "writeData$datastore_core")
/* loaded from: classes.dex */
public final class SingleProcessDataStore$writeData$1 extends ContinuationImpl {
Object L$0;
Object L$1;
Object L$2;
Object L$3;
Object L$4;
int label;
/* synthetic */ Object result;
final /* synthetic */ SingleProcessDataStore<T> this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SingleProcessDataStore$writeData$1(SingleProcessDataStore<T> singleProcessDataStore, Continuation continuation) {
super(continuation);
this.this$0 = singleProcessDataStore;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return this.this$0.writeData$datastore_core(null, this);
}
}

View File

@@ -0,0 +1,988 @@
package androidx.datastore.core;
import androidx.annotation.GuardedBy;
import androidx.datastore.core.SingleProcessDataStore;
import androidx.datastore.core.handlers.NoOpCorruptionHandler;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CancellationException;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.CompletableDeferred;
import kotlinx.coroutines.CompletableDeferredKt;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.CoroutineScopeKt;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.SupervisorKt;
import kotlinx.coroutines.flow.Flow;
import kotlinx.coroutines.flow.FlowKt;
import kotlinx.coroutines.flow.MutableStateFlow;
import kotlinx.coroutines.flow.StateFlowKt;
/* loaded from: classes.dex */
public final class SingleProcessDataStore<T> implements DataStore<T> {
public static final Companion Companion = new Companion(null);
@GuardedBy("activeFilesLock")
private static final Set<String> activeFiles = new LinkedHashSet();
private static final Object activeFilesLock = new Object();
private final String SCRATCH_SUFFIX;
private final SimpleActor<Message<T>> actor;
private final CorruptionHandler<T> corruptionHandler;
private final Flow data;
private final MutableStateFlow downstreamFlow;
private final Lazy file$delegate;
private List<? extends Function2> initTasks;
private final Function0 produceFile;
private final CoroutineScope scope;
private final Serializer<T> serializer;
private static /* synthetic */ void getDownstreamFlow$annotations() {
}
@Override // androidx.datastore.core.DataStore
public Flow getData() {
return this.data;
}
public SingleProcessDataStore(Function0 produceFile, Serializer<T> serializer, List<? extends Function2> initTasksList, CorruptionHandler<T> corruptionHandler, CoroutineScope scope) {
Lazy lazy;
Intrinsics.checkNotNullParameter(produceFile, "produceFile");
Intrinsics.checkNotNullParameter(serializer, "serializer");
Intrinsics.checkNotNullParameter(initTasksList, "initTasksList");
Intrinsics.checkNotNullParameter(corruptionHandler, "corruptionHandler");
Intrinsics.checkNotNullParameter(scope, "scope");
this.produceFile = produceFile;
this.serializer = serializer;
this.corruptionHandler = corruptionHandler;
this.scope = scope;
this.data = FlowKt.flow(new SingleProcessDataStore$data$1(this, null));
this.SCRATCH_SUFFIX = ".tmp";
lazy = LazyKt__LazyJVMKt.lazy(new Function0(this) { // from class: androidx.datastore.core.SingleProcessDataStore$file$2
final /* synthetic */ SingleProcessDataStore<T> this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(0);
this.this$0 = this;
}
@Override // kotlin.jvm.functions.Function0
public final File invoke() {
Function0 function0;
function0 = ((SingleProcessDataStore) this.this$0).produceFile;
File file = (File) function0.invoke();
String it = file.getAbsolutePath();
SingleProcessDataStore.Companion companion = SingleProcessDataStore.Companion;
synchronized (companion.getActiveFilesLock$datastore_core()) {
if (!(!companion.getActiveFiles$datastore_core().contains(it))) {
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> activeFiles$datastore_core = companion.getActiveFiles$datastore_core();
Intrinsics.checkNotNullExpressionValue(it, "it");
activeFiles$datastore_core.add(it);
}
return file;
}
});
this.file$delegate = lazy;
this.downstreamFlow = StateFlowKt.MutableStateFlow(UnInitialized.INSTANCE);
this.initTasks = CollectionsKt___CollectionsKt.toList(initTasksList);
this.actor = new SimpleActor<>(scope, new Function1(this) { // from class: androidx.datastore.core.SingleProcessDataStore$actor$1
final /* synthetic */ SingleProcessDataStore<T> this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
this.this$0 = this;
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Object invoke(Object obj) {
invoke((Throwable) obj);
return Unit.INSTANCE;
}
public final void invoke(Throwable th) {
File file;
MutableStateFlow mutableStateFlow;
if (th != null) {
mutableStateFlow = ((SingleProcessDataStore) this.this$0).downstreamFlow;
mutableStateFlow.setValue(new Final(th));
}
SingleProcessDataStore.Companion companion = SingleProcessDataStore.Companion;
Object activeFilesLock$datastore_core = companion.getActiveFilesLock$datastore_core();
SingleProcessDataStore<T> singleProcessDataStore = this.this$0;
synchronized (activeFilesLock$datastore_core) {
Set<String> activeFiles$datastore_core = companion.getActiveFiles$datastore_core();
file = singleProcessDataStore.getFile();
activeFiles$datastore_core.remove(file.getAbsolutePath());
Unit unit = Unit.INSTANCE;
}
}
}, new Function2() { // from class: androidx.datastore.core.SingleProcessDataStore$actor$2
@Override // kotlin.jvm.functions.Function2
public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2) {
invoke((SingleProcessDataStore.Message) obj, (Throwable) obj2);
return Unit.INSTANCE;
}
public final void invoke(SingleProcessDataStore.Message<T> msg, Throwable th) {
Intrinsics.checkNotNullParameter(msg, "msg");
if (msg instanceof SingleProcessDataStore.Message.Update) {
CompletableDeferred ack = ((SingleProcessDataStore.Message.Update) msg).getAck();
if (th == null) {
th = new CancellationException("DataStore scope was cancelled before updateData could complete");
}
ack.completeExceptionally(th);
}
}
}, new SingleProcessDataStore$actor$3(this, null));
}
public /* synthetic */ SingleProcessDataStore(Function0 function0, Serializer serializer, List list, CorruptionHandler corruptionHandler, CoroutineScope coroutineScope, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(function0, serializer, (i & 4) != 0 ? CollectionsKt__CollectionsKt.emptyList() : list, (i & 8) != 0 ? new NoOpCorruptionHandler() : corruptionHandler, (i & 16) != 0 ? CoroutineScopeKt.CoroutineScope(Dispatchers.getIO().plus(SupervisorKt.SupervisorJob$default(null, 1, null))) : coroutineScope);
}
@Override // androidx.datastore.core.DataStore
public Object updateData(Function2 function2, Continuation continuation) {
CompletableDeferred CompletableDeferred$default = CompletableDeferredKt.CompletableDeferred$default(null, 1, null);
this.actor.offer(new Message.Update(function2, CompletableDeferred$default, (State) this.downstreamFlow.getValue(), continuation.getContext()));
return CompletableDeferred$default.await(continuation);
}
/* JADX INFO: Access modifiers changed from: private */
public final File getFile() {
return (File) this.file$delegate.getValue();
}
public static abstract class Message<T> {
public /* synthetic */ Message(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public abstract State<T> getLastState();
private Message() {
}
public static final class Read<T> extends Message<T> {
private final State<T> lastState;
@Override // androidx.datastore.core.SingleProcessDataStore.Message
public State<T> getLastState() {
return this.lastState;
}
public Read(State<T> state) {
super(null);
this.lastState = state;
}
}
public static final class Update<T> extends Message<T> {
private final CompletableDeferred ack;
private final CoroutineContext callerContext;
private final State<T> lastState;
private final Function2 transform;
public final CompletableDeferred getAck() {
return this.ack;
}
public final CoroutineContext getCallerContext() {
return this.callerContext;
}
@Override // androidx.datastore.core.SingleProcessDataStore.Message
public State<T> getLastState() {
return this.lastState;
}
public final Function2 getTransform() {
return this.transform;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public Update(Function2 transform, CompletableDeferred ack, State<T> state, CoroutineContext callerContext) {
super(null);
Intrinsics.checkNotNullParameter(transform, "transform");
Intrinsics.checkNotNullParameter(ack, "ack");
Intrinsics.checkNotNullParameter(callerContext, "callerContext");
this.transform = transform;
this.ack = ack;
this.lastState = state;
this.callerContext = callerContext;
}
}
}
/* JADX INFO: Access modifiers changed from: private */
public final Object handleRead(Message.Read<T> read, Continuation continuation) {
Object coroutine_suspended;
Object coroutine_suspended2;
State<T> state = (State) this.downstreamFlow.getValue();
if (!(state instanceof Data)) {
if (state instanceof ReadException) {
if (state == read.getLastState()) {
Object readAndInitOrPropagateFailure = readAndInitOrPropagateFailure(continuation);
coroutine_suspended2 = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
return readAndInitOrPropagateFailure == coroutine_suspended2 ? readAndInitOrPropagateFailure : Unit.INSTANCE;
}
} else {
if (Intrinsics.areEqual(state, UnInitialized.INSTANCE)) {
Object readAndInitOrPropagateFailure2 = readAndInitOrPropagateFailure(continuation);
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
return readAndInitOrPropagateFailure2 == coroutine_suspended ? readAndInitOrPropagateFailure2 : Unit.INSTANCE;
}
if (state instanceof Final) {
throw new IllegalStateException("Can't read in final state.".toString());
}
}
}
return Unit.INSTANCE;
}
/* JADX INFO: Access modifiers changed from: private */
/* JADX WARN: Can't wrap try/catch for region: R(14:0|1|(2:3|(10:5|6|7|(5:(1:(1:(1:12)(2:19|20))(3:21|22|23))(1:28)|13|14|15|16)(4:29|30|31|(6:33|(1:35)|26|14|15|16)(4:36|(2:49|(2:51|52)(2:53|54))|39|(2:41|(1:43)(1:44))(2:45|46)))|24|(1:27)|26|14|15|16))|59|6|7|(0)(0)|24|(0)|26|14|15|16|(1:(0))) */
/* JADX WARN: Code restructure failed: missing block: B:58:0x0034, code lost:
r10 = th;
*/
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Removed duplicated region for block: B:27:0x00bd A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:29:0x0056 */
/* JADX WARN: Removed duplicated region for block: B:9:0x0025 */
/* JADX WARN: Type inference failed for: r10v11, types: [java.lang.Object] */
/* JADX WARN: Type inference failed for: r10v14 */
/* JADX WARN: Type inference failed for: r10v7, types: [java.lang.Object, kotlinx.coroutines.CompletableDeferred] */
/* JADX WARN: Type inference failed for: r10v9 */
/* JADX WARN: Type inference failed for: r9v20, types: [kotlinx.coroutines.CompletableDeferred] */
/* JADX WARN: Type inference failed for: r9v3, types: [kotlinx.coroutines.CompletableDeferred] */
/* JADX WARN: Type inference failed for: r9v33 */
/* JADX WARN: Type inference failed for: r9v34 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object handleUpdate(androidx.datastore.core.SingleProcessDataStore.Message.Update<T> r9, kotlin.coroutines.Continuation r10) {
/*
Method dump skipped, instructions count: 235
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.datastore.core.SingleProcessDataStore.handleUpdate(androidx.datastore.core.SingleProcessDataStore$Message$Update, kotlin.coroutines.Continuation):java.lang.Object");
}
/* JADX INFO: Access modifiers changed from: private */
/* JADX WARN: Removed duplicated region for block: B:21:0x0037 */
/* JADX WARN: Removed duplicated region for block: B:8:0x0023 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object readAndInitOrPropagateAndThrowFailure(kotlin.coroutines.Continuation r5) {
/*
r4 = this;
boolean r0 = r5 instanceof androidx.datastore.core.SingleProcessDataStore$readAndInitOrPropagateAndThrowFailure$1
if (r0 == 0) goto L13
r0 = r5
androidx.datastore.core.SingleProcessDataStore$readAndInitOrPropagateAndThrowFailure$1 r0 = (androidx.datastore.core.SingleProcessDataStore$readAndInitOrPropagateAndThrowFailure$1) r0
int r1 = r0.label
r2 = -2147483648(0xffffffff80000000, float:-0.0)
r3 = r1 & r2
if (r3 == 0) goto L13
int r1 = r1 - r2
r0.label = r1
goto L18
L13:
androidx.datastore.core.SingleProcessDataStore$readAndInitOrPropagateAndThrowFailure$1 r0 = new androidx.datastore.core.SingleProcessDataStore$readAndInitOrPropagateAndThrowFailure$1
r0.<init>(r4, r5)
L18:
java.lang.Object r5 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 1
if (r2 == 0) goto L37
if (r2 != r3) goto L2f
java.lang.Object r0 = r0.L$0
androidx.datastore.core.SingleProcessDataStore r0 = (androidx.datastore.core.SingleProcessDataStore) r0
kotlin.ResultKt.throwOnFailure(r5) // Catch: java.lang.Throwable -> L2d
goto L45
L2d:
r5 = move-exception
goto L4a
L2f:
java.lang.IllegalStateException r5 = new java.lang.IllegalStateException
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
r5.<init>(r0)
throw r5
L37:
kotlin.ResultKt.throwOnFailure(r5)
r0.L$0 = r4 // Catch: java.lang.Throwable -> L48
r0.label = r3 // Catch: java.lang.Throwable -> L48
java.lang.Object r5 = r4.readAndInit(r0) // Catch: java.lang.Throwable -> L48
if (r5 != r1) goto L45
return r1
L45:
kotlin.Unit r5 = kotlin.Unit.INSTANCE
return r5
L48:
r5 = move-exception
r0 = r4
L4a:
kotlinx.coroutines.flow.MutableStateFlow r0 = r0.downstreamFlow
androidx.datastore.core.ReadException r1 = new androidx.datastore.core.ReadException
r1.<init>(r5)
r0.setValue(r1)
throw r5
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.datastore.core.SingleProcessDataStore.readAndInitOrPropagateAndThrowFailure(kotlin.coroutines.Continuation):java.lang.Object");
}
/* JADX INFO: Access modifiers changed from: private */
/* JADX WARN: Removed duplicated region for block: B:20:0x0037 */
/* JADX WARN: Removed duplicated region for block: B:8:0x0023 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object readAndInitOrPropagateFailure(kotlin.coroutines.Continuation r5) {
/*
r4 = this;
boolean r0 = r5 instanceof androidx.datastore.core.SingleProcessDataStore$readAndInitOrPropagateFailure$1
if (r0 == 0) goto L13
r0 = r5
androidx.datastore.core.SingleProcessDataStore$readAndInitOrPropagateFailure$1 r0 = (androidx.datastore.core.SingleProcessDataStore$readAndInitOrPropagateFailure$1) r0
int r1 = r0.label
r2 = -2147483648(0xffffffff80000000, float:-0.0)
r3 = r1 & r2
if (r3 == 0) goto L13
int r1 = r1 - r2
r0.label = r1
goto L18
L13:
androidx.datastore.core.SingleProcessDataStore$readAndInitOrPropagateFailure$1 r0 = new androidx.datastore.core.SingleProcessDataStore$readAndInitOrPropagateFailure$1
r0.<init>(r4, r5)
L18:
java.lang.Object r5 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 1
if (r2 == 0) goto L37
if (r2 != r3) goto L2f
java.lang.Object r0 = r0.L$0
androidx.datastore.core.SingleProcessDataStore r0 = (androidx.datastore.core.SingleProcessDataStore) r0
kotlin.ResultKt.throwOnFailure(r5) // Catch: java.lang.Throwable -> L2d
goto L51
L2d:
r5 = move-exception
goto L47
L2f:
java.lang.IllegalStateException r5 = new java.lang.IllegalStateException
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
r5.<init>(r0)
throw r5
L37:
kotlin.ResultKt.throwOnFailure(r5)
r0.L$0 = r4 // Catch: java.lang.Throwable -> L45
r0.label = r3 // Catch: java.lang.Throwable -> L45
java.lang.Object r5 = r4.readAndInit(r0) // Catch: java.lang.Throwable -> L45
if (r5 != r1) goto L51
return r1
L45:
r5 = move-exception
r0 = r4
L47:
kotlinx.coroutines.flow.MutableStateFlow r0 = r0.downstreamFlow
androidx.datastore.core.ReadException r1 = new androidx.datastore.core.ReadException
r1.<init>(r5)
r0.setValue(r1)
L51:
kotlin.Unit r5 = kotlin.Unit.INSTANCE
return r5
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.datastore.core.SingleProcessDataStore.readAndInitOrPropagateFailure(kotlin.coroutines.Continuation):java.lang.Object");
}
/* JADX INFO: Access modifiers changed from: private */
/* JADX WARN: Removed duplicated region for block: B:16:0x0128 */
/* JADX WARN: Removed duplicated region for block: B:30:0x00e0 */
/* JADX WARN: Removed duplicated region for block: B:39:0x0116 A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:40:0x0117 */
/* JADX WARN: Removed duplicated region for block: B:44:0x00c8 */
/* JADX WARN: Removed duplicated region for block: B:45:0x00ce */
/* JADX WARN: Removed duplicated region for block: B:46:0x007b */
/* JADX WARN: Removed duplicated region for block: B:8:0x0027 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object readAndInit(kotlin.coroutines.Continuation r14) {
/*
Method dump skipped, instructions count: 326
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.datastore.core.SingleProcessDataStore.readAndInit(kotlin.coroutines.Continuation):java.lang.Object");
}
/* JADX INFO: Access modifiers changed from: private */
/* JADX WARN: Removed duplicated region for block: B:26:0x0085 A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:27:0x0086 */
/* JADX WARN: Removed duplicated region for block: B:40:0x0074 A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:41:0x0075 */
/* JADX WARN: Removed duplicated region for block: B:42:0x0055 */
/* JADX WARN: Removed duplicated region for block: B:8:0x0025 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object readDataOrHandleCorruption(kotlin.coroutines.Continuation r8) {
/*
r7 = this;
boolean r0 = r8 instanceof androidx.datastore.core.SingleProcessDataStore$readDataOrHandleCorruption$1
if (r0 == 0) goto L13
r0 = r8
androidx.datastore.core.SingleProcessDataStore$readDataOrHandleCorruption$1 r0 = (androidx.datastore.core.SingleProcessDataStore$readDataOrHandleCorruption$1) r0
int r1 = r0.label
r2 = -2147483648(0xffffffff80000000, float:-0.0)
r3 = r1 & r2
if (r3 == 0) goto L13
int r1 = r1 - r2
r0.label = r1
goto L18
L13:
androidx.datastore.core.SingleProcessDataStore$readDataOrHandleCorruption$1 r0 = new androidx.datastore.core.SingleProcessDataStore$readDataOrHandleCorruption$1
r0.<init>(r7, r8)
L18:
java.lang.Object r8 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 3
r4 = 2
r5 = 1
if (r2 == 0) goto L55
if (r2 == r5) goto L4b
if (r2 == r4) goto L3f
if (r2 != r3) goto L37
java.lang.Object r1 = r0.L$1
java.lang.Object r0 = r0.L$0
androidx.datastore.core.CorruptionException r0 = (androidx.datastore.core.CorruptionException) r0
kotlin.ResultKt.throwOnFailure(r8) // Catch: java.io.IOException -> L35
goto L87
L35:
r8 = move-exception
goto L8a
L37:
java.lang.IllegalStateException r8 = new java.lang.IllegalStateException
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
r8.<init>(r0)
throw r8
L3f:
java.lang.Object r2 = r0.L$1
androidx.datastore.core.CorruptionException r2 = (androidx.datastore.core.CorruptionException) r2
java.lang.Object r4 = r0.L$0
androidx.datastore.core.SingleProcessDataStore r4 = (androidx.datastore.core.SingleProcessDataStore) r4
kotlin.ResultKt.throwOnFailure(r8)
goto L79
L4b:
java.lang.Object r2 = r0.L$0
androidx.datastore.core.SingleProcessDataStore r2 = (androidx.datastore.core.SingleProcessDataStore) r2
kotlin.ResultKt.throwOnFailure(r8) // Catch: androidx.datastore.core.CorruptionException -> L53
goto L63
L53:
r8 = move-exception
goto L66
L55:
kotlin.ResultKt.throwOnFailure(r8)
r0.L$0 = r7 // Catch: androidx.datastore.core.CorruptionException -> L64
r0.label = r5 // Catch: androidx.datastore.core.CorruptionException -> L64
java.lang.Object r8 = r7.readData(r0) // Catch: androidx.datastore.core.CorruptionException -> L64
if (r8 != r1) goto L63
return r1
L63:
return r8
L64:
r8 = move-exception
r2 = r7
L66:
androidx.datastore.core.CorruptionHandler<T> r5 = r2.corruptionHandler
r0.L$0 = r2
r0.L$1 = r8
r0.label = r4
java.lang.Object r4 = r5.handleCorruption(r8, r0)
if (r4 != r1) goto L75
return r1
L75:
r6 = r2
r2 = r8
r8 = r4
r4 = r6
L79:
r0.L$0 = r2 // Catch: java.io.IOException -> L88
r0.L$1 = r8 // Catch: java.io.IOException -> L88
r0.label = r3 // Catch: java.io.IOException -> L88
java.lang.Object r0 = r4.writeData$datastore_core(r8, r0) // Catch: java.io.IOException -> L88
if (r0 != r1) goto L86
return r1
L86:
r1 = r8
L87:
return r1
L88:
r8 = move-exception
r0 = r2
L8a:
kotlin.ExceptionsKt.addSuppressed(r0, r8)
throw r0
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.datastore.core.SingleProcessDataStore.readDataOrHandleCorruption(kotlin.coroutines.Continuation):java.lang.Object");
}
/* JADX INFO: Access modifiers changed from: private */
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Removed duplicated region for block: B:26:0x003f */
/* JADX WARN: Removed duplicated region for block: B:9:0x0023 */
/* JADX WARN: Type inference failed for: r0v11, types: [androidx.datastore.core.SingleProcessDataStore] */
/* JADX WARN: Type inference failed for: r0v14 */
/* JADX WARN: Type inference failed for: r0v15 */
/* JADX WARN: Type inference failed for: r0v2, types: [androidx.datastore.core.SingleProcessDataStore$readData$1, kotlin.coroutines.Continuation] */
/* JADX WARN: Type inference failed for: r0v3 */
/* JADX WARN: Type inference failed for: r0v4, types: [androidx.datastore.core.SingleProcessDataStore] */
/* JADX WARN: Type inference failed for: r0v5 */
/* JADX WARN: Type inference failed for: r0v6 */
/* JADX WARN: Type inference failed for: r0v8 */
/* JADX WARN: Type inference failed for: r2v1, types: [java.io.FileInputStream, java.io.InputStream, java.lang.Object] */
/* JADX WARN: Type inference failed for: r2v2, types: [java.io.Closeable] */
/* JADX WARN: Type inference failed for: r2v5, types: [java.io.Closeable] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object readData(kotlin.coroutines.Continuation r6) {
/*
r5 = this;
boolean r0 = r6 instanceof androidx.datastore.core.SingleProcessDataStore$readData$1
if (r0 == 0) goto L13
r0 = r6
androidx.datastore.core.SingleProcessDataStore$readData$1 r0 = (androidx.datastore.core.SingleProcessDataStore$readData$1) r0
int r1 = r0.label
r2 = -2147483648(0xffffffff80000000, float:-0.0)
r3 = r1 & r2
if (r3 == 0) goto L13
int r1 = r1 - r2
r0.label = r1
goto L18
L13:
androidx.datastore.core.SingleProcessDataStore$readData$1 r0 = new androidx.datastore.core.SingleProcessDataStore$readData$1
r0.<init>(r5, r6)
L18:
java.lang.Object r6 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 1
if (r2 == 0) goto L3f
if (r2 != r3) goto L37
java.lang.Object r1 = r0.L$2
java.lang.Throwable r1 = (java.lang.Throwable) r1
java.lang.Object r2 = r0.L$1
java.io.Closeable r2 = (java.io.Closeable) r2
java.lang.Object r0 = r0.L$0
androidx.datastore.core.SingleProcessDataStore r0 = (androidx.datastore.core.SingleProcessDataStore) r0
kotlin.ResultKt.throwOnFailure(r6) // Catch: java.lang.Throwable -> L35
goto L5f
L35:
r6 = move-exception
goto L67
L37:
java.lang.IllegalStateException r6 = new java.lang.IllegalStateException
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
r6.<init>(r0)
throw r6
L3f:
kotlin.ResultKt.throwOnFailure(r6)
java.io.FileInputStream r2 = new java.io.FileInputStream // Catch: java.io.FileNotFoundException -> L6d
java.io.File r6 = r5.getFile() // Catch: java.io.FileNotFoundException -> L6d
r2.<init>(r6) // Catch: java.io.FileNotFoundException -> L6d
androidx.datastore.core.Serializer<T> r6 = r5.serializer // Catch: java.lang.Throwable -> L65
r0.L$0 = r5 // Catch: java.lang.Throwable -> L65
r0.L$1 = r2 // Catch: java.lang.Throwable -> L65
r4 = 0
r0.L$2 = r4 // Catch: java.lang.Throwable -> L65
r0.label = r3 // Catch: java.lang.Throwable -> L65
java.lang.Object r6 = r6.readFrom(r2, r0) // Catch: java.lang.Throwable -> L65
if (r6 != r1) goto L5d
return r1
L5d:
r0 = r5
r1 = r4
L5f:
kotlin.io.CloseableKt.closeFinally(r2, r1) // Catch: java.io.FileNotFoundException -> L63
return r6
L63:
r6 = move-exception
goto L6f
L65:
r6 = move-exception
r0 = r5
L67:
throw r6 // Catch: java.lang.Throwable -> L68
L68:
r1 = move-exception
kotlin.io.CloseableKt.closeFinally(r2, r6) // Catch: java.io.FileNotFoundException -> L63
throw r1 // Catch: java.io.FileNotFoundException -> L63
L6d:
r6 = move-exception
r0 = r5
L6f:
java.io.File r1 = r0.getFile()
boolean r1 = r1.exists()
if (r1 != 0) goto L80
androidx.datastore.core.Serializer<T> r6 = r0.serializer
java.lang.Object r6 = r6.getDefaultValue()
return r6
L80:
throw r6
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.datastore.core.SingleProcessDataStore.readData(kotlin.coroutines.Continuation):java.lang.Object");
}
/* JADX INFO: Access modifiers changed from: private */
/* JADX WARN: Removed duplicated region for block: B:13:0x0094 */
/* JADX WARN: Removed duplicated region for block: B:17:0x0099 */
/* JADX WARN: Removed duplicated region for block: B:23:0x007d */
/* JADX WARN: Removed duplicated region for block: B:27:0x0049 */
/* JADX WARN: Removed duplicated region for block: B:8:0x0025 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object transformAndWrite(kotlin.jvm.functions.Function2 r8, kotlin.coroutines.CoroutineContext r9, kotlin.coroutines.Continuation r10) {
/*
r7 = this;
boolean r0 = r10 instanceof androidx.datastore.core.SingleProcessDataStore$transformAndWrite$1
if (r0 == 0) goto L13
r0 = r10
androidx.datastore.core.SingleProcessDataStore$transformAndWrite$1 r0 = (androidx.datastore.core.SingleProcessDataStore$transformAndWrite$1) r0
int r1 = r0.label
r2 = -2147483648(0xffffffff80000000, float:-0.0)
r3 = r1 & r2
if (r3 == 0) goto L13
int r1 = r1 - r2
r0.label = r1
goto L18
L13:
androidx.datastore.core.SingleProcessDataStore$transformAndWrite$1 r0 = new androidx.datastore.core.SingleProcessDataStore$transformAndWrite$1
r0.<init>(r7, r10)
L18:
java.lang.Object r10 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 0
r4 = 2
r5 = 1
if (r2 == 0) goto L49
if (r2 == r5) goto L3b
if (r2 != r4) goto L33
java.lang.Object r8 = r0.L$1
java.lang.Object r9 = r0.L$0
androidx.datastore.core.SingleProcessDataStore r9 = (androidx.datastore.core.SingleProcessDataStore) r9
kotlin.ResultKt.throwOnFailure(r10)
goto L8e
L33:
java.lang.IllegalStateException r8 = new java.lang.IllegalStateException
java.lang.String r9 = "call to 'resume' before 'invoke' with coroutine"
r8.<init>(r9)
throw r8
L3b:
java.lang.Object r8 = r0.L$2
java.lang.Object r9 = r0.L$1
androidx.datastore.core.Data r9 = (androidx.datastore.core.Data) r9
java.lang.Object r2 = r0.L$0
androidx.datastore.core.SingleProcessDataStore r2 = (androidx.datastore.core.SingleProcessDataStore) r2
kotlin.ResultKt.throwOnFailure(r10)
goto L73
L49:
kotlin.ResultKt.throwOnFailure(r10)
kotlinx.coroutines.flow.MutableStateFlow r10 = r7.downstreamFlow
java.lang.Object r10 = r10.getValue()
androidx.datastore.core.Data r10 = (androidx.datastore.core.Data) r10
r10.checkHashCode()
java.lang.Object r2 = r10.getValue()
androidx.datastore.core.SingleProcessDataStore$transformAndWrite$newData$1 r6 = new androidx.datastore.core.SingleProcessDataStore$transformAndWrite$newData$1
r6.<init>(r8, r2, r3)
r0.L$0 = r7
r0.L$1 = r10
r0.L$2 = r2
r0.label = r5
java.lang.Object r8 = kotlinx.coroutines.BuildersKt.withContext(r9, r6, r0)
if (r8 != r1) goto L6f
return r1
L6f:
r9 = r10
r10 = r8
r8 = r2
r2 = r7
L73:
r9.checkHashCode()
boolean r9 = kotlin.jvm.internal.Intrinsics.areEqual(r8, r10)
if (r9 == 0) goto L7d
goto La0
L7d:
r0.L$0 = r2
r0.L$1 = r10
r0.L$2 = r3
r0.label = r4
java.lang.Object r8 = r2.writeData$datastore_core(r10, r0)
if (r8 != r1) goto L8c
return r1
L8c:
r8 = r10
r9 = r2
L8e:
kotlinx.coroutines.flow.MutableStateFlow r9 = r9.downstreamFlow
androidx.datastore.core.Data r10 = new androidx.datastore.core.Data
if (r8 == 0) goto L99
int r0 = r8.hashCode()
goto L9a
L99:
r0 = 0
L9a:
r10.<init>(r8, r0)
r9.setValue(r10)
La0:
return r8
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.datastore.core.SingleProcessDataStore.transformAndWrite(kotlin.jvm.functions.Function2, kotlin.coroutines.CoroutineContext, kotlin.coroutines.Continuation):java.lang.Object");
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Removed duplicated region for block: B:16:0x009f */
/* JADX WARN: Removed duplicated region for block: B:19:0x00a2 A[Catch: IOException -> 0x00be, TRY_ENTER, TryCatch #3 {IOException -> 0x00be, blocks: (B:14:0x0092, B:19:0x00a2, B:20:0x00bd, B:27:0x00c5, B:28:0x00c8, B:24:0x00c3), top: B:7:0x0021, inners: #2 }] */
/* JADX WARN: Removed duplicated region for block: B:31:0x0048 */
/* JADX WARN: Removed duplicated region for block: B:46:0x00d0 */
/* JADX WARN: Removed duplicated region for block: B:9:0x0023 */
/* JADX WARN: Type inference failed for: r2v10 */
/* JADX WARN: Type inference failed for: r2v11 */
/* JADX WARN: Type inference failed for: r2v4, types: [java.io.FileOutputStream, java.lang.Object] */
/* JADX WARN: Type inference failed for: r2v5, types: [java.io.Closeable] */
/* JADX WARN: Type inference failed for: r2v6 */
/* JADX WARN: Type inference failed for: r2v7, types: [java.io.Closeable] */
/* JADX WARN: Type inference failed for: r2v9, types: [java.io.Closeable] */
/* JADX WARN: Type inference failed for: r3v0 */
/* JADX WARN: Type inference failed for: r3v1 */
/* JADX WARN: Type inference failed for: r3v10 */
/* JADX WARN: Type inference failed for: r3v2 */
/* JADX WARN: Type inference failed for: r3v3 */
/* JADX WARN: Type inference failed for: r3v4 */
/* JADX WARN: Type inference failed for: r3v5 */
/* JADX WARN: Type inference failed for: r3v6, types: [java.io.File, java.lang.Object] */
/* JADX WARN: Type inference failed for: r3v8, types: [java.io.File] */
/* JADX WARN: Type inference failed for: r9v7, types: [java.lang.StringBuilder] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object writeData$datastore_core(T r8, kotlin.coroutines.Continuation r9) {
/*
r7 = this;
boolean r0 = r9 instanceof androidx.datastore.core.SingleProcessDataStore$writeData$1
if (r0 == 0) goto L13
r0 = r9
androidx.datastore.core.SingleProcessDataStore$writeData$1 r0 = (androidx.datastore.core.SingleProcessDataStore$writeData$1) r0
int r1 = r0.label
r2 = -2147483648(0xffffffff80000000, float:-0.0)
r3 = r1 & r2
if (r3 == 0) goto L13
int r1 = r1 - r2
r0.label = r1
goto L18
L13:
androidx.datastore.core.SingleProcessDataStore$writeData$1 r0 = new androidx.datastore.core.SingleProcessDataStore$writeData$1
r0.<init>(r7, r9)
L18:
java.lang.Object r9 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 1
if (r2 == 0) goto L48
if (r2 != r3) goto L40
java.lang.Object r8 = r0.L$4
java.io.FileOutputStream r8 = (java.io.FileOutputStream) r8
java.lang.Object r1 = r0.L$3
java.lang.Throwable r1 = (java.lang.Throwable) r1
java.lang.Object r2 = r0.L$2
java.io.Closeable r2 = (java.io.Closeable) r2
java.lang.Object r3 = r0.L$1
java.io.File r3 = (java.io.File) r3
java.lang.Object r0 = r0.L$0
androidx.datastore.core.SingleProcessDataStore r0 = (androidx.datastore.core.SingleProcessDataStore) r0
kotlin.ResultKt.throwOnFailure(r9) // Catch: java.lang.Throwable -> L3d
goto L89
L3d:
r8 = move-exception
goto Lc3
L40:
java.lang.IllegalStateException r8 = new java.lang.IllegalStateException
java.lang.String r9 = "call to 'resume' before 'invoke' with coroutine"
r8.<init>(r9)
throw r8
L48:
kotlin.ResultKt.throwOnFailure(r9)
java.io.File r9 = r7.getFile()
r7.createParentDirectories(r9)
java.io.File r9 = new java.io.File
java.io.File r2 = r7.getFile()
java.lang.String r2 = r2.getAbsolutePath()
java.lang.String r4 = r7.SCRATCH_SUFFIX
java.lang.String r2 = kotlin.jvm.internal.Intrinsics.stringPlus(r2, r4)
r9.<init>(r2)
java.io.FileOutputStream r2 = new java.io.FileOutputStream // Catch: java.io.IOException -> Lc9
r2.<init>(r9) // Catch: java.io.IOException -> Lc9
androidx.datastore.core.Serializer<T> r4 = r7.serializer // Catch: java.lang.Throwable -> Lc1
androidx.datastore.core.SingleProcessDataStore$UncloseableOutputStream r5 = new androidx.datastore.core.SingleProcessDataStore$UncloseableOutputStream // Catch: java.lang.Throwable -> Lc1
r5.<init>(r2) // Catch: java.lang.Throwable -> Lc1
r0.L$0 = r7 // Catch: java.lang.Throwable -> Lc1
r0.L$1 = r9 // Catch: java.lang.Throwable -> Lc1
r0.L$2 = r2 // Catch: java.lang.Throwable -> Lc1
r6 = 0
r0.L$3 = r6 // Catch: java.lang.Throwable -> Lc1
r0.L$4 = r2 // Catch: java.lang.Throwable -> Lc1
r0.label = r3 // Catch: java.lang.Throwable -> Lc1
java.lang.Object r8 = r4.writeTo(r8, r5, r0) // Catch: java.lang.Throwable -> Lc1
if (r8 != r1) goto L85
return r1
L85:
r0 = r7
r3 = r9
r8 = r2
r1 = r6
L89:
java.io.FileDescriptor r8 = r8.getFD() // Catch: java.lang.Throwable -> L3d
r8.sync() // Catch: java.lang.Throwable -> L3d
kotlin.Unit r8 = kotlin.Unit.INSTANCE // Catch: java.lang.Throwable -> L3d
kotlin.io.CloseableKt.closeFinally(r2, r1) // Catch: java.io.IOException -> Lbe
java.io.File r8 = r0.getFile() // Catch: java.io.IOException -> Lbe
boolean r8 = r3.renameTo(r8) // Catch: java.io.IOException -> Lbe
if (r8 == 0) goto La2
kotlin.Unit r8 = kotlin.Unit.INSTANCE
return r8
La2:
java.io.IOException r8 = new java.io.IOException // Catch: java.io.IOException -> Lbe
java.lang.StringBuilder r9 = new java.lang.StringBuilder // Catch: java.io.IOException -> Lbe
r9.<init>() // Catch: java.io.IOException -> Lbe
java.lang.String r0 = "Unable to rename "
r9.append(r0) // Catch: java.io.IOException -> Lbe
r9.append(r3) // Catch: java.io.IOException -> Lbe
java.lang.String r0 = ".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."
r9.append(r0) // Catch: java.io.IOException -> Lbe
java.lang.String r9 = r9.toString() // Catch: java.io.IOException -> Lbe
r8.<init>(r9) // Catch: java.io.IOException -> Lbe
throw r8 // Catch: java.io.IOException -> Lbe
Lbe:
r8 = move-exception
r9 = r3
goto Lca
Lc1:
r8 = move-exception
r3 = r9
Lc3:
throw r8 // Catch: java.lang.Throwable -> Lc4
Lc4:
r9 = move-exception
kotlin.io.CloseableKt.closeFinally(r2, r8) // Catch: java.io.IOException -> Lbe
throw r9 // Catch: java.io.IOException -> Lbe
Lc9:
r8 = move-exception
Lca:
boolean r0 = r9.exists()
if (r0 == 0) goto Ld3
r9.delete()
Ld3:
throw r8
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.datastore.core.SingleProcessDataStore.writeData$datastore_core(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
}
private final void createParentDirectories(File file) {
File parentFile = file.getCanonicalFile().getParentFile();
if (parentFile == null) {
return;
}
parentFile.mkdirs();
if (!parentFile.isDirectory()) {
throw new IOException(Intrinsics.stringPlus("Unable to create parent directories of ", file));
}
}
public static final class UncloseableOutputStream extends OutputStream {
private final FileOutputStream fileOutputStream;
@Override // java.io.OutputStream, java.io.Closeable, java.lang.AutoCloseable
public void close() {
}
public final FileOutputStream getFileOutputStream() {
return this.fileOutputStream;
}
public UncloseableOutputStream(FileOutputStream fileOutputStream) {
Intrinsics.checkNotNullParameter(fileOutputStream, "fileOutputStream");
this.fileOutputStream = fileOutputStream;
}
@Override // java.io.OutputStream
public void write(int i) {
this.fileOutputStream.write(i);
}
@Override // java.io.OutputStream
public void write(byte[] b) {
Intrinsics.checkNotNullParameter(b, "b");
this.fileOutputStream.write(b);
}
@Override // java.io.OutputStream
public void write(byte[] bytes, int i, int i2) {
Intrinsics.checkNotNullParameter(bytes, "bytes");
this.fileOutputStream.write(bytes, i, i2);
}
@Override // java.io.OutputStream, java.io.Flushable
public void flush() {
this.fileOutputStream.flush();
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final Set<String> getActiveFiles$datastore_core() {
return SingleProcessDataStore.activeFiles;
}
public final Object getActiveFilesLock$datastore_core() {
return SingleProcessDataStore.activeFilesLock;
}
}
}

View File

@@ -0,0 +1,13 @@
package androidx.datastore.core;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* loaded from: classes.dex */
abstract class State<T> {
public /* synthetic */ State(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private State() {
}
}

View File

@@ -0,0 +1,10 @@
package androidx.datastore.core;
/* loaded from: classes.dex */
final class UnInitialized extends State<Object> {
public static final UnInitialized INSTANCE = new UnInitialized();
private UnInitialized() {
super(null);
}
}

View File

@@ -0,0 +1,13 @@
package androidx.datastore.core.handlers;
import androidx.datastore.core.CorruptionException;
import androidx.datastore.core.CorruptionHandler;
import kotlin.coroutines.Continuation;
/* loaded from: classes.dex */
public final class NoOpCorruptionHandler<T> implements CorruptionHandler<T> {
@Override // androidx.datastore.core.CorruptionHandler
public Object handleCorruption(CorruptionException corruptionException, Continuation continuation) throws CorruptionException {
throw corruptionException;
}
}

View File

@@ -0,0 +1,23 @@
package androidx.datastore.core.handlers;
import androidx.datastore.core.CorruptionException;
import androidx.datastore.core.CorruptionHandler;
import java.io.IOException;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class ReplaceFileCorruptionHandler<T> implements CorruptionHandler<T> {
private final Function1 produceNewData;
public ReplaceFileCorruptionHandler(Function1 produceNewData) {
Intrinsics.checkNotNullParameter(produceNewData, "produceNewData");
this.produceNewData = produceNewData;
}
@Override // androidx.datastore.core.CorruptionHandler
public Object handleCorruption(CorruptionException corruptionException, Continuation continuation) throws IOException {
return this.produceNewData.invoke(corruptionException);
}
}