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,44 @@
package androidx.datastore;
import android.content.Context;
import androidx.datastore.core.Serializer;
import androidx.datastore.core.handlers.ReplaceFileCorruptionHandler;
import java.util.List;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.properties.ReadOnlyProperty;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.CoroutineScopeKt;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.SupervisorKt;
/* loaded from: classes.dex */
public final class DataStoreDelegateKt {
public static /* synthetic */ ReadOnlyProperty dataStore$default(String str, Serializer serializer, ReplaceFileCorruptionHandler replaceFileCorruptionHandler, Function1 function1, CoroutineScope coroutineScope, int i, Object obj) {
if ((i & 4) != 0) {
replaceFileCorruptionHandler = null;
}
if ((i & 8) != 0) {
function1 = new Function1() { // from class: androidx.datastore.DataStoreDelegateKt$dataStore$1
@Override // kotlin.jvm.functions.Function1
public final List invoke(Context it) {
Intrinsics.checkNotNullParameter(it, "it");
return CollectionsKt__CollectionsKt.emptyList();
}
};
}
if ((i & 16) != 0) {
coroutineScope = CoroutineScopeKt.CoroutineScope(Dispatchers.getIO().plus(SupervisorKt.SupervisorJob$default(null, 1, null)));
}
return dataStore(str, serializer, replaceFileCorruptionHandler, function1, coroutineScope);
}
public static final <T> ReadOnlyProperty dataStore(String fileName, Serializer<T> serializer, ReplaceFileCorruptionHandler<T> replaceFileCorruptionHandler, Function1 produceMigrations, CoroutineScope scope) {
Intrinsics.checkNotNullParameter(fileName, "fileName");
Intrinsics.checkNotNullParameter(serializer, "serializer");
Intrinsics.checkNotNullParameter(produceMigrations, "produceMigrations");
Intrinsics.checkNotNullParameter(scope, "scope");
return new DataStoreSingletonDelegate(fileName, serializer, replaceFileCorruptionHandler, produceMigrations, scope);
}
}

View File

@@ -0,0 +1,14 @@
package androidx.datastore;
import android.content.Context;
import java.io.File;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class DataStoreFile {
public static final File dataStoreFile(Context context, String fileName) {
Intrinsics.checkNotNullParameter(context, "<this>");
Intrinsics.checkNotNullParameter(fileName, "fileName");
return new File(context.getApplicationContext().getFilesDir(), Intrinsics.stringPlus("datastore/", fileName));
}
}

View File

@@ -0,0 +1,84 @@
package androidx.datastore;
import android.content.Context;
import androidx.annotation.GuardedBy;
import androidx.datastore.core.DataStore;
import androidx.datastore.core.DataStoreFactory;
import androidx.datastore.core.Serializer;
import androidx.datastore.core.handlers.ReplaceFileCorruptionHandler;
import java.io.File;
import java.util.List;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.properties.ReadOnlyProperty;
import kotlin.reflect.KProperty;
import kotlinx.coroutines.CoroutineScope;
/* loaded from: classes.dex */
public final class DataStoreSingletonDelegate<T> implements ReadOnlyProperty {
@GuardedBy("lock")
private volatile DataStore<T> INSTANCE;
private final ReplaceFileCorruptionHandler<T> corruptionHandler;
private final String fileName;
private final Object lock;
private final Function1 produceMigrations;
private final CoroutineScope scope;
private final Serializer<T> serializer;
public DataStoreSingletonDelegate(String fileName, Serializer<T> serializer, ReplaceFileCorruptionHandler<T> replaceFileCorruptionHandler, Function1 produceMigrations, CoroutineScope scope) {
Intrinsics.checkNotNullParameter(fileName, "fileName");
Intrinsics.checkNotNullParameter(serializer, "serializer");
Intrinsics.checkNotNullParameter(produceMigrations, "produceMigrations");
Intrinsics.checkNotNullParameter(scope, "scope");
this.fileName = fileName;
this.serializer = serializer;
this.corruptionHandler = replaceFileCorruptionHandler;
this.produceMigrations = produceMigrations;
this.scope = scope;
this.lock = new Object();
}
@Override // kotlin.properties.ReadOnlyProperty
public DataStore<T> getValue(Context thisRef, KProperty property) {
DataStore<T> dataStore;
Intrinsics.checkNotNullParameter(thisRef, "thisRef");
Intrinsics.checkNotNullParameter(property, "property");
DataStore<T> dataStore2 = this.INSTANCE;
if (dataStore2 != null) {
return dataStore2;
}
synchronized (this.lock) {
try {
if (this.INSTANCE == null) {
final Context applicationContext = thisRef.getApplicationContext();
Serializer<T> serializer = this.serializer;
ReplaceFileCorruptionHandler<T> replaceFileCorruptionHandler = this.corruptionHandler;
Function1 function1 = this.produceMigrations;
Intrinsics.checkNotNullExpressionValue(applicationContext, "applicationContext");
this.INSTANCE = DataStoreFactory.INSTANCE.create(serializer, replaceFileCorruptionHandler, (List) function1.invoke(applicationContext), this.scope, new Function0() { // from class: androidx.datastore.DataStoreSingletonDelegate$getValue$1$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(0);
}
@Override // kotlin.jvm.functions.Function0
public final File invoke() {
String str;
Context applicationContext2 = applicationContext;
Intrinsics.checkNotNullExpressionValue(applicationContext2, "applicationContext");
str = ((DataStoreSingletonDelegate) this).fileName;
return DataStoreFile.dataStoreFile(applicationContext2, str);
}
});
}
dataStore = this.INSTANCE;
Intrinsics.checkNotNull(dataStore);
} catch (Throwable th) {
throw th;
}
}
return dataStore;
}
}

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);
}
}

View File

@@ -0,0 +1,7 @@
package androidx.datastore.datastore;
/* loaded from: classes.dex */
public final class R {
private R() {
}
}

View File

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

View File

