- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
236 lines
11 KiB
Java
236 lines
11 KiB
Java
package com.google.firebase.sessions.settings;
|
|
|
|
import android.content.Context;
|
|
import android.util.Log;
|
|
import androidx.datastore.core.CorruptionException;
|
|
import androidx.datastore.core.DataStore;
|
|
import androidx.datastore.core.handlers.ReplaceFileCorruptionHandler;
|
|
import androidx.datastore.preferences.PreferenceDataStoreDelegateKt;
|
|
import androidx.datastore.preferences.core.Preferences;
|
|
import androidx.datastore.preferences.core.PreferencesFactory;
|
|
import com.google.firebase.Firebase;
|
|
import com.google.firebase.FirebaseKt;
|
|
import com.google.firebase.installations.FirebaseInstallationsApi;
|
|
import com.google.firebase.sessions.ApplicationInfo;
|
|
import com.google.firebase.sessions.ProcessDetailsProvider;
|
|
import com.google.firebase.sessions.SessionDataStoreConfigs;
|
|
import kotlin.coroutines.CoroutineContext;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.jvm.internal.PropertyReference2Impl;
|
|
import kotlin.jvm.internal.Reflection;
|
|
import kotlin.properties.ReadOnlyProperty;
|
|
import kotlin.reflect.KProperty;
|
|
import kotlin.time.Duration;
|
|
import kotlin.time.DurationKt;
|
|
import kotlin.time.DurationUnit;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public final class SessionsSettings {
|
|
public static final Companion Companion = new Companion(null);
|
|
public static final ReadOnlyProperty dataStore$delegate = PreferenceDataStoreDelegateKt.preferencesDataStore$default(SessionDataStoreConfigs.INSTANCE.getSETTINGS_CONFIG_NAME(), new ReplaceFileCorruptionHandler(new Function1() { // from class: com.google.firebase.sessions.settings.SessionsSettings$Companion$dataStore$2
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public final Preferences invoke(CorruptionException ex) {
|
|
Intrinsics.checkNotNullParameter(ex, "ex");
|
|
Log.w("SessionsSettings", "CorruptionException in settings DataStore in " + ProcessDetailsProvider.INSTANCE.getProcessName$com_google_firebase_firebase_sessions() + '.', ex);
|
|
return PreferencesFactory.createEmpty();
|
|
}
|
|
}), null, null, 12, null);
|
|
public final SettingsProvider localOverrideSettings;
|
|
public final SettingsProvider remoteSettings;
|
|
|
|
public final boolean isValidSamplingRate(double d) {
|
|
return 0.0d <= d && d <= 1.0d;
|
|
}
|
|
|
|
public SessionsSettings(SettingsProvider localOverrideSettings, SettingsProvider remoteSettings) {
|
|
Intrinsics.checkNotNullParameter(localOverrideSettings, "localOverrideSettings");
|
|
Intrinsics.checkNotNullParameter(remoteSettings, "remoteSettings");
|
|
this.localOverrideSettings = localOverrideSettings;
|
|
this.remoteSettings = remoteSettings;
|
|
}
|
|
|
|
public SessionsSettings(Context context, CoroutineContext coroutineContext, CoroutineContext coroutineContext2, FirebaseInstallationsApi firebaseInstallationsApi, ApplicationInfo applicationInfo) {
|
|
this(new LocalOverrideSettings(context), new RemoteSettings(coroutineContext2, firebaseInstallationsApi, applicationInfo, new RemoteSettingsFetcher(applicationInfo, coroutineContext, null, 4, null), Companion.getDataStore(context)));
|
|
}
|
|
|
|
/* JADX WARN: Illegal instructions before constructor call */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public SessionsSettings(com.google.firebase.FirebaseApp r8, kotlin.coroutines.CoroutineContext r9, kotlin.coroutines.CoroutineContext r10, com.google.firebase.installations.FirebaseInstallationsApi r11) {
|
|
/*
|
|
r7 = this;
|
|
java.lang.String r0 = "firebaseApp"
|
|
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r8, r0)
|
|
java.lang.String r0 = "blockingDispatcher"
|
|
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r9, r0)
|
|
java.lang.String r0 = "backgroundDispatcher"
|
|
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r10, r0)
|
|
java.lang.String r0 = "firebaseInstallationsApi"
|
|
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r11, r0)
|
|
android.content.Context r2 = r8.getApplicationContext()
|
|
java.lang.String r0 = "firebaseApp.applicationContext"
|
|
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r2, r0)
|
|
com.google.firebase.sessions.SessionEvents r0 = com.google.firebase.sessions.SessionEvents.INSTANCE
|
|
com.google.firebase.sessions.ApplicationInfo r6 = r0.getApplicationInfo(r8)
|
|
r1 = r7
|
|
r3 = r9
|
|
r4 = r10
|
|
r5 = r11
|
|
r1.<init>(r2, r3, r4, r5, r6)
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.sessions.settings.SessionsSettings.<init>(com.google.firebase.FirebaseApp, kotlin.coroutines.CoroutineContext, kotlin.coroutines.CoroutineContext, com.google.firebase.installations.FirebaseInstallationsApi):void");
|
|
}
|
|
|
|
public final boolean getSessionsEnabled() {
|
|
Boolean sessionEnabled = this.localOverrideSettings.getSessionEnabled();
|
|
if (sessionEnabled != null) {
|
|
return sessionEnabled.booleanValue();
|
|
}
|
|
Boolean sessionEnabled2 = this.remoteSettings.getSessionEnabled();
|
|
if (sessionEnabled2 != null) {
|
|
return sessionEnabled2.booleanValue();
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public final double getSamplingRate() {
|
|
Double samplingRate = this.localOverrideSettings.getSamplingRate();
|
|
if (samplingRate != null) {
|
|
double doubleValue = samplingRate.doubleValue();
|
|
if (isValidSamplingRate(doubleValue)) {
|
|
return doubleValue;
|
|
}
|
|
}
|
|
Double samplingRate2 = this.remoteSettings.getSamplingRate();
|
|
if (samplingRate2 == null) {
|
|
return 1.0d;
|
|
}
|
|
double doubleValue2 = samplingRate2.doubleValue();
|
|
if (isValidSamplingRate(doubleValue2)) {
|
|
return doubleValue2;
|
|
}
|
|
return 1.0d;
|
|
}
|
|
|
|
/* renamed from: getSessionRestartTimeout-UwyO8pc, reason: not valid java name */
|
|
public final long m853getSessionRestartTimeoutUwyO8pc() {
|
|
Duration mo852getSessionRestartTimeoutFghU774 = this.localOverrideSettings.mo852getSessionRestartTimeoutFghU774();
|
|
if (mo852getSessionRestartTimeoutFghU774 != null) {
|
|
long m4102unboximpl = mo852getSessionRestartTimeoutFghU774.m4102unboximpl();
|
|
if (m854isValidSessionRestartTimeoutLRDsOJo(m4102unboximpl)) {
|
|
return m4102unboximpl;
|
|
}
|
|
}
|
|
Duration mo852getSessionRestartTimeoutFghU7742 = this.remoteSettings.mo852getSessionRestartTimeoutFghU774();
|
|
if (mo852getSessionRestartTimeoutFghU7742 != null) {
|
|
long m4102unboximpl2 = mo852getSessionRestartTimeoutFghU7742.m4102unboximpl();
|
|
if (m854isValidSessionRestartTimeoutLRDsOJo(m4102unboximpl2)) {
|
|
return m4102unboximpl2;
|
|
}
|
|
}
|
|
Duration.Companion companion = Duration.Companion;
|
|
return DurationKt.toDuration(30, DurationUnit.MINUTES);
|
|
}
|
|
|
|
/* renamed from: isValidSessionRestartTimeout-LRDsOJo, reason: not valid java name */
|
|
public final boolean m854isValidSessionRestartTimeoutLRDsOJo(long j) {
|
|
return Duration.m4095isPositiveimpl(j) && Duration.m4090isFiniteimpl(j);
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:19:0x005a A[RETURN] */
|
|
/* JADX WARN: Removed duplicated region for block: B:20:0x003c */
|
|
/* JADX WARN: Removed duplicated region for block: B:8:0x0024 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final java.lang.Object updateSettings(kotlin.coroutines.Continuation r6) {
|
|
/*
|
|
r5 = this;
|
|
boolean r0 = r6 instanceof com.google.firebase.sessions.settings.SessionsSettings$updateSettings$1
|
|
if (r0 == 0) goto L13
|
|
r0 = r6
|
|
com.google.firebase.sessions.settings.SessionsSettings$updateSettings$1 r0 = (com.google.firebase.sessions.settings.SessionsSettings$updateSettings$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:
|
|
com.google.firebase.sessions.settings.SessionsSettings$updateSettings$1 r0 = new com.google.firebase.sessions.settings.SessionsSettings$updateSettings$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 = 2
|
|
r4 = 1
|
|
if (r2 == 0) goto L3c
|
|
if (r2 == r4) goto L34
|
|
if (r2 != r3) goto L2c
|
|
kotlin.ResultKt.throwOnFailure(r6)
|
|
goto L5b
|
|
L2c:
|
|
java.lang.IllegalStateException r6 = new java.lang.IllegalStateException
|
|
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
|
|
r6.<init>(r0)
|
|
throw r6
|
|
L34:
|
|
java.lang.Object r2 = r0.L$0
|
|
com.google.firebase.sessions.settings.SessionsSettings r2 = (com.google.firebase.sessions.settings.SessionsSettings) r2
|
|
kotlin.ResultKt.throwOnFailure(r6)
|
|
goto L4d
|
|
L3c:
|
|
kotlin.ResultKt.throwOnFailure(r6)
|
|
com.google.firebase.sessions.settings.SettingsProvider r6 = r5.localOverrideSettings
|
|
r0.L$0 = r5
|
|
r0.label = r4
|
|
java.lang.Object r6 = r6.updateSettings(r0)
|
|
if (r6 != r1) goto L4c
|
|
return r1
|
|
L4c:
|
|
r2 = r5
|
|
L4d:
|
|
com.google.firebase.sessions.settings.SettingsProvider r6 = r2.remoteSettings
|
|
r2 = 0
|
|
r0.L$0 = r2
|
|
r0.label = r3
|
|
java.lang.Object r6 = r6.updateSettings(r0)
|
|
if (r6 != r1) goto L5b
|
|
return r1
|
|
L5b:
|
|
kotlin.Unit r6 = kotlin.Unit.INSTANCE
|
|
return r6
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.sessions.settings.SessionsSettings.updateSettings(kotlin.coroutines.Continuation):java.lang.Object");
|
|
}
|
|
|
|
public static final class Companion {
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {Reflection.property2(new PropertyReference2Impl(Companion.class, "dataStore", "getDataStore(Landroid/content/Context;)Landroidx/datastore/core/DataStore;", 0))};
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public Companion() {
|
|
}
|
|
|
|
public final SessionsSettings getInstance() {
|
|
Object obj = FirebaseKt.getApp(Firebase.INSTANCE).get(SessionsSettings.class);
|
|
Intrinsics.checkNotNullExpressionValue(obj, "Firebase.app[SessionsSettings::class.java]");
|
|
return (SessionsSettings) obj;
|
|
}
|
|
|
|
public final DataStore getDataStore(Context context) {
|
|
return (DataStore) SessionsSettings.dataStore$delegate.getValue(context, $$delegatedProperties[0]);
|
|
}
|
|
}
|
|
}
|