@@ -0,0 +1,396 @@
package androidx.datastore.migrations;
import android.content.Context;
import android.content.SharedPreferences;
import androidx.annotation.DoNotInline;
import androidx.annotation.RequiresApi;
import androidx.datastore.core.DataMigration;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.Set;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.Boxing;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.functions.Function3;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class SharedPreferencesMigration<T> implements DataMigration<T> {
private final Context context;
private final Set<String> keySet;
private final Function3 migrate;
private final String name;
private final Lazy sharedPrefs$delegate;
private final Function2 shouldRunMigration;
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public SharedPreferencesMigration(Context context, String sharedPreferencesName, Set<String> keysToMigrate, Function3 migrate) {
this(context, sharedPreferencesName, keysToMigrate, null, migrate, 8, null);
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(sharedPreferencesName, "sharedPreferencesName");
Intrinsics.checkNotNullParameter(keysToMigrate, "keysToMigrate");
Intrinsics.checkNotNullParameter(migrate, "migrate");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public SharedPreferencesMigration(Context context, String sharedPreferencesName, Function3 migrate) {
this(context, sharedPreferencesName, null, null, migrate, 12, null);
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(sharedPreferencesName, "sharedPreferencesName");
Intrinsics.checkNotNullParameter(migrate, "migrate");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public SharedPreferencesMigration(Function0 produceSharedPreferences, Set<String> keysToMigrate, Function3 migrate) {
this(produceSharedPreferences, keysToMigrate, (Function2) null, migrate, 4, (DefaultConstructorMarker) null);
Intrinsics.checkNotNullParameter(produceSharedPreferences, "produceSharedPreferences");
Intrinsics.checkNotNullParameter(keysToMigrate, "keysToMigrate");
Intrinsics.checkNotNullParameter(migrate, "migrate");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public SharedPreferencesMigration(Function0 produceSharedPreferences, Function3 migrate) {
this(produceSharedPreferences, (Set) null, (Function2) null, migrate, 6, (DefaultConstructorMarker) null);
Intrinsics.checkNotNullParameter(produceSharedPreferences, "produceSharedPreferences");
Intrinsics.checkNotNullParameter(migrate, "migrate");
}
private SharedPreferencesMigration(Function0 function0, Set<String> set, Function2 function2, Function3 function3, Context context, String str) {
Lazy lazy;
this.shouldRunMigration = function2;
this.migrate = function3;
this.context = context;
this.name = str;
lazy = LazyKt__LazyJVMKt.lazy(function0);
this.sharedPrefs$delegate = lazy;
this.keySet = set == SharedPreferencesMigrationKt.getMIGRATE_ALL_KEYS() ? null : CollectionsKt___CollectionsKt.toMutableSet(set);
}
@DebugMetadata(c = "androidx.datastore.migrations.SharedPreferencesMigration$1", f = "SharedPreferencesMigration.kt", l = {}, m = "invokeSuspend")
/* renamed from: androidx.datastore.migrations.SharedPreferencesMigration$1, reason: invalid class name */
public static final class AnonymousClass1 extends SuspendLambda implements Function2 {
int label;
public AnonymousClass1(Continuation continuation) {
super(2, continuation);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new AnonymousClass1(continuation);
}
@Override // kotlin.jvm.functions.Function2
public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2) {
return invoke((AnonymousClass1) obj, (Continuation) obj2);
}
public final Object invoke(T t, Continuation continuation) {
return ((AnonymousClass1) create(t, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (this.label != 0) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
return Boxing.boxBoolean(true);
}
}
public /* synthetic */ SharedPreferencesMigration(Function0 function0, Set set, Function2 function2, Function3 function3, Context context, String str, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(function0, (Set<String>) set, (i & 4) != 0 ? new AnonymousClass1(null) : function2, function3, context, str);
}
@DebugMetadata(c = "androidx.datastore.migrations.SharedPreferencesMigration$2", f = "SharedPreferencesMigration.kt", l = {}, m = "invokeSuspend")
/* renamed from: androidx.datastore.migrations.SharedPreferencesMigration$2, reason: invalid class name */
public static final class AnonymousClass2 extends SuspendLambda implements Function2 {
int label;
public AnonymousClass2(Continuation continuation) {
super(2, continuation);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new AnonymousClass2(continuation);
}
@Override // kotlin.jvm.functions.Function2
public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2) {
return invoke((AnonymousClass2) obj, (Continuation) obj2);
}
public final Object invoke(T t, Continuation continuation) {
return ((AnonymousClass2) create(t, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (this.label != 0) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
return Boxing.boxBoolean(true);
}
}
public /* synthetic */ SharedPreferencesMigration(Function0 function0, Set set, Function2 function2, Function3 function3, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(function0, (Set<String>) ((i & 2) != 0 ? SharedPreferencesMigrationKt.getMIGRATE_ALL_KEYS() : set), (i & 4) != 0 ? new AnonymousClass2(null) : function2, function3);
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public SharedPreferencesMigration(Function0 produceSharedPreferences, Set<String> keysToMigrate, Function2 shouldRunMigration, Function3 migrate) {
this(produceSharedPreferences, keysToMigrate, shouldRunMigration, migrate, (Context) null, (String) null);
Intrinsics.checkNotNullParameter(produceSharedPreferences, "produceSharedPreferences");
Intrinsics.checkNotNullParameter(keysToMigrate, "keysToMigrate");
Intrinsics.checkNotNullParameter(shouldRunMigration, "shouldRunMigration");
Intrinsics.checkNotNullParameter(migrate, "migrate");
}
@DebugMetadata(c = "androidx.datastore.migrations.SharedPreferencesMigration$3", f = "SharedPreferencesMigration.kt", l = {}, m = "invokeSuspend")
/* renamed from: androidx.datastore.migrations.SharedPreferencesMigration$3, reason: invalid class name */
public static final class AnonymousClass3 extends SuspendLambda implements Function2 {
int label;
public AnonymousClass3(Continuation continuation) {
super(2, continuation);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new AnonymousClass3(continuation);
}
@Override // kotlin.jvm.functions.Function2
public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2) {
return invoke((AnonymousClass3) obj, (Continuation) obj2);
}
public final Object invoke(T t, Continuation continuation) {
return ((AnonymousClass3) create(t, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (this.label != 0) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
return Boxing.boxBoolean(true);
}
}
public /* synthetic */ SharedPreferencesMigration(Context context, String str, Set set, Function2 function2, Function3 function3, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(context, str, (i & 4) != 0 ? SharedPreferencesMigrationKt.getMIGRATE_ALL_KEYS() : set, (i & 8) != 0 ? new AnonymousClass3(null) : function2, function3);
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public SharedPreferencesMigration(final Context context, final String sharedPreferencesName, Set<String> keysToMigrate, Function2 shouldRunMigration, Function3 migrate) {
this(new Function0() { // from class: androidx.datastore.migrations.SharedPreferencesMigration.4
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(0);
}
@Override // kotlin.jvm.functions.Function0
public final SharedPreferences invoke() {
SharedPreferences sharedPreferences = context.getSharedPreferences(sharedPreferencesName, 0);
Intrinsics.checkNotNullExpressionValue(sharedPreferences, "context.getSharedPreferences(sharedPreferencesName, Context.MODE_PRIVATE)");
return sharedPreferences;
}
}, keysToMigrate, shouldRunMigration, migrate, context, sharedPreferencesName);
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(sharedPreferencesName, "sharedPreferencesName");
Intrinsics.checkNotNullParameter(keysToMigrate, "keysToMigrate");
Intrinsics.checkNotNullParameter(shouldRunMigration, "shouldRunMigration");
Intrinsics.checkNotNullParameter(migrate, "migrate");
}
private final SharedPreferences getSharedPrefs() {
return (SharedPreferences) this.sharedPrefs$delegate.getValue();
}
/* JADX WARN: Code restructure failed: missing block: B:18:0x0069, code lost:
if (r5.isEmpty() == false) goto L38;
*/
/* JADX WARN: Removed duplicated region for block: B:12:0x004f */
/* JADX WARN: Removed duplicated region for block: B:15:0x0054 */
/* JADX WARN: Removed duplicated region for block: B:36:0x0035 */
/* JADX WARN: Removed duplicated region for block: B:8:0x0023 */
@Override // androidx.datastore.core.DataMigration
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public java.lang.Object shouldMigrate(T r5, kotlin.coroutines.Continuation r6) {
/*
r4 = this;
boolean r0 = r6 instanceof androidx.datastore.migrations.SharedPreferencesMigration$shouldMigrate$1
if (r0 == 0) goto L13
r0 = r6
androidx.datastore.migrations.SharedPreferencesMigration$shouldMigrate$1 r0 = (androidx.datastore.migrations.SharedPreferencesMigration$shouldMigrate$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.migrations.SharedPreferencesMigration$shouldMigrate$1 r0 = new androidx.datastore.migrations.SharedPreferencesMigration$shouldMigrate$1
r0.<init>(r4, 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 L35
if (r2 != r3) goto L2d
java.lang.Object r5 = r0.L$0
androidx.datastore.migrations.SharedPreferencesMigration r5 = (androidx.datastore.migrations.SharedPreferencesMigration) r5
kotlin.ResultKt.throwOnFailure(r6)
goto L46
L2d:
java.lang.IllegalStateException r5 = new java.lang.IllegalStateException
java.lang.String r6 = "call to 'resume' before 'invoke' with coroutine"
r5.<init>(r6)
throw r5
L35:
kotlin.ResultKt.throwOnFailure(r6)
kotlin.jvm.functions.Function2 r6 = r4.shouldRunMigration
r0.L$0 = r4
r0.label = r3
java.lang.Object r6 = r6.invoke(r5, r0)
if (r6 != r1) goto L45
return r1
L45:
r5 = r4
L46:
java.lang.Boolean r6 = (java.lang.Boolean) r6
boolean r6 = r6.booleanValue()
r0 = 0
if (r6 != 0) goto L54
java.lang.Boolean r5 = kotlin.coroutines.jvm.internal.Boxing.boxBoolean(r0)
return r5
L54:
java.util.Set<java.lang.String> r6 = r5.keySet
if (r6 != 0) goto L6e
android.content.SharedPreferences r5 = r5.getSharedPrefs()
java.util.Map r5 = r5.getAll()
java.lang.String r6 = "sharedPrefs.all"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r5, r6)
boolean r5 = r5.isEmpty()
if (r5 != 0) goto L6c
goto L9b
L6c:
r3 = r0
goto L9b
L6e:
android.content.SharedPreferences r5 = r5.getSharedPrefs()
boolean r1 = r6 instanceof java.util.Collection
if (r1 == 0) goto L7d
boolean r1 = r6.isEmpty()
if (r1 == 0) goto L7d
goto L6c
L7d:
java.util.Iterator r6 = r6.iterator()
L81:
boolean r1 = r6.hasNext()
if (r1 == 0) goto L6c
java.lang.Object r1 = r6.next()
java.lang.String r1 = (java.lang.String) r1
boolean r1 = r5.contains(r1)
java.lang.Boolean r1 = kotlin.coroutines.jvm.internal.Boxing.boxBoolean(r1)
boolean r1 = r1.booleanValue()
if (r1 == 0) goto L81
L9b:
java.lang.Boolean r5 = kotlin.coroutines.jvm.internal.Boxing.boxBoolean(r3)
return r5
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.datastore.migrations.SharedPreferencesMigration.shouldMigrate(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
}
@Override // androidx.datastore.core.DataMigration
public Object migrate(T t, Continuation continuation) {
return this.migrate.invoke(new SharedPreferencesView(getSharedPrefs(), this.keySet), t, continuation);
}
@Override // androidx.datastore.core.DataMigration
public Object cleanUp(Continuation continuation) throws IOException {
Unit unit;
Object coroutine_suspended;
Context context;
String str;
SharedPreferences.Editor edit = getSharedPrefs().edit();
Set<String> set = this.keySet;
if (set == null) {
edit.clear();
} else {
Iterator<T> it = set.iterator();
while (it.hasNext()) {
edit.remove((String) it.next());
}
}
if (!edit.commit()) {
throw new IOException("Unable to delete migrated keys from SharedPreferences.");
}
if (getSharedPrefs().getAll().isEmpty() && (context = this.context) != null && (str = this.name) != null) {
deleteSharedPreferences(context, str);
}
Set<String> set2 = this.keySet;
if (set2 == null) {
unit = null;
} else {
set2.clear();
unit = Unit.INSTANCE;
}
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
return unit == coroutine_suspended ? unit : Unit.INSTANCE;
}
private final void deleteSharedPreferences(Context context, String str) {
if (!Api24Impl.deleteSharedPreferences(context, str)) {
throw new IOException(Intrinsics.stringPlus("Unable to delete SharedPreferences: ", str));
}
}
private final File getSharedPrefsFile(Context context, String str) {
return new File(new File(context.getApplicationInfo().dataDir, "shared_prefs"), Intrinsics.stringPlus(str, ".xml"));
}
private final File getSharedPrefsBackup(File file) {
return new File(Intrinsics.stringPlus(file.getPath(), ".bak"));
}
@RequiresApi(24)
public static final class Api24Impl {
public static final Api24Impl INSTANCE = new Api24Impl();
private Api24Impl() {
}
@DoNotInline
public static final boolean deleteSharedPreferences(Context context, String name) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(name, "name");
return context.deleteSharedPreferences(name);
}
}
}

View File

@@ -0,0 +1,13 @@
package androidx.datastore.migrations;
import java.util.LinkedHashSet;
import java.util.Set;
/* loaded from: classes.dex */
public final class SharedPreferencesMigrationKt {
private static final Set<String> MIGRATE_ALL_KEYS = new LinkedHashSet();
public static final Set<String> getMIGRATE_ALL_KEYS() {
return MIGRATE_ALL_KEYS;
}
}

View File

@@ -0,0 +1,108 @@
package androidx.datastore.migrations;
import android.content.SharedPreferences;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.collections.MapsKt__MapsJVMKt;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class SharedPreferencesView {
private final Set<String> keySet;
private final SharedPreferences prefs;
public SharedPreferencesView(SharedPreferences prefs, Set<String> set) {
Intrinsics.checkNotNullParameter(prefs, "prefs");
this.prefs = prefs;
this.keySet = set;
}
public final boolean contains(String key) {
Intrinsics.checkNotNullParameter(key, "key");
return this.prefs.contains(checkKey(key));
}
public final boolean getBoolean(String key, boolean z) {
Intrinsics.checkNotNullParameter(key, "key");
return this.prefs.getBoolean(checkKey(key), z);
}
public final float getFloat(String key, float f) {
Intrinsics.checkNotNullParameter(key, "key");
return this.prefs.getFloat(checkKey(key), f);
}
public final int getInt(String key, int i) {
Intrinsics.checkNotNullParameter(key, "key");
return this.prefs.getInt(checkKey(key), i);
}
public final long getLong(String key, long j) {
Intrinsics.checkNotNullParameter(key, "key");
return this.prefs.getLong(checkKey(key), j);
}
public static /* synthetic */ String getString$default(SharedPreferencesView sharedPreferencesView, String str, String str2, int i, Object obj) {
if ((i & 2) != 0) {
str2 = null;
}
return sharedPreferencesView.getString(str, str2);
}
public final String getString(String key, String str) {
Intrinsics.checkNotNullParameter(key, "key");
return this.prefs.getString(checkKey(key), str);
}
/* JADX WARN: Multi-variable type inference failed */
public static /* synthetic */ Set getStringSet$default(SharedPreferencesView sharedPreferencesView, String str, Set set, int i, Object obj) {
if ((i & 2) != 0) {
set = null;
}
return sharedPreferencesView.getStringSet(str, set);
}
public final Set<String> getStringSet(String key, Set<String> set) {
Intrinsics.checkNotNullParameter(key, "key");
Set<String> stringSet = this.prefs.getStringSet(checkKey(key), set);
if (stringSet == null) {
return null;
}
return CollectionsKt___CollectionsKt.toMutableSet(stringSet);
}
public final Map<String, Object> getAll() {
int mapCapacity;
Map<String, ?> all = this.prefs.getAll();
Intrinsics.checkNotNullExpressionValue(all, "prefs.all");
LinkedHashMap linkedHashMap = new LinkedHashMap();
for (Map.Entry<String, ?> entry : all.entrySet()) {
String key = entry.getKey();
Set<String> set = this.keySet;
if (set == null || set.contains(key)) {
linkedHashMap.put(entry.getKey(), entry.getValue());
}
}
mapCapacity = MapsKt__MapsJVMKt.mapCapacity(linkedHashMap.size());
LinkedHashMap linkedHashMap2 = new LinkedHashMap(mapCapacity);
for (Map.Entry entry2 : linkedHashMap.entrySet()) {
Object key2 = entry2.getKey();
Object value = entry2.getValue();
if (value instanceof Set) {
value = CollectionsKt___CollectionsKt.toSet((Iterable) value);
}
linkedHashMap2.put(key2, value);
}
return linkedHashMap2;
}
private final String checkKey(String str) {
Set<String> set = this.keySet;
if (set == null || set.contains(str)) {
return str;
}
throw new IllegalStateException(Intrinsics.stringPlus("Can't access key outside migration: ", str).toString());
}
}

View File

@@ -0,0 +1,44 @@
package androidx.datastore.preferences;
import android.content.Context;
import androidx.datastore.core.DataMigration;
import androidx.datastore.core.handlers.ReplaceFileCorruptionHandler;
import androidx.datastore.preferences.core.Preferences;
import java.util.List;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.properties.ReadOnlyProperty;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.CoroutineScopeKt;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.SupervisorKt;
/* loaded from: classes.dex */
public final class PreferenceDataStoreDelegateKt {
public static /* synthetic */ ReadOnlyProperty preferencesDataStore$default(String str, ReplaceFileCorruptionHandler replaceFileCorruptionHandler, Function1 function1, CoroutineScope coroutineScope, int i, Object obj) {
if ((i & 2) != 0) {
replaceFileCorruptionHandler = null;
}
if ((i & 4) != 0) {
function1 = new Function1() { // from class: androidx.datastore.preferences.PreferenceDataStoreDelegateKt$preferencesDataStore$1
@Override // kotlin.jvm.functions.Function1
public final List<DataMigration<Preferences>> invoke(Context it) {
Intrinsics.checkNotNullParameter(it, "it");
return CollectionsKt__CollectionsKt.emptyList();
}
};
}
if ((i & 8) != 0) {
coroutineScope = CoroutineScopeKt.CoroutineScope(Dispatchers.getIO().plus(SupervisorKt.SupervisorJob$default(null, 1, null)));
}
return preferencesDataStore(str, replaceFileCorruptionHandler, function1, coroutineScope);
}
public static final ReadOnlyProperty preferencesDataStore(String name, ReplaceFileCorruptionHandler<Preferences> replaceFileCorruptionHandler, Function1 produceMigrations, CoroutineScope scope) {
Intrinsics.checkNotNullParameter(name, "name");
Intrinsics.checkNotNullParameter(produceMigrations, "produceMigrations");
Intrinsics.checkNotNullParameter(scope, "scope");
return new PreferenceDataStoreSingletonDelegate(name, replaceFileCorruptionHandler, produceMigrations, scope);
}
}

View File

@@ -0,0 +1,15 @@
package androidx.datastore.preferences;
import android.content.Context;
import androidx.datastore.DataStoreFile;
import java.io.File;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class PreferenceDataStoreFile {
public static final File preferencesDataStoreFile(Context context, String name) {
Intrinsics.checkNotNullParameter(context, "<this>");
Intrinsics.checkNotNullParameter(name, "name");
return DataStoreFile.dataStoreFile(context, Intrinsics.stringPlus(name, ".preferences_pb"));
}
}

View File

@@ -0,0 +1,81 @@
package androidx.datastore.preferences;
import android.content.Context;
import androidx.annotation.GuardedBy;
import androidx.datastore.core.DataStore;
import androidx.datastore.core.handlers.ReplaceFileCorruptionHandler;
import androidx.datastore.preferences.core.PreferenceDataStoreFactory;
import androidx.datastore.preferences.core.Preferences;
import java.io.File;
import java.util.List;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.properties.ReadOnlyProperty;
import kotlin.reflect.KProperty;
import kotlinx.coroutines.CoroutineScope;
/* loaded from: classes.dex */
public final class PreferenceDataStoreSingletonDelegate implements ReadOnlyProperty {
@GuardedBy("lock")
private volatile DataStore<Preferences> INSTANCE;
private final ReplaceFileCorruptionHandler<Preferences> corruptionHandler;
private final Object lock;
private final String name;
private final Function1 produceMigrations;
private final CoroutineScope scope;
public PreferenceDataStoreSingletonDelegate(String name, ReplaceFileCorruptionHandler<Preferences> replaceFileCorruptionHandler, Function1 produceMigrations, CoroutineScope scope) {
Intrinsics.checkNotNullParameter(name, "name");
Intrinsics.checkNotNullParameter(produceMigrations, "produceMigrations");
Intrinsics.checkNotNullParameter(scope, "scope");
this.name = name;
this.corruptionHandler = replaceFileCorruptionHandler;
this.produceMigrations = produceMigrations;
this.scope = scope;
this.lock = new Object();
}
@Override // kotlin.properties.ReadOnlyProperty
public DataStore<Preferences> getValue(Context thisRef, KProperty property) {
DataStore<Preferences> dataStore;
Intrinsics.checkNotNullParameter(thisRef, "thisRef");
Intrinsics.checkNotNullParameter(property, "property");
DataStore<Preferences> dataStore2 = this.INSTANCE;
if (dataStore2 != null) {
return dataStore2;
}
synchronized (this.lock) {
try {
if (this.INSTANCE == null) {
final Context applicationContext = thisRef.getApplicationContext();
PreferenceDataStoreFactory preferenceDataStoreFactory = PreferenceDataStoreFactory.INSTANCE;
ReplaceFileCorruptionHandler<Preferences> replaceFileCorruptionHandler = this.corruptionHandler;
Function1 function1 = this.produceMigrations;
Intrinsics.checkNotNullExpressionValue(applicationContext, "applicationContext");
this.INSTANCE = preferenceDataStoreFactory.create(replaceFileCorruptionHandler, (List) function1.invoke(applicationContext), this.scope, new Function0() { // from class: androidx.datastore.preferences.PreferenceDataStoreSingletonDelegate$getValue$1$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(0);
}
@Override // kotlin.jvm.functions.Function0
public final File invoke() {
String str;
Context applicationContext2 = applicationContext;
Intrinsics.checkNotNullExpressionValue(applicationContext2, "applicationContext");
str = this.name;
return PreferenceDataStoreFile.preferencesDataStoreFile(applicationContext2, str);
}
});
}
dataStore = this.INSTANCE;
Intrinsics.checkNotNull(dataStore);
} catch (Throwable th) {
throw th;
}
}
return dataStore;
}
}

View File

@@ -0,0 +1,33 @@
package androidx.datastore.preferences;
import androidx.datastore.core.CorruptionException;
import androidx.datastore.preferences.PreferencesProto;
import androidx.datastore.preferences.protobuf.InvalidProtocolBufferException;
import java.io.InputStream;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class PreferencesMapCompat {
public static final Companion Companion = new Companion(null);
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final PreferencesProto.PreferenceMap readFrom(InputStream input) {
Intrinsics.checkNotNullParameter(input, "input");
try {
PreferencesProto.PreferenceMap parseFrom = PreferencesProto.PreferenceMap.parseFrom(input);
Intrinsics.checkNotNullExpressionValue(parseFrom, "{\n PreferencesProto.PreferenceMap.parseFrom(input)\n }");
return parseFrom;
} catch (InvalidProtocolBufferException e) {
throw new CorruptionException("Unable to parse preferences proto.", e);
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
package androidx.datastore.preferences;
/* loaded from: classes.dex */
public final class R {
private R() {
}
}

View File

@@ -0,0 +1,90 @@
package androidx.datastore.preferences;
import androidx.datastore.migrations.SharedPreferencesView;
import androidx.datastore.preferences.core.MutablePreferences;
import androidx.datastore.preferences.core.Preferences;
import androidx.datastore.preferences.core.PreferencesKeys;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__IterablesKt;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.Boxing;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function3;
@DebugMetadata(c = "androidx.datastore.preferences.SharedPreferencesMigrationKt$getMigrationFunction$1", f = "SharedPreferencesMigration.kt", l = {}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class SharedPreferencesMigrationKt$getMigrationFunction$1 extends SuspendLambda implements Function3 {
/* synthetic */ Object L$0;
/* synthetic */ Object L$1;
int label;
public SharedPreferencesMigrationKt$getMigrationFunction$1(Continuation continuation) {
super(3, continuation);
}
@Override // kotlin.jvm.functions.Function3
public final Object invoke(SharedPreferencesView sharedPreferencesView, Preferences preferences, Continuation continuation) {
SharedPreferencesMigrationKt$getMigrationFunction$1 sharedPreferencesMigrationKt$getMigrationFunction$1 = new SharedPreferencesMigrationKt$getMigrationFunction$1(continuation);
sharedPreferencesMigrationKt$getMigrationFunction$1.L$0 = sharedPreferencesView;
sharedPreferencesMigrationKt$getMigrationFunction$1.L$1 = preferences;
return sharedPreferencesMigrationKt$getMigrationFunction$1.invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (this.label != 0) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
SharedPreferencesView sharedPreferencesView = (SharedPreferencesView) this.L$0;
Preferences preferences = (Preferences) this.L$1;
Set<Preferences.Key<?>> keySet = preferences.asMap().keySet();
ArrayList arrayList = new ArrayList(CollectionsKt__IterablesKt.collectionSizeOrDefault(keySet, 10));
Iterator<T> it = keySet.iterator();
while (it.hasNext()) {
arrayList.add(((Preferences.Key) it.next()).getName());
}
Map<String, Object> all = sharedPreferencesView.getAll();
LinkedHashMap linkedHashMap = new LinkedHashMap();
for (Map.Entry<String, Object> entry : all.entrySet()) {
if (Boxing.boxBoolean(!arrayList.contains(entry.getKey())).booleanValue()) {
linkedHashMap.put(entry.getKey(), entry.getValue());
}
}
MutablePreferences mutablePreferences = preferences.toMutablePreferences();
for (Map.Entry entry2 : linkedHashMap.entrySet()) {
String str = (String) entry2.getKey();
Object value = entry2.getValue();
if (value instanceof Boolean) {
mutablePreferences.set(PreferencesKeys.booleanKey(str), value);
} else if (value instanceof Float) {
mutablePreferences.set(PreferencesKeys.floatKey(str), value);
} else if (value instanceof Integer) {
mutablePreferences.set(PreferencesKeys.intKey(str), value);
} else if (value instanceof Long) {
mutablePreferences.set(PreferencesKeys.longKey(str), value);
} else if (value instanceof String) {
mutablePreferences.set(PreferencesKeys.stringKey(str), value);
} else if (value instanceof Set) {
Preferences.Key<Set<String>> stringSetKey = PreferencesKeys.stringSetKey(str);
if (value != null) {
mutablePreferences.set(stringSetKey, (Set) value);
} else {
throw new NullPointerException("null cannot be cast to non-null type kotlin.collections.Set<kotlin.String>");
}
} else {
continue;
}
}
return mutablePreferences.toPreferences();
}
}

View File

@@ -0,0 +1,71 @@
package androidx.datastore.preferences;
import androidx.datastore.preferences.core.Preferences;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__IterablesKt;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.Boxing;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
@DebugMetadata(c = "androidx.datastore.preferences.SharedPreferencesMigrationKt$getShouldRunMigration$1", f = "SharedPreferencesMigration.kt", l = {}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class SharedPreferencesMigrationKt$getShouldRunMigration$1 extends SuspendLambda implements Function2 {
final /* synthetic */ Set<String> $keysToMigrate;
/* synthetic */ Object L$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SharedPreferencesMigrationKt$getShouldRunMigration$1(Set<String> set, Continuation continuation) {
super(2, continuation);
this.$keysToMigrate = set;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
SharedPreferencesMigrationKt$getShouldRunMigration$1 sharedPreferencesMigrationKt$getShouldRunMigration$1 = new SharedPreferencesMigrationKt$getShouldRunMigration$1(this.$keysToMigrate, continuation);
sharedPreferencesMigrationKt$getShouldRunMigration$1.L$0 = obj;
return sharedPreferencesMigrationKt$getShouldRunMigration$1;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(Preferences preferences, Continuation continuation) {
return ((SharedPreferencesMigrationKt$getShouldRunMigration$1) create(preferences, 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);
Set<Preferences.Key<?>> keySet = ((Preferences) this.L$0).asMap().keySet();
ArrayList arrayList = new ArrayList(CollectionsKt__IterablesKt.collectionSizeOrDefault(keySet, 10));
Iterator<T> it = keySet.iterator();
while (it.hasNext()) {
arrayList.add(((Preferences.Key) it.next()).getName());
}
boolean z = true;
if (this.$keysToMigrate != SharedPreferencesMigrationKt.getMIGRATE_ALL_KEYS()) {
Set<String> set = this.$keysToMigrate;
if (!(set instanceof Collection) || !set.isEmpty()) {
Iterator<T> it2 = set.iterator();
while (it2.hasNext()) {
if (Boxing.boxBoolean(!arrayList.contains((String) it2.next())).booleanValue()) {
break;
}
}
}
z = false;
}
return Boxing.boxBoolean(z);
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}

View File

@@ -0,0 +1,73 @@
package androidx.datastore.preferences;
import android.content.Context;
import androidx.datastore.migrations.SharedPreferencesMigration;
import androidx.datastore.preferences.core.Preferences;
import java.util.LinkedHashSet;
import java.util.Set;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.functions.Function3;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class SharedPreferencesMigrationKt {
private static final Set<String> MIGRATE_ALL_KEYS = new LinkedHashSet();
public static final SharedPreferencesMigration<Preferences> SharedPreferencesMigration(Context context, String sharedPreferencesName) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(sharedPreferencesName, "sharedPreferencesName");
return SharedPreferencesMigration$default(context, sharedPreferencesName, null, 4, null);
}
public static final SharedPreferencesMigration<Preferences> SharedPreferencesMigration(Function0 produceSharedPreferences) {
Intrinsics.checkNotNullParameter(produceSharedPreferences, "produceSharedPreferences");
return SharedPreferencesMigration$default(produceSharedPreferences, null, 2, null);
}
public static final Set<String> getMIGRATE_ALL_KEYS() {
return MIGRATE_ALL_KEYS;
}
public static /* synthetic */ SharedPreferencesMigration SharedPreferencesMigration$default(Function0 function0, Set set, int i, Object obj) {
if ((i & 2) != 0) {
set = MIGRATE_ALL_KEYS;
}
return SharedPreferencesMigration(function0, (Set<String>) set);
}
public static final SharedPreferencesMigration<Preferences> SharedPreferencesMigration(Function0 produceSharedPreferences, Set<String> keysToMigrate) {
Intrinsics.checkNotNullParameter(produceSharedPreferences, "produceSharedPreferences");
Intrinsics.checkNotNullParameter(keysToMigrate, "keysToMigrate");
if (keysToMigrate == MIGRATE_ALL_KEYS) {
return new SharedPreferencesMigration<>(produceSharedPreferences, (Set) null, getShouldRunMigration(keysToMigrate), getMigrationFunction(), 2, (DefaultConstructorMarker) null);
}
return new SharedPreferencesMigration<>(produceSharedPreferences, keysToMigrate, getShouldRunMigration(keysToMigrate), getMigrationFunction());
}
public static /* synthetic */ SharedPreferencesMigration SharedPreferencesMigration$default(Context context, String str, Set set, int i, Object obj) {
if ((i & 4) != 0) {
set = MIGRATE_ALL_KEYS;
}
return SharedPreferencesMigration(context, str, set);
}
public static final SharedPreferencesMigration<Preferences> SharedPreferencesMigration(Context context, String sharedPreferencesName, Set<String> keysToMigrate) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(sharedPreferencesName, "sharedPreferencesName");
Intrinsics.checkNotNullParameter(keysToMigrate, "keysToMigrate");
if (keysToMigrate == MIGRATE_ALL_KEYS) {
return new SharedPreferencesMigration<>(context, sharedPreferencesName, null, getShouldRunMigration(keysToMigrate), getMigrationFunction(), 4, null);
}
return new SharedPreferencesMigration<>(context, sharedPreferencesName, keysToMigrate, getShouldRunMigration(keysToMigrate), getMigrationFunction());
}
private static final Function3 getMigrationFunction() {
return new SharedPreferencesMigrationKt$getMigrationFunction$1(null);
}
private static final Function2 getShouldRunMigration(Set<String> set) {
return new SharedPreferencesMigrationKt$getShouldRunMigration$1(set, null);
}
}

View File

@@ -0,0 +1,150 @@
package androidx.datastore.preferences.core;
import androidx.datastore.preferences.core.Preferences;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class MutablePreferences extends Preferences {
private final AtomicBoolean frozen;
private final Map<Preferences.Key<?>, Object> preferencesMap;
/* JADX WARN: Multi-variable type inference failed */
public MutablePreferences() {
this(null, false, 3, 0 == true ? 1 : 0);
}
public final Map<Preferences.Key<?>, Object> getPreferencesMap$datastore_preferences_core() {
return this.preferencesMap;
}
public /* synthetic */ MutablePreferences(Map map, boolean z, int i, DefaultConstructorMarker defaultConstructorMarker) {
this((i & 1) != 0 ? new LinkedHashMap() : map, (i & 2) != 0 ? true : z);
}
public MutablePreferences(Map<Preferences.Key<?>, Object> preferencesMap, boolean z) {
Intrinsics.checkNotNullParameter(preferencesMap, "preferencesMap");
this.preferencesMap = preferencesMap;
this.frozen = new AtomicBoolean(z);
}
public final void checkNotFrozen$datastore_preferences_core() {
if (!(!this.frozen.get())) {
throw new IllegalStateException("Do mutate preferences once returned to DataStore.".toString());
}
}
public final void freeze$datastore_preferences_core() {
this.frozen.set(true);
}
@Override // androidx.datastore.preferences.core.Preferences
public <T> boolean contains(Preferences.Key<T> key) {
Intrinsics.checkNotNullParameter(key, "key");
return this.preferencesMap.containsKey(key);
}
@Override // androidx.datastore.preferences.core.Preferences
public <T> T get(Preferences.Key<T> key) {
Intrinsics.checkNotNullParameter(key, "key");
return (T) this.preferencesMap.get(key);
}
@Override // androidx.datastore.preferences.core.Preferences
public Map<Preferences.Key<?>, Object> asMap() {
Map<Preferences.Key<?>, Object> unmodifiableMap = Collections.unmodifiableMap(this.preferencesMap);
Intrinsics.checkNotNullExpressionValue(unmodifiableMap, "unmodifiableMap(preferencesMap)");
return unmodifiableMap;
}
public final <T> void set(Preferences.Key<T> key, T t) {
Intrinsics.checkNotNullParameter(key, "key");
setUnchecked$datastore_preferences_core(key, t);
}
public final void setUnchecked$datastore_preferences_core(Preferences.Key<?> key, Object obj) {
Set set;
Intrinsics.checkNotNullParameter(key, "key");
checkNotFrozen$datastore_preferences_core();
if (obj == null) {
remove(key);
return;
}
if (!(obj instanceof Set)) {
this.preferencesMap.put(key, obj);
return;
}
Map<Preferences.Key<?>, Object> map = this.preferencesMap;
set = CollectionsKt___CollectionsKt.toSet((Iterable) obj);
Set unmodifiableSet = Collections.unmodifiableSet(set);
Intrinsics.checkNotNullExpressionValue(unmodifiableSet, "unmodifiableSet(value.toSet())");
map.put(key, unmodifiableSet);
}
public final void plusAssign(Preferences prefs) {
Intrinsics.checkNotNullParameter(prefs, "prefs");
checkNotFrozen$datastore_preferences_core();
this.preferencesMap.putAll(prefs.asMap());
}
public final void plusAssign(Preferences.Pair<?> pair) {
Intrinsics.checkNotNullParameter(pair, "pair");
checkNotFrozen$datastore_preferences_core();
putAll(pair);
}
public final void minusAssign(Preferences.Key<?> key) {
Intrinsics.checkNotNullParameter(key, "key");
checkNotFrozen$datastore_preferences_core();
remove(key);
}
public final void putAll(Preferences.Pair<?>... pairs) {
Intrinsics.checkNotNullParameter(pairs, "pairs");
checkNotFrozen$datastore_preferences_core();
for (Preferences.Pair<?> pair : pairs) {
setUnchecked$datastore_preferences_core(pair.getKey$datastore_preferences_core(), pair.getValue$datastore_preferences_core());
}
}
public final <T> T remove(Preferences.Key<T> key) {
Intrinsics.checkNotNullParameter(key, "key");
checkNotFrozen$datastore_preferences_core();
return (T) this.preferencesMap.remove(key);
}
public final void clear() {
checkNotFrozen$datastore_preferences_core();
this.preferencesMap.clear();
}
public boolean equals(Object obj) {
if (obj instanceof MutablePreferences) {
return Intrinsics.areEqual(this.preferencesMap, ((MutablePreferences) obj).preferencesMap);
}
return false;
}
public int hashCode() {
return this.preferencesMap.hashCode();
}
public String toString() {
String joinToString$default;
joinToString$default = CollectionsKt___CollectionsKt.joinToString$default(this.preferencesMap.entrySet(), ",\n", "{\n", "\n}", 0, null, new Function1() { // from class: androidx.datastore.preferences.core.MutablePreferences$toString$1
@Override // kotlin.jvm.functions.Function1
public final CharSequence invoke(Map.Entry<Preferences.Key<?>, Object> entry) {
Intrinsics.checkNotNullParameter(entry, "entry");
return " " + entry.getKey().getName() + " = " + entry.getValue();
}
}, 24, null);
return joinToString$default;
}
}

View File

@@ -0,0 +1,59 @@
package androidx.datastore.preferences.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;
@DebugMetadata(c = "androidx.datastore.preferences.core.PreferenceDataStore$updateData$2", f = "PreferenceDataStoreFactory.kt", l = {85}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class PreferenceDataStore$updateData$2 extends SuspendLambda implements Function2 {
final /* synthetic */ Function2 $transform;
/* synthetic */ Object L$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public PreferenceDataStore$updateData$2(Function2 function2, Continuation continuation) {
super(2, continuation);
this.$transform = function2;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
PreferenceDataStore$updateData$2 preferenceDataStore$updateData$2 = new PreferenceDataStore$updateData$2(this.$transform, continuation);
preferenceDataStore$updateData$2.L$0 = obj;
return preferenceDataStore$updateData$2;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(Preferences preferences, Continuation continuation) {
return ((PreferenceDataStore$updateData$2) create(preferences, 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);
Preferences preferences = (Preferences) this.L$0;
Function2 function2 = this.$transform;
this.label = 1;
obj = function2.invoke(preferences, this);
if (obj == coroutine_suspended) {
return coroutine_suspended;
}
} else if (i == 1) {
ResultKt.throwOnFailure(obj);
} else {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
Preferences preferences2 = (Preferences) obj;
((MutablePreferences) preferences2).freeze$datastore_preferences_core();
return preferences2;
}
}

View File

@@ -0,0 +1,27 @@
package androidx.datastore.preferences.core;
import androidx.datastore.core.DataStore;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.flow.Flow;
/* loaded from: classes.dex */
public final class PreferenceDataStore implements DataStore<Preferences> {
private final DataStore<Preferences> delegate;
@Override // androidx.datastore.core.DataStore
public Flow getData() {
return this.delegate.getData();
}
public PreferenceDataStore(DataStore<Preferences> delegate) {
Intrinsics.checkNotNullParameter(delegate, "delegate");
this.delegate = delegate;
}
@Override // androidx.datastore.core.DataStore
public Object updateData(Function2 function2, Continuation continuation) {
return this.delegate.updateData(new PreferenceDataStore$updateData$2(function2, null), continuation);
}
}

View File

@@ -0,0 +1,77 @@
package androidx.datastore.preferences.core;
import androidx.datastore.core.DataMigration;
import androidx.datastore.core.DataStore;
import androidx.datastore.core.DataStoreFactory;
import androidx.datastore.core.handlers.ReplaceFileCorruptionHandler;
import java.io.File;
import java.util.List;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.io.FilesKt__UtilsKt;
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 PreferenceDataStoreFactory {
public static final PreferenceDataStoreFactory INSTANCE = new PreferenceDataStoreFactory();
public final DataStore<Preferences> create(ReplaceFileCorruptionHandler<Preferences> replaceFileCorruptionHandler, List<? extends DataMigration<Preferences>> migrations, Function0 produceFile) {
Intrinsics.checkNotNullParameter(migrations, "migrations");
Intrinsics.checkNotNullParameter(produceFile, "produceFile");
return create$default(this, replaceFileCorruptionHandler, migrations, null, produceFile, 4, null);
}
public final DataStore<Preferences> create(ReplaceFileCorruptionHandler<Preferences> replaceFileCorruptionHandler, Function0 produceFile) {
Intrinsics.checkNotNullParameter(produceFile, "produceFile");
return create$default(this, replaceFileCorruptionHandler, null, null, produceFile, 6, null);
}
public final DataStore<Preferences> create(Function0 produceFile) {
Intrinsics.checkNotNullParameter(produceFile, "produceFile");
return create$default(this, null, null, null, produceFile, 7, null);
}
private PreferenceDataStoreFactory() {
}
/* JADX WARN: Multi-variable type inference failed */
public static /* synthetic */ DataStore create$default(PreferenceDataStoreFactory preferenceDataStoreFactory, ReplaceFileCorruptionHandler replaceFileCorruptionHandler, List list, CoroutineScope coroutineScope, Function0 function0, int i, Object obj) {
if ((i & 1) != 0) {
replaceFileCorruptionHandler = null;
}
if ((i & 2) != 0) {
list = CollectionsKt__CollectionsKt.emptyList();
}
if ((i & 4) != 0) {
coroutineScope = CoroutineScopeKt.CoroutineScope(Dispatchers.getIO().plus(SupervisorKt.SupervisorJob$default(null, 1, null)));
}
return preferenceDataStoreFactory.create(replaceFileCorruptionHandler, list, coroutineScope, function0);
}
public final DataStore<Preferences> create(ReplaceFileCorruptionHandler<Preferences> replaceFileCorruptionHandler, List<? extends DataMigration<Preferences>> migrations, CoroutineScope scope, final Function0 produceFile) {
Intrinsics.checkNotNullParameter(migrations, "migrations");
Intrinsics.checkNotNullParameter(scope, "scope");
Intrinsics.checkNotNullParameter(produceFile, "produceFile");
return new PreferenceDataStore(DataStoreFactory.INSTANCE.create(PreferencesSerializer.INSTANCE, replaceFileCorruptionHandler, migrations, scope, new Function0() { // from class: androidx.datastore.preferences.core.PreferenceDataStoreFactory$create$delegate$1
{
super(0);
}
@Override // kotlin.jvm.functions.Function0
public final File invoke() {
String extension;
File file = (File) Function0.this.invoke();
extension = FilesKt__UtilsKt.getExtension(file);
PreferencesSerializer preferencesSerializer = PreferencesSerializer.INSTANCE;
if (Intrinsics.areEqual(extension, preferencesSerializer.getFileExtension())) {
return file;
}
throw new IllegalStateException(("File extension for file: " + file + " does not match required extension for Preferences file: " + preferencesSerializer.getFileExtension()).toString());
}
}));
}
}

View File

@@ -0,0 +1,77 @@
package androidx.datastore.preferences.core;
import java.util.Map;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public abstract class Preferences {
public abstract Map<Key<?>, Object> asMap();
public abstract <T> boolean contains(Key<T> key);
public abstract <T> T get(Key<T> key);
public static final class Key<T> {
private final String name;
public final String getName() {
return this.name;
}
public String toString() {
return this.name;
}
public Key(String name) {
Intrinsics.checkNotNullParameter(name, "name");
this.name = name;
}
public final Pair<T> to(T t) {
return new Pair<>(this, t);
}
public boolean equals(Object obj) {
if (obj instanceof Key) {
return Intrinsics.areEqual(this.name, ((Key) obj).name);
}
return false;
}
public int hashCode() {
return this.name.hashCode();
}
}
public static final class Pair<T> {
private final Key<T> key;
private final T value;
public final Key<T> getKey$datastore_preferences_core() {
return this.key;
}
public final T getValue$datastore_preferences_core() {
return this.value;
}
public Pair(Key<T> key, T t) {
Intrinsics.checkNotNullParameter(key, "key");
this.key = key;
this.value = t;
}
}
public final MutablePreferences toMutablePreferences() {
Map mutableMap;
mutableMap = MapsKt__MapsKt.toMutableMap(asMap());
return new MutablePreferences(mutableMap, false);
}
public final Preferences toPreferences() {
Map mutableMap;
mutableMap = MapsKt__MapsKt.toMutableMap(asMap());
return new MutablePreferences(mutableMap, true);
}
}

View File

@@ -0,0 +1,24 @@
package androidx.datastore.preferences.core;
import androidx.datastore.preferences.core.Preferences;
import java.util.Arrays;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class PreferencesFactory {
public static final Preferences createEmpty() {
return new MutablePreferences(null, true, 1, null);
}
public static final Preferences create(Preferences.Pair<?>... pairs) {
Intrinsics.checkNotNullParameter(pairs, "pairs");
return createMutable((Preferences.Pair[]) Arrays.copyOf(pairs, pairs.length));
}
public static final MutablePreferences createMutable(Preferences.Pair<?>... pairs) {
Intrinsics.checkNotNullParameter(pairs, "pairs");
MutablePreferences mutablePreferences = new MutablePreferences(null, false, 1, null);
mutablePreferences.putAll((Preferences.Pair[]) Arrays.copyOf(pairs, pairs.length));
return mutablePreferences;
}
}

View File

@@ -0,0 +1,43 @@
package androidx.datastore.preferences.core;
import androidx.datastore.preferences.core.Preferences;
import java.util.Set;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class PreferencesKeys {
public static final Preferences.Key<Integer> intKey(String name) {
Intrinsics.checkNotNullParameter(name, "name");
return new Preferences.Key<>(name);
}
public static final Preferences.Key<Double> doubleKey(String name) {
Intrinsics.checkNotNullParameter(name, "name");
return new Preferences.Key<>(name);
}
public static final Preferences.Key<String> stringKey(String name) {
Intrinsics.checkNotNullParameter(name, "name");
return new Preferences.Key<>(name);
}
public static final Preferences.Key<Boolean> booleanKey(String name) {
Intrinsics.checkNotNullParameter(name, "name");
return new Preferences.Key<>(name);
}
public static final Preferences.Key<Float> floatKey(String name) {
Intrinsics.checkNotNullParameter(name, "name");
return new Preferences.Key<>(name);
}
public static final Preferences.Key<Long> longKey(String name) {
Intrinsics.checkNotNullParameter(name, "name");
return new Preferences.Key<>(name);
}
public static final Preferences.Key<Set<String>> stringSetKey(String name) {
Intrinsics.checkNotNullParameter(name, "name");
return new Preferences.Key<>(name);
}
}

View File

@@ -0,0 +1,56 @@
package androidx.datastore.preferences.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;
@DebugMetadata(c = "androidx.datastore.preferences.core.PreferencesKt$edit$2", f = "Preferences.kt", l = {329}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class PreferencesKt$edit$2 extends SuspendLambda implements Function2 {
final /* synthetic */ Function2 $transform;
/* synthetic */ Object L$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public PreferencesKt$edit$2(Function2 function2, Continuation continuation) {
super(2, continuation);
this.$transform = function2;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
PreferencesKt$edit$2 preferencesKt$edit$2 = new PreferencesKt$edit$2(this.$transform, continuation);
preferencesKt$edit$2.L$0 = obj;
return preferencesKt$edit$2;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(Preferences preferences, Continuation continuation) {
return ((PreferencesKt$edit$2) create(preferences, 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) {
if (i == 1) {
MutablePreferences mutablePreferences = (MutablePreferences) this.L$0;
ResultKt.throwOnFailure(obj);
return mutablePreferences;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
MutablePreferences mutablePreferences2 = ((Preferences) this.L$0).toMutablePreferences();
Function2 function2 = this.$transform;
this.L$0 = mutablePreferences2;
this.label = 1;
return function2.invoke(mutablePreferences2, this) == coroutine_suspended ? coroutine_suspended : mutablePreferences2;
}
}

View File

@@ -0,0 +1,12 @@
package androidx.datastore.preferences.core;
import androidx.datastore.core.DataStore;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function2;
/* loaded from: classes.dex */
public final class PreferencesKt {
public static final Object edit(DataStore<Preferences> dataStore, Function2 function2, Continuation continuation) {
return dataStore.updateData(new PreferencesKt$edit$2(function2, null), continuation);
}
}

View File

@@ -0,0 +1,163 @@
package androidx.datastore.preferences.core;
import androidx.datastore.core.CorruptionException;
import androidx.datastore.core.Serializer;
import androidx.datastore.preferences.PreferencesMapCompat;
import androidx.datastore.preferences.PreferencesProto;
import androidx.datastore.preferences.core.Preferences;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import java.util.Set;
import kotlin.NoWhenBranchMatchedException;
import kotlin.Unit;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.coroutines.Continuation;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class PreferencesSerializer implements Serializer<Preferences> {
public static final PreferencesSerializer INSTANCE = new PreferencesSerializer();
private static final String fileExtension = "preferences_pb";
public /* synthetic */ class WhenMappings {
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[PreferencesProto.Value.ValueCase.values().length];
iArr[PreferencesProto.Value.ValueCase.BOOLEAN.ordinal()] = 1;
iArr[PreferencesProto.Value.ValueCase.FLOAT.ordinal()] = 2;
iArr[PreferencesProto.Value.ValueCase.DOUBLE.ordinal()] = 3;
iArr[PreferencesProto.Value.ValueCase.INTEGER.ordinal()] = 4;
iArr[PreferencesProto.Value.ValueCase.LONG.ordinal()] = 5;
iArr[PreferencesProto.Value.ValueCase.STRING.ordinal()] = 6;
iArr[PreferencesProto.Value.ValueCase.STRING_SET.ordinal()] = 7;
iArr[PreferencesProto.Value.ValueCase.VALUE_NOT_SET.ordinal()] = 8;
$EnumSwitchMapping$0 = iArr;
}
}
public final String getFileExtension() {
return fileExtension;
}
private PreferencesSerializer() {
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.datastore.core.Serializer
public Preferences getDefaultValue() {
return PreferencesFactory.createEmpty();
}
@Override // androidx.datastore.core.Serializer
public Object readFrom(InputStream inputStream, Continuation continuation) throws IOException, CorruptionException {
PreferencesProto.PreferenceMap readFrom = PreferencesMapCompat.Companion.readFrom(inputStream);
MutablePreferences createMutable = PreferencesFactory.createMutable(new Preferences.Pair[0]);
Map<String, PreferencesProto.Value> preferencesMap = readFrom.getPreferencesMap();
Intrinsics.checkNotNullExpressionValue(preferencesMap, "preferencesProto.preferencesMap");
for (Map.Entry<String, PreferencesProto.Value> entry : preferencesMap.entrySet()) {
String name = entry.getKey();
PreferencesProto.Value value = entry.getValue();
PreferencesSerializer preferencesSerializer = INSTANCE;
Intrinsics.checkNotNullExpressionValue(name, "name");
Intrinsics.checkNotNullExpressionValue(value, "value");
preferencesSerializer.addProtoEntryToPreferences(name, value, createMutable);
}
return createMutable.toPreferences();
}
@Override // androidx.datastore.core.Serializer
public Object writeTo(Preferences preferences, OutputStream outputStream, Continuation continuation) throws IOException, CorruptionException {
Map<Preferences.Key<?>, Object> asMap = preferences.asMap();
PreferencesProto.PreferenceMap.Builder newBuilder = PreferencesProto.PreferenceMap.newBuilder();
for (Map.Entry<Preferences.Key<?>, Object> entry : asMap.entrySet()) {
newBuilder.putPreferences(entry.getKey().getName(), getValueProto(entry.getValue()));
}
newBuilder.build().writeTo(outputStream);
return Unit.INSTANCE;
}
private final PreferencesProto.Value getValueProto(Object obj) {
if (obj instanceof Boolean) {
PreferencesProto.Value build = PreferencesProto.Value.newBuilder().setBoolean(((Boolean) obj).booleanValue()).build();
Intrinsics.checkNotNullExpressionValue(build, "newBuilder().setBoolean(value).build()");
return build;
}
if (obj instanceof Float) {
PreferencesProto.Value build2 = PreferencesProto.Value.newBuilder().setFloat(((Number) obj).floatValue()).build();
Intrinsics.checkNotNullExpressionValue(build2, "newBuilder().setFloat(value).build()");
return build2;
}
if (obj instanceof Double) {
PreferencesProto.Value build3 = PreferencesProto.Value.newBuilder().setDouble(((Number) obj).doubleValue()).build();
Intrinsics.checkNotNullExpressionValue(build3, "newBuilder().setDouble(value).build()");
return build3;
}
if (obj instanceof Integer) {
PreferencesProto.Value build4 = PreferencesProto.Value.newBuilder().setInteger(((Number) obj).intValue()).build();
Intrinsics.checkNotNullExpressionValue(build4, "newBuilder().setInteger(value).build()");
return build4;
}
if (obj instanceof Long) {
PreferencesProto.Value build5 = PreferencesProto.Value.newBuilder().setLong(((Number) obj).longValue()).build();
Intrinsics.checkNotNullExpressionValue(build5, "newBuilder().setLong(value).build()");
return build5;
}
if (obj instanceof String) {
PreferencesProto.Value build6 = PreferencesProto.Value.newBuilder().setString((String) obj).build();
Intrinsics.checkNotNullExpressionValue(build6, "newBuilder().setString(value).build()");
return build6;
}
if (obj instanceof Set) {
PreferencesProto.Value build7 = PreferencesProto.Value.newBuilder().setStringSet(PreferencesProto.StringSet.newBuilder().addAllStrings((Set) obj)).build();
Intrinsics.checkNotNullExpressionValue(build7, "newBuilder().setStringSet(\n StringSet.newBuilder().addAllStrings(value as Set<String>)\n ).build()");
return build7;
}
throw new IllegalStateException(Intrinsics.stringPlus("PreferencesSerializer does not support type: ", obj.getClass().getName()));
}
private final void addProtoEntryToPreferences(String str, PreferencesProto.Value value, MutablePreferences mutablePreferences) {
Set set;
PreferencesProto.Value.ValueCase valueCase = value.getValueCase();
switch (valueCase == null ? -1 : WhenMappings.$EnumSwitchMapping$0[valueCase.ordinal()]) {
case -1:
throw new CorruptionException("Value case is null.", null, 2, null);
case 0:
default:
throw new NoWhenBranchMatchedException();
case 1:
mutablePreferences.set(PreferencesKeys.booleanKey(str), Boolean.valueOf(value.getBoolean()));
return;
case 2:
mutablePreferences.set(PreferencesKeys.floatKey(str), Float.valueOf(value.getFloat()));
return;
case 3:
mutablePreferences.set(PreferencesKeys.doubleKey(str), Double.valueOf(value.getDouble()));
return;
case 4:
mutablePreferences.set(PreferencesKeys.intKey(str), Integer.valueOf(value.getInteger()));
return;
case 5:
mutablePreferences.set(PreferencesKeys.longKey(str), Long.valueOf(value.getLong()));
return;
case 6:
Preferences.Key<String> stringKey = PreferencesKeys.stringKey(str);
String string = value.getString();
Intrinsics.checkNotNullExpressionValue(string, "value.string");
mutablePreferences.set(stringKey, string);
return;
case 7:
Preferences.Key<Set<String>> stringSetKey = PreferencesKeys.stringSetKey(str);
List<String> stringsList = value.getStringSet().getStringsList();
Intrinsics.checkNotNullExpressionValue(stringsList, "value.stringSet.stringsList");
set = CollectionsKt___CollectionsKt.toSet(stringsList);
mutablePreferences.set(stringSetKey, set);
return;
case 8:
throw new CorruptionException("Value not set.", null, 2, null);
}
}
}

View File

@@ -0,0 +1,332 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.AbstractMessageLite;
import androidx.datastore.preferences.protobuf.AbstractMessageLite.Builder;
import androidx.datastore.preferences.protobuf.ByteString;
import androidx.datastore.preferences.protobuf.MessageLite;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/* loaded from: classes.dex */
public abstract class AbstractMessageLite<MessageType extends AbstractMessageLite<MessageType, BuilderType>, BuilderType extends Builder<MessageType, BuilderType>> implements MessageLite {
protected int memoizedHashCode = 0;
public interface InternalOneOfEnum {
int getNumber();
}
@Override // androidx.datastore.preferences.protobuf.MessageLite
public ByteString toByteString() {
try {
ByteString.CodedBuilder newCodedBuilder = ByteString.newCodedBuilder(getSerializedSize());
writeTo(newCodedBuilder.getCodedOutput());
return newCodedBuilder.build();
} catch (IOException e) {
throw new RuntimeException(getSerializingExceptionMessage("ByteString"), e);
}
}
@Override // androidx.datastore.preferences.protobuf.MessageLite
public byte[] toByteArray() {
try {
byte[] bArr = new byte[getSerializedSize()];
CodedOutputStream newInstance = CodedOutputStream.newInstance(bArr);
writeTo(newInstance);
newInstance.checkNoSpaceLeft();
return bArr;
} catch (IOException e) {
throw new RuntimeException(getSerializingExceptionMessage("byte array"), e);
}
}
@Override // androidx.datastore.preferences.protobuf.MessageLite
public void writeTo(OutputStream outputStream) throws IOException {
CodedOutputStream newInstance = CodedOutputStream.newInstance(outputStream, CodedOutputStream.computePreferredBufferSize(getSerializedSize()));
writeTo(newInstance);
newInstance.flush();
}
@Override // androidx.datastore.preferences.protobuf.MessageLite
public void writeDelimitedTo(OutputStream outputStream) throws IOException {
int serializedSize = getSerializedSize();
CodedOutputStream newInstance = CodedOutputStream.newInstance(outputStream, CodedOutputStream.computePreferredBufferSize(CodedOutputStream.computeRawVarint32Size(serializedSize) + serializedSize));
newInstance.writeRawVarint32(serializedSize);
writeTo(newInstance);
newInstance.flush();
}
public int getMemoizedSerializedSize() {
throw new UnsupportedOperationException();
}
public void setMemoizedSerializedSize(int i) {
throw new UnsupportedOperationException();
}
public int getSerializedSize(Schema schema) {
int memoizedSerializedSize = getMemoizedSerializedSize();
if (memoizedSerializedSize != -1) {
return memoizedSerializedSize;
}
int serializedSize = schema.getSerializedSize(this);
setMemoizedSerializedSize(serializedSize);
return serializedSize;
}
public UninitializedMessageException newUninitializedMessageException() {
return new UninitializedMessageException(this);
}
private String getSerializingExceptionMessage(String str) {
return "Serializing " + getClass().getName() + " to a " + str + " threw an IOException (should never happen).";
}
public static void checkByteStringIsUtf8(ByteString byteString) throws IllegalArgumentException {
if (!byteString.isValidUtf8()) {
throw new IllegalArgumentException("Byte string is not UTF-8.");
}
}
@Deprecated
public static <T> void addAll(Iterable<T> iterable, Collection<? super T> collection) {
Builder.addAll((Iterable) iterable, (List) collection);
}
public static <T> void addAll(Iterable<T> iterable, List<? super T> list) {
Builder.addAll((Iterable) iterable, (List) list);
}
public static abstract class Builder<MessageType extends AbstractMessageLite<MessageType, BuilderType>, BuilderType extends Builder<MessageType, BuilderType>> implements MessageLite.Builder {
@Override //
/* renamed from: clone */
public abstract BuilderType mo146clone();
public abstract BuilderType internalMergeFrom(MessageType messagetype);
@Override // androidx.datastore.preferences.protobuf.MessageLite.Builder
public abstract BuilderType mergeFrom(CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException;
@Override // androidx.datastore.preferences.protobuf.MessageLite.Builder
public BuilderType mergeFrom(CodedInputStream codedInputStream) throws IOException {
return mergeFrom(codedInputStream, ExtensionRegistryLite.getEmptyRegistry());
}
@Override // androidx.datastore.preferences.protobuf.MessageLite.Builder
public BuilderType mergeFrom(ByteString byteString) throws InvalidProtocolBufferException {
try {
CodedInputStream newCodedInput = byteString.newCodedInput();
mergeFrom(newCodedInput);
newCodedInput.checkLastTagWas(0);
return this;
} catch (InvalidProtocolBufferException e) {
throw e;
} catch (IOException e2) {
throw new RuntimeException(getReadingExceptionMessage("ByteString"), e2);
}
}
@Override // androidx.datastore.preferences.protobuf.MessageLite.Builder
public BuilderType mergeFrom(ByteString byteString, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
try {
CodedInputStream newCodedInput = byteString.newCodedInput();
mergeFrom(newCodedInput, extensionRegistryLite);
newCodedInput.checkLastTagWas(0);
return this;
} catch (InvalidProtocolBufferException e) {
throw e;
} catch (IOException e2) {
throw new RuntimeException(getReadingExceptionMessage("ByteString"), e2);
}
}
@Override // androidx.datastore.preferences.protobuf.MessageLite.Builder
public BuilderType mergeFrom(byte[] bArr) throws InvalidProtocolBufferException {
return mergeFrom(bArr, 0, bArr.length);
}
@Override // androidx.datastore.preferences.protobuf.MessageLite.Builder
public BuilderType mergeFrom(byte[] bArr, int i, int i2) throws InvalidProtocolBufferException {
try {
CodedInputStream newInstance = CodedInputStream.newInstance(bArr, i, i2);
mergeFrom(newInstance);
newInstance.checkLastTagWas(0);
return this;
} catch (InvalidProtocolBufferException e) {
throw e;
} catch (IOException e2) {
throw new RuntimeException(getReadingExceptionMessage("byte array"), e2);
}
}
@Override // androidx.datastore.preferences.protobuf.MessageLite.Builder
public BuilderType mergeFrom(byte[] bArr, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return mergeFrom(bArr, 0, bArr.length, extensionRegistryLite);
}
@Override // androidx.datastore.preferences.protobuf.MessageLite.Builder
public BuilderType mergeFrom(byte[] bArr, int i, int i2, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
try {
CodedInputStream newInstance = CodedInputStream.newInstance(bArr, i, i2);
mergeFrom(newInstance, extensionRegistryLite);
newInstance.checkLastTagWas(0);
return this;
} catch (InvalidProtocolBufferException e) {
throw e;
} catch (IOException e2) {
throw new RuntimeException(getReadingExceptionMessage("byte array"), e2);
}
}
@Override // androidx.datastore.preferences.protobuf.MessageLite.Builder
public BuilderType mergeFrom(InputStream inputStream) throws IOException {
CodedInputStream newInstance = CodedInputStream.newInstance(inputStream);
mergeFrom(newInstance);
newInstance.checkLastTagWas(0);
return this;
}
@Override // androidx.datastore.preferences.protobuf.MessageLite.Builder
public BuilderType mergeFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
CodedInputStream newInstance = CodedInputStream.newInstance(inputStream);
mergeFrom(newInstance, extensionRegistryLite);
newInstance.checkLastTagWas(0);
return this;
}
public static final class LimitedInputStream extends FilterInputStream {
private int limit;
public LimitedInputStream(InputStream inputStream, int i) {
super(inputStream);
this.limit = i;
}
@Override // java.io.FilterInputStream, java.io.InputStream
public int available() throws IOException {
return Math.min(super.available(), this.limit);
}
@Override // java.io.FilterInputStream, java.io.InputStream
public int read() throws IOException {
if (this.limit <= 0) {
return -1;
}
int read = super.read();
if (read >= 0) {
this.limit--;
}
return read;
}
@Override // java.io.FilterInputStream, java.io.InputStream
public int read(byte[] bArr, int i, int i2) throws IOException {
int i3 = this.limit;
if (i3 <= 0) {
return -1;
}
int read = super.read(bArr, i, Math.min(i2, i3));
if (read >= 0) {
this.limit -= read;
}
return read;
}
@Override // java.io.FilterInputStream, java.io.InputStream
public long skip(long j) throws IOException {
long skip = super.skip(Math.min(j, this.limit));
if (skip >= 0) {
this.limit = (int) (this.limit - skip);
}
return skip;
}
}
@Override // androidx.datastore.preferences.protobuf.MessageLite.Builder
public boolean mergeDelimitedFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
int read = inputStream.read();
if (read == -1) {
return false;
}
mergeFrom((InputStream) new LimitedInputStream(inputStream, CodedInputStream.readRawVarint32(read, inputStream)), extensionRegistryLite);
return true;
}
@Override // androidx.datastore.preferences.protobuf.MessageLite.Builder
public boolean mergeDelimitedFrom(InputStream inputStream) throws IOException {
return mergeDelimitedFrom(inputStream, ExtensionRegistryLite.getEmptyRegistry());
}
/* JADX WARN: Multi-variable type inference failed */
@Override // androidx.datastore.preferences.protobuf.MessageLite.Builder
public BuilderType mergeFrom(MessageLite messageLite) {
if (!getDefaultInstanceForType().getClass().isInstance(messageLite)) {
throw new IllegalArgumentException("mergeFrom(MessageLite) can only merge messages of the same type.");
}
return (BuilderType) internalMergeFrom((AbstractMessageLite) messageLite);
}
private String getReadingExceptionMessage(String str) {
return "Reading " + getClass().getName() + " from a " + str + " threw an IOException (should never happen).";
}
private static <T> void addAllCheckingNulls(Iterable<T> iterable, List<? super T> list) {
if ((list instanceof ArrayList) && (iterable instanceof Collection)) {
((ArrayList) list).ensureCapacity(list.size() + ((Collection) iterable).size());
}
int size = list.size();
for (T t : iterable) {
if (t == null) {
String str = "Element at index " + (list.size() - size) + " is null.";
for (int size2 = list.size() - 1; size2 >= size; size2--) {
list.remove(size2);
}
throw new NullPointerException(str);
}
list.add(t);
}
}
public static UninitializedMessageException newUninitializedMessageException(MessageLite messageLite) {
return new UninitializedMessageException(messageLite);
}
@Deprecated
public static <T> void addAll(Iterable<T> iterable, Collection<? super T> collection) {
addAll((Iterable) iterable, (List) collection);
}
public static <T> void addAll(Iterable<T> iterable, List<? super T> list) {
Internal.checkNotNull(iterable);
if (iterable instanceof LazyStringList) {
List<?> underlyingElements = ((LazyStringList) iterable).getUnderlyingElements();
LazyStringList lazyStringList = (LazyStringList) list;
int size = list.size();
for (Object obj : underlyingElements) {
if (obj == null) {
String str = "Element at index " + (lazyStringList.size() - size) + " is null.";
for (int size2 = lazyStringList.size() - 1; size2 >= size; size2--) {
lazyStringList.remove(size2);
}
throw new NullPointerException(str);
}
if (obj instanceof ByteString) {
lazyStringList.add((ByteString) obj);
} else {
lazyStringList.add((LazyStringList) obj);
}
}
return;
}
if (iterable instanceof PrimitiveNonBoxingCollection) {
list.addAll((Collection) iterable);
} else {
addAllCheckingNulls(iterable, list);
}
}
}
}

View File

@@ -0,0 +1,189 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.AbstractMessageLite;
import androidx.datastore.preferences.protobuf.MessageLite;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
/* loaded from: classes.dex */
public abstract class AbstractParser<MessageType extends MessageLite> implements Parser<MessageType> {
private static final ExtensionRegistryLite EMPTY_REGISTRY = ExtensionRegistryLite.getEmptyRegistry();
private UninitializedMessageException newUninitializedMessageException(MessageType messagetype) {
if (messagetype instanceof AbstractMessageLite) {
return ((AbstractMessageLite) messagetype).newUninitializedMessageException();
}
return new UninitializedMessageException(messagetype);
}
private MessageType checkMessageInitialized(MessageType messagetype) throws InvalidProtocolBufferException {
if (messagetype == null || messagetype.isInitialized()) {
return messagetype;
}
throw newUninitializedMessageException(messagetype).asInvalidProtocolBufferException().setUnfinishedMessage(messagetype);
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parsePartialFrom(CodedInputStream codedInputStream) throws InvalidProtocolBufferException {
return (MessageType) parsePartialFrom(codedInputStream, EMPTY_REGISTRY);
}
/* JADX WARN: Multi-variable type inference failed */
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parseFrom(CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (MessageType) checkMessageInitialized((MessageLite) parsePartialFrom(codedInputStream, extensionRegistryLite));
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parseFrom(CodedInputStream codedInputStream) throws InvalidProtocolBufferException {
return parseFrom(codedInputStream, EMPTY_REGISTRY);
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parsePartialFrom(ByteString byteString, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
CodedInputStream newCodedInput = byteString.newCodedInput();
MessageType messagetype = (MessageType) parsePartialFrom(newCodedInput, extensionRegistryLite);
try {
newCodedInput.checkLastTagWas(0);
return messagetype;
} catch (InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(messagetype);
}
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parsePartialFrom(ByteString byteString) throws InvalidProtocolBufferException {
return parsePartialFrom(byteString, EMPTY_REGISTRY);
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parseFrom(ByteString byteString, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return checkMessageInitialized(parsePartialFrom(byteString, extensionRegistryLite));
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parseFrom(ByteString byteString) throws InvalidProtocolBufferException {
return parseFrom(byteString, EMPTY_REGISTRY);
}
/* JADX WARN: Multi-variable type inference failed */
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parseFrom(ByteBuffer byteBuffer, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
CodedInputStream newInstance = CodedInputStream.newInstance(byteBuffer);
MessageLite messageLite = (MessageLite) parsePartialFrom(newInstance, extensionRegistryLite);
try {
newInstance.checkLastTagWas(0);
return (MessageType) checkMessageInitialized(messageLite);
} catch (InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(messageLite);
}
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parseFrom(ByteBuffer byteBuffer) throws InvalidProtocolBufferException {
return parseFrom(byteBuffer, EMPTY_REGISTRY);
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parsePartialFrom(byte[] bArr, int i, int i2, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
CodedInputStream newInstance = CodedInputStream.newInstance(bArr, i, i2);
MessageType messagetype = (MessageType) parsePartialFrom(newInstance, extensionRegistryLite);
try {
newInstance.checkLastTagWas(0);
return messagetype;
} catch (InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(messagetype);
}
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parsePartialFrom(byte[] bArr, int i, int i2) throws InvalidProtocolBufferException {
return parsePartialFrom(bArr, i, i2, EMPTY_REGISTRY);
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parsePartialFrom(byte[] bArr, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return parsePartialFrom(bArr, 0, bArr.length, extensionRegistryLite);
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parsePartialFrom(byte[] bArr) throws InvalidProtocolBufferException {
return parsePartialFrom(bArr, 0, bArr.length, EMPTY_REGISTRY);
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parseFrom(byte[] bArr, int i, int i2, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return checkMessageInitialized(parsePartialFrom(bArr, i, i2, extensionRegistryLite));
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parseFrom(byte[] bArr, int i, int i2) throws InvalidProtocolBufferException {
return parseFrom(bArr, i, i2, EMPTY_REGISTRY);
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parseFrom(byte[] bArr, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return parseFrom(bArr, 0, bArr.length, extensionRegistryLite);
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parseFrom(byte[] bArr) throws InvalidProtocolBufferException {
return parseFrom(bArr, EMPTY_REGISTRY);
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parsePartialFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
CodedInputStream newInstance = CodedInputStream.newInstance(inputStream);
MessageType messagetype = (MessageType) parsePartialFrom(newInstance, extensionRegistryLite);
try {
newInstance.checkLastTagWas(0);
return messagetype;
} catch (InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(messagetype);
}
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parsePartialFrom(InputStream inputStream) throws InvalidProtocolBufferException {
return parsePartialFrom(inputStream, EMPTY_REGISTRY);
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parseFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return checkMessageInitialized(parsePartialFrom(inputStream, extensionRegistryLite));
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parseFrom(InputStream inputStream) throws InvalidProtocolBufferException {
return parseFrom(inputStream, EMPTY_REGISTRY);
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parsePartialDelimitedFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
try {
int read = inputStream.read();
if (read == -1) {
return null;
}
return parsePartialFrom((InputStream) new AbstractMessageLite.Builder.LimitedInputStream(inputStream, CodedInputStream.readRawVarint32(read, inputStream)), extensionRegistryLite);
} catch (IOException e) {
throw new InvalidProtocolBufferException(e);
}
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parsePartialDelimitedFrom(InputStream inputStream) throws InvalidProtocolBufferException {
return parsePartialDelimitedFrom(inputStream, EMPTY_REGISTRY);
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parseDelimitedFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return checkMessageInitialized(parsePartialDelimitedFrom(inputStream, extensionRegistryLite));
}
@Override // androidx.datastore.preferences.protobuf.Parser
public MessageType parseDelimitedFrom(InputStream inputStream) throws InvalidProtocolBufferException {
return parseDelimitedFrom(inputStream, EMPTY_REGISTRY);
}
}

View File

@@ -0,0 +1,123 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.Internal;
import java.util.AbstractList;
import java.util.Collection;
import java.util.List;
import java.util.RandomAccess;
/* loaded from: classes.dex */
abstract class AbstractProtobufList<E> extends AbstractList<E> implements Internal.ProtobufList<E> {
protected static final int DEFAULT_CAPACITY = 10;
private boolean isMutable = true;
@Override // androidx.datastore.preferences.protobuf.Internal.ProtobufList
public boolean isModifiable() {
return this.isMutable;
}
@Override // androidx.datastore.preferences.protobuf.Internal.ProtobufList
public final void makeImmutable() {
this.isMutable = false;
}
@Override // java.util.AbstractList, java.util.Collection, java.util.List
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof List)) {
return false;
}
if (!(obj instanceof RandomAccess)) {
return super.equals(obj);
}
List list = (List) obj;
int size = size();
if (size != list.size()) {
return false;
}
for (int i = 0; i < size; i++) {
if (!get(i).equals(list.get(i))) {
return false;
}
}
return true;
}
@Override // java.util.AbstractList, java.util.Collection, java.util.List
public int hashCode() {
int size = size();
int i = 1;
for (int i2 = 0; i2 < size; i2++) {
i = (i * 31) + get(i2).hashCode();
}
return i;
}
@Override // java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean add(E e) {
ensureIsMutable();
return super.add(e);
}
@Override // java.util.AbstractList, java.util.List
public void add(int i, E e) {
ensureIsMutable();
super.add(i, e);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean addAll(Collection<? extends E> collection) {
ensureIsMutable();
return super.addAll(collection);
}
@Override // java.util.AbstractList, java.util.List
public boolean addAll(int i, Collection<? extends E> collection) {
ensureIsMutable();
return super.addAll(i, collection);
}
@Override // java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List
public void clear() {
ensureIsMutable();
super.clear();
}
@Override // java.util.AbstractList, java.util.List
public E remove(int i) {
ensureIsMutable();
return (E) super.remove(i);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean remove(Object obj) {
ensureIsMutable();
return super.remove(obj);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean removeAll(Collection<?> collection) {
ensureIsMutable();
return super.removeAll(collection);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean retainAll(Collection<?> collection) {
ensureIsMutable();
return super.retainAll(collection);
}
@Override // java.util.AbstractList, java.util.List
public E set(int i, E e) {
ensureIsMutable();
return (E) super.set(i, e);
}
public void ensureIsMutable() {
if (!this.isMutable) {
throw new UnsupportedOperationException();
}
}
}

View File

@@ -0,0 +1,141 @@
package androidx.datastore.preferences.protobuf;
import java.nio.ByteBuffer;
/* loaded from: classes.dex */
abstract class AllocatedBuffer {
public abstract byte[] array();
public abstract int arrayOffset();
public abstract boolean hasArray();
public abstract boolean hasNioBuffer();
public abstract int limit();
public abstract ByteBuffer nioBuffer();
public abstract int position();
public abstract AllocatedBuffer position(int i);
public abstract int remaining();
public static AllocatedBuffer wrap(byte[] bArr) {
return wrapNoCheck(bArr, 0, bArr.length);
}
public static AllocatedBuffer wrap(byte[] bArr, int i, int i2) {
if (i < 0 || i2 < 0 || i + i2 > bArr.length) {
throw new IndexOutOfBoundsException(String.format("bytes.length=%d, offset=%d, length=%d", Integer.valueOf(bArr.length), Integer.valueOf(i), Integer.valueOf(i2)));
}
return wrapNoCheck(bArr, i, i2);
}
public static AllocatedBuffer wrap(final ByteBuffer byteBuffer) {
Internal.checkNotNull(byteBuffer, "buffer");
return new AllocatedBuffer() { // from class: androidx.datastore.preferences.protobuf.AllocatedBuffer.1
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public boolean hasNioBuffer() {
return true;
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public ByteBuffer nioBuffer() {
return byteBuffer;
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public boolean hasArray() {
return byteBuffer.hasArray();
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public byte[] array() {
return byteBuffer.array();
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public int arrayOffset() {
return byteBuffer.arrayOffset();
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public int position() {
return byteBuffer.position();
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public AllocatedBuffer position(int i) {
byteBuffer.position(i);
return this;
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public int limit() {
return byteBuffer.limit();
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public int remaining() {
return byteBuffer.remaining();
}
};
}
private static AllocatedBuffer wrapNoCheck(final byte[] bArr, final int i, final int i2) {
return new AllocatedBuffer() { // from class: androidx.datastore.preferences.protobuf.AllocatedBuffer.2
private int position;
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public byte[] array() {
return bArr;
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public int arrayOffset() {
return i;
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public boolean hasArray() {
return true;
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public boolean hasNioBuffer() {
return false;
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public int limit() {
return i2;
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public int position() {
return this.position;
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public int remaining() {
return i2 - this.position;
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public ByteBuffer nioBuffer() {
throw new UnsupportedOperationException();
}
@Override // androidx.datastore.preferences.protobuf.AllocatedBuffer
public AllocatedBuffer position(int i3) {
if (i3 >= 0 && i3 <= i2) {
this.position = i3;
return this;
}
throw new IllegalArgumentException("Invalid position: " + i3);
}
};
}
}

View File

@@ -0,0 +1,27 @@
package androidx.datastore.preferences.protobuf;
/* loaded from: classes.dex */
final class Android {
private static final boolean IS_ROBOLECTRIC;
private static final Class<?> MEMORY_CLASS = getClassForName("libcore.io.Memory");
public static Class<?> getMemoryClass() {
return MEMORY_CLASS;
}
public static boolean isOnAndroidDevice() {
return (MEMORY_CLASS == null || IS_ROBOLECTRIC) ? false : true;
}
static {
IS_ROBOLECTRIC = getClassForName("org.robolectric.Robolectric") != null;
}
private static <T> Class<T> getClassForName(String str) {
try {
return (Class<T>) Class.forName(str);
} catch (Throwable unused) {
return null;
}
}
}

View File

@@ -0,0 +1,262 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.GeneratedMessageLite;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
/* loaded from: classes.dex */
public final class Any extends GeneratedMessageLite<Any, Builder> implements AnyOrBuilder {
private static final Any DEFAULT_INSTANCE;
private static volatile Parser<Any> PARSER = null;
public static final int TYPE_URL_FIELD_NUMBER = 1;
public static final int VALUE_FIELD_NUMBER = 2;
private String typeUrl_ = "";
private ByteString value_ = ByteString.EMPTY;
public static Any getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@Override // androidx.datastore.preferences.protobuf.AnyOrBuilder
public String getTypeUrl() {
return this.typeUrl_;
}
@Override // androidx.datastore.preferences.protobuf.AnyOrBuilder
public ByteString getValue() {
return this.value_;
}
private Any() {
}
@Override // androidx.datastore.preferences.protobuf.AnyOrBuilder
public ByteString getTypeUrlBytes() {
return ByteString.copyFromUtf8(this.typeUrl_);
}
/* JADX INFO: Access modifiers changed from: private */
public void setTypeUrl(String str) {
str.getClass();
this.typeUrl_ = str;
}
/* JADX INFO: Access modifiers changed from: private */
public void clearTypeUrl() {
this.typeUrl_ = getDefaultInstance().getTypeUrl();
}
/* JADX INFO: Access modifiers changed from: private */
public void setTypeUrlBytes(ByteString byteString) {
byteString.getClass();
AbstractMessageLite.checkByteStringIsUtf8(byteString);
this.typeUrl_ = byteString.toStringUtf8();
}
/* JADX INFO: Access modifiers changed from: private */
public void setValue(ByteString byteString) {
byteString.getClass();
this.value_ = byteString;
}
/* JADX INFO: Access modifiers changed from: private */
public void clearValue() {
this.value_ = getDefaultInstance().getValue();
}
public static Any parseFrom(ByteBuffer byteBuffer) throws InvalidProtocolBufferException {
return (Any) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer);
}
public static Any parseFrom(ByteBuffer byteBuffer, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Any) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer, extensionRegistryLite);
}
public static Any parseFrom(ByteString byteString) throws InvalidProtocolBufferException {
return (Any) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString);
}
public static Any parseFrom(ByteString byteString, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Any) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString, extensionRegistryLite);
}
public static Any parseFrom(byte[] bArr) throws InvalidProtocolBufferException {
return (Any) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr);
}
public static Any parseFrom(byte[] bArr, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Any) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr, extensionRegistryLite);
}
public static Any parseFrom(InputStream inputStream) throws IOException {
return (Any) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream);
}
public static Any parseFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Any) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static Any parseDelimitedFrom(InputStream inputStream) throws IOException {
return (Any) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream);
}
public static Any parseDelimitedFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Any) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static Any parseFrom(CodedInputStream codedInputStream) throws IOException {
return (Any) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream);
}
public static Any parseFrom(CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Any) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream, extensionRegistryLite);
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.createBuilder();
}
public static Builder newBuilder(Any any) {
return DEFAULT_INSTANCE.createBuilder(any);
}
public static final class Builder extends GeneratedMessageLite.Builder<Any, Builder> implements AnyOrBuilder {
public /* synthetic */ Builder(AnonymousClass1 anonymousClass1) {
this();
}
private Builder() {
super(Any.DEFAULT_INSTANCE);
}
@Override // androidx.datastore.preferences.protobuf.AnyOrBuilder
public String getTypeUrl() {
return ((Any) this.instance).getTypeUrl();
}
@Override // androidx.datastore.preferences.protobuf.AnyOrBuilder
public ByteString getTypeUrlBytes() {
return ((Any) this.instance).getTypeUrlBytes();
}
public Builder setTypeUrl(String str) {
copyOnWrite();
((Any) this.instance).setTypeUrl(str);
return this;
}
public Builder clearTypeUrl() {
copyOnWrite();
((Any) this.instance).clearTypeUrl();
return this;
}
public Builder setTypeUrlBytes(ByteString byteString) {
copyOnWrite();
((Any) this.instance).setTypeUrlBytes(byteString);
return this;
}
@Override // androidx.datastore.preferences.protobuf.AnyOrBuilder
public ByteString getValue() {
return ((Any) this.instance).getValue();
}
public Builder setValue(ByteString byteString) {
copyOnWrite();
((Any) this.instance).setValue(byteString);
return this;
}
public Builder clearValue() {
copyOnWrite();
((Any) this.instance).clearValue();
return this;
}
}
/* renamed from: androidx.datastore.preferences.protobuf.Any$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke;
static {
int[] iArr = new int[GeneratedMessageLite.MethodToInvoke.values().length];
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke = iArr;
try {
iArr[GeneratedMessageLite.MethodToInvoke.NEW_MUTABLE_INSTANCE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.NEW_BUILDER.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.BUILD_MESSAGE_INFO.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_DEFAULT_INSTANCE.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_PARSER.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_MEMOIZED_IS_INITIALIZED.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.SET_MEMOIZED_IS_INITIALIZED.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
}
}
@Override // androidx.datastore.preferences.protobuf.GeneratedMessageLite
public final Object dynamicMethod(GeneratedMessageLite.MethodToInvoke methodToInvoke, Object obj, Object obj2) {
AnonymousClass1 anonymousClass1 = null;
switch (AnonymousClass1.$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[methodToInvoke.ordinal()]) {
case 1:
return new Any();
case 2:
return new Builder(anonymousClass1);
case 3:
return GeneratedMessageLite.newMessageInfo(DEFAULT_INSTANCE, "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001Ȉ\u0002\n", new Object[]{"typeUrl_", "value_"});
case 4:
return DEFAULT_INSTANCE;
case 5:
Parser<Any> parser = PARSER;
if (parser == null) {
synchronized (Any.class) {
try {
parser = PARSER;
if (parser == null) {
parser = new GeneratedMessageLite.DefaultInstanceBasedParser<>(DEFAULT_INSTANCE);
PARSER = parser;
}
} finally {
}
}
}
return parser;
case 6:
return (byte) 1;
case 7:
return null;
default:
throw new UnsupportedOperationException();
}
}
static {
Any any = new Any();
DEFAULT_INSTANCE = any;
GeneratedMessageLite.registerDefaultInstance(Any.class, any);
}
public static Parser<Any> parser() {
return DEFAULT_INSTANCE.getParserForType();
}
}

View File

@@ -0,0 +1,10 @@
package androidx.datastore.preferences.protobuf;
/* loaded from: classes.dex */
public interface AnyOrBuilder extends MessageLiteOrBuilder {
String getTypeUrl();
ByteString getTypeUrlBytes();
ByteString getValue();
}

View File

@@ -0,0 +1,10 @@
package androidx.datastore.preferences.protobuf;
/* loaded from: classes.dex */
public final class AnyProto {
public static void registerAllExtensions(ExtensionRegistryLite extensionRegistryLite) {
}
private AnyProto() {
}
}

View File

@@ -0,0 +1,894 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.GeneratedMessageLite;
import androidx.datastore.preferences.protobuf.Internal;
import androidx.datastore.preferences.protobuf.Method;
import androidx.datastore.preferences.protobuf.Mixin;
import androidx.datastore.preferences.protobuf.Option;
import androidx.datastore.preferences.protobuf.SourceContext;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.Collections;
import java.util.List;
/* loaded from: classes.dex */
public final class Api extends GeneratedMessageLite<Api, Builder> implements ApiOrBuilder {
private static final Api DEFAULT_INSTANCE;
public static final int METHODS_FIELD_NUMBER = 2;
public static final int MIXINS_FIELD_NUMBER = 6;
public static final int NAME_FIELD_NUMBER = 1;
public static final int OPTIONS_FIELD_NUMBER = 3;
private static volatile Parser<Api> PARSER = null;
public static final int SOURCE_CONTEXT_FIELD_NUMBER = 5;
public static final int SYNTAX_FIELD_NUMBER = 7;
public static final int VERSION_FIELD_NUMBER = 4;
private SourceContext sourceContext_;
private int syntax_;
private String name_ = "";
private Internal.ProtobufList<Method> methods_ = GeneratedMessageLite.emptyProtobufList();
private Internal.ProtobufList<Option> options_ = GeneratedMessageLite.emptyProtobufList();
private String version_ = "";
private Internal.ProtobufList<Mixin> mixins_ = GeneratedMessageLite.emptyProtobufList();
/* JADX INFO: Access modifiers changed from: private */
public void clearSourceContext() {
this.sourceContext_ = null;
}
/* JADX INFO: Access modifiers changed from: private */
public void clearSyntax() {
this.syntax_ = 0;
}
public static Api getDefaultInstance() {
return DEFAULT_INSTANCE;
}
/* JADX INFO: Access modifiers changed from: private */
public void setSyntaxValue(int i) {
this.syntax_ = i;
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public List<Method> getMethodsList() {
return this.methods_;
}
public List<? extends MethodOrBuilder> getMethodsOrBuilderList() {
return this.methods_;
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public List<Mixin> getMixinsList() {
return this.mixins_;
}
public List<? extends MixinOrBuilder> getMixinsOrBuilderList() {
return this.mixins_;
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public String getName() {
return this.name_;
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public List<Option> getOptionsList() {
return this.options_;
}
public List<? extends OptionOrBuilder> getOptionsOrBuilderList() {
return this.options_;
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public int getSyntaxValue() {
return this.syntax_;
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public String getVersion() {
return this.version_;
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public boolean hasSourceContext() {
return this.sourceContext_ != null;
}
private Api() {
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public ByteString getNameBytes() {
return ByteString.copyFromUtf8(this.name_);
}
/* JADX INFO: Access modifiers changed from: private */
public void setName(String str) {
str.getClass();
this.name_ = str;
}
/* JADX INFO: Access modifiers changed from: private */
public void clearName() {
this.name_ = getDefaultInstance().getName();
}
/* JADX INFO: Access modifiers changed from: private */
public void setNameBytes(ByteString byteString) {
byteString.getClass();
AbstractMessageLite.checkByteStringIsUtf8(byteString);
this.name_ = byteString.toStringUtf8();
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public int getMethodsCount() {
return this.methods_.size();
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public Method getMethods(int i) {
return this.methods_.get(i);
}
public MethodOrBuilder getMethodsOrBuilder(int i) {
return this.methods_.get(i);
}
private void ensureMethodsIsMutable() {
if (this.methods_.isModifiable()) {
return;
}
this.methods_ = GeneratedMessageLite.mutableCopy(this.methods_);
}
/* JADX INFO: Access modifiers changed from: private */
public void setMethods(int i, Method method) {
method.getClass();
ensureMethodsIsMutable();
this.methods_.set(i, method);
}
/* JADX INFO: Access modifiers changed from: private */
public void setMethods(int i, Method.Builder builder) {
ensureMethodsIsMutable();
this.methods_.set(i, builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addMethods(Method method) {
method.getClass();
ensureMethodsIsMutable();
this.methods_.add(method);
}
/* JADX INFO: Access modifiers changed from: private */
public void addMethods(int i, Method method) {
method.getClass();
ensureMethodsIsMutable();
this.methods_.add(i, method);
}
/* JADX INFO: Access modifiers changed from: private */
public void addMethods(Method.Builder builder) {
ensureMethodsIsMutable();
this.methods_.add(builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addMethods(int i, Method.Builder builder) {
ensureMethodsIsMutable();
this.methods_.add(i, builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addAllMethods(Iterable<? extends Method> iterable) {
ensureMethodsIsMutable();
AbstractMessageLite.addAll((Iterable) iterable, (List) this.methods_);
}
/* JADX INFO: Access modifiers changed from: private */
public void clearMethods() {
this.methods_ = GeneratedMessageLite.emptyProtobufList();
}
/* JADX INFO: Access modifiers changed from: private */
public void removeMethods(int i) {
ensureMethodsIsMutable();
this.methods_.remove(i);
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public int getOptionsCount() {
return this.options_.size();
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public Option getOptions(int i) {
return this.options_.get(i);
}
public OptionOrBuilder getOptionsOrBuilder(int i) {
return this.options_.get(i);
}
private void ensureOptionsIsMutable() {
if (this.options_.isModifiable()) {
return;
}
this.options_ = GeneratedMessageLite.mutableCopy(this.options_);
}
/* JADX INFO: Access modifiers changed from: private */
public void setOptions(int i, Option option) {
option.getClass();
ensureOptionsIsMutable();
this.options_.set(i, option);
}
/* JADX INFO: Access modifiers changed from: private */
public void setOptions(int i, Option.Builder builder) {
ensureOptionsIsMutable();
this.options_.set(i, builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addOptions(Option option) {
option.getClass();
ensureOptionsIsMutable();
this.options_.add(option);
}
/* JADX INFO: Access modifiers changed from: private */
public void addOptions(int i, Option option) {
option.getClass();
ensureOptionsIsMutable();
this.options_.add(i, option);
}
/* JADX INFO: Access modifiers changed from: private */
public void addOptions(Option.Builder builder) {
ensureOptionsIsMutable();
this.options_.add(builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addOptions(int i, Option.Builder builder) {
ensureOptionsIsMutable();
this.options_.add(i, builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addAllOptions(Iterable<? extends Option> iterable) {
ensureOptionsIsMutable();
AbstractMessageLite.addAll((Iterable) iterable, (List) this.options_);
}
/* JADX INFO: Access modifiers changed from: private */
public void clearOptions() {
this.options_ = GeneratedMessageLite.emptyProtobufList();
}
/* JADX INFO: Access modifiers changed from: private */
public void removeOptions(int i) {
ensureOptionsIsMutable();
this.options_.remove(i);
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public ByteString getVersionBytes() {
return ByteString.copyFromUtf8(this.version_);
}
/* JADX INFO: Access modifiers changed from: private */
public void setVersion(String str) {
str.getClass();
this.version_ = str;
}
/* JADX INFO: Access modifiers changed from: private */
public void clearVersion() {
this.version_ = getDefaultInstance().getVersion();
}
/* JADX INFO: Access modifiers changed from: private */
public void setVersionBytes(ByteString byteString) {
byteString.getClass();
AbstractMessageLite.checkByteStringIsUtf8(byteString);
this.version_ = byteString.toStringUtf8();
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public SourceContext getSourceContext() {
SourceContext sourceContext = this.sourceContext_;
return sourceContext == null ? SourceContext.getDefaultInstance() : sourceContext;
}
/* JADX INFO: Access modifiers changed from: private */
public void setSourceContext(SourceContext sourceContext) {
sourceContext.getClass();
this.sourceContext_ = sourceContext;
}
/* JADX INFO: Access modifiers changed from: private */
public void setSourceContext(SourceContext.Builder builder) {
this.sourceContext_ = builder.build();
}
/* JADX INFO: Access modifiers changed from: private */
public void mergeSourceContext(SourceContext sourceContext) {
sourceContext.getClass();
SourceContext sourceContext2 = this.sourceContext_;
if (sourceContext2 == null || sourceContext2 == SourceContext.getDefaultInstance()) {
this.sourceContext_ = sourceContext;
} else {
this.sourceContext_ = SourceContext.newBuilder(this.sourceContext_).mergeFrom((SourceContext.Builder) sourceContext).buildPartial();
}
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public int getMixinsCount() {
return this.mixins_.size();
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public Mixin getMixins(int i) {
return this.mixins_.get(i);
}
public MixinOrBuilder getMixinsOrBuilder(int i) {
return this.mixins_.get(i);
}
private void ensureMixinsIsMutable() {
if (this.mixins_.isModifiable()) {
return;
}
this.mixins_ = GeneratedMessageLite.mutableCopy(this.mixins_);
}
/* JADX INFO: Access modifiers changed from: private */
public void setMixins(int i, Mixin mixin) {
mixin.getClass();
ensureMixinsIsMutable();
this.mixins_.set(i, mixin);
}
/* JADX INFO: Access modifiers changed from: private */
public void setMixins(int i, Mixin.Builder builder) {
ensureMixinsIsMutable();
this.mixins_.set(i, builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addMixins(Mixin mixin) {
mixin.getClass();
ensureMixinsIsMutable();
this.mixins_.add(mixin);
}
/* JADX INFO: Access modifiers changed from: private */
public void addMixins(int i, Mixin mixin) {
mixin.getClass();
ensureMixinsIsMutable();
this.mixins_.add(i, mixin);
}
/* JADX INFO: Access modifiers changed from: private */
public void addMixins(Mixin.Builder builder) {
ensureMixinsIsMutable();
this.mixins_.add(builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addMixins(int i, Mixin.Builder builder) {
ensureMixinsIsMutable();
this.mixins_.add(i, builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addAllMixins(Iterable<? extends Mixin> iterable) {
ensureMixinsIsMutable();
AbstractMessageLite.addAll((Iterable) iterable, (List) this.mixins_);
}
/* JADX INFO: Access modifiers changed from: private */
public void clearMixins() {
this.mixins_ = GeneratedMessageLite.emptyProtobufList();
}
/* JADX INFO: Access modifiers changed from: private */
public void removeMixins(int i) {
ensureMixinsIsMutable();
this.mixins_.remove(i);
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public Syntax getSyntax() {
Syntax forNumber = Syntax.forNumber(this.syntax_);
return forNumber == null ? Syntax.UNRECOGNIZED : forNumber;
}
/* JADX INFO: Access modifiers changed from: private */
public void setSyntax(Syntax syntax) {
syntax.getClass();
this.syntax_ = syntax.getNumber();
}
public static Api parseFrom(ByteBuffer byteBuffer) throws InvalidProtocolBufferException {
return (Api) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer);
}
public static Api parseFrom(ByteBuffer byteBuffer, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Api) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer, extensionRegistryLite);
}
public static Api parseFrom(ByteString byteString) throws InvalidProtocolBufferException {
return (Api) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString);
}
public static Api parseFrom(ByteString byteString, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Api) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString, extensionRegistryLite);
}
public static Api parseFrom(byte[] bArr) throws InvalidProtocolBufferException {
return (Api) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr);
}
public static Api parseFrom(byte[] bArr, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Api) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr, extensionRegistryLite);
}
public static Api parseFrom(InputStream inputStream) throws IOException {
return (Api) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream);
}
public static Api parseFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Api) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static Api parseDelimitedFrom(InputStream inputStream) throws IOException {
return (Api) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream);
}
public static Api parseDelimitedFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Api) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static Api parseFrom(CodedInputStream codedInputStream) throws IOException {
return (Api) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream);
}
public static Api parseFrom(CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Api) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream, extensionRegistryLite);
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.createBuilder();
}
public static Builder newBuilder(Api api) {
return DEFAULT_INSTANCE.createBuilder(api);
}
public static final class Builder extends GeneratedMessageLite.Builder<Api, Builder> implements ApiOrBuilder {
public /* synthetic */ Builder(AnonymousClass1 anonymousClass1) {
this();
}
private Builder() {
super(Api.DEFAULT_INSTANCE);
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public String getName() {
return ((Api) this.instance).getName();
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public ByteString getNameBytes() {
return ((Api) this.instance).getNameBytes();
}
public Builder setName(String str) {
copyOnWrite();
((Api) this.instance).setName(str);
return this;
}
public Builder clearName() {
copyOnWrite();
((Api) this.instance).clearName();
return this;
}
public Builder setNameBytes(ByteString byteString) {
copyOnWrite();
((Api) this.instance).setNameBytes(byteString);
return this;
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public List<Method> getMethodsList() {
return Collections.unmodifiableList(((Api) this.instance).getMethodsList());
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public int getMethodsCount() {
return ((Api) this.instance).getMethodsCount();
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public Method getMethods(int i) {
return ((Api) this.instance).getMethods(i);
}
public Builder setMethods(int i, Method method) {
copyOnWrite();
((Api) this.instance).setMethods(i, method);
return this;
}
public Builder setMethods(int i, Method.Builder builder) {
copyOnWrite();
((Api) this.instance).setMethods(i, builder);
return this;
}
public Builder addMethods(Method method) {
copyOnWrite();
((Api) this.instance).addMethods(method);
return this;
}
public Builder addMethods(int i, Method method) {
copyOnWrite();
((Api) this.instance).addMethods(i, method);
return this;
}
public Builder addMethods(Method.Builder builder) {
copyOnWrite();
((Api) this.instance).addMethods(builder);
return this;
}
public Builder addMethods(int i, Method.Builder builder) {
copyOnWrite();
((Api) this.instance).addMethods(i, builder);
return this;
}
public Builder addAllMethods(Iterable<? extends Method> iterable) {
copyOnWrite();
((Api) this.instance).addAllMethods(iterable);
return this;
}
public Builder clearMethods() {
copyOnWrite();
((Api) this.instance).clearMethods();
return this;
}
public Builder removeMethods(int i) {
copyOnWrite();
((Api) this.instance).removeMethods(i);
return this;
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public List<Option> getOptionsList() {
return Collections.unmodifiableList(((Api) this.instance).getOptionsList());
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public int getOptionsCount() {
return ((Api) this.instance).getOptionsCount();
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public Option getOptions(int i) {
return ((Api) this.instance).getOptions(i);
}
public Builder setOptions(int i, Option option) {
copyOnWrite();
((Api) this.instance).setOptions(i, option);
return this;
}
public Builder setOptions(int i, Option.Builder builder) {
copyOnWrite();
((Api) this.instance).setOptions(i, builder);
return this;
}
public Builder addOptions(Option option) {
copyOnWrite();
((Api) this.instance).addOptions(option);
return this;
}
public Builder addOptions(int i, Option option) {
copyOnWrite();
((Api) this.instance).addOptions(i, option);
return this;
}
public Builder addOptions(Option.Builder builder) {
copyOnWrite();
((Api) this.instance).addOptions(builder);
return this;
}
public Builder addOptions(int i, Option.Builder builder) {
copyOnWrite();
((Api) this.instance).addOptions(i, builder);
return this;
}
public Builder addAllOptions(Iterable<? extends Option> iterable) {
copyOnWrite();
((Api) this.instance).addAllOptions(iterable);
return this;
}
public Builder clearOptions() {
copyOnWrite();
((Api) this.instance).clearOptions();
return this;
}
public Builder removeOptions(int i) {
copyOnWrite();
((Api) this.instance).removeOptions(i);
return this;
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public String getVersion() {
return ((Api) this.instance).getVersion();
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public ByteString getVersionBytes() {
return ((Api) this.instance).getVersionBytes();
}
public Builder setVersion(String str) {
copyOnWrite();
((Api) this.instance).setVersion(str);
return this;
}
public Builder clearVersion() {
copyOnWrite();
((Api) this.instance).clearVersion();
return this;
}
public Builder setVersionBytes(ByteString byteString) {
copyOnWrite();
((Api) this.instance).setVersionBytes(byteString);
return this;
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public boolean hasSourceContext() {
return ((Api) this.instance).hasSourceContext();
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public SourceContext getSourceContext() {
return ((Api) this.instance).getSourceContext();
}
public Builder setSourceContext(SourceContext sourceContext) {
copyOnWrite();
((Api) this.instance).setSourceContext(sourceContext);
return this;
}
public Builder setSourceContext(SourceContext.Builder builder) {
copyOnWrite();
((Api) this.instance).setSourceContext(builder);
return this;
}
public Builder mergeSourceContext(SourceContext sourceContext) {
copyOnWrite();
((Api) this.instance).mergeSourceContext(sourceContext);
return this;
}
public Builder clearSourceContext() {
copyOnWrite();
((Api) this.instance).clearSourceContext();
return this;
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public List<Mixin> getMixinsList() {
return Collections.unmodifiableList(((Api) this.instance).getMixinsList());
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public int getMixinsCount() {
return ((Api) this.instance).getMixinsCount();
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public Mixin getMixins(int i) {
return ((Api) this.instance).getMixins(i);
}
public Builder setMixins(int i, Mixin mixin) {
copyOnWrite();
((Api) this.instance).setMixins(i, mixin);
return this;
}
public Builder setMixins(int i, Mixin.Builder builder) {
copyOnWrite();
((Api) this.instance).setMixins(i, builder);
return this;
}
public Builder addMixins(Mixin mixin) {
copyOnWrite();
((Api) this.instance).addMixins(mixin);
return this;
}
public Builder addMixins(int i, Mixin mixin) {
copyOnWrite();
((Api) this.instance).addMixins(i, mixin);
return this;
}
public Builder addMixins(Mixin.Builder builder) {
copyOnWrite();
((Api) this.instance).addMixins(builder);
return this;
}
public Builder addMixins(int i, Mixin.Builder builder) {
copyOnWrite();
((Api) this.instance).addMixins(i, builder);
return this;
}
public Builder addAllMixins(Iterable<? extends Mixin> iterable) {
copyOnWrite();
((Api) this.instance).addAllMixins(iterable);
return this;
}
public Builder clearMixins() {
copyOnWrite();
((Api) this.instance).clearMixins();
return this;
}
public Builder removeMixins(int i) {
copyOnWrite();
((Api) this.instance).removeMixins(i);
return this;
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public int getSyntaxValue() {
return ((Api) this.instance).getSyntaxValue();
}
public Builder setSyntaxValue(int i) {
copyOnWrite();
((Api) this.instance).setSyntaxValue(i);
return this;
}
@Override // androidx.datastore.preferences.protobuf.ApiOrBuilder
public Syntax getSyntax() {
return ((Api) this.instance).getSyntax();
}
public Builder setSyntax(Syntax syntax) {
copyOnWrite();
((Api) this.instance).setSyntax(syntax);
return this;
}
public Builder clearSyntax() {
copyOnWrite();
((Api) this.instance).clearSyntax();
return this;
}
}
/* renamed from: androidx.datastore.preferences.protobuf.Api$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke;
static {
int[] iArr = new int[GeneratedMessageLite.MethodToInvoke.values().length];
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke = iArr;
try {
iArr[GeneratedMessageLite.MethodToInvoke.NEW_MUTABLE_INSTANCE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.NEW_BUILDER.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.BUILD_MESSAGE_INFO.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_DEFAULT_INSTANCE.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_PARSER.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_MEMOIZED_IS_INITIALIZED.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.SET_MEMOIZED_IS_INITIALIZED.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
}
}
@Override // androidx.datastore.preferences.protobuf.GeneratedMessageLite
public final Object dynamicMethod(GeneratedMessageLite.MethodToInvoke methodToInvoke, Object obj, Object obj2) {
AnonymousClass1 anonymousClass1 = null;
switch (AnonymousClass1.$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[methodToInvoke.ordinal()]) {
case 1:
return new Api();
case 2:
return new Builder(anonymousClass1);
case 3:
return GeneratedMessageLite.newMessageInfo(DEFAULT_INSTANCE, "\u0000\u0007\u0000\u0000\u0001\u0007\u0007\u0000\u0003\u0000\u0001Ȉ\u0002\u001b\u0003\u001b\u0004Ȉ\u0005\t\u0006\u001b\u0007\f", new Object[]{"name_", "methods_", Method.class, "options_", Option.class, "version_", "sourceContext_", "mixins_", Mixin.class, "syntax_"});
case 4:
return DEFAULT_INSTANCE;
case 5:
Parser<Api> parser = PARSER;
if (parser == null) {
synchronized (Api.class) {
try {
parser = PARSER;
if (parser == null) {
parser = new GeneratedMessageLite.DefaultInstanceBasedParser<>(DEFAULT_INSTANCE);
PARSER = parser;
}
} finally {
}
}
}
return parser;
case 6:
return (byte) 1;
case 7:
return null;
default:
throw new UnsupportedOperationException();
}
}
static {
Api api = new Api();
DEFAULT_INSTANCE = api;
GeneratedMessageLite.registerDefaultInstance(Api.class, api);
}
public static Parser<Api> parser() {
return DEFAULT_INSTANCE.getParserForType();
}
}

View File

@@ -0,0 +1,40 @@
package androidx.datastore.preferences.protobuf;
import java.util.List;
/* loaded from: classes.dex */
public interface ApiOrBuilder extends MessageLiteOrBuilder {
Method getMethods(int i);
int getMethodsCount();
List<Method> getMethodsList();
Mixin getMixins(int i);
int getMixinsCount();
List<Mixin> getMixinsList();
String getName();
ByteString getNameBytes();
Option getOptions(int i);
int getOptionsCount();
List<Option> getOptionsList();
SourceContext getSourceContext();
Syntax getSyntax();
int getSyntaxValue();
String getVersion();
ByteString getVersionBytes();
boolean hasSourceContext();
}

View File

@@ -0,0 +1,10 @@
package androidx.datastore.preferences.protobuf;
/* loaded from: classes.dex */
public final class ApiProto {
public static void registerAllExtensions(ExtensionRegistryLite extensionRegistryLite) {
}
private ApiProto() {
}
}

View File

@@ -0,0 +1,939 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.GeneratedMessageLite;
import androidx.datastore.preferences.protobuf.Internal;
import androidx.datastore.preferences.protobuf.WireFormat;
import com.applovin.exoplayer2.common.base.Ascii;
import java.io.IOException;
import java.util.List;
/* loaded from: classes.dex */
final class ArrayDecoders {
public static final class Registers {
public final ExtensionRegistryLite extensionRegistry;
public int int1;
public long long1;
public Object object1;
public Registers() {
this.extensionRegistry = ExtensionRegistryLite.getEmptyRegistry();
}
public Registers(ExtensionRegistryLite extensionRegistryLite) {
extensionRegistryLite.getClass();
this.extensionRegistry = extensionRegistryLite;
}
}
public static int decodeVarint32(byte[] bArr, int i, Registers registers) {
int i2 = i + 1;
byte b = bArr[i];
if (b >= 0) {
registers.int1 = b;
return i2;
}
return decodeVarint32(b, bArr, i2, registers);
}
public static int decodeVarint32(int i, byte[] bArr, int i2, Registers registers) {
int i3 = i & 127;
int i4 = i2 + 1;
byte b = bArr[i2];
if (b >= 0) {
registers.int1 = i3 | (b << 7);
return i4;
}
int i5 = i3 | ((b & Byte.MAX_VALUE) << 7);
int i6 = i2 + 2;
byte b2 = bArr[i4];
if (b2 >= 0) {
registers.int1 = i5 | (b2 << Ascii.SO);
return i6;
}
int i7 = i5 | ((b2 & Byte.MAX_VALUE) << 14);
int i8 = i2 + 3;
byte b3 = bArr[i6];
if (b3 >= 0) {
registers.int1 = i7 | (b3 << Ascii.NAK);
return i8;
}
int i9 = i7 | ((b3 & Byte.MAX_VALUE) << 21);
int i10 = i2 + 4;
byte b4 = bArr[i8];
if (b4 >= 0) {
registers.int1 = i9 | (b4 << Ascii.FS);
return i10;
}
int i11 = i9 | ((b4 & Byte.MAX_VALUE) << 28);
while (true) {
int i12 = i10 + 1;
if (bArr[i10] >= 0) {
registers.int1 = i11;
return i12;
}
i10 = i12;
}
}
public static int decodeVarint64(byte[] bArr, int i, Registers registers) {
int i2 = i + 1;
long j = bArr[i];
if (j >= 0) {
registers.long1 = j;
return i2;
}
return decodeVarint64(j, bArr, i2, registers);
}
public static int decodeVarint64(long j, byte[] bArr, int i, Registers registers) {
int i2 = i + 1;
byte b = bArr[i];
long j2 = (j & 127) | ((b & Byte.MAX_VALUE) << 7);
int i3 = 7;
while (b < 0) {
int i4 = i2 + 1;
byte b2 = bArr[i2];
i3 += 7;
j2 |= (b2 & Byte.MAX_VALUE) << i3;
i2 = i4;
b = b2;
}
registers.long1 = j2;
return i2;
}
public static int decodeFixed32(byte[] bArr, int i) {
return ((bArr[i + 3] & 255) << 24) | (bArr[i] & 255) | ((bArr[i + 1] & 255) << 8) | ((bArr[i + 2] & 255) << 16);
}
public static long decodeFixed64(byte[] bArr, int i) {
return ((bArr[i + 7] & 255) << 56) | (bArr[i] & 255) | ((bArr[i + 1] & 255) << 8) | ((bArr[i + 2] & 255) << 16) | ((bArr[i + 3] & 255) << 24) | ((bArr[i + 4] & 255) << 32) | ((bArr[i + 5] & 255) << 40) | ((bArr[i + 6] & 255) << 48);
}
public static double decodeDouble(byte[] bArr, int i) {
return Double.longBitsToDouble(decodeFixed64(bArr, i));
}
public static float decodeFloat(byte[] bArr, int i) {
return Float.intBitsToFloat(decodeFixed32(bArr, i));
}
public static int decodeString(byte[] bArr, int i, Registers registers) throws InvalidProtocolBufferException {
int decodeVarint32 = decodeVarint32(bArr, i, registers);
int i2 = registers.int1;
if (i2 < 0) {
throw InvalidProtocolBufferException.negativeSize();
}
if (i2 == 0) {
registers.object1 = "";
return decodeVarint32;
}
registers.object1 = new String(bArr, decodeVarint32, i2, Internal.UTF_8);
return decodeVarint32 + i2;
}
public static int decodeStringRequireUtf8(byte[] bArr, int i, Registers registers) throws InvalidProtocolBufferException {
int decodeVarint32 = decodeVarint32(bArr, i, registers);
int i2 = registers.int1;
if (i2 < 0) {
throw InvalidProtocolBufferException.negativeSize();
}
if (i2 == 0) {
registers.object1 = "";
return decodeVarint32;
}
registers.object1 = Utf8.decodeUtf8(bArr, decodeVarint32, i2);
return decodeVarint32 + i2;
}
public static int decodeBytes(byte[] bArr, int i, Registers registers) throws InvalidProtocolBufferException {
int decodeVarint32 = decodeVarint32(bArr, i, registers);
int i2 = registers.int1;
if (i2 < 0) {
throw InvalidProtocolBufferException.negativeSize();
}
if (i2 > bArr.length - decodeVarint32) {
throw InvalidProtocolBufferException.truncatedMessage();
}
if (i2 == 0) {
registers.object1 = ByteString.EMPTY;
return decodeVarint32;
}
registers.object1 = ByteString.copyFrom(bArr, decodeVarint32, i2);
return decodeVarint32 + i2;
}
public static int decodeMessageField(Schema schema, byte[] bArr, int i, int i2, Registers registers) throws IOException {
int i3 = i + 1;
int i4 = bArr[i];
if (i4 < 0) {
i3 = decodeVarint32(i4, bArr, i3, registers);
i4 = registers.int1;
}
int i5 = i3;
if (i4 < 0 || i4 > i2 - i5) {
throw InvalidProtocolBufferException.truncatedMessage();
}
Object newInstance = schema.newInstance();
int i6 = i4 + i5;
schema.mergeFrom(newInstance, bArr, i5, i6, registers);
schema.makeImmutable(newInstance);
registers.object1 = newInstance;
return i6;
}
public static int decodeGroupField(Schema schema, byte[] bArr, int i, int i2, int i3, Registers registers) throws IOException {
MessageSchema messageSchema = (MessageSchema) schema;
Object newInstance = messageSchema.newInstance();
int parseProto2Message = messageSchema.parseProto2Message(newInstance, bArr, i, i2, i3, registers);
messageSchema.makeImmutable(newInstance);
registers.object1 = newInstance;
return parseProto2Message;
}
public static int decodeVarint32List(int i, byte[] bArr, int i2, int i3, Internal.ProtobufList<?> protobufList, Registers registers) {
IntArrayList intArrayList = (IntArrayList) protobufList;
int decodeVarint32 = decodeVarint32(bArr, i2, registers);
intArrayList.addInt(registers.int1);
while (decodeVarint32 < i3) {
int decodeVarint322 = decodeVarint32(bArr, decodeVarint32, registers);
if (i != registers.int1) {
break;
}
decodeVarint32 = decodeVarint32(bArr, decodeVarint322, registers);
intArrayList.addInt(registers.int1);
}
return decodeVarint32;
}
public static int decodeVarint64List(int i, byte[] bArr, int i2, int i3, Internal.ProtobufList<?> protobufList, Registers registers) {
LongArrayList longArrayList = (LongArrayList) protobufList;
int decodeVarint64 = decodeVarint64(bArr, i2, registers);
longArrayList.addLong(registers.long1);
while (decodeVarint64 < i3) {
int decodeVarint32 = decodeVarint32(bArr, decodeVarint64, registers);
if (i != registers.int1) {
break;
}
decodeVarint64 = decodeVarint64(bArr, decodeVarint32, registers);
longArrayList.addLong(registers.long1);
}
return decodeVarint64;
}
public static int decodeFixed32List(int i, byte[] bArr, int i2, int i3, Internal.ProtobufList<?> protobufList, Registers registers) {
IntArrayList intArrayList = (IntArrayList) protobufList;
intArrayList.addInt(decodeFixed32(bArr, i2));
int i4 = i2 + 4;
while (i4 < i3) {
int decodeVarint32 = decodeVarint32(bArr, i4, registers);
if (i != registers.int1) {
break;
}
intArrayList.addInt(decodeFixed32(bArr, decodeVarint32));
i4 = decodeVarint32 + 4;
}
return i4;
}
public static int decodeFixed64List(int i, byte[] bArr, int i2, int i3, Internal.ProtobufList<?> protobufList, Registers registers) {
LongArrayList longArrayList = (LongArrayList) protobufList;
longArrayList.addLong(decodeFixed64(bArr, i2));
int i4 = i2 + 8;
while (i4 < i3) {
int decodeVarint32 = decodeVarint32(bArr, i4, registers);
if (i != registers.int1) {
break;
}
longArrayList.addLong(decodeFixed64(bArr, decodeVarint32));
i4 = decodeVarint32 + 8;
}
return i4;
}
public static int decodeFloatList(int i, byte[] bArr, int i2, int i3, Internal.ProtobufList<?> protobufList, Registers registers) {
FloatArrayList floatArrayList = (FloatArrayList) protobufList;
floatArrayList.addFloat(decodeFloat(bArr, i2));
int i4 = i2 + 4;
while (i4 < i3) {
int decodeVarint32 = decodeVarint32(bArr, i4, registers);
if (i != registers.int1) {
break;
}
floatArrayList.addFloat(decodeFloat(bArr, decodeVarint32));
i4 = decodeVarint32 + 4;
}
return i4;
}
public static int decodeDoubleList(int i, byte[] bArr, int i2, int i3, Internal.ProtobufList<?> protobufList, Registers registers) {
DoubleArrayList doubleArrayList = (DoubleArrayList) protobufList;
doubleArrayList.addDouble(decodeDouble(bArr, i2));
int i4 = i2 + 8;
while (i4 < i3) {
int decodeVarint32 = decodeVarint32(bArr, i4, registers);
if (i != registers.int1) {
break;
}
doubleArrayList.addDouble(decodeDouble(bArr, decodeVarint32));
i4 = decodeVarint32 + 8;
}
return i4;
}
public static int decodeBoolList(int i, byte[] bArr, int i2, int i3, Internal.ProtobufList<?> protobufList, Registers registers) {
BooleanArrayList booleanArrayList = (BooleanArrayList) protobufList;
int decodeVarint64 = decodeVarint64(bArr, i2, registers);
booleanArrayList.addBoolean(registers.long1 != 0);
while (decodeVarint64 < i3) {
int decodeVarint32 = decodeVarint32(bArr, decodeVarint64, registers);
if (i != registers.int1) {
break;
}
decodeVarint64 = decodeVarint64(bArr, decodeVarint32, registers);
booleanArrayList.addBoolean(registers.long1 != 0);
}
return decodeVarint64;
}
public static int decodeSInt32List(int i, byte[] bArr, int i2, int i3, Internal.ProtobufList<?> protobufList, Registers registers) {
IntArrayList intArrayList = (IntArrayList) protobufList;
int decodeVarint32 = decodeVarint32(bArr, i2, registers);
intArrayList.addInt(CodedInputStream.decodeZigZag32(registers.int1));
while (decodeVarint32 < i3) {
int decodeVarint322 = decodeVarint32(bArr, decodeVarint32, registers);
if (i != registers.int1) {
break;
}
decodeVarint32 = decodeVarint32(bArr, decodeVarint322, registers);
intArrayList.addInt(CodedInputStream.decodeZigZag32(registers.int1));
}
return decodeVarint32;
}
public static int decodeSInt64List(int i, byte[] bArr, int i2, int i3, Internal.ProtobufList<?> protobufList, Registers registers) {
LongArrayList longArrayList = (LongArrayList) protobufList;
int decodeVarint64 = decodeVarint64(bArr, i2, registers);
longArrayList.addLong(CodedInputStream.decodeZigZag64(registers.long1));
while (decodeVarint64 < i3) {
int decodeVarint32 = decodeVarint32(bArr, decodeVarint64, registers);
if (i != registers.int1) {
break;
}
decodeVarint64 = decodeVarint64(bArr, decodeVarint32, registers);
longArrayList.addLong(CodedInputStream.decodeZigZag64(registers.long1));
}
return decodeVarint64;
}
public static int decodePackedVarint32List(byte[] bArr, int i, Internal.ProtobufList<?> protobufList, Registers registers) throws IOException {
IntArrayList intArrayList = (IntArrayList) protobufList;
int decodeVarint32 = decodeVarint32(bArr, i, registers);
int i2 = registers.int1 + decodeVarint32;
while (decodeVarint32 < i2) {
decodeVarint32 = decodeVarint32(bArr, decodeVarint32, registers);
intArrayList.addInt(registers.int1);
}
if (decodeVarint32 == i2) {
return decodeVarint32;
}
throw InvalidProtocolBufferException.truncatedMessage();
}
public static int decodePackedVarint64List(byte[] bArr, int i, Internal.ProtobufList<?> protobufList, Registers registers) throws IOException {
LongArrayList longArrayList = (LongArrayList) protobufList;
int decodeVarint32 = decodeVarint32(bArr, i, registers);
int i2 = registers.int1 + decodeVarint32;
while (decodeVarint32 < i2) {
decodeVarint32 = decodeVarint64(bArr, decodeVarint32, registers);
longArrayList.addLong(registers.long1);
}
if (decodeVarint32 == i2) {
return decodeVarint32;
}
throw InvalidProtocolBufferException.truncatedMessage();
}
public static int decodePackedFixed32List(byte[] bArr, int i, Internal.ProtobufList<?> protobufList, Registers registers) throws IOException {
IntArrayList intArrayList = (IntArrayList) protobufList;
int decodeVarint32 = decodeVarint32(bArr, i, registers);
int i2 = registers.int1 + decodeVarint32;
while (decodeVarint32 < i2) {
intArrayList.addInt(decodeFixed32(bArr, decodeVarint32));
decodeVarint32 += 4;
}
if (decodeVarint32 == i2) {
return decodeVarint32;
}
throw InvalidProtocolBufferException.truncatedMessage();
}
public static int decodePackedFixed64List(byte[] bArr, int i, Internal.ProtobufList<?> protobufList, Registers registers) throws IOException {
LongArrayList longArrayList = (LongArrayList) protobufList;
int decodeVarint32 = decodeVarint32(bArr, i, registers);
int i2 = registers.int1 + decodeVarint32;
while (decodeVarint32 < i2) {
longArrayList.addLong(decodeFixed64(bArr, decodeVarint32));
decodeVarint32 += 8;
}
if (decodeVarint32 == i2) {
return decodeVarint32;
}
throw InvalidProtocolBufferException.truncatedMessage();
}
public static int decodePackedFloatList(byte[] bArr, int i, Internal.ProtobufList<?> protobufList, Registers registers) throws IOException {
FloatArrayList floatArrayList = (FloatArrayList) protobufList;
int decodeVarint32 = decodeVarint32(bArr, i, registers);
int i2 = registers.int1 + decodeVarint32;
while (decodeVarint32 < i2) {
floatArrayList.addFloat(decodeFloat(bArr, decodeVarint32));
decodeVarint32 += 4;
}
if (decodeVarint32 == i2) {
return decodeVarint32;
}
throw InvalidProtocolBufferException.truncatedMessage();
}
public static int decodePackedDoubleList(byte[] bArr, int i, Internal.ProtobufList<?> protobufList, Registers registers) throws IOException {
DoubleArrayList doubleArrayList = (DoubleArrayList) protobufList;
int decodeVarint32 = decodeVarint32(bArr, i, registers);
int i2 = registers.int1 + decodeVarint32;
while (decodeVarint32 < i2) {
doubleArrayList.addDouble(decodeDouble(bArr, decodeVarint32));
decodeVarint32 += 8;
}
if (decodeVarint32 == i2) {
return decodeVarint32;
}
throw InvalidProtocolBufferException.truncatedMessage();
}
public static int decodePackedBoolList(byte[] bArr, int i, Internal.ProtobufList<?> protobufList, Registers registers) throws IOException {
BooleanArrayList booleanArrayList = (BooleanArrayList) protobufList;
int decodeVarint32 = decodeVarint32(bArr, i, registers);
int i2 = registers.int1 + decodeVarint32;
while (decodeVarint32 < i2) {
decodeVarint32 = decodeVarint64(bArr, decodeVarint32, registers);
booleanArrayList.addBoolean(registers.long1 != 0);
}
if (decodeVarint32 == i2) {
return decodeVarint32;
}
throw InvalidProtocolBufferException.truncatedMessage();
}
public static int decodePackedSInt32List(byte[] bArr, int i, Internal.ProtobufList<?> protobufList, Registers registers) throws IOException {
IntArrayList intArrayList = (IntArrayList) protobufList;
int decodeVarint32 = decodeVarint32(bArr, i, registers);
int i2 = registers.int1 + decodeVarint32;
while (decodeVarint32 < i2) {
decodeVarint32 = decodeVarint32(bArr, decodeVarint32, registers);
intArrayList.addInt(CodedInputStream.decodeZigZag32(registers.int1));
}
if (decodeVarint32 == i2) {
return decodeVarint32;
}
throw InvalidProtocolBufferException.truncatedMessage();
}
public static int decodePackedSInt64List(byte[] bArr, int i, Internal.ProtobufList<?> protobufList, Registers registers) throws IOException {
LongArrayList longArrayList = (LongArrayList) protobufList;
int decodeVarint32 = decodeVarint32(bArr, i, registers);
int i2 = registers.int1 + decodeVarint32;
while (decodeVarint32 < i2) {
decodeVarint32 = decodeVarint64(bArr, decodeVarint32, registers);
longArrayList.addLong(CodedInputStream.decodeZigZag64(registers.long1));
}
if (decodeVarint32 == i2) {
return decodeVarint32;
}
throw InvalidProtocolBufferException.truncatedMessage();
}
public static int decodeStringList(int i, byte[] bArr, int i2, int i3, Internal.ProtobufList<?> protobufList, Registers registers) throws InvalidProtocolBufferException {
int decodeVarint32 = decodeVarint32(bArr, i2, registers);
int i4 = registers.int1;
if (i4 < 0) {
throw InvalidProtocolBufferException.negativeSize();
}
if (i4 == 0) {
protobufList.add("");
} else {
protobufList.add(new String(bArr, decodeVarint32, i4, Internal.UTF_8));
decodeVarint32 += i4;
}
while (decodeVarint32 < i3) {
int decodeVarint322 = decodeVarint32(bArr, decodeVarint32, registers);
if (i != registers.int1) {
break;
}
decodeVarint32 = decodeVarint32(bArr, decodeVarint322, registers);
int i5 = registers.int1;
if (i5 < 0) {
throw InvalidProtocolBufferException.negativeSize();
}
if (i5 == 0) {
protobufList.add("");
} else {
protobufList.add(new String(bArr, decodeVarint32, i5, Internal.UTF_8));
decodeVarint32 += i5;
}
}
return decodeVarint32;
}
public static int decodeStringListRequireUtf8(int i, byte[] bArr, int i2, int i3, Internal.ProtobufList<?> protobufList, Registers registers) throws InvalidProtocolBufferException {
int decodeVarint32 = decodeVarint32(bArr, i2, registers);
int i4 = registers.int1;
if (i4 < 0) {
throw InvalidProtocolBufferException.negativeSize();
}
if (i4 == 0) {
protobufList.add("");
} else {
int i5 = decodeVarint32 + i4;
if (!Utf8.isValidUtf8(bArr, decodeVarint32, i5)) {
throw InvalidProtocolBufferException.invalidUtf8();
}
protobufList.add(new String(bArr, decodeVarint32, i4, Internal.UTF_8));
decodeVarint32 = i5;
}
while (decodeVarint32 < i3) {
int decodeVarint322 = decodeVarint32(bArr, decodeVarint32, registers);
if (i != registers.int1) {
break;
}
decodeVarint32 = decodeVarint32(bArr, decodeVarint322, registers);
int i6 = registers.int1;
if (i6 < 0) {
throw InvalidProtocolBufferException.negativeSize();
}
if (i6 == 0) {
protobufList.add("");
} else {
int i7 = decodeVarint32 + i6;
if (!Utf8.isValidUtf8(bArr, decodeVarint32, i7)) {
throw InvalidProtocolBufferException.invalidUtf8();
}
protobufList.add(new String(bArr, decodeVarint32, i6, Internal.UTF_8));
decodeVarint32 = i7;
}
}
return decodeVarint32;
}
public static int decodeBytesList(int i, byte[] bArr, int i2, int i3, Internal.ProtobufList<?> protobufList, Registers registers) throws InvalidProtocolBufferException {
int decodeVarint32 = decodeVarint32(bArr, i2, registers);
int i4 = registers.int1;
if (i4 < 0) {
throw InvalidProtocolBufferException.negativeSize();
}
if (i4 > bArr.length - decodeVarint32) {
throw InvalidProtocolBufferException.truncatedMessage();
}
if (i4 == 0) {
protobufList.add(ByteString.EMPTY);
} else {
protobufList.add(ByteString.copyFrom(bArr, decodeVarint32, i4));
decodeVarint32 += i4;
}
while (decodeVarint32 < i3) {
int decodeVarint322 = decodeVarint32(bArr, decodeVarint32, registers);
if (i != registers.int1) {
break;
}
decodeVarint32 = decodeVarint32(bArr, decodeVarint322, registers);
int i5 = registers.int1;
if (i5 < 0) {
throw InvalidProtocolBufferException.negativeSize();
}
if (i5 > bArr.length - decodeVarint32) {
throw InvalidProtocolBufferException.truncatedMessage();
}
if (i5 == 0) {
protobufList.add(ByteString.EMPTY);
} else {
protobufList.add(ByteString.copyFrom(bArr, decodeVarint32, i5));
decodeVarint32 += i5;
}
}
return decodeVarint32;
}
public static int decodeMessageList(Schema<?> schema, int i, byte[] bArr, int i2, int i3, Internal.ProtobufList<?> protobufList, Registers registers) throws IOException {
int decodeMessageField = decodeMessageField(schema, bArr, i2, i3, registers);
protobufList.add(registers.object1);
while (decodeMessageField < i3) {
int decodeVarint32 = decodeVarint32(bArr, decodeMessageField, registers);
if (i != registers.int1) {
break;
}
decodeMessageField = decodeMessageField(schema, bArr, decodeVarint32, i3, registers);
protobufList.add(registers.object1);
}
return decodeMessageField;
}
public static int decodeGroupList(Schema schema, int i, byte[] bArr, int i2, int i3, Internal.ProtobufList<?> protobufList, Registers registers) throws IOException {
int i4 = (i & (-8)) | 4;
int decodeGroupField = decodeGroupField(schema, bArr, i2, i3, i4, registers);
protobufList.add(registers.object1);
while (decodeGroupField < i3) {
int decodeVarint32 = decodeVarint32(bArr, decodeGroupField, registers);
if (i != registers.int1) {
break;
}
decodeGroupField = decodeGroupField(schema, bArr, decodeVarint32, i3, i4, registers);
protobufList.add(registers.object1);
}
return decodeGroupField;
}
public static int decodeExtensionOrUnknownField(int i, byte[] bArr, int i2, int i3, Object obj, MessageLite messageLite, UnknownFieldSchema<UnknownFieldSetLite, UnknownFieldSetLite> unknownFieldSchema, Registers registers) throws IOException {
GeneratedMessageLite.GeneratedExtension findLiteExtensionByNumber = registers.extensionRegistry.findLiteExtensionByNumber(messageLite, i >>> 3);
if (findLiteExtensionByNumber == null) {
return decodeUnknownField(i, bArr, i2, i3, MessageSchema.getMutableUnknownFields(obj), registers);
}
GeneratedMessageLite.ExtendableMessage extendableMessage = (GeneratedMessageLite.ExtendableMessage) obj;
extendableMessage.ensureExtensionsAreMutable();
return decodeExtension(i, bArr, i2, i3, extendableMessage, findLiteExtensionByNumber, unknownFieldSchema, registers);
}
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
public static int decodeExtension(int i, byte[] bArr, int i2, int i3, GeneratedMessageLite.ExtendableMessage<?, ?> extendableMessage, GeneratedMessageLite.GeneratedExtension<?, ?> generatedExtension, UnknownFieldSchema<UnknownFieldSetLite, UnknownFieldSetLite> unknownFieldSchema, Registers registers) throws IOException {
Object field;
FieldSet<GeneratedMessageLite.ExtensionDescriptor> fieldSet = extendableMessage.extensions;
int i4 = i >>> 3;
if (generatedExtension.descriptor.isRepeated() && generatedExtension.descriptor.isPacked()) {
switch (AnonymousClass1.$SwitchMap$com$google$protobuf$WireFormat$FieldType[generatedExtension.getLiteType().ordinal()]) {
case 1:
DoubleArrayList doubleArrayList = new DoubleArrayList();
int decodePackedDoubleList = decodePackedDoubleList(bArr, i2, doubleArrayList, registers);
fieldSet.setField(generatedExtension.descriptor, doubleArrayList);
return decodePackedDoubleList;
case 2:
FloatArrayList floatArrayList = new FloatArrayList();
int decodePackedFloatList = decodePackedFloatList(bArr, i2, floatArrayList, registers);
fieldSet.setField(generatedExtension.descriptor, floatArrayList);
return decodePackedFloatList;
case 3:
case 4:
LongArrayList longArrayList = new LongArrayList();
int decodePackedVarint64List = decodePackedVarint64List(bArr, i2, longArrayList, registers);
fieldSet.setField(generatedExtension.descriptor, longArrayList);
return decodePackedVarint64List;
case 5:
case 6:
IntArrayList intArrayList = new IntArrayList();
int decodePackedVarint32List = decodePackedVarint32List(bArr, i2, intArrayList, registers);
fieldSet.setField(generatedExtension.descriptor, intArrayList);
return decodePackedVarint32List;
case 7:
case 8:
LongArrayList longArrayList2 = new LongArrayList();
int decodePackedFixed64List = decodePackedFixed64List(bArr, i2, longArrayList2, registers);
fieldSet.setField(generatedExtension.descriptor, longArrayList2);
return decodePackedFixed64List;
case 9:
case 10:
IntArrayList intArrayList2 = new IntArrayList();
int decodePackedFixed32List = decodePackedFixed32List(bArr, i2, intArrayList2, registers);
fieldSet.setField(generatedExtension.descriptor, intArrayList2);
return decodePackedFixed32List;
case 11:
BooleanArrayList booleanArrayList = new BooleanArrayList();
int decodePackedBoolList = decodePackedBoolList(bArr, i2, booleanArrayList, registers);
fieldSet.setField(generatedExtension.descriptor, booleanArrayList);
return decodePackedBoolList;
case 12:
IntArrayList intArrayList3 = new IntArrayList();
int decodePackedSInt32List = decodePackedSInt32List(bArr, i2, intArrayList3, registers);
fieldSet.setField(generatedExtension.descriptor, intArrayList3);
return decodePackedSInt32List;
case 13:
LongArrayList longArrayList3 = new LongArrayList();
int decodePackedSInt64List = decodePackedSInt64List(bArr, i2, longArrayList3, registers);
fieldSet.setField(generatedExtension.descriptor, longArrayList3);
return decodePackedSInt64List;
case 14:
IntArrayList intArrayList4 = new IntArrayList();
int decodePackedVarint32List2 = decodePackedVarint32List(bArr, i2, intArrayList4, registers);
UnknownFieldSetLite unknownFieldSetLite = extendableMessage.unknownFields;
UnknownFieldSetLite unknownFieldSetLite2 = (UnknownFieldSetLite) SchemaUtil.filterUnknownEnumList(i4, (List<Integer>) intArrayList4, generatedExtension.descriptor.getEnumType(), unknownFieldSetLite != UnknownFieldSetLite.getDefaultInstance() ? unknownFieldSetLite : null, (UnknownFieldSchema<UT, Object>) unknownFieldSchema);
if (unknownFieldSetLite2 != null) {
extendableMessage.unknownFields = unknownFieldSetLite2;
}
fieldSet.setField(generatedExtension.descriptor, intArrayList4);
return decodePackedVarint32List2;
default:
throw new IllegalStateException("Type cannot be packed: " + generatedExtension.descriptor.getLiteType());
}
}
if (generatedExtension.getLiteType() == WireFormat.FieldType.ENUM) {
i2 = decodeVarint32(bArr, i2, registers);
if (generatedExtension.descriptor.getEnumType().findValueByNumber(registers.int1) == null) {
UnknownFieldSetLite unknownFieldSetLite3 = extendableMessage.unknownFields;
if (unknownFieldSetLite3 == UnknownFieldSetLite.getDefaultInstance()) {
unknownFieldSetLite3 = UnknownFieldSetLite.newInstance();
extendableMessage.unknownFields = unknownFieldSetLite3;
}
SchemaUtil.storeUnknownEnum(i4, registers.int1, unknownFieldSetLite3, unknownFieldSchema);
return i2;
}
r2 = Integer.valueOf(registers.int1);
} else {
switch (AnonymousClass1.$SwitchMap$com$google$protobuf$WireFormat$FieldType[generatedExtension.getLiteType().ordinal()]) {
case 1:
r2 = Double.valueOf(decodeDouble(bArr, i2));
i2 += 8;
break;
case 2:
r2 = Float.valueOf(decodeFloat(bArr, i2));
i2 += 4;
break;
case 3:
case 4:
i2 = decodeVarint64(bArr, i2, registers);
r2 = Long.valueOf(registers.long1);
break;
case 5:
case 6:
i2 = decodeVarint32(bArr, i2, registers);
r2 = Integer.valueOf(registers.int1);
break;
case 7:
case 8:
r2 = Long.valueOf(decodeFixed64(bArr, i2));
i2 += 8;
break;
case 9:
case 10:
r2 = Integer.valueOf(decodeFixed32(bArr, i2));
i2 += 4;
break;
case 11:
i2 = decodeVarint64(bArr, i2, registers);
r2 = Boolean.valueOf(registers.long1 != 0);
break;
case 12:
i2 = decodeVarint32(bArr, i2, registers);
r2 = Integer.valueOf(CodedInputStream.decodeZigZag32(registers.int1));
break;
case 13:
i2 = decodeVarint64(bArr, i2, registers);
r2 = Long.valueOf(CodedInputStream.decodeZigZag64(registers.long1));
break;
case 14:
throw new IllegalStateException("Shouldn't reach here.");
case 15:
i2 = decodeBytes(bArr, i2, registers);
r2 = registers.object1;
break;
case 16:
i2 = decodeString(bArr, i2, registers);
r2 = registers.object1;
break;
case 17:
i2 = decodeGroupField(Protobuf.getInstance().schemaFor((Class) generatedExtension.getMessageDefaultInstance().getClass()), bArr, i2, i3, (i4 << 3) | 4, registers);
r2 = registers.object1;
break;
case 18:
i2 = decodeMessageField(Protobuf.getInstance().schemaFor((Class) generatedExtension.getMessageDefaultInstance().getClass()), bArr, i2, i3, registers);
r2 = registers.object1;
break;
}
}
if (generatedExtension.isRepeated()) {
fieldSet.addRepeatedField(generatedExtension.descriptor, r2);
} else {
int i5 = AnonymousClass1.$SwitchMap$com$google$protobuf$WireFormat$FieldType[generatedExtension.getLiteType().ordinal()];
if ((i5 == 17 || i5 == 18) && (field = fieldSet.getField(generatedExtension.descriptor)) != null) {
r2 = Internal.mergeMessage(field, r2);
}
fieldSet.setField(generatedExtension.descriptor, r2);
}
return i2;
}
/* renamed from: androidx.datastore.preferences.protobuf.ArrayDecoders$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$com$google$protobuf$WireFormat$FieldType;
static {
int[] iArr = new int[WireFormat.FieldType.values().length];
$SwitchMap$com$google$protobuf$WireFormat$FieldType = iArr;
try {
iArr[WireFormat.FieldType.DOUBLE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.FLOAT.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.INT64.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.UINT64.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.INT32.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.UINT32.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.FIXED64.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.SFIXED64.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.FIXED32.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.SFIXED32.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.BOOL.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.SINT32.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.SINT64.ordinal()] = 13;
} catch (NoSuchFieldError unused13) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.ENUM.ordinal()] = 14;
} catch (NoSuchFieldError unused14) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.BYTES.ordinal()] = 15;
} catch (NoSuchFieldError unused15) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.STRING.ordinal()] = 16;
} catch (NoSuchFieldError unused16) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.GROUP.ordinal()] = 17;
} catch (NoSuchFieldError unused17) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.MESSAGE.ordinal()] = 18;
} catch (NoSuchFieldError unused18) {
}
}
}
public static int decodeUnknownField(int i, byte[] bArr, int i2, int i3, UnknownFieldSetLite unknownFieldSetLite, Registers registers) throws InvalidProtocolBufferException {
if (WireFormat.getTagFieldNumber(i) == 0) {
throw InvalidProtocolBufferException.invalidTag();
}
int tagWireType = WireFormat.getTagWireType(i);
if (tagWireType == 0) {
int decodeVarint64 = decodeVarint64(bArr, i2, registers);
unknownFieldSetLite.storeField(i, Long.valueOf(registers.long1));
return decodeVarint64;
}
if (tagWireType == 1) {
unknownFieldSetLite.storeField(i, Long.valueOf(decodeFixed64(bArr, i2)));
return i2 + 8;
}
if (tagWireType == 2) {
int decodeVarint32 = decodeVarint32(bArr, i2, registers);
int i4 = registers.int1;
if (i4 < 0) {
throw InvalidProtocolBufferException.negativeSize();
}
if (i4 > bArr.length - decodeVarint32) {
throw InvalidProtocolBufferException.truncatedMessage();
}
if (i4 == 0) {
unknownFieldSetLite.storeField(i, ByteString.EMPTY);
} else {
unknownFieldSetLite.storeField(i, ByteString.copyFrom(bArr, decodeVarint32, i4));
}
return decodeVarint32 + i4;
}
if (tagWireType != 3) {
if (tagWireType == 5) {
unknownFieldSetLite.storeField(i, Integer.valueOf(decodeFixed32(bArr, i2)));
return i2 + 4;
}
throw InvalidProtocolBufferException.invalidTag();
}
UnknownFieldSetLite newInstance = UnknownFieldSetLite.newInstance();
int i5 = (i & (-8)) | 4;
int i6 = 0;
while (true) {
if (i2 >= i3) {
break;
}
int decodeVarint322 = decodeVarint32(bArr, i2, registers);
int i7 = registers.int1;
if (i7 == i5) {
i6 = i7;
i2 = decodeVarint322;
break;
}
i6 = i7;
i2 = decodeUnknownField(i7, bArr, decodeVarint322, i3, newInstance, registers);
}
if (i2 > i3 || i6 != i5) {
throw InvalidProtocolBufferException.parseFailure();
}
unknownFieldSetLite.storeField(i, newInstance);
return i2;
}
public static int skipField(int i, byte[] bArr, int i2, int i3, Registers registers) throws InvalidProtocolBufferException {
if (WireFormat.getTagFieldNumber(i) == 0) {
throw InvalidProtocolBufferException.invalidTag();
}
int tagWireType = WireFormat.getTagWireType(i);
if (tagWireType == 0) {
return decodeVarint64(bArr, i2, registers);
}
if (tagWireType == 1) {
return i2 + 8;
}
if (tagWireType == 2) {
return decodeVarint32(bArr, i2, registers) + registers.int1;
}
if (tagWireType != 3) {
if (tagWireType == 5) {
return i2 + 4;
}
throw InvalidProtocolBufferException.invalidTag();
}
int i4 = (i & (-8)) | 4;
int i5 = 0;
while (i2 < i3) {
i2 = decodeVarint32(bArr, i2, registers);
i5 = registers.int1;
if (i5 == i4) {
break;
}
i2 = skipField(i5, bArr, i2, i3, registers);
}
if (i2 > i3 || i5 != i4) {
throw InvalidProtocolBufferException.parseFailure();
}
return i2;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,207 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.GeneratedMessageLite;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
/* loaded from: classes.dex */
public final class BoolValue extends GeneratedMessageLite<BoolValue, Builder> implements BoolValueOrBuilder {
private static final BoolValue DEFAULT_INSTANCE;
private static volatile Parser<BoolValue> PARSER = null;
public static final int VALUE_FIELD_NUMBER = 1;
private boolean value_;
/* JADX INFO: Access modifiers changed from: private */
public void clearValue() {
this.value_ = false;
}
public static BoolValue getDefaultInstance() {
return DEFAULT_INSTANCE;
}
/* JADX INFO: Access modifiers changed from: private */
public void setValue(boolean z) {
this.value_ = z;
}
@Override // androidx.datastore.preferences.protobuf.BoolValueOrBuilder
public boolean getValue() {
return this.value_;
}
private BoolValue() {
}
public static BoolValue parseFrom(ByteBuffer byteBuffer) throws InvalidProtocolBufferException {
return (BoolValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer);
}
public static BoolValue parseFrom(ByteBuffer byteBuffer, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (BoolValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer, extensionRegistryLite);
}
public static BoolValue parseFrom(ByteString byteString) throws InvalidProtocolBufferException {
return (BoolValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString);
}
public static BoolValue parseFrom(ByteString byteString, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (BoolValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString, extensionRegistryLite);
}
public static BoolValue parseFrom(byte[] bArr) throws InvalidProtocolBufferException {
return (BoolValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr);
}
public static BoolValue parseFrom(byte[] bArr, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (BoolValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr, extensionRegistryLite);
}
public static BoolValue parseFrom(InputStream inputStream) throws IOException {
return (BoolValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream);
}
public static BoolValue parseFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (BoolValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static BoolValue parseDelimitedFrom(InputStream inputStream) throws IOException {
return (BoolValue) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream);
}
public static BoolValue parseDelimitedFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (BoolValue) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static BoolValue parseFrom(CodedInputStream codedInputStream) throws IOException {
return (BoolValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream);
}
public static BoolValue parseFrom(CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (BoolValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream, extensionRegistryLite);
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.createBuilder();
}
public static Builder newBuilder(BoolValue boolValue) {
return DEFAULT_INSTANCE.createBuilder(boolValue);
}
public static final class Builder extends GeneratedMessageLite.Builder<BoolValue, Builder> implements BoolValueOrBuilder {
public /* synthetic */ Builder(AnonymousClass1 anonymousClass1) {
this();
}
private Builder() {
super(BoolValue.DEFAULT_INSTANCE);
}
@Override // androidx.datastore.preferences.protobuf.BoolValueOrBuilder
public boolean getValue() {
return ((BoolValue) this.instance).getValue();
}
public Builder setValue(boolean z) {
copyOnWrite();
((BoolValue) this.instance).setValue(z);
return this;
}
public Builder clearValue() {
copyOnWrite();
((BoolValue) this.instance).clearValue();
return this;
}
}
/* renamed from: androidx.datastore.preferences.protobuf.BoolValue$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke;
static {
int[] iArr = new int[GeneratedMessageLite.MethodToInvoke.values().length];
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke = iArr;
try {
iArr[GeneratedMessageLite.MethodToInvoke.NEW_MUTABLE_INSTANCE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.NEW_BUILDER.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.BUILD_MESSAGE_INFO.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_DEFAULT_INSTANCE.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_PARSER.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_MEMOIZED_IS_INITIALIZED.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.SET_MEMOIZED_IS_INITIALIZED.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
}
}
@Override // androidx.datastore.preferences.protobuf.GeneratedMessageLite
public final Object dynamicMethod(GeneratedMessageLite.MethodToInvoke methodToInvoke, Object obj, Object obj2) {
AnonymousClass1 anonymousClass1 = null;
switch (AnonymousClass1.$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[methodToInvoke.ordinal()]) {
case 1:
return new BoolValue();
case 2:
return new Builder(anonymousClass1);
case 3:
return GeneratedMessageLite.newMessageInfo(DEFAULT_INSTANCE, "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0007", new Object[]{"value_"});
case 4:
return DEFAULT_INSTANCE;
case 5:
Parser<BoolValue> parser = PARSER;
if (parser == null) {
synchronized (BoolValue.class) {
try {
parser = PARSER;
if (parser == null) {
parser = new GeneratedMessageLite.DefaultInstanceBasedParser<>(DEFAULT_INSTANCE);
PARSER = parser;
}
} finally {
}
}
}
return parser;
case 6:
return (byte) 1;
case 7:
return null;
default:
throw new UnsupportedOperationException();
}
}
static {
BoolValue boolValue = new BoolValue();
DEFAULT_INSTANCE = boolValue;
GeneratedMessageLite.registerDefaultInstance(BoolValue.class, boolValue);
}
public static BoolValue of(boolean z) {
return newBuilder().setValue(z).build();
}
public static Parser<BoolValue> parser() {
return DEFAULT_INSTANCE.getParserForType();
}
}

View File

@@ -0,0 +1,6 @@
package androidx.datastore.preferences.protobuf;
/* loaded from: classes.dex */
public interface BoolValueOrBuilder extends MessageLiteOrBuilder {
boolean getValue();
}

View File

@@ -0,0 +1,228 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.Internal;
import java.util.AbstractList;
import java.util.Arrays;
import java.util.Collection;
import java.util.RandomAccess;
/* loaded from: classes.dex */
final class BooleanArrayList extends AbstractProtobufList<Boolean> implements Internal.BooleanList, RandomAccess, PrimitiveNonBoxingCollection {
private static final BooleanArrayList EMPTY_LIST;
private boolean[] array;
private int size;
public static BooleanArrayList emptyList() {
return EMPTY_LIST;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public int size() {
return this.size;
}
static {
BooleanArrayList booleanArrayList = new BooleanArrayList(new boolean[0], 0);
EMPTY_LIST = booleanArrayList;
booleanArrayList.makeImmutable();
}
public BooleanArrayList() {
this(new boolean[10], 0);
}
private BooleanArrayList(boolean[] zArr, int i) {
this.array = zArr;
this.size = i;
}
@Override // java.util.AbstractList
public void removeRange(int i, int i2) {
ensureIsMutable();
if (i2 < i) {
throw new IndexOutOfBoundsException("toIndex < fromIndex");
}
boolean[] zArr = this.array;
System.arraycopy(zArr, i2, zArr, i, this.size - i2);
this.size -= i2 - i;
((AbstractList) this).modCount++;
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractList, java.util.Collection, java.util.List
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof BooleanArrayList)) {
return super.equals(obj);
}
BooleanArrayList booleanArrayList = (BooleanArrayList) obj;
if (this.size != booleanArrayList.size) {
return false;
}
boolean[] zArr = booleanArrayList.array;
for (int i = 0; i < this.size; i++) {
if (this.array[i] != zArr[i]) {
return false;
}
}
return true;
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractList, java.util.Collection, java.util.List
public int hashCode() {
int i = 1;
for (int i2 = 0; i2 < this.size; i2++) {
i = (i * 31) + Internal.hashBoolean(this.array[i2]);
}
return i;
}
@Override // androidx.datastore.preferences.protobuf.Internal.ProtobufList, androidx.datastore.preferences.protobuf.Internal.BooleanList
/* renamed from: mutableCopyWithCapacity, reason: merged with bridge method [inline-methods] */
public Internal.ProtobufList<Boolean> mutableCopyWithCapacity2(int i) {
if (i < this.size) {
throw new IllegalArgumentException();
}
return new BooleanArrayList(Arrays.copyOf(this.array, i), this.size);
}
@Override // java.util.AbstractList, java.util.List
public Boolean get(int i) {
return Boolean.valueOf(getBoolean(i));
}
@Override // androidx.datastore.preferences.protobuf.Internal.BooleanList
public boolean getBoolean(int i) {
ensureIndexInRange(i);
return this.array[i];
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractList, java.util.List
public Boolean set(int i, Boolean bool) {
return Boolean.valueOf(setBoolean(i, bool.booleanValue()));
}
@Override // androidx.datastore.preferences.protobuf.Internal.BooleanList
public boolean setBoolean(int i, boolean z) {
ensureIsMutable();
ensureIndexInRange(i);
boolean[] zArr = this.array;
boolean z2 = zArr[i];
zArr[i] = z;
return z2;
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean add(Boolean bool) {
addBoolean(bool.booleanValue());
return true;
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractList, java.util.List
public void add(int i, Boolean bool) {
addBoolean(i, bool.booleanValue());
}
@Override // androidx.datastore.preferences.protobuf.Internal.BooleanList
public void addBoolean(boolean z) {
ensureIsMutable();
int i = this.size;
boolean[] zArr = this.array;
if (i == zArr.length) {
boolean[] zArr2 = new boolean[((i * 3) / 2) + 1];
System.arraycopy(zArr, 0, zArr2, 0, i);
this.array = zArr2;
}
boolean[] zArr3 = this.array;
int i2 = this.size;
this.size = i2 + 1;
zArr3[i2] = z;
}
private void addBoolean(int i, boolean z) {
int i2;
ensureIsMutable();
if (i < 0 || i > (i2 = this.size)) {
throw new IndexOutOfBoundsException(makeOutOfBoundsExceptionMessage(i));
}
boolean[] zArr = this.array;
if (i2 < zArr.length) {
System.arraycopy(zArr, i, zArr, i + 1, i2 - i);
} else {
boolean[] zArr2 = new boolean[((i2 * 3) / 2) + 1];
System.arraycopy(zArr, 0, zArr2, 0, i);
System.arraycopy(this.array, i, zArr2, i + 1, this.size - i);
this.array = zArr2;
}
this.array[i] = z;
this.size++;
((AbstractList) this).modCount++;
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean addAll(Collection<? extends Boolean> collection) {
ensureIsMutable();
Internal.checkNotNull(collection);
if (!(collection instanceof BooleanArrayList)) {
return super.addAll(collection);
}
BooleanArrayList booleanArrayList = (BooleanArrayList) collection;
int i = booleanArrayList.size;
if (i == 0) {
return false;
}
int i2 = this.size;
if (Integer.MAX_VALUE - i2 < i) {
throw new OutOfMemoryError();
}
int i3 = i2 + i;
boolean[] zArr = this.array;
if (i3 > zArr.length) {
this.array = Arrays.copyOf(zArr, i3);
}
System.arraycopy(booleanArrayList.array, 0, this.array, this.size, booleanArrayList.size);
this.size = i3;
((AbstractList) this).modCount++;
return true;
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean remove(Object obj) {
ensureIsMutable();
for (int i = 0; i < this.size; i++) {
if (obj.equals(Boolean.valueOf(this.array[i]))) {
boolean[] zArr = this.array;
System.arraycopy(zArr, i + 1, zArr, i, (this.size - i) - 1);
this.size--;
((AbstractList) this).modCount++;
return true;
}
}
return false;
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractList, java.util.List
public Boolean remove(int i) {
ensureIsMutable();
ensureIndexInRange(i);
boolean[] zArr = this.array;
boolean z = zArr[i];
if (i < this.size - 1) {
System.arraycopy(zArr, i + 1, zArr, i, (r2 - i) - 1);
}
this.size--;
((AbstractList) this).modCount++;
return Boolean.valueOf(z);
}
private void ensureIndexInRange(int i) {
if (i < 0 || i >= this.size) {
throw new IndexOutOfBoundsException(makeOutOfBoundsExceptionMessage(i));
}
}
private String makeOutOfBoundsExceptionMessage(int i) {
return "Index:" + i + ", Size:" + this.size;
}
}

View File

@@ -0,0 +1,26 @@
package androidx.datastore.preferences.protobuf;
import java.nio.ByteBuffer;
/* loaded from: classes.dex */
abstract class BufferAllocator {
private static final BufferAllocator UNPOOLED = new BufferAllocator() { // from class: androidx.datastore.preferences.protobuf.BufferAllocator.1
@Override // androidx.datastore.preferences.protobuf.BufferAllocator
public AllocatedBuffer allocateHeapBuffer(int i) {
return AllocatedBuffer.wrap(new byte[i]);
}
@Override // androidx.datastore.preferences.protobuf.BufferAllocator
public AllocatedBuffer allocateDirectBuffer(int i) {
return AllocatedBuffer.wrap(ByteBuffer.allocateDirect(i));
}
};
public static BufferAllocator unpooled() {
return UNPOOLED;
}
public abstract AllocatedBuffer allocateDirectBuffer(int i);
public abstract AllocatedBuffer allocateHeapBuffer(int i);
}

View File

@@ -0,0 +1,119 @@
package androidx.datastore.preferences.protobuf;
import com.firemonkeys.cloudcellapi.LocalNotificationsCenter;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.ref.SoftReference;
import java.nio.ByteBuffer;
import java.nio.channels.WritableByteChannel;
/* loaded from: classes.dex */
final class ByteBufferWriter {
private static final ThreadLocal<SoftReference<byte[]>> BUFFER = new ThreadLocal<>();
private static final float BUFFER_REALLOCATION_THRESHOLD = 0.5f;
private static final long CHANNEL_FIELD_OFFSET;
private static final Class<?> FILE_OUTPUT_STREAM_CLASS;
private static final int MAX_CACHED_BUFFER_SIZE = 16384;
private static final int MIN_CACHED_BUFFER_SIZE = 1024;
private static boolean needToReallocate(int i, int i2) {
return i2 < i && ((float) i2) < ((float) i) * BUFFER_REALLOCATION_THRESHOLD;
}
private ByteBufferWriter() {
}
static {
Class<?> safeGetClass = safeGetClass("java.io.FileOutputStream");
FILE_OUTPUT_STREAM_CLASS = safeGetClass;
CHANNEL_FIELD_OFFSET = getChannelFieldOffset(safeGetClass);
}
public static void clearCachedBuffer() {
BUFFER.set(null);
}
public static void write(ByteBuffer byteBuffer, OutputStream outputStream) throws IOException {
int position = byteBuffer.position();
try {
if (byteBuffer.hasArray()) {
outputStream.write(byteBuffer.array(), byteBuffer.arrayOffset() + byteBuffer.position(), byteBuffer.remaining());
} else if (!writeToChannel(byteBuffer, outputStream)) {
byte[] orCreateBuffer = getOrCreateBuffer(byteBuffer.remaining());
while (byteBuffer.hasRemaining()) {
int min = Math.min(byteBuffer.remaining(), orCreateBuffer.length);
byteBuffer.get(orCreateBuffer, 0, min);
outputStream.write(orCreateBuffer, 0, min);
}
}
byteBuffer.position(position);
} catch (Throwable th) {
byteBuffer.position(position);
throw th;
}
}
private static byte[] getOrCreateBuffer(int i) {
int max = Math.max(i, 1024);
byte[] buffer = getBuffer();
if (buffer == null || needToReallocate(max, buffer.length)) {
buffer = new byte[max];
if (max <= 16384) {
setBuffer(buffer);
}
}
return buffer;
}
private static byte[] getBuffer() {
SoftReference<byte[]> softReference = BUFFER.get();
if (softReference == null) {
return null;
}
return softReference.get();
}
private static void setBuffer(byte[] bArr) {
BUFFER.set(new SoftReference<>(bArr));
}
private static boolean writeToChannel(ByteBuffer byteBuffer, OutputStream outputStream) throws IOException {
WritableByteChannel writableByteChannel;
long j = CHANNEL_FIELD_OFFSET;
if (j < 0 || !FILE_OUTPUT_STREAM_CLASS.isInstance(outputStream)) {
return false;
}
try {
writableByteChannel = (WritableByteChannel) UnsafeUtil.getObject(outputStream, j);
} catch (ClassCastException unused) {
writableByteChannel = null;
}
if (writableByteChannel == null) {
return false;
}
writableByteChannel.write(byteBuffer);
return true;
}
private static Class<?> safeGetClass(String str) {
try {
return Class.forName(str);
} catch (ClassNotFoundException unused) {
return null;
}
}
private static long getChannelFieldOffset(Class<?> cls) {
if (cls == null) {
return -1L;
}
try {
if (UnsafeUtil.hasUnsafeArrayOperations()) {
return UnsafeUtil.objectFieldOffset(cls.getDeclaredField(LocalNotificationsCenter.EXTRA_CHANNEL_ID));
}
return -1L;
} catch (Throwable unused) {
return -1L;
}
}
}

View File

@@ -0,0 +1,17 @@
package androidx.datastore.preferences.protobuf;
import java.io.IOException;
import java.nio.ByteBuffer;
/* loaded from: classes.dex */
public abstract class ByteOutput {
public abstract void write(byte b) throws IOException;
public abstract void write(ByteBuffer byteBuffer) throws IOException;
public abstract void write(byte[] bArr, int i, int i2) throws IOException;
public abstract void writeLazy(ByteBuffer byteBuffer) throws IOException;
public abstract void writeLazy(byte[] bArr, int i, int i2) throws IOException;
}

View File

@@ -0,0 +1,773 @@
package androidx.datastore.preferences.protobuf;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.charset.UnsupportedCharsetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
/* loaded from: classes.dex */
public abstract class ByteString implements Iterable<Byte>, Serializable {
static final int CONCATENATE_BY_COPY_SIZE = 128;
public static final ByteString EMPTY = new LiteralByteString(Internal.EMPTY_BYTE_ARRAY);
static final int MAX_READ_FROM_CHUNK_SIZE = 8192;
static final int MIN_READ_FROM_CHUNK_SIZE = 256;
private static final int UNSIGNED_BYTE_MASK = 255;
private static final Comparator<ByteString> UNSIGNED_LEXICOGRAPHICAL_COMPARATOR;
private static final ByteArrayCopier byteArrayCopier;
private int hash = 0;
public interface ByteArrayCopier {
byte[] copyFrom(byte[] bArr, int i, int i2);
}
public interface ByteIterator extends Iterator<Byte> {
byte nextByte();
}
/* JADX INFO: Access modifiers changed from: private */
public static int toInt(byte b) {
return b & 255;
}
public static Comparator<ByteString> unsignedLexicographicalComparator() {
return UNSIGNED_LEXICOGRAPHICAL_COMPARATOR;
}
public abstract ByteBuffer asReadOnlyByteBuffer();
public abstract List<ByteBuffer> asReadOnlyByteBufferList();
public abstract byte byteAt(int i);
public abstract void copyTo(ByteBuffer byteBuffer);
public abstract void copyToInternal(byte[] bArr, int i, int i2, int i3);
public abstract boolean equals(Object obj);
public abstract int getTreeDepth();
public abstract byte internalByteAt(int i);
public abstract boolean isBalanced();
public abstract boolean isValidUtf8();
public abstract CodedInputStream newCodedInput();
public abstract InputStream newInput();
public abstract int partialHash(int i, int i2, int i3);
public abstract int partialIsValidUtf8(int i, int i2, int i3);
public final int peekCachedHashCode() {
return this.hash;
}
public abstract int size();
public abstract ByteString substring(int i, int i2);
public abstract String toStringInternal(Charset charset);
public abstract void writeTo(ByteOutput byteOutput) throws IOException;
public abstract void writeTo(OutputStream outputStream) throws IOException;
public abstract void writeToInternal(OutputStream outputStream, int i, int i2) throws IOException;
public abstract void writeToReverse(ByteOutput byteOutput) throws IOException;
static {
byteArrayCopier = Android.isOnAndroidDevice() ? new SystemByteArrayCopier() : new ArraysByteArrayCopier();
UNSIGNED_LEXICOGRAPHICAL_COMPARATOR = new Comparator<ByteString>() { // from class: androidx.datastore.preferences.protobuf.ByteString.2
/* JADX WARN: Type inference failed for: r0v0, types: [androidx.datastore.preferences.protobuf.ByteString$ByteIterator, java.util.Iterator] */
/* JADX WARN: Type inference failed for: r1v0, types: [androidx.datastore.preferences.protobuf.ByteString$ByteIterator, java.util.Iterator] */
@Override // java.util.Comparator
public int compare(ByteString byteString, ByteString byteString2) {
?? iterator2 = byteString.iterator2();
?? iterator22 = byteString2.iterator2();
while (iterator2.hasNext() && iterator22.hasNext()) {
int compare = Integer.compare(ByteString.toInt(iterator2.nextByte()), ByteString.toInt(iterator22.nextByte()));
if (compare != 0) {
return compare;
}
}
return Integer.compare(byteString.size(), byteString2.size());
}
};
}
public static final class SystemByteArrayCopier implements ByteArrayCopier {
private SystemByteArrayCopier() {
}
@Override // androidx.datastore.preferences.protobuf.ByteString.ByteArrayCopier
public byte[] copyFrom(byte[] bArr, int i, int i2) {
byte[] bArr2 = new byte[i2];
System.arraycopy(bArr, i, bArr2, 0, i2);
return bArr2;
}
}
public static final class ArraysByteArrayCopier implements ByteArrayCopier {
private ArraysByteArrayCopier() {
}
@Override // androidx.datastore.preferences.protobuf.ByteString.ByteArrayCopier
public byte[] copyFrom(byte[] bArr, int i, int i2) {
return Arrays.copyOfRange(bArr, i, i2 + i);
}
}
@Override // java.lang.Iterable
/* renamed from: iterator, reason: merged with bridge method [inline-methods] */
public Iterator<Byte> iterator2() {
return new AbstractByteIterator() { // from class: androidx.datastore.preferences.protobuf.ByteString.1
private final int limit;
private int position = 0;
@Override // java.util.Iterator
public boolean hasNext() {
return this.position < this.limit;
}
{
this.limit = ByteString.this.size();
}
@Override // androidx.datastore.preferences.protobuf.ByteString.ByteIterator
public byte nextByte() {
int i = this.position;
if (i >= this.limit) {
throw new NoSuchElementException();
}
this.position = i + 1;
return ByteString.this.internalByteAt(i);
}
};
}
public static abstract class AbstractByteIterator implements ByteIterator {
/* JADX WARN: Can't rename method to resolve collision */
@Override // java.util.Iterator
public final Byte next() {
return Byte.valueOf(nextByte());
}
@Override // java.util.Iterator
public final void remove() {
throw new UnsupportedOperationException();
}
}
public final boolean isEmpty() {
return size() == 0;
}
public final ByteString substring(int i) {
return substring(i, size());
}
public final boolean startsWith(ByteString byteString) {
return size() >= byteString.size() && substring(0, byteString.size()).equals(byteString);
}
public final boolean endsWith(ByteString byteString) {
return size() >= byteString.size() && substring(size() - byteString.size()).equals(byteString);
}
public static ByteString copyFrom(byte[] bArr, int i, int i2) {
checkRange(i, i + i2, bArr.length);
return new LiteralByteString(byteArrayCopier.copyFrom(bArr, i, i2));
}
public static ByteString copyFrom(byte[] bArr) {
return copyFrom(bArr, 0, bArr.length);
}
public static ByteString wrap(ByteBuffer byteBuffer) {
if (byteBuffer.hasArray()) {
return wrap(byteBuffer.array(), byteBuffer.arrayOffset() + byteBuffer.position(), byteBuffer.remaining());
}
return new NioByteString(byteBuffer);
}
public static ByteString wrap(byte[] bArr) {
return new LiteralByteString(bArr);
}
public static ByteString wrap(byte[] bArr, int i, int i2) {
return new BoundedByteString(bArr, i, i2);
}
public static ByteString copyFrom(ByteBuffer byteBuffer, int i) {
checkRange(0, i, byteBuffer.remaining());
byte[] bArr = new byte[i];
byteBuffer.get(bArr);
return new LiteralByteString(bArr);
}
public static ByteString copyFrom(ByteBuffer byteBuffer) {
return copyFrom(byteBuffer, byteBuffer.remaining());
}
public static ByteString copyFrom(String str, String str2) throws UnsupportedEncodingException {
return new LiteralByteString(str.getBytes(str2));
}
public static ByteString copyFrom(String str, Charset charset) {
return new LiteralByteString(str.getBytes(charset));
}
public static ByteString copyFromUtf8(String str) {
return new LiteralByteString(str.getBytes(Internal.UTF_8));
}
public static ByteString readFrom(InputStream inputStream) throws IOException {
return readFrom(inputStream, 256, 8192);
}
public static ByteString readFrom(InputStream inputStream, int i) throws IOException {
return readFrom(inputStream, i, i);
}
public static ByteString readFrom(InputStream inputStream, int i, int i2) throws IOException {
ArrayList arrayList = new ArrayList();
while (true) {
ByteString readChunk = readChunk(inputStream, i);
if (readChunk != null) {
arrayList.add(readChunk);
i = Math.min(i * 2, i2);
} else {
return copyFrom(arrayList);
}
}
}
private static ByteString readChunk(InputStream inputStream, int i) throws IOException {
byte[] bArr = new byte[i];
int i2 = 0;
while (i2 < i) {
int read = inputStream.read(bArr, i2, i - i2);
if (read == -1) {
break;
}
i2 += read;
}
if (i2 == 0) {
return null;
}
return copyFrom(bArr, 0, i2);
}
public final ByteString concat(ByteString byteString) {
if (Integer.MAX_VALUE - size() < byteString.size()) {
throw new IllegalArgumentException("ByteString would be too long: " + size() + "+" + byteString.size());
}
return RopeByteString.concatenate(this, byteString);
}
public static ByteString copyFrom(Iterable<ByteString> iterable) {
int size;
if (!(iterable instanceof Collection)) {
Iterator<ByteString> it = iterable.iterator();
size = 0;
while (it.hasNext()) {
it.next();
size++;
}
} else {
size = ((Collection) iterable).size();
}
return size == 0 ? EMPTY : balancedConcat(iterable.iterator(), size);
}
private static ByteString balancedConcat(Iterator<ByteString> it, int i) {
if (i < 1) {
throw new IllegalArgumentException(String.format("length (%s) must be >= 1", Integer.valueOf(i)));
}
if (i == 1) {
return it.next();
}
int i2 = i >>> 1;
return balancedConcat(it, i2).concat(balancedConcat(it, i - i2));
}
public void copyTo(byte[] bArr, int i) {
copyTo(bArr, 0, i, size());
}
@Deprecated
public final void copyTo(byte[] bArr, int i, int i2, int i3) {
checkRange(i, i + i3, size());
checkRange(i2, i2 + i3, bArr.length);
if (i3 > 0) {
copyToInternal(bArr, i, i2, i3);
}
}
public final byte[] toByteArray() {
int size = size();
if (size == 0) {
return Internal.EMPTY_BYTE_ARRAY;
}
byte[] bArr = new byte[size];
copyToInternal(bArr, 0, 0, size);
return bArr;
}
public final void writeTo(OutputStream outputStream, int i, int i2) throws IOException {
checkRange(i, i + i2, size());
if (i2 > 0) {
writeToInternal(outputStream, i, i2);
}
}
public final String toString(String str) throws UnsupportedEncodingException {
try {
return toString(Charset.forName(str));
} catch (UnsupportedCharsetException e) {
UnsupportedEncodingException unsupportedEncodingException = new UnsupportedEncodingException(str);
unsupportedEncodingException.initCause(e);
throw unsupportedEncodingException;
}
}
public final String toString(Charset charset) {
return size() == 0 ? "" : toStringInternal(charset);
}
public final String toStringUtf8() {
return toString(Internal.UTF_8);
}
public static abstract class LeafByteString extends ByteString {
public abstract boolean equalsRange(ByteString byteString, int i, int i2);
@Override // androidx.datastore.preferences.protobuf.ByteString
public final int getTreeDepth() {
return 0;
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final boolean isBalanced() {
return true;
}
@Override // androidx.datastore.preferences.protobuf.ByteString, java.lang.Iterable
public /* bridge */ /* synthetic */ Iterator<Byte> iterator() {
return super.iterator2();
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public void writeToReverse(ByteOutput byteOutput) throws IOException {
writeTo(byteOutput);
}
}
public final int hashCode() {
int i = this.hash;
if (i == 0) {
int size = size();
i = partialHash(size, 0, size);
if (i == 0) {
i = 1;
}
this.hash = i;
}
return i;
}
public static Output newOutput(int i) {
return new Output(i);
}
public static Output newOutput() {
return new Output(128);
}
public static final class Output extends OutputStream {
private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
private byte[] buffer;
private int bufferPos;
private final ArrayList<ByteString> flushedBuffers;
private int flushedBuffersTotalBytes;
private final int initialCapacity;
public Output(int i) {
if (i < 0) {
throw new IllegalArgumentException("Buffer size < 0");
}
this.initialCapacity = i;
this.flushedBuffers = new ArrayList<>();
this.buffer = new byte[i];
}
@Override // java.io.OutputStream
public synchronized void write(int i) {
try {
if (this.bufferPos == this.buffer.length) {
flushFullBuffer(1);
}
byte[] bArr = this.buffer;
int i2 = this.bufferPos;
this.bufferPos = i2 + 1;
bArr[i2] = (byte) i;
} catch (Throwable th) {
throw th;
}
}
@Override // java.io.OutputStream
public synchronized void write(byte[] bArr, int i, int i2) {
try {
byte[] bArr2 = this.buffer;
int length = bArr2.length;
int i3 = this.bufferPos;
if (i2 <= length - i3) {
System.arraycopy(bArr, i, bArr2, i3, i2);
this.bufferPos += i2;
} else {
int length2 = bArr2.length - i3;
System.arraycopy(bArr, i, bArr2, i3, length2);
int i4 = i2 - length2;
flushFullBuffer(i4);
System.arraycopy(bArr, i + length2, this.buffer, 0, i4);
this.bufferPos = i4;
}
} catch (Throwable th) {
throw th;
}
}
public synchronized ByteString toByteString() {
flushLastBuffer();
return ByteString.copyFrom(this.flushedBuffers);
}
private byte[] copyArray(byte[] bArr, int i) {
byte[] bArr2 = new byte[i];
System.arraycopy(bArr, 0, bArr2, 0, Math.min(bArr.length, i));
return bArr2;
}
public void writeTo(OutputStream outputStream) throws IOException {
ByteString[] byteStringArr;
byte[] bArr;
int i;
synchronized (this) {
ArrayList<ByteString> arrayList = this.flushedBuffers;
byteStringArr = (ByteString[]) arrayList.toArray(new ByteString[arrayList.size()]);
bArr = this.buffer;
i = this.bufferPos;
}
for (ByteString byteString : byteStringArr) {
byteString.writeTo(outputStream);
}
outputStream.write(copyArray(bArr, i));
}
public synchronized int size() {
return this.flushedBuffersTotalBytes + this.bufferPos;
}
public synchronized void reset() {
this.flushedBuffers.clear();
this.flushedBuffersTotalBytes = 0;
this.bufferPos = 0;
}
public String toString() {
return String.format("<ByteString.Output@%s size=%d>", Integer.toHexString(System.identityHashCode(this)), Integer.valueOf(size()));
}
private void flushFullBuffer(int i) {
this.flushedBuffers.add(new LiteralByteString(this.buffer));
int length = this.flushedBuffersTotalBytes + this.buffer.length;
this.flushedBuffersTotalBytes = length;
this.buffer = new byte[Math.max(this.initialCapacity, Math.max(i, length >>> 1))];
this.bufferPos = 0;
}
private void flushLastBuffer() {
int i = this.bufferPos;
byte[] bArr = this.buffer;
if (i >= bArr.length) {
this.flushedBuffers.add(new LiteralByteString(this.buffer));
this.buffer = EMPTY_BYTE_ARRAY;
} else if (i > 0) {
this.flushedBuffers.add(new LiteralByteString(copyArray(bArr, i)));
}
this.flushedBuffersTotalBytes += this.bufferPos;
this.bufferPos = 0;
}
}
public static CodedBuilder newCodedBuilder(int i) {
return new CodedBuilder(i);
}
public static final class CodedBuilder {
private final byte[] buffer;
private final CodedOutputStream output;
public CodedOutputStream getCodedOutput() {
return this.output;
}
private CodedBuilder(int i) {
byte[] bArr = new byte[i];
this.buffer = bArr;
this.output = CodedOutputStream.newInstance(bArr);
}
public ByteString build() {
this.output.checkNoSpaceLeft();
return new LiteralByteString(this.buffer);
}
}
public static void checkIndex(int i, int i2) {
if (((i2 - (i + 1)) | i) < 0) {
if (i < 0) {
throw new ArrayIndexOutOfBoundsException("Index < 0: " + i);
}
throw new ArrayIndexOutOfBoundsException("Index > length: " + i + ", " + i2);
}
}
public static int checkRange(int i, int i2, int i3) {
int i4 = i2 - i;
if ((i | i2 | i4 | (i3 - i2)) >= 0) {
return i4;
}
if (i < 0) {
throw new IndexOutOfBoundsException("Beginning index: " + i + " < 0");
}
if (i2 < i) {
throw new IndexOutOfBoundsException("Beginning index larger than ending index: " + i + ", " + i2);
}
throw new IndexOutOfBoundsException("End index: " + i2 + " >= " + i3);
}
public final String toString() {
return String.format("<ByteString@%s size=%d>", Integer.toHexString(System.identityHashCode(this)), Integer.valueOf(size()));
}
public static class LiteralByteString extends LeafByteString {
private static final long serialVersionUID = 1;
protected final byte[] bytes;
public int getOffsetIntoBytes() {
return 0;
}
public LiteralByteString(byte[] bArr) {
bArr.getClass();
this.bytes = bArr;
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public byte byteAt(int i) {
return this.bytes[i];
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public byte internalByteAt(int i) {
return this.bytes[i];
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public int size() {
return this.bytes.length;
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final ByteString substring(int i, int i2) {
int checkRange = ByteString.checkRange(i, i2, size());
return checkRange == 0 ? ByteString.EMPTY : new BoundedByteString(this.bytes, getOffsetIntoBytes() + i, checkRange);
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public void copyToInternal(byte[] bArr, int i, int i2, int i3) {
System.arraycopy(this.bytes, i, bArr, i2, i3);
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final void copyTo(ByteBuffer byteBuffer) {
byteBuffer.put(this.bytes, getOffsetIntoBytes(), size());
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final ByteBuffer asReadOnlyByteBuffer() {
return ByteBuffer.wrap(this.bytes, getOffsetIntoBytes(), size()).asReadOnlyBuffer();
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final List<ByteBuffer> asReadOnlyByteBufferList() {
return Collections.singletonList(asReadOnlyByteBuffer());
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final void writeTo(OutputStream outputStream) throws IOException {
outputStream.write(toByteArray());
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final void writeToInternal(OutputStream outputStream, int i, int i2) throws IOException {
outputStream.write(this.bytes, getOffsetIntoBytes() + i, i2);
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final void writeTo(ByteOutput byteOutput) throws IOException {
byteOutput.writeLazy(this.bytes, getOffsetIntoBytes(), size());
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final String toStringInternal(Charset charset) {
return new String(this.bytes, getOffsetIntoBytes(), size(), charset);
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final boolean isValidUtf8() {
int offsetIntoBytes = getOffsetIntoBytes();
return Utf8.isValidUtf8(this.bytes, offsetIntoBytes, size() + offsetIntoBytes);
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final int partialIsValidUtf8(int i, int i2, int i3) {
int offsetIntoBytes = getOffsetIntoBytes() + i2;
return Utf8.partialIsValidUtf8(i, this.bytes, offsetIntoBytes, i3 + offsetIntoBytes);
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof ByteString) || size() != ((ByteString) obj).size()) {
return false;
}
if (size() == 0) {
return true;
}
if (obj instanceof LiteralByteString) {
LiteralByteString literalByteString = (LiteralByteString) obj;
int peekCachedHashCode = peekCachedHashCode();
int peekCachedHashCode2 = literalByteString.peekCachedHashCode();
if (peekCachedHashCode == 0 || peekCachedHashCode2 == 0 || peekCachedHashCode == peekCachedHashCode2) {
return equalsRange(literalByteString, 0, size());
}
return false;
}
return obj.equals(this);
}
@Override // androidx.datastore.preferences.protobuf.ByteString.LeafByteString
public final boolean equalsRange(ByteString byteString, int i, int i2) {
if (i2 > byteString.size()) {
throw new IllegalArgumentException("Length too large: " + i2 + size());
}
int i3 = i + i2;
if (i3 > byteString.size()) {
throw new IllegalArgumentException("Ran off end of other: " + i + ", " + i2 + ", " + byteString.size());
}
if (byteString instanceof LiteralByteString) {
LiteralByteString literalByteString = (LiteralByteString) byteString;
byte[] bArr = this.bytes;
byte[] bArr2 = literalByteString.bytes;
int offsetIntoBytes = getOffsetIntoBytes() + i2;
int offsetIntoBytes2 = getOffsetIntoBytes();
int offsetIntoBytes3 = literalByteString.getOffsetIntoBytes() + i;
while (offsetIntoBytes2 < offsetIntoBytes) {
if (bArr[offsetIntoBytes2] != bArr2[offsetIntoBytes3]) {
return false;
}
offsetIntoBytes2++;
offsetIntoBytes3++;
}
return true;
}
return byteString.substring(i, i3).equals(substring(0, i2));
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final int partialHash(int i, int i2, int i3) {
return Internal.partialHash(i, this.bytes, getOffsetIntoBytes() + i2, i3);
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final InputStream newInput() {
return new ByteArrayInputStream(this.bytes, getOffsetIntoBytes(), size());
}
@Override // androidx.datastore.preferences.protobuf.ByteString
public final CodedInputStream newCodedInput() {
return CodedInputStream.newInstance(this.bytes, getOffsetIntoBytes(), size(), true);
}
}
public static final class BoundedByteString extends LiteralByteString {
private static final long serialVersionUID = 1;
private final int bytesLength;
private final int bytesOffset;
@Override // androidx.datastore.preferences.protobuf.ByteString.LiteralByteString
public int getOffsetIntoBytes() {
return this.bytesOffset;
}
@Override // androidx.datastore.preferences.protobuf.ByteString.LiteralByteString, androidx.datastore.preferences.protobuf.ByteString
public int size() {
return this.bytesLength;
}
public BoundedByteString(byte[] bArr, int i, int i2) {
super(bArr);
ByteString.checkRange(i, i + i2, bArr.length);
this.bytesOffset = i;
this.bytesLength = i2;
}
@Override // androidx.datastore.preferences.protobuf.ByteString.LiteralByteString, androidx.datastore.preferences.protobuf.ByteString
public byte byteAt(int i) {
ByteString.checkIndex(i, size());
return this.bytes[this.bytesOffset + i];
}
@Override // androidx.datastore.preferences.protobuf.ByteString.LiteralByteString, androidx.datastore.preferences.protobuf.ByteString
public byte internalByteAt(int i) {
return this.bytes[this.bytesOffset + i];
}
@Override // androidx.datastore.preferences.protobuf.ByteString.LiteralByteString, androidx.datastore.preferences.protobuf.ByteString
public void copyToInternal(byte[] bArr, int i, int i2, int i3) {
System.arraycopy(this.bytes, getOffsetIntoBytes() + i, bArr, i2, i3);
}
public Object writeReplace() {
return ByteString.wrap(toByteArray());
}
private void readObject(ObjectInputStream objectInputStream) throws IOException {
throw new InvalidObjectException("BoundedByteStream instances are not to be serialized directly");
}
}
}

View File

@@ -0,0 +1,208 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.GeneratedMessageLite;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
/* loaded from: classes.dex */
public final class BytesValue extends GeneratedMessageLite<BytesValue, Builder> implements BytesValueOrBuilder {
private static final BytesValue DEFAULT_INSTANCE;
private static volatile Parser<BytesValue> PARSER = null;
public static final int VALUE_FIELD_NUMBER = 1;
private ByteString value_ = ByteString.EMPTY;
public static BytesValue getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@Override // androidx.datastore.preferences.protobuf.BytesValueOrBuilder
public ByteString getValue() {
return this.value_;
}
private BytesValue() {
}
/* JADX INFO: Access modifiers changed from: private */
public void setValue(ByteString byteString) {
byteString.getClass();
this.value_ = byteString;
}
/* JADX INFO: Access modifiers changed from: private */
public void clearValue() {
this.value_ = getDefaultInstance().getValue();
}
public static BytesValue parseFrom(ByteBuffer byteBuffer) throws InvalidProtocolBufferException {
return (BytesValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer);
}
public static BytesValue parseFrom(ByteBuffer byteBuffer, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (BytesValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer, extensionRegistryLite);
}
public static BytesValue parseFrom(ByteString byteString) throws InvalidProtocolBufferException {
return (BytesValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString);
}
public static BytesValue parseFrom(ByteString byteString, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (BytesValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString, extensionRegistryLite);
}
public static BytesValue parseFrom(byte[] bArr) throws InvalidProtocolBufferException {
return (BytesValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr);
}
public static BytesValue parseFrom(byte[] bArr, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (BytesValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr, extensionRegistryLite);
}
public static BytesValue parseFrom(InputStream inputStream) throws IOException {
return (BytesValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream);
}
public static BytesValue parseFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (BytesValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static BytesValue parseDelimitedFrom(InputStream inputStream) throws IOException {
return (BytesValue) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream);
}
public static BytesValue parseDelimitedFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (BytesValue) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static BytesValue parseFrom(CodedInputStream codedInputStream) throws IOException {
return (BytesValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream);
}
public static BytesValue parseFrom(CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (BytesValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream, extensionRegistryLite);
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.createBuilder();
}
public static Builder newBuilder(BytesValue bytesValue) {
return DEFAULT_INSTANCE.createBuilder(bytesValue);
}
public static final class Builder extends GeneratedMessageLite.Builder<BytesValue, Builder> implements BytesValueOrBuilder {
public /* synthetic */ Builder(AnonymousClass1 anonymousClass1) {
this();
}
private Builder() {
super(BytesValue.DEFAULT_INSTANCE);
}
@Override // androidx.datastore.preferences.protobuf.BytesValueOrBuilder
public ByteString getValue() {
return ((BytesValue) this.instance).getValue();
}
public Builder setValue(ByteString byteString) {
copyOnWrite();
((BytesValue) this.instance).setValue(byteString);
return this;
}
public Builder clearValue() {
copyOnWrite();
((BytesValue) this.instance).clearValue();
return this;
}
}
/* renamed from: androidx.datastore.preferences.protobuf.BytesValue$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke;
static {
int[] iArr = new int[GeneratedMessageLite.MethodToInvoke.values().length];
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke = iArr;
try {
iArr[GeneratedMessageLite.MethodToInvoke.NEW_MUTABLE_INSTANCE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.NEW_BUILDER.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.BUILD_MESSAGE_INFO.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_DEFAULT_INSTANCE.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_PARSER.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_MEMOIZED_IS_INITIALIZED.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.SET_MEMOIZED_IS_INITIALIZED.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
}
}
@Override // androidx.datastore.preferences.protobuf.GeneratedMessageLite
public final Object dynamicMethod(GeneratedMessageLite.MethodToInvoke methodToInvoke, Object obj, Object obj2) {
AnonymousClass1 anonymousClass1 = null;
switch (AnonymousClass1.$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[methodToInvoke.ordinal()]) {
case 1:
return new BytesValue();
case 2:
return new Builder(anonymousClass1);
case 3:
return GeneratedMessageLite.newMessageInfo(DEFAULT_INSTANCE, "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\n", new Object[]{"value_"});
case 4:
return DEFAULT_INSTANCE;
case 5:
Parser<BytesValue> parser = PARSER;
if (parser == null) {
synchronized (BytesValue.class) {
try {
parser = PARSER;
if (parser == null) {
parser = new GeneratedMessageLite.DefaultInstanceBasedParser<>(DEFAULT_INSTANCE);
PARSER = parser;
}
} finally {
}
}
}
return parser;
case 6:
return (byte) 1;
case 7:
return null;
default:
throw new UnsupportedOperationException();
}
}
static {
BytesValue bytesValue = new BytesValue();
DEFAULT_INSTANCE = bytesValue;
GeneratedMessageLite.registerDefaultInstance(BytesValue.class, bytesValue);
}
public static BytesValue of(ByteString byteString) {
return newBuilder().setValue(byteString).build();
}
public static Parser<BytesValue> parser() {
return DEFAULT_INSTANCE.getParserForType();
}
}

View File

@@ -0,0 +1,6 @@
package androidx.datastore.preferences.protobuf;
/* loaded from: classes.dex */
public interface BytesValueOrBuilder extends MessageLiteOrBuilder {
ByteString getValue();
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,691 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.MapEntryLite;
import androidx.datastore.preferences.protobuf.WireFormat;
import androidx.datastore.preferences.protobuf.Writer;
import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/* loaded from: classes.dex */
final class CodedOutputStreamWriter implements Writer {
private final CodedOutputStream output;
public static CodedOutputStreamWriter forCodedOutput(CodedOutputStream codedOutputStream) {
CodedOutputStreamWriter codedOutputStreamWriter = codedOutputStream.wrapper;
return codedOutputStreamWriter != null ? codedOutputStreamWriter : new CodedOutputStreamWriter(codedOutputStream);
}
private CodedOutputStreamWriter(CodedOutputStream codedOutputStream) {
CodedOutputStream codedOutputStream2 = (CodedOutputStream) Internal.checkNotNull(codedOutputStream, "output");
this.output = codedOutputStream2;
codedOutputStream2.wrapper = this;
}
@Override // androidx.datastore.preferences.protobuf.Writer
public Writer.FieldOrder fieldOrder() {
return Writer.FieldOrder.ASCENDING;
}
public int getTotalBytesWritten() {
return this.output.getTotalBytesWritten();
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeSFixed32(int i, int i2) throws IOException {
this.output.writeSFixed32(i, i2);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeInt64(int i, long j) throws IOException {
this.output.writeInt64(i, j);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeSFixed64(int i, long j) throws IOException {
this.output.writeSFixed64(i, j);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeFloat(int i, float f) throws IOException {
this.output.writeFloat(i, f);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeDouble(int i, double d) throws IOException {
this.output.writeDouble(i, d);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeEnum(int i, int i2) throws IOException {
this.output.writeEnum(i, i2);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeUInt64(int i, long j) throws IOException {
this.output.writeUInt64(i, j);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeInt32(int i, int i2) throws IOException {
this.output.writeInt32(i, i2);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeFixed64(int i, long j) throws IOException {
this.output.writeFixed64(i, j);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeFixed32(int i, int i2) throws IOException {
this.output.writeFixed32(i, i2);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeBool(int i, boolean z) throws IOException {
this.output.writeBool(i, z);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeString(int i, String str) throws IOException {
this.output.writeString(i, str);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeBytes(int i, ByteString byteString) throws IOException {
this.output.writeBytes(i, byteString);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeUInt32(int i, int i2) throws IOException {
this.output.writeUInt32(i, i2);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeSInt32(int i, int i2) throws IOException {
this.output.writeSInt32(i, i2);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeSInt64(int i, long j) throws IOException {
this.output.writeSInt64(i, j);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeMessage(int i, Object obj) throws IOException {
this.output.writeMessage(i, (MessageLite) obj);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeMessage(int i, Object obj, Schema schema) throws IOException {
this.output.writeMessage(i, (MessageLite) obj, schema);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeGroup(int i, Object obj) throws IOException {
this.output.writeGroup(i, (MessageLite) obj);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeGroup(int i, Object obj, Schema schema) throws IOException {
this.output.writeGroup(i, (MessageLite) obj, schema);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeStartGroup(int i) throws IOException {
this.output.writeTag(i, 3);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeEndGroup(int i) throws IOException {
this.output.writeTag(i, 4);
}
@Override // androidx.datastore.preferences.protobuf.Writer
public final void writeMessageSetItem(int i, Object obj) throws IOException {
if (obj instanceof ByteString) {
this.output.writeRawMessageSetExtension(i, (ByteString) obj);
} else {
this.output.writeMessageSetExtension(i, (MessageLite) obj);
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeInt32List(int i, List<Integer> list, boolean z) throws IOException {
int i2 = 0;
if (z) {
this.output.writeTag(i, 2);
int i3 = 0;
for (int i4 = 0; i4 < list.size(); i4++) {
i3 += CodedOutputStream.computeInt32SizeNoTag(list.get(i4).intValue());
}
this.output.writeUInt32NoTag(i3);
while (i2 < list.size()) {
this.output.writeInt32NoTag(list.get(i2).intValue());
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeInt32(i, list.get(i2).intValue());
i2++;
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeFixed32List(int i, List<Integer> list, boolean z) throws IOException {
int i2 = 0;
if (z) {
this.output.writeTag(i, 2);
int i3 = 0;
for (int i4 = 0; i4 < list.size(); i4++) {
i3 += CodedOutputStream.computeFixed32SizeNoTag(list.get(i4).intValue());
}
this.output.writeUInt32NoTag(i3);
while (i2 < list.size()) {
this.output.writeFixed32NoTag(list.get(i2).intValue());
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeFixed32(i, list.get(i2).intValue());
i2++;
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeInt64List(int i, List<Long> list, boolean z) throws IOException {
int i2 = 0;
if (z) {
this.output.writeTag(i, 2);
int i3 = 0;
for (int i4 = 0; i4 < list.size(); i4++) {
i3 += CodedOutputStream.computeInt64SizeNoTag(list.get(i4).longValue());
}
this.output.writeUInt32NoTag(i3);
while (i2 < list.size()) {
this.output.writeInt64NoTag(list.get(i2).longValue());
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeInt64(i, list.get(i2).longValue());
i2++;
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeUInt64List(int i, List<Long> list, boolean z) throws IOException {
int i2 = 0;
if (z) {
this.output.writeTag(i, 2);
int i3 = 0;
for (int i4 = 0; i4 < list.size(); i4++) {
i3 += CodedOutputStream.computeUInt64SizeNoTag(list.get(i4).longValue());
}
this.output.writeUInt32NoTag(i3);
while (i2 < list.size()) {
this.output.writeUInt64NoTag(list.get(i2).longValue());
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeUInt64(i, list.get(i2).longValue());
i2++;
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeFixed64List(int i, List<Long> list, boolean z) throws IOException {
int i2 = 0;
if (z) {
this.output.writeTag(i, 2);
int i3 = 0;
for (int i4 = 0; i4 < list.size(); i4++) {
i3 += CodedOutputStream.computeFixed64SizeNoTag(list.get(i4).longValue());
}
this.output.writeUInt32NoTag(i3);
while (i2 < list.size()) {
this.output.writeFixed64NoTag(list.get(i2).longValue());
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeFixed64(i, list.get(i2).longValue());
i2++;
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeFloatList(int i, List<Float> list, boolean z) throws IOException {
int i2 = 0;
if (z) {
this.output.writeTag(i, 2);
int i3 = 0;
for (int i4 = 0; i4 < list.size(); i4++) {
i3 += CodedOutputStream.computeFloatSizeNoTag(list.get(i4).floatValue());
}
this.output.writeUInt32NoTag(i3);
while (i2 < list.size()) {
this.output.writeFloatNoTag(list.get(i2).floatValue());
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeFloat(i, list.get(i2).floatValue());
i2++;
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeDoubleList(int i, List<Double> list, boolean z) throws IOException {
int i2 = 0;
if (z) {
this.output.writeTag(i, 2);
int i3 = 0;
for (int i4 = 0; i4 < list.size(); i4++) {
i3 += CodedOutputStream.computeDoubleSizeNoTag(list.get(i4).doubleValue());
}
this.output.writeUInt32NoTag(i3);
while (i2 < list.size()) {
this.output.writeDoubleNoTag(list.get(i2).doubleValue());
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeDouble(i, list.get(i2).doubleValue());
i2++;
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeEnumList(int i, List<Integer> list, boolean z) throws IOException {
int i2 = 0;
if (z) {
this.output.writeTag(i, 2);
int i3 = 0;
for (int i4 = 0; i4 < list.size(); i4++) {
i3 += CodedOutputStream.computeEnumSizeNoTag(list.get(i4).intValue());
}
this.output.writeUInt32NoTag(i3);
while (i2 < list.size()) {
this.output.writeEnumNoTag(list.get(i2).intValue());
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeEnum(i, list.get(i2).intValue());
i2++;
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeBoolList(int i, List<Boolean> list, boolean z) throws IOException {
int i2 = 0;
if (z) {
this.output.writeTag(i, 2);
int i3 = 0;
for (int i4 = 0; i4 < list.size(); i4++) {
i3 += CodedOutputStream.computeBoolSizeNoTag(list.get(i4).booleanValue());
}
this.output.writeUInt32NoTag(i3);
while (i2 < list.size()) {
this.output.writeBoolNoTag(list.get(i2).booleanValue());
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeBool(i, list.get(i2).booleanValue());
i2++;
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeStringList(int i, List<String> list) throws IOException {
int i2 = 0;
if (list instanceof LazyStringList) {
LazyStringList lazyStringList = (LazyStringList) list;
while (i2 < list.size()) {
writeLazyString(i, lazyStringList.getRaw(i2));
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeString(i, list.get(i2));
i2++;
}
}
private void writeLazyString(int i, Object obj) throws IOException {
if (obj instanceof String) {
this.output.writeString(i, (String) obj);
} else {
this.output.writeBytes(i, (ByteString) obj);
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeBytesList(int i, List<ByteString> list) throws IOException {
for (int i2 = 0; i2 < list.size(); i2++) {
this.output.writeBytes(i, list.get(i2));
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeUInt32List(int i, List<Integer> list, boolean z) throws IOException {
int i2 = 0;
if (z) {
this.output.writeTag(i, 2);
int i3 = 0;
for (int i4 = 0; i4 < list.size(); i4++) {
i3 += CodedOutputStream.computeUInt32SizeNoTag(list.get(i4).intValue());
}
this.output.writeUInt32NoTag(i3);
while (i2 < list.size()) {
this.output.writeUInt32NoTag(list.get(i2).intValue());
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeUInt32(i, list.get(i2).intValue());
i2++;
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeSFixed32List(int i, List<Integer> list, boolean z) throws IOException {
int i2 = 0;
if (z) {
this.output.writeTag(i, 2);
int i3 = 0;
for (int i4 = 0; i4 < list.size(); i4++) {
i3 += CodedOutputStream.computeSFixed32SizeNoTag(list.get(i4).intValue());
}
this.output.writeUInt32NoTag(i3);
while (i2 < list.size()) {
this.output.writeSFixed32NoTag(list.get(i2).intValue());
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeSFixed32(i, list.get(i2).intValue());
i2++;
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeSFixed64List(int i, List<Long> list, boolean z) throws IOException {
int i2 = 0;
if (z) {
this.output.writeTag(i, 2);
int i3 = 0;
for (int i4 = 0; i4 < list.size(); i4++) {
i3 += CodedOutputStream.computeSFixed64SizeNoTag(list.get(i4).longValue());
}
this.output.writeUInt32NoTag(i3);
while (i2 < list.size()) {
this.output.writeSFixed64NoTag(list.get(i2).longValue());
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeSFixed64(i, list.get(i2).longValue());
i2++;
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeSInt32List(int i, List<Integer> list, boolean z) throws IOException {
int i2 = 0;
if (z) {
this.output.writeTag(i, 2);
int i3 = 0;
for (int i4 = 0; i4 < list.size(); i4++) {
i3 += CodedOutputStream.computeSInt32SizeNoTag(list.get(i4).intValue());
}
this.output.writeUInt32NoTag(i3);
while (i2 < list.size()) {
this.output.writeSInt32NoTag(list.get(i2).intValue());
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeSInt32(i, list.get(i2).intValue());
i2++;
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeSInt64List(int i, List<Long> list, boolean z) throws IOException {
int i2 = 0;
if (z) {
this.output.writeTag(i, 2);
int i3 = 0;
for (int i4 = 0; i4 < list.size(); i4++) {
i3 += CodedOutputStream.computeSInt64SizeNoTag(list.get(i4).longValue());
}
this.output.writeUInt32NoTag(i3);
while (i2 < list.size()) {
this.output.writeSInt64NoTag(list.get(i2).longValue());
i2++;
}
return;
}
while (i2 < list.size()) {
this.output.writeSInt64(i, list.get(i2).longValue());
i2++;
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeMessageList(int i, List<?> list) throws IOException {
for (int i2 = 0; i2 < list.size(); i2++) {
writeMessage(i, list.get(i2));
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeMessageList(int i, List<?> list, Schema schema) throws IOException {
for (int i2 = 0; i2 < list.size(); i2++) {
writeMessage(i, list.get(i2), schema);
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeGroupList(int i, List<?> list) throws IOException {
for (int i2 = 0; i2 < list.size(); i2++) {
writeGroup(i, list.get(i2));
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public void writeGroupList(int i, List<?> list, Schema schema) throws IOException {
for (int i2 = 0; i2 < list.size(); i2++) {
writeGroup(i, list.get(i2), schema);
}
}
@Override // androidx.datastore.preferences.protobuf.Writer
public <K, V> void writeMap(int i, MapEntryLite.Metadata<K, V> metadata, Map<K, V> map) throws IOException {
if (this.output.isSerializationDeterministic()) {
writeDeterministicMap(i, metadata, map);
return;
}
for (Map.Entry<K, V> entry : map.entrySet()) {
this.output.writeTag(i, 2);
this.output.writeUInt32NoTag(MapEntryLite.computeSerializedSize(metadata, entry.getKey(), entry.getValue()));
MapEntryLite.writeTo(this.output, metadata, entry.getKey(), entry.getValue());
}
}
/* renamed from: androidx.datastore.preferences.protobuf.CodedOutputStreamWriter$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$com$google$protobuf$WireFormat$FieldType;
static {
int[] iArr = new int[WireFormat.FieldType.values().length];
$SwitchMap$com$google$protobuf$WireFormat$FieldType = iArr;
try {
iArr[WireFormat.FieldType.BOOL.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.FIXED32.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.INT32.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.SFIXED32.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.SINT32.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.UINT32.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.FIXED64.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.INT64.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.SFIXED64.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.SINT64.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.UINT64.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
$SwitchMap$com$google$protobuf$WireFormat$FieldType[WireFormat.FieldType.STRING.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
}
}
private <K, V> void writeDeterministicMap(int i, MapEntryLite.Metadata<K, V> metadata, Map<K, V> map) throws IOException {
switch (AnonymousClass1.$SwitchMap$com$google$protobuf$WireFormat$FieldType[metadata.keyType.ordinal()]) {
case 1:
V v = map.get(Boolean.FALSE);
if (v != null) {
writeDeterministicBooleanMapEntry(i, false, v, metadata);
}
V v2 = map.get(Boolean.TRUE);
if (v2 != null) {
writeDeterministicBooleanMapEntry(i, true, v2, metadata);
return;
}
return;
case 2:
case 3:
case 4:
case 5:
case 6:
writeDeterministicIntegerMap(i, metadata, map);
return;
case 7:
case 8:
case 9:
case 10:
case 11:
writeDeterministicLongMap(i, metadata, map);
return;
case 12:
writeDeterministicStringMap(i, metadata, map);
return;
default:
throw new IllegalArgumentException("does not support key type: " + metadata.keyType);
}
}
private <V> void writeDeterministicBooleanMapEntry(int i, boolean z, V v, MapEntryLite.Metadata<Boolean, V> metadata) throws IOException {
this.output.writeTag(i, 2);
this.output.writeUInt32NoTag(MapEntryLite.computeSerializedSize(metadata, Boolean.valueOf(z), v));
MapEntryLite.writeTo(this.output, metadata, Boolean.valueOf(z), v);
}
private <V> void writeDeterministicIntegerMap(int i, MapEntryLite.Metadata<Integer, V> metadata, Map<Integer, V> map) throws IOException {
int size = map.size();
int[] iArr = new int[size];
Iterator<Integer> it = map.keySet().iterator();
int i2 = 0;
while (it.hasNext()) {
iArr[i2] = it.next().intValue();
i2++;
}
Arrays.sort(iArr);
for (int i3 = 0; i3 < size; i3++) {
int i4 = iArr[i3];
V v = map.get(Integer.valueOf(i4));
this.output.writeTag(i, 2);
this.output.writeUInt32NoTag(MapEntryLite.computeSerializedSize(metadata, Integer.valueOf(i4), v));
MapEntryLite.writeTo(this.output, metadata, Integer.valueOf(i4), v);
}
}
private <V> void writeDeterministicLongMap(int i, MapEntryLite.Metadata<Long, V> metadata, Map<Long, V> map) throws IOException {
int size = map.size();
long[] jArr = new long[size];
Iterator<Long> it = map.keySet().iterator();
int i2 = 0;
while (it.hasNext()) {
jArr[i2] = it.next().longValue();
i2++;
}
Arrays.sort(jArr);
for (int i3 = 0; i3 < size; i3++) {
long j = jArr[i3];
V v = map.get(Long.valueOf(j));
this.output.writeTag(i, 2);
this.output.writeUInt32NoTag(MapEntryLite.computeSerializedSize(metadata, Long.valueOf(j), v));
MapEntryLite.writeTo(this.output, metadata, Long.valueOf(j), v);
}
}
private <V> void writeDeterministicStringMap(int i, MapEntryLite.Metadata<String, V> metadata, Map<String, V> map) throws IOException {
int size = map.size();
String[] strArr = new String[size];
Iterator<String> it = map.keySet().iterator();
int i2 = 0;
while (it.hasNext()) {
strArr[i2] = it.next();
i2++;
}
Arrays.sort(strArr);
for (int i3 = 0; i3 < size; i3++) {
String str = strArr[i3];
V v = map.get(str);
this.output.writeTag(i, 2);
this.output.writeUInt32NoTag(MapEntryLite.computeSerializedSize(metadata, str, v));
MapEntryLite.writeTo(this.output, metadata, str, v);
}
}
}

View File

@@ -0,0 +1,228 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.Internal;
import java.util.AbstractList;
import java.util.Arrays;
import java.util.Collection;
import java.util.RandomAccess;
/* loaded from: classes.dex */
final class DoubleArrayList extends AbstractProtobufList<Double> implements Internal.DoubleList, RandomAccess, PrimitiveNonBoxingCollection {
private static final DoubleArrayList EMPTY_LIST;
private double[] array;
private int size;
public static DoubleArrayList emptyList() {
return EMPTY_LIST;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public int size() {
return this.size;
}
static {
DoubleArrayList doubleArrayList = new DoubleArrayList(new double[0], 0);
EMPTY_LIST = doubleArrayList;
doubleArrayList.makeImmutable();
}
public DoubleArrayList() {
this(new double[10], 0);
}
private DoubleArrayList(double[] dArr, int i) {
this.array = dArr;
this.size = i;
}
@Override // java.util.AbstractList
public void removeRange(int i, int i2) {
ensureIsMutable();
if (i2 < i) {
throw new IndexOutOfBoundsException("toIndex < fromIndex");
}
double[] dArr = this.array;
System.arraycopy(dArr, i2, dArr, i, this.size - i2);
this.size -= i2 - i;
((AbstractList) this).modCount++;
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractList, java.util.Collection, java.util.List
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof DoubleArrayList)) {
return super.equals(obj);
}
DoubleArrayList doubleArrayList = (DoubleArrayList) obj;
if (this.size != doubleArrayList.size) {
return false;
}
double[] dArr = doubleArrayList.array;
for (int i = 0; i < this.size; i++) {
if (Double.doubleToLongBits(this.array[i]) != Double.doubleToLongBits(dArr[i])) {
return false;
}
}
return true;
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractList, java.util.Collection, java.util.List
public int hashCode() {
int i = 1;
for (int i2 = 0; i2 < this.size; i2++) {
i = (i * 31) + Internal.hashLong(Double.doubleToLongBits(this.array[i2]));
}
return i;
}
@Override // androidx.datastore.preferences.protobuf.Internal.ProtobufList, androidx.datastore.preferences.protobuf.Internal.BooleanList
/* renamed from: mutableCopyWithCapacity */
public Internal.ProtobufList<Double> mutableCopyWithCapacity2(int i) {
if (i < this.size) {
throw new IllegalArgumentException();
}
return new DoubleArrayList(Arrays.copyOf(this.array, i), this.size);
}
@Override // java.util.AbstractList, java.util.List
public Double get(int i) {
return Double.valueOf(getDouble(i));
}
@Override // androidx.datastore.preferences.protobuf.Internal.DoubleList
public double getDouble(int i) {
ensureIndexInRange(i);
return this.array[i];
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractList, java.util.List
public Double set(int i, Double d) {
return Double.valueOf(setDouble(i, d.doubleValue()));
}
@Override // androidx.datastore.preferences.protobuf.Internal.DoubleList
public double setDouble(int i, double d) {
ensureIsMutable();
ensureIndexInRange(i);
double[] dArr = this.array;
double d2 = dArr[i];
dArr[i] = d;
return d2;
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean add(Double d) {
addDouble(d.doubleValue());
return true;
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractList, java.util.List
public void add(int i, Double d) {
addDouble(i, d.doubleValue());
}
@Override // androidx.datastore.preferences.protobuf.Internal.DoubleList
public void addDouble(double d) {
ensureIsMutable();
int i = this.size;
double[] dArr = this.array;
if (i == dArr.length) {
double[] dArr2 = new double[((i * 3) / 2) + 1];
System.arraycopy(dArr, 0, dArr2, 0, i);
this.array = dArr2;
}
double[] dArr3 = this.array;
int i2 = this.size;
this.size = i2 + 1;
dArr3[i2] = d;
}
private void addDouble(int i, double d) {
int i2;
ensureIsMutable();
if (i < 0 || i > (i2 = this.size)) {
throw new IndexOutOfBoundsException(makeOutOfBoundsExceptionMessage(i));
}
double[] dArr = this.array;
if (i2 < dArr.length) {
System.arraycopy(dArr, i, dArr, i + 1, i2 - i);
} else {
double[] dArr2 = new double[((i2 * 3) / 2) + 1];
System.arraycopy(dArr, 0, dArr2, 0, i);
System.arraycopy(this.array, i, dArr2, i + 1, this.size - i);
this.array = dArr2;
}
this.array[i] = d;
this.size++;
((AbstractList) this).modCount++;
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean addAll(Collection<? extends Double> collection) {
ensureIsMutable();
Internal.checkNotNull(collection);
if (!(collection instanceof DoubleArrayList)) {
return super.addAll(collection);
}
DoubleArrayList doubleArrayList = (DoubleArrayList) collection;
int i = doubleArrayList.size;
if (i == 0) {
return false;
}
int i2 = this.size;
if (Integer.MAX_VALUE - i2 < i) {
throw new OutOfMemoryError();
}
int i3 = i2 + i;
double[] dArr = this.array;
if (i3 > dArr.length) {
this.array = Arrays.copyOf(dArr, i3);
}
System.arraycopy(doubleArrayList.array, 0, this.array, this.size, doubleArrayList.size);
this.size = i3;
((AbstractList) this).modCount++;
return true;
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean remove(Object obj) {
ensureIsMutable();
for (int i = 0; i < this.size; i++) {
if (obj.equals(Double.valueOf(this.array[i]))) {
double[] dArr = this.array;
System.arraycopy(dArr, i + 1, dArr, i, (this.size - i) - 1);
this.size--;
((AbstractList) this).modCount++;
return true;
}
}
return false;
}
@Override // androidx.datastore.preferences.protobuf.AbstractProtobufList, java.util.AbstractList, java.util.List
public Double remove(int i) {
ensureIsMutable();
ensureIndexInRange(i);
double[] dArr = this.array;
double d = dArr[i];
if (i < this.size - 1) {
System.arraycopy(dArr, i + 1, dArr, i, (r3 - i) - 1);
}
this.size--;
((AbstractList) this).modCount++;
return Double.valueOf(d);
}
private void ensureIndexInRange(int i) {
if (i < 0 || i >= this.size) {
throw new IndexOutOfBoundsException(makeOutOfBoundsExceptionMessage(i));
}
}
private String makeOutOfBoundsExceptionMessage(int i) {
return "Index:" + i + ", Size:" + this.size;
}
}

View File

@@ -0,0 +1,207 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.GeneratedMessageLite;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
/* loaded from: classes.dex */
public final class DoubleValue extends GeneratedMessageLite<DoubleValue, Builder> implements DoubleValueOrBuilder {
private static final DoubleValue DEFAULT_INSTANCE;
private static volatile Parser<DoubleValue> PARSER = null;
public static final int VALUE_FIELD_NUMBER = 1;
private double value_;
/* JADX INFO: Access modifiers changed from: private */
public void clearValue() {
this.value_ = 0.0d;
}
public static DoubleValue getDefaultInstance() {
return DEFAULT_INSTANCE;
}
/* JADX INFO: Access modifiers changed from: private */
public void setValue(double d) {
this.value_ = d;
}
@Override // androidx.datastore.preferences.protobuf.DoubleValueOrBuilder
public double getValue() {
return this.value_;
}
private DoubleValue() {
}
public static DoubleValue parseFrom(ByteBuffer byteBuffer) throws InvalidProtocolBufferException {
return (DoubleValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer);
}
public static DoubleValue parseFrom(ByteBuffer byteBuffer, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (DoubleValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer, extensionRegistryLite);
}
public static DoubleValue parseFrom(ByteString byteString) throws InvalidProtocolBufferException {
return (DoubleValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString);
}
public static DoubleValue parseFrom(ByteString byteString, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (DoubleValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString, extensionRegistryLite);
}
public static DoubleValue parseFrom(byte[] bArr) throws InvalidProtocolBufferException {
return (DoubleValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr);
}
public static DoubleValue parseFrom(byte[] bArr, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (DoubleValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr, extensionRegistryLite);
}
public static DoubleValue parseFrom(InputStream inputStream) throws IOException {
return (DoubleValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream);
}
public static DoubleValue parseFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (DoubleValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static DoubleValue parseDelimitedFrom(InputStream inputStream) throws IOException {
return (DoubleValue) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream);
}
public static DoubleValue parseDelimitedFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (DoubleValue) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static DoubleValue parseFrom(CodedInputStream codedInputStream) throws IOException {
return (DoubleValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream);
}
public static DoubleValue parseFrom(CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (DoubleValue) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream, extensionRegistryLite);
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.createBuilder();
}
public static Builder newBuilder(DoubleValue doubleValue) {
return DEFAULT_INSTANCE.createBuilder(doubleValue);
}
public static final class Builder extends GeneratedMessageLite.Builder<DoubleValue, Builder> implements DoubleValueOrBuilder {
public /* synthetic */ Builder(AnonymousClass1 anonymousClass1) {
this();
}
private Builder() {
super(DoubleValue.DEFAULT_INSTANCE);
}
@Override // androidx.datastore.preferences.protobuf.DoubleValueOrBuilder
public double getValue() {
return ((DoubleValue) this.instance).getValue();
}
public Builder setValue(double d) {
copyOnWrite();
((DoubleValue) this.instance).setValue(d);
return this;
}
public Builder clearValue() {
copyOnWrite();
((DoubleValue) this.instance).clearValue();
return this;
}
}
/* renamed from: androidx.datastore.preferences.protobuf.DoubleValue$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke;
static {
int[] iArr = new int[GeneratedMessageLite.MethodToInvoke.values().length];
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke = iArr;
try {
iArr[GeneratedMessageLite.MethodToInvoke.NEW_MUTABLE_INSTANCE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.NEW_BUILDER.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.BUILD_MESSAGE_INFO.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_DEFAULT_INSTANCE.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_PARSER.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_MEMOIZED_IS_INITIALIZED.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.SET_MEMOIZED_IS_INITIALIZED.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
}
}
@Override // androidx.datastore.preferences.protobuf.GeneratedMessageLite
public final Object dynamicMethod(GeneratedMessageLite.MethodToInvoke methodToInvoke, Object obj, Object obj2) {
AnonymousClass1 anonymousClass1 = null;
switch (AnonymousClass1.$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[methodToInvoke.ordinal()]) {
case 1:
return new DoubleValue();
case 2:
return new Builder(anonymousClass1);
case 3:
return GeneratedMessageLite.newMessageInfo(DEFAULT_INSTANCE, "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0000", new Object[]{"value_"});
case 4:
return DEFAULT_INSTANCE;
case 5:
Parser<DoubleValue> parser = PARSER;
if (parser == null) {
synchronized (DoubleValue.class) {
try {
parser = PARSER;
if (parser == null) {
parser = new GeneratedMessageLite.DefaultInstanceBasedParser<>(DEFAULT_INSTANCE);
PARSER = parser;
}
} finally {
}
}
}
return parser;
case 6:
return (byte) 1;
case 7:
return null;
default:
throw new UnsupportedOperationException();
}
}
static {
DoubleValue doubleValue = new DoubleValue();
DEFAULT_INSTANCE = doubleValue;
GeneratedMessageLite.registerDefaultInstance(DoubleValue.class, doubleValue);
}
public static DoubleValue of(double d) {
return newBuilder().setValue(d).build();
}
public static Parser<DoubleValue> parser() {
return DEFAULT_INSTANCE.getParserForType();
}
}

View File

@@ -0,0 +1,6 @@
package androidx.datastore.preferences.protobuf;
/* loaded from: classes.dex */
public interface DoubleValueOrBuilder extends MessageLiteOrBuilder {
double getValue();
}

View File

@@ -0,0 +1,237 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.GeneratedMessageLite;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
/* loaded from: classes.dex */
public final class Duration extends GeneratedMessageLite<Duration, Builder> implements DurationOrBuilder {
private static final Duration DEFAULT_INSTANCE;
public static final int NANOS_FIELD_NUMBER = 2;
private static volatile Parser<Duration> PARSER = null;
public static final int SECONDS_FIELD_NUMBER = 1;
private int nanos_;
private long seconds_;
/* JADX INFO: Access modifiers changed from: private */
public void clearNanos() {
this.nanos_ = 0;
}
/* JADX INFO: Access modifiers changed from: private */
public void clearSeconds() {
this.seconds_ = 0L;
}
public static Duration getDefaultInstance() {
return DEFAULT_INSTANCE;
}
/* JADX INFO: Access modifiers changed from: private */
public void setNanos(int i) {
this.nanos_ = i;
}
/* JADX INFO: Access modifiers changed from: private */
public void setSeconds(long j) {
this.seconds_ = j;
}
@Override // androidx.datastore.preferences.protobuf.DurationOrBuilder
public int getNanos() {
return this.nanos_;
}
@Override // androidx.datastore.preferences.protobuf.DurationOrBuilder
public long getSeconds() {
return this.seconds_;
}
private Duration() {
}
public static Duration parseFrom(ByteBuffer byteBuffer) throws InvalidProtocolBufferException {
return (Duration) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer);
}
public static Duration parseFrom(ByteBuffer byteBuffer, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Duration) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer, extensionRegistryLite);
}
public static Duration parseFrom(ByteString byteString) throws InvalidProtocolBufferException {
return (Duration) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString);
}
public static Duration parseFrom(ByteString byteString, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Duration) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString, extensionRegistryLite);
}
public static Duration parseFrom(byte[] bArr) throws InvalidProtocolBufferException {
return (Duration) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr);
}
public static Duration parseFrom(byte[] bArr, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Duration) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr, extensionRegistryLite);
}
public static Duration parseFrom(InputStream inputStream) throws IOException {
return (Duration) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream);
}
public static Duration parseFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Duration) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static Duration parseDelimitedFrom(InputStream inputStream) throws IOException {
return (Duration) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream);
}
public static Duration parseDelimitedFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Duration) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static Duration parseFrom(CodedInputStream codedInputStream) throws IOException {
return (Duration) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream);
}
public static Duration parseFrom(CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Duration) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream, extensionRegistryLite);
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.createBuilder();
}
public static Builder newBuilder(Duration duration) {
return DEFAULT_INSTANCE.createBuilder(duration);
}
public static final class Builder extends GeneratedMessageLite.Builder<Duration, Builder> implements DurationOrBuilder {
public /* synthetic */ Builder(AnonymousClass1 anonymousClass1) {
this();
}
private Builder() {
super(Duration.DEFAULT_INSTANCE);
}
@Override // androidx.datastore.preferences.protobuf.DurationOrBuilder
public long getSeconds() {
return ((Duration) this.instance).getSeconds();
}
public Builder setSeconds(long j) {
copyOnWrite();
((Duration) this.instance).setSeconds(j);
return this;
}
public Builder clearSeconds() {
copyOnWrite();
((Duration) this.instance).clearSeconds();
return this;
}
@Override // androidx.datastore.preferences.protobuf.DurationOrBuilder
public int getNanos() {
return ((Duration) this.instance).getNanos();
}
public Builder setNanos(int i) {
copyOnWrite();
((Duration) this.instance).setNanos(i);
return this;
}
public Builder clearNanos() {
copyOnWrite();
((Duration) this.instance).clearNanos();
return this;
}
}
/* renamed from: androidx.datastore.preferences.protobuf.Duration$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke;
static {
int[] iArr = new int[GeneratedMessageLite.MethodToInvoke.values().length];
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke = iArr;
try {
iArr[GeneratedMessageLite.MethodToInvoke.NEW_MUTABLE_INSTANCE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.NEW_BUILDER.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.BUILD_MESSAGE_INFO.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_DEFAULT_INSTANCE.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_PARSER.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_MEMOIZED_IS_INITIALIZED.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.SET_MEMOIZED_IS_INITIALIZED.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
}
}
@Override // androidx.datastore.preferences.protobuf.GeneratedMessageLite
public final Object dynamicMethod(GeneratedMessageLite.MethodToInvoke methodToInvoke, Object obj, Object obj2) {
AnonymousClass1 anonymousClass1 = null;
switch (AnonymousClass1.$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[methodToInvoke.ordinal()]) {
case 1:
return new Duration();
case 2:
return new Builder(anonymousClass1);
case 3:
return GeneratedMessageLite.newMessageInfo(DEFAULT_INSTANCE, "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0002\u0002\u0004", new Object[]{"seconds_", "nanos_"});
case 4:
return DEFAULT_INSTANCE;
case 5:
Parser<Duration> parser = PARSER;
if (parser == null) {
synchronized (Duration.class) {
try {
parser = PARSER;
if (parser == null) {
parser = new GeneratedMessageLite.DefaultInstanceBasedParser<>(DEFAULT_INSTANCE);
PARSER = parser;
}
} finally {
}
}
}
return parser;
case 6:
return (byte) 1;
case 7:
return null;
default:
throw new UnsupportedOperationException();
}
}
static {
Duration duration = new Duration();
DEFAULT_INSTANCE = duration;
GeneratedMessageLite.registerDefaultInstance(Duration.class, duration);
}
public static Parser<Duration> parser() {
return DEFAULT_INSTANCE.getParserForType();
}
}

View File

@@ -0,0 +1,8 @@
package androidx.datastore.preferences.protobuf;
/* loaded from: classes.dex */
public interface DurationOrBuilder extends MessageLiteOrBuilder {
int getNanos();
long getSeconds();
}

View File

@@ -0,0 +1,10 @@
package androidx.datastore.preferences.protobuf;
/* loaded from: classes.dex */
public final class DurationProto {
public static void registerAllExtensions(ExtensionRegistryLite extensionRegistryLite) {
}
private DurationProto() {
}
}

View File

@@ -0,0 +1,169 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.GeneratedMessageLite;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
/* loaded from: classes.dex */
public final class Empty extends GeneratedMessageLite<Empty, Builder> implements EmptyOrBuilder {
private static final Empty DEFAULT_INSTANCE;
private static volatile Parser<Empty> PARSER;
public static Empty getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private Empty() {
}
public static Empty parseFrom(ByteBuffer byteBuffer) throws InvalidProtocolBufferException {
return (Empty) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer);
}
public static Empty parseFrom(ByteBuffer byteBuffer, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Empty) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer, extensionRegistryLite);
}
public static Empty parseFrom(ByteString byteString) throws InvalidProtocolBufferException {
return (Empty) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString);
}
public static Empty parseFrom(ByteString byteString, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Empty) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString, extensionRegistryLite);
}
public static Empty parseFrom(byte[] bArr) throws InvalidProtocolBufferException {
return (Empty) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr);
}
public static Empty parseFrom(byte[] bArr, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Empty) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr, extensionRegistryLite);
}
public static Empty parseFrom(InputStream inputStream) throws IOException {
return (Empty) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream);
}
public static Empty parseFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Empty) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static Empty parseDelimitedFrom(InputStream inputStream) throws IOException {
return (Empty) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream);
}
public static Empty parseDelimitedFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Empty) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static Empty parseFrom(CodedInputStream codedInputStream) throws IOException {
return (Empty) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream);
}
public static Empty parseFrom(CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Empty) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream, extensionRegistryLite);
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.createBuilder();
}
public static Builder newBuilder(Empty empty) {
return DEFAULT_INSTANCE.createBuilder(empty);
}
public static final class Builder extends GeneratedMessageLite.Builder<Empty, Builder> implements EmptyOrBuilder {
public /* synthetic */ Builder(AnonymousClass1 anonymousClass1) {
this();
}
private Builder() {
super(Empty.DEFAULT_INSTANCE);
}
}
/* renamed from: androidx.datastore.preferences.protobuf.Empty$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke;
static {
int[] iArr = new int[GeneratedMessageLite.MethodToInvoke.values().length];
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke = iArr;
try {
iArr[GeneratedMessageLite.MethodToInvoke.NEW_MUTABLE_INSTANCE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.NEW_BUILDER.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.BUILD_MESSAGE_INFO.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_DEFAULT_INSTANCE.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_PARSER.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_MEMOIZED_IS_INITIALIZED.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.SET_MEMOIZED_IS_INITIALIZED.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
}
}
@Override // androidx.datastore.preferences.protobuf.GeneratedMessageLite
public final Object dynamicMethod(GeneratedMessageLite.MethodToInvoke methodToInvoke, Object obj, Object obj2) {
AnonymousClass1 anonymousClass1 = null;
switch (AnonymousClass1.$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[methodToInvoke.ordinal()]) {
case 1:
return new Empty();
case 2:
return new Builder(anonymousClass1);
case 3:
return GeneratedMessageLite.newMessageInfo(DEFAULT_INSTANCE, "\u0000\u0000", null);
case 4:
return DEFAULT_INSTANCE;
case 5:
Parser<Empty> parser = PARSER;
if (parser == null) {
synchronized (Empty.class) {
try {
parser = PARSER;
if (parser == null) {
parser = new GeneratedMessageLite.DefaultInstanceBasedParser<>(DEFAULT_INSTANCE);
PARSER = parser;
}
} finally {
}
}
}
return parser;
case 6:
return (byte) 1;
case 7:
return null;
default:
throw new UnsupportedOperationException();
}
}
static {
Empty empty = new Empty();
DEFAULT_INSTANCE = empty;
GeneratedMessageLite.registerDefaultInstance(Empty.class, empty);
}
public static Parser<Empty> parser() {
return DEFAULT_INSTANCE.getParserForType();
}
}

View File

@@ -0,0 +1,5 @@
package androidx.datastore.preferences.protobuf;
/* loaded from: classes.dex */
public interface EmptyOrBuilder extends MessageLiteOrBuilder {
}

View File

@@ -0,0 +1,10 @@
package androidx.datastore.preferences.protobuf;
/* loaded from: classes.dex */
public final class EmptyProto {
public static void registerAllExtensions(ExtensionRegistryLite extensionRegistryLite) {
}
private EmptyProto() {
}
}

View File

@@ -0,0 +1,678 @@
package androidx.datastore.preferences.protobuf;
import androidx.datastore.preferences.protobuf.EnumValue;
import androidx.datastore.preferences.protobuf.GeneratedMessageLite;
import androidx.datastore.preferences.protobuf.Internal;
import androidx.datastore.preferences.protobuf.Option;
import androidx.datastore.preferences.protobuf.SourceContext;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.Collections;
import java.util.List;
/* loaded from: classes.dex */
public final class Enum extends GeneratedMessageLite<Enum, Builder> implements EnumOrBuilder {
private static final Enum DEFAULT_INSTANCE;
public static final int ENUMVALUE_FIELD_NUMBER = 2;
public static final int NAME_FIELD_NUMBER = 1;
public static final int OPTIONS_FIELD_NUMBER = 3;
private static volatile Parser<Enum> PARSER = null;
public static final int SOURCE_CONTEXT_FIELD_NUMBER = 4;
public static final int SYNTAX_FIELD_NUMBER = 5;
private SourceContext sourceContext_;
private int syntax_;
private String name_ = "";
private Internal.ProtobufList<EnumValue> enumvalue_ = GeneratedMessageLite.emptyProtobufList();
private Internal.ProtobufList<Option> options_ = GeneratedMessageLite.emptyProtobufList();
/* JADX INFO: Access modifiers changed from: private */
public void clearSourceContext() {
this.sourceContext_ = null;
}
/* JADX INFO: Access modifiers changed from: private */
public void clearSyntax() {
this.syntax_ = 0;
}
public static Enum getDefaultInstance() {
return DEFAULT_INSTANCE;
}
/* JADX INFO: Access modifiers changed from: private */
public void setSyntaxValue(int i) {
this.syntax_ = i;
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public List<EnumValue> getEnumvalueList() {
return this.enumvalue_;
}
public List<? extends EnumValueOrBuilder> getEnumvalueOrBuilderList() {
return this.enumvalue_;
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public String getName() {
return this.name_;
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public List<Option> getOptionsList() {
return this.options_;
}
public List<? extends OptionOrBuilder> getOptionsOrBuilderList() {
return this.options_;
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public int getSyntaxValue() {
return this.syntax_;
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public boolean hasSourceContext() {
return this.sourceContext_ != null;
}
private Enum() {
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public ByteString getNameBytes() {
return ByteString.copyFromUtf8(this.name_);
}
/* JADX INFO: Access modifiers changed from: private */
public void setName(String str) {
str.getClass();
this.name_ = str;
}
/* JADX INFO: Access modifiers changed from: private */
public void clearName() {
this.name_ = getDefaultInstance().getName();
}
/* JADX INFO: Access modifiers changed from: private */
public void setNameBytes(ByteString byteString) {
byteString.getClass();
AbstractMessageLite.checkByteStringIsUtf8(byteString);
this.name_ = byteString.toStringUtf8();
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public int getEnumvalueCount() {
return this.enumvalue_.size();
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public EnumValue getEnumvalue(int i) {
return this.enumvalue_.get(i);
}
public EnumValueOrBuilder getEnumvalueOrBuilder(int i) {
return this.enumvalue_.get(i);
}
private void ensureEnumvalueIsMutable() {
if (this.enumvalue_.isModifiable()) {
return;
}
this.enumvalue_ = GeneratedMessageLite.mutableCopy(this.enumvalue_);
}
/* JADX INFO: Access modifiers changed from: private */
public void setEnumvalue(int i, EnumValue enumValue) {
enumValue.getClass();
ensureEnumvalueIsMutable();
this.enumvalue_.set(i, enumValue);
}
/* JADX INFO: Access modifiers changed from: private */
public void setEnumvalue(int i, EnumValue.Builder builder) {
ensureEnumvalueIsMutable();
this.enumvalue_.set(i, builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addEnumvalue(EnumValue enumValue) {
enumValue.getClass();
ensureEnumvalueIsMutable();
this.enumvalue_.add(enumValue);
}
/* JADX INFO: Access modifiers changed from: private */
public void addEnumvalue(int i, EnumValue enumValue) {
enumValue.getClass();
ensureEnumvalueIsMutable();
this.enumvalue_.add(i, enumValue);
}
/* JADX INFO: Access modifiers changed from: private */
public void addEnumvalue(EnumValue.Builder builder) {
ensureEnumvalueIsMutable();
this.enumvalue_.add(builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addEnumvalue(int i, EnumValue.Builder builder) {
ensureEnumvalueIsMutable();
this.enumvalue_.add(i, builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addAllEnumvalue(Iterable<? extends EnumValue> iterable) {
ensureEnumvalueIsMutable();
AbstractMessageLite.addAll((Iterable) iterable, (List) this.enumvalue_);
}
/* JADX INFO: Access modifiers changed from: private */
public void clearEnumvalue() {
this.enumvalue_ = GeneratedMessageLite.emptyProtobufList();
}
/* JADX INFO: Access modifiers changed from: private */
public void removeEnumvalue(int i) {
ensureEnumvalueIsMutable();
this.enumvalue_.remove(i);
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public int getOptionsCount() {
return this.options_.size();
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public Option getOptions(int i) {
return this.options_.get(i);
}
public OptionOrBuilder getOptionsOrBuilder(int i) {
return this.options_.get(i);
}
private void ensureOptionsIsMutable() {
if (this.options_.isModifiable()) {
return;
}
this.options_ = GeneratedMessageLite.mutableCopy(this.options_);
}
/* JADX INFO: Access modifiers changed from: private */
public void setOptions(int i, Option option) {
option.getClass();
ensureOptionsIsMutable();
this.options_.set(i, option);
}
/* JADX INFO: Access modifiers changed from: private */
public void setOptions(int i, Option.Builder builder) {
ensureOptionsIsMutable();
this.options_.set(i, builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addOptions(Option option) {
option.getClass();
ensureOptionsIsMutable();
this.options_.add(option);
}
/* JADX INFO: Access modifiers changed from: private */
public void addOptions(int i, Option option) {
option.getClass();
ensureOptionsIsMutable();
this.options_.add(i, option);
}
/* JADX INFO: Access modifiers changed from: private */
public void addOptions(Option.Builder builder) {
ensureOptionsIsMutable();
this.options_.add(builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addOptions(int i, Option.Builder builder) {
ensureOptionsIsMutable();
this.options_.add(i, builder.build());
}
/* JADX INFO: Access modifiers changed from: private */
public void addAllOptions(Iterable<? extends Option> iterable) {
ensureOptionsIsMutable();
AbstractMessageLite.addAll((Iterable) iterable, (List) this.options_);
}
/* JADX INFO: Access modifiers changed from: private */
public void clearOptions() {
this.options_ = GeneratedMessageLite.emptyProtobufList();
}
/* JADX INFO: Access modifiers changed from: private */
public void removeOptions(int i) {
ensureOptionsIsMutable();
this.options_.remove(i);
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public SourceContext getSourceContext() {
SourceContext sourceContext = this.sourceContext_;
return sourceContext == null ? SourceContext.getDefaultInstance() : sourceContext;
}
/* JADX INFO: Access modifiers changed from: private */
public void setSourceContext(SourceContext sourceContext) {
sourceContext.getClass();
this.sourceContext_ = sourceContext;
}
/* JADX INFO: Access modifiers changed from: private */
public void setSourceContext(SourceContext.Builder builder) {
this.sourceContext_ = builder.build();
}
/* JADX INFO: Access modifiers changed from: private */
public void mergeSourceContext(SourceContext sourceContext) {
sourceContext.getClass();
SourceContext sourceContext2 = this.sourceContext_;
if (sourceContext2 == null || sourceContext2 == SourceContext.getDefaultInstance()) {
this.sourceContext_ = sourceContext;
} else {
this.sourceContext_ = SourceContext.newBuilder(this.sourceContext_).mergeFrom((SourceContext.Builder) sourceContext).buildPartial();
}
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public Syntax getSyntax() {
Syntax forNumber = Syntax.forNumber(this.syntax_);
return forNumber == null ? Syntax.UNRECOGNIZED : forNumber;
}
/* JADX INFO: Access modifiers changed from: private */
public void setSyntax(Syntax syntax) {
syntax.getClass();
this.syntax_ = syntax.getNumber();
}
public static Enum parseFrom(ByteBuffer byteBuffer) throws InvalidProtocolBufferException {
return (Enum) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer);
}
public static Enum parseFrom(ByteBuffer byteBuffer, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Enum) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteBuffer, extensionRegistryLite);
}
public static Enum parseFrom(ByteString byteString) throws InvalidProtocolBufferException {
return (Enum) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString);
}
public static Enum parseFrom(ByteString byteString, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Enum) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, byteString, extensionRegistryLite);
}
public static Enum parseFrom(byte[] bArr) throws InvalidProtocolBufferException {
return (Enum) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr);
}
public static Enum parseFrom(byte[] bArr, ExtensionRegistryLite extensionRegistryLite) throws InvalidProtocolBufferException {
return (Enum) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, bArr, extensionRegistryLite);
}
public static Enum parseFrom(InputStream inputStream) throws IOException {
return (Enum) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream);
}
public static Enum parseFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Enum) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static Enum parseDelimitedFrom(InputStream inputStream) throws IOException {
return (Enum) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream);
}
public static Enum parseDelimitedFrom(InputStream inputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Enum) GeneratedMessageLite.parseDelimitedFrom(DEFAULT_INSTANCE, inputStream, extensionRegistryLite);
}
public static Enum parseFrom(CodedInputStream codedInputStream) throws IOException {
return (Enum) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream);
}
public static Enum parseFrom(CodedInputStream codedInputStream, ExtensionRegistryLite extensionRegistryLite) throws IOException {
return (Enum) GeneratedMessageLite.parseFrom(DEFAULT_INSTANCE, codedInputStream, extensionRegistryLite);
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.createBuilder();
}
public static Builder newBuilder(Enum r1) {
return DEFAULT_INSTANCE.createBuilder(r1);
}
public static final class Builder extends GeneratedMessageLite.Builder<Enum, Builder> implements EnumOrBuilder {
public /* synthetic */ Builder(AnonymousClass1 anonymousClass1) {
this();
}
private Builder() {
super(Enum.DEFAULT_INSTANCE);
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public String getName() {
return ((Enum) this.instance).getName();
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public ByteString getNameBytes() {
return ((Enum) this.instance).getNameBytes();
}
public Builder setName(String str) {
copyOnWrite();
((Enum) this.instance).setName(str);
return this;
}
public Builder clearName() {
copyOnWrite();
((Enum) this.instance).clearName();
return this;
}
public Builder setNameBytes(ByteString byteString) {
copyOnWrite();
((Enum) this.instance).setNameBytes(byteString);
return this;
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public List<EnumValue> getEnumvalueList() {
return Collections.unmodifiableList(((Enum) this.instance).getEnumvalueList());
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public int getEnumvalueCount() {
return ((Enum) this.instance).getEnumvalueCount();
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public EnumValue getEnumvalue(int i) {
return ((Enum) this.instance).getEnumvalue(i);
}
public Builder setEnumvalue(int i, EnumValue enumValue) {
copyOnWrite();
((Enum) this.instance).setEnumvalue(i, enumValue);
return this;
}
public Builder setEnumvalue(int i, EnumValue.Builder builder) {
copyOnWrite();
((Enum) this.instance).setEnumvalue(i, builder);
return this;
}
public Builder addEnumvalue(EnumValue enumValue) {
copyOnWrite();
((Enum) this.instance).addEnumvalue(enumValue);
return this;
}
public Builder addEnumvalue(int i, EnumValue enumValue) {
copyOnWrite();
((Enum) this.instance).addEnumvalue(i, enumValue);
return this;
}
public Builder addEnumvalue(EnumValue.Builder builder) {
copyOnWrite();
((Enum) this.instance).addEnumvalue(builder);
return this;
}
public Builder addEnumvalue(int i, EnumValue.Builder builder) {
copyOnWrite();
((Enum) this.instance).addEnumvalue(i, builder);
return this;
}
public Builder addAllEnumvalue(Iterable<? extends EnumValue> iterable) {
copyOnWrite();
((Enum) this.instance).addAllEnumvalue(iterable);
return this;
}
public Builder clearEnumvalue() {
copyOnWrite();
((Enum) this.instance).clearEnumvalue();
return this;
}
public Builder removeEnumvalue(int i) {
copyOnWrite();
((Enum) this.instance).removeEnumvalue(i);
return this;
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public List<Option> getOptionsList() {
return Collections.unmodifiableList(((Enum) this.instance).getOptionsList());
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public int getOptionsCount() {
return ((Enum) this.instance).getOptionsCount();
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public Option getOptions(int i) {
return ((Enum) this.instance).getOptions(i);
}
public Builder setOptions(int i, Option option) {
copyOnWrite();
((Enum) this.instance).setOptions(i, option);
return this;
}
public Builder setOptions(int i, Option.Builder builder) {
copyOnWrite();
((Enum) this.instance).setOptions(i, builder);
return this;
}
public Builder addOptions(Option option) {
copyOnWrite();
((Enum) this.instance).addOptions(option);
return this;
}
public Builder addOptions(int i, Option option) {
copyOnWrite();
((Enum) this.instance).addOptions(i, option);
return this;
}
public Builder addOptions(Option.Builder builder) {
copyOnWrite();
((Enum) this.instance).addOptions(builder);
return this;
}
public Builder addOptions(int i, Option.Builder builder) {
copyOnWrite();
((Enum) this.instance).addOptions(i, builder);
return this;
}
public Builder addAllOptions(Iterable<? extends Option> iterable) {
copyOnWrite();
((Enum) this.instance).addAllOptions(iterable);
return this;
}
public Builder clearOptions() {
copyOnWrite();
((Enum) this.instance).clearOptions();
return this;
}
public Builder removeOptions(int i) {
copyOnWrite();
((Enum) this.instance).removeOptions(i);
return this;
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public boolean hasSourceContext() {
return ((Enum) this.instance).hasSourceContext();
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public SourceContext getSourceContext() {
return ((Enum) this.instance).getSourceContext();
}
public Builder setSourceContext(SourceContext sourceContext) {
copyOnWrite();
((Enum) this.instance).setSourceContext(sourceContext);
return this;
}
public Builder setSourceContext(SourceContext.Builder builder) {
copyOnWrite();
((Enum) this.instance).setSourceContext(builder);
return this;
}
public Builder mergeSourceContext(SourceContext sourceContext) {
copyOnWrite();
((Enum) this.instance).mergeSourceContext(sourceContext);
return this;
}
public Builder clearSourceContext() {
copyOnWrite();
((Enum) this.instance).clearSourceContext();
return this;
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public int getSyntaxValue() {
return ((Enum) this.instance).getSyntaxValue();
}
public Builder setSyntaxValue(int i) {
copyOnWrite();
((Enum) this.instance).setSyntaxValue(i);
return this;
}
@Override // androidx.datastore.preferences.protobuf.EnumOrBuilder
public Syntax getSyntax() {
return ((Enum) this.instance).getSyntax();
}
public Builder setSyntax(Syntax syntax) {
copyOnWrite();
((Enum) this.instance).setSyntax(syntax);
return this;
}
public Builder clearSyntax() {
copyOnWrite();
((Enum) this.instance).clearSyntax();
return this;
}
}
/* renamed from: androidx.datastore.preferences.protobuf.Enum$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke;
static {
int[] iArr = new int[GeneratedMessageLite.MethodToInvoke.values().length];
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke = iArr;
try {
iArr[GeneratedMessageLite.MethodToInvoke.NEW_MUTABLE_INSTANCE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.NEW_BUILDER.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.BUILD_MESSAGE_INFO.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_DEFAULT_INSTANCE.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_PARSER.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.GET_MEMOIZED_IS_INITIALIZED.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[GeneratedMessageLite.MethodToInvoke.SET_MEMOIZED_IS_INITIALIZED.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
}
}
@Override // androidx.datastore.preferences.protobuf.GeneratedMessageLite
public final Object dynamicMethod(GeneratedMessageLite.MethodToInvoke methodToInvoke, Object obj, Object obj2) {
AnonymousClass1 anonymousClass1 = null;
switch (AnonymousClass1.$SwitchMap$com$google$protobuf$GeneratedMessageLite$MethodToInvoke[methodToInvoke.ordinal()]) {
case 1:
return new Enum();
case 2:
return new Builder(anonymousClass1);
case 3:
return GeneratedMessageLite.newMessageInfo(DEFAULT_INSTANCE, "\u0000\u0005\u0000\u0000\u0001\u0005\u0005\u0000\u0002\u0000\u0001Ȉ\u0002\u001b\u0003\u001b\u0004\t\u0005\f", new Object[]{"name_", "enumvalue_", EnumValue.class, "options_", Option.class, "sourceContext_", "syntax_"});
case 4:
return DEFAULT_INSTANCE;
case 5:
Parser<Enum> parser = PARSER;
if (parser == null) {
synchronized (Enum.class) {
try {
parser = PARSER;
if (parser == null) {
parser = new GeneratedMessageLite.DefaultInstanceBasedParser<>(DEFAULT_INSTANCE);
PARSER = parser;
}
} finally {
}
}
}
return parser;
case 6:
return (byte) 1;
case 7:
return null;
default:
throw new UnsupportedOperationException();
}
}
static {
Enum r0 = new Enum();
DEFAULT_INSTANCE = r0;
GeneratedMessageLite.registerDefaultInstance(Enum.class, r0);
}
public static Parser<Enum> parser() {
return DEFAULT_INSTANCE.getParserForType();
}
}

View File

@@ -0,0 +1,30 @@
package androidx.datastore.preferences.protobuf;
import java.util.List;
/* loaded from: classes.dex */
public interface EnumOrBuilder extends MessageLiteOrBuilder {
EnumValue getEnumvalue(int i);
int getEnumvalueCount();
List<EnumValue> getEnumvalueList();
String getName();
ByteString getNameBytes();
Option getOptions(int i);
int getOptionsCount();
List<Option> getOptionsList();
SourceContext getSourceContext();
Syntax getSyntax();
int getSyntaxValue();
boolean hasSourceContext();
}

Some files were not shown because too many files have changed in this diff Show More