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,72 @@
package com.google.firebase.sessions;
import java.util.List;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public final class AndroidApplicationInfo {
public final String appBuildVersion;
public final List appProcessDetails;
public final ProcessDetails currentProcessDetails;
public final String deviceManufacturer;
public final String packageName;
public final String versionName;
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof AndroidApplicationInfo)) {
return false;
}
AndroidApplicationInfo androidApplicationInfo = (AndroidApplicationInfo) obj;
return Intrinsics.areEqual(this.packageName, androidApplicationInfo.packageName) && Intrinsics.areEqual(this.versionName, androidApplicationInfo.versionName) && Intrinsics.areEqual(this.appBuildVersion, androidApplicationInfo.appBuildVersion) && Intrinsics.areEqual(this.deviceManufacturer, androidApplicationInfo.deviceManufacturer) && Intrinsics.areEqual(this.currentProcessDetails, androidApplicationInfo.currentProcessDetails) && Intrinsics.areEqual(this.appProcessDetails, androidApplicationInfo.appProcessDetails);
}
public final String getAppBuildVersion() {
return this.appBuildVersion;
}
public final List getAppProcessDetails() {
return this.appProcessDetails;
}
public final ProcessDetails getCurrentProcessDetails() {
return this.currentProcessDetails;
}
public final String getDeviceManufacturer() {
return this.deviceManufacturer;
}
public final String getPackageName() {
return this.packageName;
}
public final String getVersionName() {
return this.versionName;
}
public int hashCode() {
return (((((((((this.packageName.hashCode() * 31) + this.versionName.hashCode()) * 31) + this.appBuildVersion.hashCode()) * 31) + this.deviceManufacturer.hashCode()) * 31) + this.currentProcessDetails.hashCode()) * 31) + this.appProcessDetails.hashCode();
}
public String toString() {
return "AndroidApplicationInfo(packageName=" + this.packageName + ", versionName=" + this.versionName + ", appBuildVersion=" + this.appBuildVersion + ", deviceManufacturer=" + this.deviceManufacturer + ", currentProcessDetails=" + this.currentProcessDetails + ", appProcessDetails=" + this.appProcessDetails + ')';
}
public AndroidApplicationInfo(String packageName, String versionName, String appBuildVersion, String deviceManufacturer, ProcessDetails currentProcessDetails, List appProcessDetails) {
Intrinsics.checkNotNullParameter(packageName, "packageName");
Intrinsics.checkNotNullParameter(versionName, "versionName");
Intrinsics.checkNotNullParameter(appBuildVersion, "appBuildVersion");
Intrinsics.checkNotNullParameter(deviceManufacturer, "deviceManufacturer");
Intrinsics.checkNotNullParameter(currentProcessDetails, "currentProcessDetails");
Intrinsics.checkNotNullParameter(appProcessDetails, "appProcessDetails");
this.packageName = packageName;
this.versionName = versionName;
this.appBuildVersion = appBuildVersion;
this.deviceManufacturer = deviceManufacturer;
this.currentProcessDetails = currentProcessDetails;
this.appProcessDetails = appProcessDetails;
}
}

View File

@@ -0,0 +1,71 @@
package com.google.firebase.sessions;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public final class ApplicationInfo {
public final AndroidApplicationInfo androidAppInfo;
public final String appId;
public final String deviceModel;
public final LogEnvironment logEnvironment;
public final String osVersion;
public final String sessionSdkVersion;
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ApplicationInfo)) {
return false;
}
ApplicationInfo applicationInfo = (ApplicationInfo) obj;
return Intrinsics.areEqual(this.appId, applicationInfo.appId) && Intrinsics.areEqual(this.deviceModel, applicationInfo.deviceModel) && Intrinsics.areEqual(this.sessionSdkVersion, applicationInfo.sessionSdkVersion) && Intrinsics.areEqual(this.osVersion, applicationInfo.osVersion) && this.logEnvironment == applicationInfo.logEnvironment && Intrinsics.areEqual(this.androidAppInfo, applicationInfo.androidAppInfo);
}
public final AndroidApplicationInfo getAndroidAppInfo() {
return this.androidAppInfo;
}
public final String getAppId() {
return this.appId;
}
public final String getDeviceModel() {
return this.deviceModel;
}
public final LogEnvironment getLogEnvironment() {
return this.logEnvironment;
}
public final String getOsVersion() {
return this.osVersion;
}
public final String getSessionSdkVersion() {
return this.sessionSdkVersion;
}
public int hashCode() {
return (((((((((this.appId.hashCode() * 31) + this.deviceModel.hashCode()) * 31) + this.sessionSdkVersion.hashCode()) * 31) + this.osVersion.hashCode()) * 31) + this.logEnvironment.hashCode()) * 31) + this.androidAppInfo.hashCode();
}
public String toString() {
return "ApplicationInfo(appId=" + this.appId + ", deviceModel=" + this.deviceModel + ", sessionSdkVersion=" + this.sessionSdkVersion + ", osVersion=" + this.osVersion + ", logEnvironment=" + this.logEnvironment + ", androidAppInfo=" + this.androidAppInfo + ')';
}
public ApplicationInfo(String appId, String deviceModel, String sessionSdkVersion, String osVersion, LogEnvironment logEnvironment, AndroidApplicationInfo androidAppInfo) {
Intrinsics.checkNotNullParameter(appId, "appId");
Intrinsics.checkNotNullParameter(deviceModel, "deviceModel");
Intrinsics.checkNotNullParameter(sessionSdkVersion, "sessionSdkVersion");
Intrinsics.checkNotNullParameter(osVersion, "osVersion");
Intrinsics.checkNotNullParameter(logEnvironment, "logEnvironment");
Intrinsics.checkNotNullParameter(androidAppInfo, "androidAppInfo");
this.appId = appId;
this.deviceModel = deviceModel;
this.sessionSdkVersion = sessionSdkVersion;
this.osVersion = osVersion;
this.logEnvironment = logEnvironment;
this.androidAppInfo = androidAppInfo;
}
}

View File

@@ -0,0 +1,130 @@
package com.google.firebase.sessions;
import com.glu.plugins.gluanalytics.AnalyticsData;
import com.google.firebase.encoders.FieldDescriptor;
import com.google.firebase.encoders.ObjectEncoder;
import com.google.firebase.encoders.ObjectEncoderContext;
import com.google.firebase.encoders.config.Configurator;
import com.google.firebase.encoders.config.EncoderConfig;
import com.unity3d.ads.core.domain.HandleInvocationsFromAdViewer;
/* loaded from: classes3.dex */
public final class AutoSessionEventEncoder implements Configurator {
public static final Configurator CONFIG = new AutoSessionEventEncoder();
@Override // com.google.firebase.encoders.config.Configurator
public void configure(EncoderConfig encoderConfig) {
encoderConfig.registerEncoder(SessionEvent.class, SessionEventEncoder.INSTANCE);
encoderConfig.registerEncoder(SessionInfo.class, SessionInfoEncoder.INSTANCE);
encoderConfig.registerEncoder(DataCollectionStatus.class, DataCollectionStatusEncoder.INSTANCE);
encoderConfig.registerEncoder(ApplicationInfo.class, ApplicationInfoEncoder.INSTANCE);
encoderConfig.registerEncoder(AndroidApplicationInfo.class, AndroidApplicationInfoEncoder.INSTANCE);
encoderConfig.registerEncoder(ProcessDetails.class, ProcessDetailsEncoder.INSTANCE);
}
public static final class SessionEventEncoder implements ObjectEncoder {
public static final SessionEventEncoder INSTANCE = new SessionEventEncoder();
public static final FieldDescriptor EVENTTYPE_DESCRIPTOR = FieldDescriptor.of("eventType");
public static final FieldDescriptor SESSIONDATA_DESCRIPTOR = FieldDescriptor.of("sessionData");
public static final FieldDescriptor APPLICATIONINFO_DESCRIPTOR = FieldDescriptor.of("applicationInfo");
@Override // com.google.firebase.encoders.ObjectEncoder
public void encode(SessionEvent sessionEvent, ObjectEncoderContext objectEncoderContext) {
objectEncoderContext.add(EVENTTYPE_DESCRIPTOR, sessionEvent.getEventType());
objectEncoderContext.add(SESSIONDATA_DESCRIPTOR, sessionEvent.getSessionData());
objectEncoderContext.add(APPLICATIONINFO_DESCRIPTOR, sessionEvent.getApplicationInfo());
}
}
public static final class SessionInfoEncoder implements ObjectEncoder {
public static final SessionInfoEncoder INSTANCE = new SessionInfoEncoder();
public static final FieldDescriptor SESSIONID_DESCRIPTOR = FieldDescriptor.of("sessionId");
public static final FieldDescriptor FIRSTSESSIONID_DESCRIPTOR = FieldDescriptor.of("firstSessionId");
public static final FieldDescriptor SESSIONINDEX_DESCRIPTOR = FieldDescriptor.of("sessionIndex");
public static final FieldDescriptor EVENTTIMESTAMPUS_DESCRIPTOR = FieldDescriptor.of("eventTimestampUs");
public static final FieldDescriptor DATACOLLECTIONSTATUS_DESCRIPTOR = FieldDescriptor.of("dataCollectionStatus");
public static final FieldDescriptor FIREBASEINSTALLATIONID_DESCRIPTOR = FieldDescriptor.of("firebaseInstallationId");
public static final FieldDescriptor FIREBASEAUTHENTICATIONTOKEN_DESCRIPTOR = FieldDescriptor.of("firebaseAuthenticationToken");
@Override // com.google.firebase.encoders.ObjectEncoder
public void encode(SessionInfo sessionInfo, ObjectEncoderContext objectEncoderContext) {
objectEncoderContext.add(SESSIONID_DESCRIPTOR, sessionInfo.getSessionId());
objectEncoderContext.add(FIRSTSESSIONID_DESCRIPTOR, sessionInfo.getFirstSessionId());
objectEncoderContext.add(SESSIONINDEX_DESCRIPTOR, sessionInfo.getSessionIndex());
objectEncoderContext.add(EVENTTIMESTAMPUS_DESCRIPTOR, sessionInfo.getEventTimestampUs());
objectEncoderContext.add(DATACOLLECTIONSTATUS_DESCRIPTOR, sessionInfo.getDataCollectionStatus());
objectEncoderContext.add(FIREBASEINSTALLATIONID_DESCRIPTOR, sessionInfo.getFirebaseInstallationId());
objectEncoderContext.add(FIREBASEAUTHENTICATIONTOKEN_DESCRIPTOR, sessionInfo.getFirebaseAuthenticationToken());
}
}
public static final class DataCollectionStatusEncoder implements ObjectEncoder {
public static final DataCollectionStatusEncoder INSTANCE = new DataCollectionStatusEncoder();
public static final FieldDescriptor PERFORMANCE_DESCRIPTOR = FieldDescriptor.of("performance");
public static final FieldDescriptor CRASHLYTICS_DESCRIPTOR = FieldDescriptor.of("crashlytics");
public static final FieldDescriptor SESSIONSAMPLINGRATE_DESCRIPTOR = FieldDescriptor.of("sessionSamplingRate");
@Override // com.google.firebase.encoders.ObjectEncoder
public void encode(DataCollectionStatus dataCollectionStatus, ObjectEncoderContext objectEncoderContext) {
objectEncoderContext.add(PERFORMANCE_DESCRIPTOR, dataCollectionStatus.getPerformance());
objectEncoderContext.add(CRASHLYTICS_DESCRIPTOR, dataCollectionStatus.getCrashlytics());
objectEncoderContext.add(SESSIONSAMPLINGRATE_DESCRIPTOR, dataCollectionStatus.getSessionSamplingRate());
}
}
public static final class ApplicationInfoEncoder implements ObjectEncoder {
public static final ApplicationInfoEncoder INSTANCE = new ApplicationInfoEncoder();
public static final FieldDescriptor APPID_DESCRIPTOR = FieldDescriptor.of("appId");
public static final FieldDescriptor DEVICEMODEL_DESCRIPTOR = FieldDescriptor.of("deviceModel");
public static final FieldDescriptor SESSIONSDKVERSION_DESCRIPTOR = FieldDescriptor.of("sessionSdkVersion");
public static final FieldDescriptor OSVERSION_DESCRIPTOR = FieldDescriptor.of(AnalyticsData.S_OS_VERSION);
public static final FieldDescriptor LOGENVIRONMENT_DESCRIPTOR = FieldDescriptor.of("logEnvironment");
public static final FieldDescriptor ANDROIDAPPINFO_DESCRIPTOR = FieldDescriptor.of("androidAppInfo");
@Override // com.google.firebase.encoders.ObjectEncoder
public void encode(ApplicationInfo applicationInfo, ObjectEncoderContext objectEncoderContext) {
objectEncoderContext.add(APPID_DESCRIPTOR, applicationInfo.getAppId());
objectEncoderContext.add(DEVICEMODEL_DESCRIPTOR, applicationInfo.getDeviceModel());
objectEncoderContext.add(SESSIONSDKVERSION_DESCRIPTOR, applicationInfo.getSessionSdkVersion());
objectEncoderContext.add(OSVERSION_DESCRIPTOR, applicationInfo.getOsVersion());
objectEncoderContext.add(LOGENVIRONMENT_DESCRIPTOR, applicationInfo.getLogEnvironment());
objectEncoderContext.add(ANDROIDAPPINFO_DESCRIPTOR, applicationInfo.getAndroidAppInfo());
}
}
public static final class AndroidApplicationInfoEncoder implements ObjectEncoder {
public static final AndroidApplicationInfoEncoder INSTANCE = new AndroidApplicationInfoEncoder();
public static final FieldDescriptor PACKAGENAME_DESCRIPTOR = FieldDescriptor.of(HandleInvocationsFromAdViewer.KEY_PACKAGE_NAME);
public static final FieldDescriptor VERSIONNAME_DESCRIPTOR = FieldDescriptor.of("versionName");
public static final FieldDescriptor APPBUILDVERSION_DESCRIPTOR = FieldDescriptor.of("appBuildVersion");
public static final FieldDescriptor DEVICEMANUFACTURER_DESCRIPTOR = FieldDescriptor.of("deviceManufacturer");
public static final FieldDescriptor CURRENTPROCESSDETAILS_DESCRIPTOR = FieldDescriptor.of("currentProcessDetails");
public static final FieldDescriptor APPPROCESSDETAILS_DESCRIPTOR = FieldDescriptor.of("appProcessDetails");
@Override // com.google.firebase.encoders.ObjectEncoder
public void encode(AndroidApplicationInfo androidApplicationInfo, ObjectEncoderContext objectEncoderContext) {
objectEncoderContext.add(PACKAGENAME_DESCRIPTOR, androidApplicationInfo.getPackageName());
objectEncoderContext.add(VERSIONNAME_DESCRIPTOR, androidApplicationInfo.getVersionName());
objectEncoderContext.add(APPBUILDVERSION_DESCRIPTOR, androidApplicationInfo.getAppBuildVersion());
objectEncoderContext.add(DEVICEMANUFACTURER_DESCRIPTOR, androidApplicationInfo.getDeviceManufacturer());
objectEncoderContext.add(CURRENTPROCESSDETAILS_DESCRIPTOR, androidApplicationInfo.getCurrentProcessDetails());
objectEncoderContext.add(APPPROCESSDETAILS_DESCRIPTOR, androidApplicationInfo.getAppProcessDetails());
}
}
public static final class ProcessDetailsEncoder implements ObjectEncoder {
public static final ProcessDetailsEncoder INSTANCE = new ProcessDetailsEncoder();
public static final FieldDescriptor PROCESSNAME_DESCRIPTOR = FieldDescriptor.of("processName");
public static final FieldDescriptor PID_DESCRIPTOR = FieldDescriptor.of("pid");
public static final FieldDescriptor IMPORTANCE_DESCRIPTOR = FieldDescriptor.of("importance");
public static final FieldDescriptor DEFAULTPROCESS_DESCRIPTOR = FieldDescriptor.of("defaultProcess");
@Override // com.google.firebase.encoders.ObjectEncoder
public void encode(ProcessDetails processDetails, ObjectEncoderContext objectEncoderContext) {
objectEncoderContext.add(PROCESSNAME_DESCRIPTOR, processDetails.getProcessName());
objectEncoderContext.add(PID_DESCRIPTOR, processDetails.getPid());
objectEncoderContext.add(IMPORTANCE_DESCRIPTOR, processDetails.getImportance());
objectEncoderContext.add(DEFAULTPROCESS_DESCRIPTOR, processDetails.isDefaultProcess());
}
}
}

View File

@@ -0,0 +1,24 @@
package com.google.firebase.sessions;
import com.google.firebase.encoders.json.NumberedEnum;
/* loaded from: classes3.dex */
public enum DataCollectionState implements NumberedEnum {
COLLECTION_UNKNOWN(0),
COLLECTION_SDK_NOT_INSTALLED(1),
COLLECTION_ENABLED(2),
COLLECTION_DISABLED(3),
COLLECTION_DISABLED_REMOTE(4),
COLLECTION_SAMPLED(5);
private final int number;
@Override // com.google.firebase.encoders.json.NumberedEnum
public int getNumber() {
return this.number;
}
DataCollectionState(int i) {
this.number = i;
}
}

View File

@@ -0,0 +1,49 @@
package com.google.firebase.sessions;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public final class DataCollectionStatus {
public final DataCollectionState crashlytics;
public final DataCollectionState performance;
public final double sessionSamplingRate;
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof DataCollectionStatus)) {
return false;
}
DataCollectionStatus dataCollectionStatus = (DataCollectionStatus) obj;
return this.performance == dataCollectionStatus.performance && this.crashlytics == dataCollectionStatus.crashlytics && Double.compare(this.sessionSamplingRate, dataCollectionStatus.sessionSamplingRate) == 0;
}
public final DataCollectionState getCrashlytics() {
return this.crashlytics;
}
public final DataCollectionState getPerformance() {
return this.performance;
}
public final double getSessionSamplingRate() {
return this.sessionSamplingRate;
}
public int hashCode() {
return (((this.performance.hashCode() * 31) + this.crashlytics.hashCode()) * 31) + Double.hashCode(this.sessionSamplingRate);
}
public String toString() {
return "DataCollectionStatus(performance=" + this.performance + ", crashlytics=" + this.crashlytics + ", sessionSamplingRate=" + this.sessionSamplingRate + ')';
}
public DataCollectionStatus(DataCollectionState performance, DataCollectionState crashlytics, double d) {
Intrinsics.checkNotNullParameter(performance, "performance");
Intrinsics.checkNotNullParameter(crashlytics, "crashlytics");
this.performance = performance;
this.crashlytics = crashlytics;
this.sessionSamplingRate = d;
}
}

View File

@@ -0,0 +1,54 @@
package com.google.firebase.sessions;
import com.google.android.datatransport.Encoding;
import com.google.android.datatransport.Event;
import com.google.android.datatransport.Transformer;
import com.google.android.datatransport.TransportFactory;
import com.google.firebase.inject.Provider;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.Charsets;
/* loaded from: classes3.dex */
public final class EventGDTLogger implements EventGDTLoggerInterface {
public static final Companion Companion = new Companion(null);
public final Provider transportFactoryProvider;
public EventGDTLogger(Provider transportFactoryProvider) {
Intrinsics.checkNotNullParameter(transportFactoryProvider, "transportFactoryProvider");
this.transportFactoryProvider = transportFactoryProvider;
}
@Override // com.google.firebase.sessions.EventGDTLoggerInterface
public void log(SessionEvent sessionEvent) {
Intrinsics.checkNotNullParameter(sessionEvent, "sessionEvent");
((TransportFactory) this.transportFactoryProvider.get()).getTransport("FIREBASE_APPQUALITY_SESSION", SessionEvent.class, Encoding.of("json"), new Transformer() { // from class: com.google.firebase.sessions.EventGDTLogger$$ExternalSyntheticLambda0
@Override // com.google.android.datatransport.Transformer
public final Object apply(Object obj) {
byte[] encode;
encode = EventGDTLogger.this.encode((SessionEvent) obj);
return encode;
}
}).send(Event.ofData(sessionEvent));
}
public final byte[] encode(SessionEvent sessionEvent) {
String encode = SessionEvents.INSTANCE.getSESSION_EVENT_ENCODER$com_google_firebase_firebase_sessions().encode(sessionEvent);
Intrinsics.checkNotNullExpressionValue(encode, "SessionEvents.SESSION_EVENT_ENCODER.encode(value)");
StringBuilder sb = new StringBuilder();
sb.append("Session Event: ");
sb.append(encode);
byte[] bytes = encode.getBytes(Charsets.UTF_8);
Intrinsics.checkNotNullExpressionValue(bytes, "this as java.lang.String).getBytes(charset)");
return bytes;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
}

View File

@@ -0,0 +1,6 @@
package com.google.firebase.sessions;
/* loaded from: classes3.dex */
public interface EventGDTLoggerInterface {
void log(SessionEvent sessionEvent);
}

View File

@@ -0,0 +1,20 @@
package com.google.firebase.sessions;
import com.google.firebase.encoders.json.NumberedEnum;
/* loaded from: classes3.dex */
public enum EventType implements NumberedEnum {
EVENT_TYPE_UNKNOWN(0),
SESSION_START(1);
private final int number;
@Override // com.google.firebase.encoders.json.NumberedEnum
public int getNumber() {
return this.number;
}
EventType(int i) {
this.number = i;
}
}

View File

@@ -0,0 +1,158 @@
package com.google.firebase.sessions;
import android.app.Application;
import android.content.Context;
import android.util.Log;
import com.google.firebase.FirebaseApp;
import com.google.firebase.sessions.settings.SessionsSettings;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.CoroutineScopeKt;
/* loaded from: classes3.dex */
public final class FirebaseSessions {
public static final Companion Companion = new Companion(null);
public final FirebaseApp firebaseApp;
public final SessionsSettings settings;
public FirebaseSessions(FirebaseApp firebaseApp, SessionsSettings settings, CoroutineContext backgroundDispatcher, SessionLifecycleServiceBinder lifecycleServiceBinder) {
Intrinsics.checkNotNullParameter(firebaseApp, "firebaseApp");
Intrinsics.checkNotNullParameter(settings, "settings");
Intrinsics.checkNotNullParameter(backgroundDispatcher, "backgroundDispatcher");
Intrinsics.checkNotNullParameter(lifecycleServiceBinder, "lifecycleServiceBinder");
this.firebaseApp = firebaseApp;
this.settings = settings;
Context applicationContext = firebaseApp.getApplicationContext().getApplicationContext();
if (applicationContext instanceof Application) {
((Application) applicationContext).registerActivityLifecycleCallbacks(SessionsActivityLifecycleCallbacks.INSTANCE);
BuildersKt__Builders_commonKt.launch$default(CoroutineScopeKt.CoroutineScope(backgroundDispatcher), null, null, new AnonymousClass1(backgroundDispatcher, lifecycleServiceBinder, null), 3, null);
return;
}
Log.e("FirebaseSessions", "Failed to register lifecycle callbacks, unexpected context " + applicationContext.getClass() + '.');
}
/* renamed from: com.google.firebase.sessions.FirebaseSessions$1, reason: invalid class name */
public static final class AnonymousClass1 extends SuspendLambda implements Function2 {
public final /* synthetic */ CoroutineContext $backgroundDispatcher;
public final /* synthetic */ SessionLifecycleServiceBinder $lifecycleServiceBinder;
public int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public AnonymousClass1(CoroutineContext coroutineContext, SessionLifecycleServiceBinder sessionLifecycleServiceBinder, Continuation continuation) {
super(2, continuation);
this.$backgroundDispatcher = coroutineContext;
this.$lifecycleServiceBinder = sessionLifecycleServiceBinder;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return FirebaseSessions.this.new AnonymousClass1(this.$backgroundDispatcher, this.$lifecycleServiceBinder, continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((AnonymousClass1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
/* JADX WARN: Removed duplicated region for block: B:8:0x0074 */
@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 r5) {
/*
r4 = this;
java.lang.Object r0 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r1 = r4.label
r2 = 2
r3 = 1
if (r1 == 0) goto L1e
if (r1 == r3) goto L1a
if (r1 != r2) goto L12
kotlin.ResultKt.throwOnFailure(r5)
goto L67
L12:
java.lang.IllegalStateException r5 = new java.lang.IllegalStateException
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
r5.<init>(r0)
throw r5
L1a:
kotlin.ResultKt.throwOnFailure(r5)
goto L2c
L1e:
kotlin.ResultKt.throwOnFailure(r5)
com.google.firebase.sessions.api.FirebaseSessionsDependencies r5 = com.google.firebase.sessions.api.FirebaseSessionsDependencies.INSTANCE
r4.label = r3
java.lang.Object r5 = r5.getRegisteredSubscribers$com_google_firebase_firebase_sessions(r4)
if (r5 != r0) goto L2c
return r0
L2c:
java.util.Map r5 = (java.util.Map) r5
java.util.Collection r5 = r5.values()
java.lang.Iterable r5 = (java.lang.Iterable) r5
boolean r1 = r5 instanceof java.util.Collection
if (r1 == 0) goto L42
r1 = r5
java.util.Collection r1 = (java.util.Collection) r1
boolean r1 = r1.isEmpty()
if (r1 == 0) goto L42
goto L93
L42:
java.util.Iterator r5 = r5.iterator()
L46:
boolean r1 = r5.hasNext()
if (r1 == 0) goto L93
java.lang.Object r1 = r5.next()
com.google.firebase.sessions.api.SessionSubscriber r1 = (com.google.firebase.sessions.api.SessionSubscriber) r1
boolean r1 = r1.isDataCollectionEnabled()
if (r1 == 0) goto L46
com.google.firebase.sessions.FirebaseSessions r5 = com.google.firebase.sessions.FirebaseSessions.this
com.google.firebase.sessions.settings.SessionsSettings r5 = com.google.firebase.sessions.FirebaseSessions.access$getSettings$p(r5)
r4.label = r2
java.lang.Object r5 = r5.updateSettings(r4)
if (r5 != r0) goto L67
return r0
L67:
com.google.firebase.sessions.FirebaseSessions r5 = com.google.firebase.sessions.FirebaseSessions.this
com.google.firebase.sessions.settings.SessionsSettings r5 = com.google.firebase.sessions.FirebaseSessions.access$getSettings$p(r5)
boolean r5 = r5.getSessionsEnabled()
if (r5 != 0) goto L74
goto L93
L74:
com.google.firebase.sessions.SessionLifecycleClient r5 = new com.google.firebase.sessions.SessionLifecycleClient
kotlin.coroutines.CoroutineContext r0 = r4.$backgroundDispatcher
r5.<init>(r0)
com.google.firebase.sessions.SessionLifecycleServiceBinder r0 = r4.$lifecycleServiceBinder
r5.bindToService(r0)
com.google.firebase.sessions.SessionsActivityLifecycleCallbacks r0 = com.google.firebase.sessions.SessionsActivityLifecycleCallbacks.INSTANCE
r0.setLifecycleClient(r5)
com.google.firebase.sessions.FirebaseSessions r5 = com.google.firebase.sessions.FirebaseSessions.this
com.google.firebase.FirebaseApp r5 = com.google.firebase.sessions.FirebaseSessions.access$getFirebaseApp$p(r5)
com.google.firebase.sessions.FirebaseSessions$1$$ExternalSyntheticLambda0 r0 = new com.google.firebase.sessions.FirebaseSessions$1$$ExternalSyntheticLambda0
r0.<init>()
r5.addLifecycleEventListener(r0)
L93:
kotlin.Unit r5 = kotlin.Unit.INSTANCE
return r5
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.sessions.FirebaseSessions.AnonymousClass1.invokeSuspend(java.lang.Object):java.lang.Object");
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
}

View File

@@ -0,0 +1,35 @@
package com.google.firebase.sessions;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public final class FirebaseSessionsData {
public final String sessionId;
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
return (obj instanceof FirebaseSessionsData) && Intrinsics.areEqual(this.sessionId, ((FirebaseSessionsData) obj).sessionId);
}
public final String getSessionId() {
return this.sessionId;
}
public int hashCode() {
String str = this.sessionId;
if (str == null) {
return 0;
}
return str.hashCode();
}
public String toString() {
return "FirebaseSessionsData(sessionId=" + this.sessionId + ')';
}
public FirebaseSessionsData(String str) {
this.sessionId = str;
}
}

View File

@@ -0,0 +1,196 @@
package com.google.firebase.sessions;
import android.content.Context;
import androidx.annotation.Keep;
import com.google.android.datatransport.TransportFactory;
import com.google.firebase.FirebaseApp;
import com.google.firebase.annotations.concurrent.Background;
import com.google.firebase.annotations.concurrent.Blocking;
import com.google.firebase.components.Component;
import com.google.firebase.components.ComponentContainer;
import com.google.firebase.components.ComponentFactory;
import com.google.firebase.components.ComponentRegistrar;
import com.google.firebase.components.Dependency;
import com.google.firebase.components.Qualified;
import com.google.firebase.inject.Provider;
import com.google.firebase.installations.FirebaseInstallationsApi;
import com.google.firebase.platforminfo.LibraryVersionComponent;
import com.google.firebase.sessions.settings.SessionsSettings;
import java.util.List;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.CoroutineDispatcher;
@Keep
/* loaded from: classes3.dex */
public final class FirebaseSessionsRegistrar implements ComponentRegistrar {
private static final Companion Companion = new Companion(null);
private static final String LIBRARY_NAME = "fire-sessions";
private static final Qualified backgroundDispatcher;
private static final Qualified blockingDispatcher;
private static final Qualified firebaseApp;
private static final Qualified firebaseInstallationsApi;
private static final Qualified sessionLifecycleServiceBinder;
private static final Qualified sessionsSettings;
private static final Qualified transportFactory;
@Override // com.google.firebase.components.ComponentRegistrar
public List<Component> getComponents() {
List<Component> listOf;
Component.Builder name = Component.builder(FirebaseSessions.class).name(LIBRARY_NAME);
Qualified qualified = firebaseApp;
Component.Builder add = name.add(Dependency.required(qualified));
Qualified qualified2 = sessionsSettings;
Component.Builder add2 = add.add(Dependency.required(qualified2));
Qualified qualified3 = backgroundDispatcher;
Component build = add2.add(Dependency.required(qualified3)).add(Dependency.required(sessionLifecycleServiceBinder)).factory(new ComponentFactory() { // from class: com.google.firebase.sessions.FirebaseSessionsRegistrar$$ExternalSyntheticLambda0
@Override // com.google.firebase.components.ComponentFactory
public final Object create(ComponentContainer componentContainer) {
FirebaseSessions components$lambda$0;
components$lambda$0 = FirebaseSessionsRegistrar.getComponents$lambda$0(componentContainer);
return components$lambda$0;
}
}).eagerInDefaultApp().build();
Component build2 = Component.builder(SessionGenerator.class).name("session-generator").factory(new ComponentFactory() { // from class: com.google.firebase.sessions.FirebaseSessionsRegistrar$$ExternalSyntheticLambda1
@Override // com.google.firebase.components.ComponentFactory
public final Object create(ComponentContainer componentContainer) {
SessionGenerator components$lambda$1;
components$lambda$1 = FirebaseSessionsRegistrar.getComponents$lambda$1(componentContainer);
return components$lambda$1;
}
}).build();
Component.Builder add3 = Component.builder(SessionFirelogPublisher.class).name("session-publisher").add(Dependency.required(qualified));
Qualified qualified4 = firebaseInstallationsApi;
listOf = CollectionsKt__CollectionsKt.listOf((Object[]) new Component[]{build, build2, add3.add(Dependency.required(qualified4)).add(Dependency.required(qualified2)).add(Dependency.requiredProvider(transportFactory)).add(Dependency.required(qualified3)).factory(new ComponentFactory() { // from class: com.google.firebase.sessions.FirebaseSessionsRegistrar$$ExternalSyntheticLambda2
@Override // com.google.firebase.components.ComponentFactory
public final Object create(ComponentContainer componentContainer) {
SessionFirelogPublisher components$lambda$2;
components$lambda$2 = FirebaseSessionsRegistrar.getComponents$lambda$2(componentContainer);
return components$lambda$2;
}
}).build(), Component.builder(SessionsSettings.class).name("sessions-settings").add(Dependency.required(qualified)).add(Dependency.required(blockingDispatcher)).add(Dependency.required(qualified3)).add(Dependency.required(qualified4)).factory(new ComponentFactory() { // from class: com.google.firebase.sessions.FirebaseSessionsRegistrar$$ExternalSyntheticLambda3
@Override // com.google.firebase.components.ComponentFactory
public final Object create(ComponentContainer componentContainer) {
SessionsSettings components$lambda$3;
components$lambda$3 = FirebaseSessionsRegistrar.getComponents$lambda$3(componentContainer);
return components$lambda$3;
}
}).build(), Component.builder(SessionDatastore.class).name("sessions-datastore").add(Dependency.required(qualified)).add(Dependency.required(qualified3)).factory(new ComponentFactory() { // from class: com.google.firebase.sessions.FirebaseSessionsRegistrar$$ExternalSyntheticLambda4
@Override // com.google.firebase.components.ComponentFactory
public final Object create(ComponentContainer componentContainer) {
SessionDatastore components$lambda$4;
components$lambda$4 = FirebaseSessionsRegistrar.getComponents$lambda$4(componentContainer);
return components$lambda$4;
}
}).build(), Component.builder(SessionLifecycleServiceBinder.class).name("sessions-service-binder").add(Dependency.required(qualified)).factory(new ComponentFactory() { // from class: com.google.firebase.sessions.FirebaseSessionsRegistrar$$ExternalSyntheticLambda5
@Override // com.google.firebase.components.ComponentFactory
public final Object create(ComponentContainer componentContainer) {
SessionLifecycleServiceBinder components$lambda$5;
components$lambda$5 = FirebaseSessionsRegistrar.getComponents$lambda$5(componentContainer);
return components$lambda$5;
}
}).build(), LibraryVersionComponent.create(LIBRARY_NAME, "2.0.1")});
return listOf;
}
/* JADX INFO: Access modifiers changed from: private */
public static final FirebaseSessions getComponents$lambda$0(ComponentContainer componentContainer) {
Object obj = componentContainer.get(firebaseApp);
Intrinsics.checkNotNullExpressionValue(obj, "container[firebaseApp]");
Object obj2 = componentContainer.get(sessionsSettings);
Intrinsics.checkNotNullExpressionValue(obj2, "container[sessionsSettings]");
Object obj3 = componentContainer.get(backgroundDispatcher);
Intrinsics.checkNotNullExpressionValue(obj3, "container[backgroundDispatcher]");
Object obj4 = componentContainer.get(sessionLifecycleServiceBinder);
Intrinsics.checkNotNullExpressionValue(obj4, "container[sessionLifecycleServiceBinder]");
return new FirebaseSessions((FirebaseApp) obj, (SessionsSettings) obj2, (CoroutineContext) obj3, (SessionLifecycleServiceBinder) obj4);
}
/* JADX INFO: Access modifiers changed from: private */
public static final SessionGenerator getComponents$lambda$1(ComponentContainer componentContainer) {
return new SessionGenerator(WallClock.INSTANCE, null, 2, null);
}
/* JADX INFO: Access modifiers changed from: private */
public static final SessionFirelogPublisher getComponents$lambda$2(ComponentContainer componentContainer) {
Object obj = componentContainer.get(firebaseApp);
Intrinsics.checkNotNullExpressionValue(obj, "container[firebaseApp]");
FirebaseApp firebaseApp2 = (FirebaseApp) obj;
Object obj2 = componentContainer.get(firebaseInstallationsApi);
Intrinsics.checkNotNullExpressionValue(obj2, "container[firebaseInstallationsApi]");
FirebaseInstallationsApi firebaseInstallationsApi2 = (FirebaseInstallationsApi) obj2;
Object obj3 = componentContainer.get(sessionsSettings);
Intrinsics.checkNotNullExpressionValue(obj3, "container[sessionsSettings]");
SessionsSettings sessionsSettings2 = (SessionsSettings) obj3;
Provider provider = componentContainer.getProvider(transportFactory);
Intrinsics.checkNotNullExpressionValue(provider, "container.getProvider(transportFactory)");
EventGDTLogger eventGDTLogger = new EventGDTLogger(provider);
Object obj4 = componentContainer.get(backgroundDispatcher);
Intrinsics.checkNotNullExpressionValue(obj4, "container[backgroundDispatcher]");
return new SessionFirelogPublisherImpl(firebaseApp2, firebaseInstallationsApi2, sessionsSettings2, eventGDTLogger, (CoroutineContext) obj4);
}
/* JADX INFO: Access modifiers changed from: private */
public static final SessionsSettings getComponents$lambda$3(ComponentContainer componentContainer) {
Object obj = componentContainer.get(firebaseApp);
Intrinsics.checkNotNullExpressionValue(obj, "container[firebaseApp]");
Object obj2 = componentContainer.get(blockingDispatcher);
Intrinsics.checkNotNullExpressionValue(obj2, "container[blockingDispatcher]");
Object obj3 = componentContainer.get(backgroundDispatcher);
Intrinsics.checkNotNullExpressionValue(obj3, "container[backgroundDispatcher]");
Object obj4 = componentContainer.get(firebaseInstallationsApi);
Intrinsics.checkNotNullExpressionValue(obj4, "container[firebaseInstallationsApi]");
return new SessionsSettings((FirebaseApp) obj, (CoroutineContext) obj2, (CoroutineContext) obj3, (FirebaseInstallationsApi) obj4);
}
/* JADX INFO: Access modifiers changed from: private */
public static final SessionDatastore getComponents$lambda$4(ComponentContainer componentContainer) {
Context applicationContext = ((FirebaseApp) componentContainer.get(firebaseApp)).getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext, "container[firebaseApp].applicationContext");
Object obj = componentContainer.get(backgroundDispatcher);
Intrinsics.checkNotNullExpressionValue(obj, "container[backgroundDispatcher]");
return new SessionDatastoreImpl(applicationContext, (CoroutineContext) obj);
}
/* JADX INFO: Access modifiers changed from: private */
public static final SessionLifecycleServiceBinder getComponents$lambda$5(ComponentContainer componentContainer) {
Object obj = componentContainer.get(firebaseApp);
Intrinsics.checkNotNullExpressionValue(obj, "container[firebaseApp]");
return new SessionLifecycleServiceBinderImpl((FirebaseApp) obj);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
static {
Qualified unqualified = Qualified.unqualified(FirebaseApp.class);
Intrinsics.checkNotNullExpressionValue(unqualified, "unqualified(FirebaseApp::class.java)");
firebaseApp = unqualified;
Qualified unqualified2 = Qualified.unqualified(FirebaseInstallationsApi.class);
Intrinsics.checkNotNullExpressionValue(unqualified2, "unqualified(FirebaseInstallationsApi::class.java)");
firebaseInstallationsApi = unqualified2;
Qualified qualified = Qualified.qualified(Background.class, CoroutineDispatcher.class);
Intrinsics.checkNotNullExpressionValue(qualified, "qualified(Background::cl…neDispatcher::class.java)");
backgroundDispatcher = qualified;
Qualified qualified2 = Qualified.qualified(Blocking.class, CoroutineDispatcher.class);
Intrinsics.checkNotNullExpressionValue(qualified2, "qualified(Blocking::clas…neDispatcher::class.java)");
blockingDispatcher = qualified2;
Qualified unqualified3 = Qualified.unqualified(TransportFactory.class);
Intrinsics.checkNotNullExpressionValue(unqualified3, "unqualified(TransportFactory::class.java)");
transportFactory = unqualified3;
Qualified unqualified4 = Qualified.unqualified(SessionsSettings.class);
Intrinsics.checkNotNullExpressionValue(unqualified4, "unqualified(SessionsSettings::class.java)");
sessionsSettings = unqualified4;
Qualified unqualified5 = Qualified.unqualified(SessionLifecycleServiceBinder.class);
Intrinsics.checkNotNullExpressionValue(unqualified5, "unqualified(SessionLifec…erviceBinder::class.java)");
sessionLifecycleServiceBinder = unqualified5;
}
}

View File

@@ -0,0 +1,26 @@
package com.google.firebase.sessions;
import com.google.firebase.sessions.InstallationId;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
/* loaded from: classes3.dex */
public final class InstallationId$Companion$create$1 extends ContinuationImpl {
public Object L$0;
public int label;
public /* synthetic */ Object result;
public final /* synthetic */ InstallationId.Companion this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public InstallationId$Companion$create$1(InstallationId.Companion companion, Continuation continuation) {
super(continuation);
this.this$0 = companion;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return this.this$0.create(null, this);
}
}

View File

@@ -0,0 +1,171 @@
package com.google.firebase.sessions;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* loaded from: classes3.dex */
public final class InstallationId {
public static final Companion Companion = new Companion(null);
public final String authToken;
public final String fid;
public /* synthetic */ InstallationId(String str, String str2, DefaultConstructorMarker defaultConstructorMarker) {
this(str, str2);
}
public final String getAuthToken() {
return this.authToken;
}
public final String getFid() {
return this.fid;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
/* JADX WARN: Can't wrap try/catch for region: R(15:0|1|(2:3|(12:5|6|7|(1:(1:(6:11|12|13|14|15|16)(2:19|20))(2:21|22))(3:29|30|(1:32))|23|24|25|(1:27)|13|14|15|16))|37|6|7|(0)(0)|23|24|25|(0)|13|14|15|16) */
/* JADX WARN: Code restructure failed: missing block: B:33:0x0046, code lost:
r10 = move-exception;
*/
/* JADX WARN: Code restructure failed: missing block: B:34:0x006f, code lost:
android.util.Log.w("InstallationId", "Error getting authentication token.", r10);
r10 = r9;
r9 = "";
*/
/* JADX WARN: Code restructure failed: missing block: B:35:0x0034, code lost:
r10 = move-exception;
*/
/* JADX WARN: Code restructure failed: missing block: B:36:0x0093, code lost:
android.util.Log.w("InstallationId", "Error getting Firebase installation id .", r10);
r9 = r9;
*/
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Removed duplicated region for block: B:27:0x0089 A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:29:0x0048 */
/* JADX WARN: Removed duplicated region for block: B:9:0x0028 */
/* JADX WARN: Type inference failed for: r9v13, types: [java.lang.String] */
/* JADX WARN: Type inference failed for: r9v16 */
/* JADX WARN: Type inference failed for: r9v17 */
/* JADX WARN: Type inference failed for: r9v3 */
/* JADX WARN: Type inference failed for: r9v4, types: [java.lang.Object] */
/* JADX WARN: Type inference failed for: r9v5, types: [java.lang.String] */
/* JADX WARN: Type inference failed for: r9v8 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object create(com.google.firebase.installations.FirebaseInstallationsApi r9, kotlin.coroutines.Continuation r10) {
/*
r8 = this;
boolean r0 = r10 instanceof com.google.firebase.sessions.InstallationId$Companion$create$1
if (r0 == 0) goto L13
r0 = r10
com.google.firebase.sessions.InstallationId$Companion$create$1 r0 = (com.google.firebase.sessions.InstallationId$Companion$create$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.InstallationId$Companion$create$1 r0 = new com.google.firebase.sessions.InstallationId$Companion$create$1
r0.<init>(r8, r10)
L18:
java.lang.Object r10 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
java.lang.String r3 = ""
java.lang.String r4 = "InstallationId"
r5 = 2
r6 = 1
if (r2 == 0) goto L48
if (r2 == r6) goto L3e
if (r2 != r5) goto L36
java.lang.Object r9 = r0.L$0
java.lang.String r9 = (java.lang.String) r9
kotlin.ResultKt.throwOnFailure(r10) // Catch: java.lang.Exception -> L34
goto L8a
L34:
r10 = move-exception
goto L93
L36:
java.lang.IllegalStateException r9 = new java.lang.IllegalStateException
java.lang.String r10 = "call to 'resume' before 'invoke' with coroutine"
r9.<init>(r10)
throw r9
L3e:
java.lang.Object r9 = r0.L$0
com.google.firebase.installations.FirebaseInstallationsApi r9 = (com.google.firebase.installations.FirebaseInstallationsApi) r9
kotlin.ResultKt.throwOnFailure(r10) // Catch: java.lang.Exception -> L46
goto L60
L46:
r10 = move-exception
goto L6f
L48:
kotlin.ResultKt.throwOnFailure(r10)
r10 = 0
com.google.android.gms.tasks.Task r10 = r9.getToken(r10) // Catch: java.lang.Exception -> L46
java.lang.String r2 = "firebaseInstallations.getToken(false)"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r10, r2) // Catch: java.lang.Exception -> L46
r0.L$0 = r9 // Catch: java.lang.Exception -> L46
r0.label = r6 // Catch: java.lang.Exception -> L46
java.lang.Object r10 = kotlinx.coroutines.tasks.TasksKt.await(r10, r0) // Catch: java.lang.Exception -> L46
if (r10 != r1) goto L60
return r1
L60:
com.google.firebase.installations.InstallationTokenResult r10 = (com.google.firebase.installations.InstallationTokenResult) r10 // Catch: java.lang.Exception -> L46
java.lang.String r10 = r10.getToken() // Catch: java.lang.Exception -> L46
java.lang.String r2 = "{\n firebaseInst…).await().token\n }"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r10, r2) // Catch: java.lang.Exception -> L46
r7 = r10
r10 = r9
r9 = r7
goto L76
L6f:
java.lang.String r2 = "Error getting authentication token."
android.util.Log.w(r4, r2, r10)
r10 = r9
r9 = r3
L76:
com.google.android.gms.tasks.Task r10 = r10.getId() // Catch: java.lang.Exception -> L34
java.lang.String r2 = "firebaseInstallations.id"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r10, r2) // Catch: java.lang.Exception -> L34
r0.L$0 = r9 // Catch: java.lang.Exception -> L34
r0.label = r5 // Catch: java.lang.Exception -> L34
java.lang.Object r10 = kotlinx.coroutines.tasks.TasksKt.await(r10, r0) // Catch: java.lang.Exception -> L34
if (r10 != r1) goto L8a
return r1
L8a:
java.lang.String r0 = "{\n firebaseInst…ions.id.await()\n }"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r10, r0) // Catch: java.lang.Exception -> L34
java.lang.String r10 = (java.lang.String) r10 // Catch: java.lang.Exception -> L34
r3 = r10
goto L98
L93:
java.lang.String r0 = "Error getting Firebase installation id ."
android.util.Log.w(r4, r0, r10)
L98:
com.google.firebase.sessions.InstallationId r10 = new com.google.firebase.sessions.InstallationId
r0 = 0
r10.<init>(r3, r9, r0)
return r10
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.sessions.InstallationId.Companion.create(com.google.firebase.installations.FirebaseInstallationsApi, kotlin.coroutines.Continuation):java.lang.Object");
}
}
public InstallationId(String str, String str2) {
this.fid = str;
this.authToken = str2;
}
}

View File

@@ -0,0 +1,22 @@
package com.google.firebase.sessions;
import com.google.firebase.encoders.json.NumberedEnum;
/* loaded from: classes3.dex */
public enum LogEnvironment implements NumberedEnum {
LOG_ENVIRONMENT_UNKNOWN(0),
LOG_ENVIRONMENT_AUTOPUSH(1),
LOG_ENVIRONMENT_STAGING(2),
LOG_ENVIRONMENT_PROD(3);
private final int number;
@Override // com.google.firebase.encoders.json.NumberedEnum
public int getNumber() {
return this.number;
}
LogEnvironment(int i) {
this.number = i;
}
}

View File

@@ -0,0 +1,61 @@
package com.google.firebase.sessions;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public final class ProcessDetails {
public final int importance;
public final boolean isDefaultProcess;
public final int pid;
public final String processName;
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ProcessDetails)) {
return false;
}
ProcessDetails processDetails = (ProcessDetails) obj;
return Intrinsics.areEqual(this.processName, processDetails.processName) && this.pid == processDetails.pid && this.importance == processDetails.importance && this.isDefaultProcess == processDetails.isDefaultProcess;
}
public final int getImportance() {
return this.importance;
}
public final int getPid() {
return this.pid;
}
public final String getProcessName() {
return this.processName;
}
/* JADX WARN: Multi-variable type inference failed */
public int hashCode() {
int hashCode = ((((this.processName.hashCode() * 31) + Integer.hashCode(this.pid)) * 31) + Integer.hashCode(this.importance)) * 31;
boolean z = this.isDefaultProcess;
int i = z;
if (z != 0) {
i = 1;
}
return hashCode + i;
}
public final boolean isDefaultProcess() {
return this.isDefaultProcess;
}
public String toString() {
return "ProcessDetails(processName=" + this.processName + ", pid=" + this.pid + ", importance=" + this.importance + ", isDefaultProcess=" + this.isDefaultProcess + ')';
}
public ProcessDetails(String processName, int i, int i2, boolean z) {
Intrinsics.checkNotNullParameter(processName, "processName");
this.processName = processName;
this.pid = i;
this.importance = i2;
this.isDefaultProcess = z;
}
}

View File

@@ -0,0 +1,115 @@
package com.google.firebase.sessions;
import android.app.ActivityManager;
import android.content.Context;
import android.os.Process;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.CollectionsKt__IterablesKt;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public final class ProcessDetailsProvider {
public static final ProcessDetailsProvider INSTANCE = new ProcessDetailsProvider();
public final List getAppProcessDetails(Context context) {
List filterNotNull;
Intrinsics.checkNotNullParameter(context, "context");
int i = context.getApplicationInfo().uid;
String str = context.getApplicationInfo().processName;
Object systemService = context.getSystemService("activity");
ActivityManager activityManager = systemService instanceof ActivityManager ? (ActivityManager) systemService : null;
List<ActivityManager.RunningAppProcessInfo> runningAppProcesses = activityManager != null ? activityManager.getRunningAppProcesses() : null;
if (runningAppProcesses == null) {
runningAppProcesses = CollectionsKt__CollectionsKt.emptyList();
}
filterNotNull = CollectionsKt___CollectionsKt.filterNotNull(runningAppProcesses);
ArrayList<ActivityManager.RunningAppProcessInfo> arrayList = new ArrayList();
for (Object obj : filterNotNull) {
if (((ActivityManager.RunningAppProcessInfo) obj).uid == i) {
arrayList.add(obj);
}
}
ArrayList arrayList2 = new ArrayList(CollectionsKt__IterablesKt.collectionSizeOrDefault(arrayList, 10));
for (ActivityManager.RunningAppProcessInfo runningAppProcessInfo : arrayList) {
String str2 = runningAppProcessInfo.processName;
Intrinsics.checkNotNullExpressionValue(str2, "runningAppProcessInfo.processName");
arrayList2.add(new ProcessDetails(str2, runningAppProcessInfo.pid, runningAppProcessInfo.importance, Intrinsics.areEqual(runningAppProcessInfo.processName, str)));
}
return arrayList2;
}
public final ProcessDetails getCurrentProcessDetails(Context context) {
Object obj;
Intrinsics.checkNotNullParameter(context, "context");
int myPid = Process.myPid();
Iterator it = getAppProcessDetails(context).iterator();
while (true) {
if (!it.hasNext()) {
obj = null;
break;
}
obj = it.next();
if (((ProcessDetails) obj).getPid() == myPid) {
break;
}
}
ProcessDetails processDetails = (ProcessDetails) obj;
return processDetails == null ? buildProcessDetails$default(this, getProcessName$com_google_firebase_firebase_sessions(), myPid, 0, false, 12, null) : processDetails;
}
public static /* synthetic */ ProcessDetails buildProcessDetails$default(ProcessDetailsProvider processDetailsProvider, String str, int i, int i2, boolean z, int i3, Object obj) {
if ((i3 & 2) != 0) {
i = 0;
}
if ((i3 & 4) != 0) {
i2 = 0;
}
if ((i3 & 8) != 0) {
z = false;
}
return processDetailsProvider.buildProcessDetails(str, i, i2, z);
}
public final ProcessDetails buildProcessDetails(String str, int i, int i2, boolean z) {
return new ProcessDetails(str, i, i2, z);
}
/* JADX WARN: Code restructure failed: missing block: B:8:0x0014, code lost:
r0 = android.app.Application.getProcessName();
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.String getProcessName$com_google_firebase_firebase_sessions() {
/*
r2 = this;
int r0 = android.os.Build.VERSION.SDK_INT
r1 = 33
if (r0 < r1) goto L10
java.lang.String r0 = com.google.firebase.crashlytics.internal.ProcessDetailsProvider$$ExternalSyntheticApiModelOutline0.m()
java.lang.String r1 = "myProcessName()"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r0, r1)
return r0
L10:
r1 = 28
if (r0 < r1) goto L1b
java.lang.String r0 = com.google.android.gms.common.util.ProcessUtils$$ExternalSyntheticApiModelOutline0.m()
if (r0 == 0) goto L1b
return r0
L1b:
java.lang.String r0 = com.google.android.gms.common.util.ProcessUtils.getMyProcessName()
if (r0 == 0) goto L22
return r0
L22:
java.lang.String r0 = ""
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.sessions.ProcessDetailsProvider.getProcessName$com_google_firebase_firebase_sessions():java.lang.String");
}
}

View File

@@ -0,0 +1,29 @@
package com.google.firebase.sessions;
import android.util.Base64;
import kotlin.text.StringsKt__StringsJVMKt;
/* loaded from: classes3.dex */
public final class SessionDataStoreConfigs {
public static final SessionDataStoreConfigs INSTANCE = new SessionDataStoreConfigs();
public static final String PROCESS_NAME;
public static final String SESSIONS_CONFIG_NAME;
public static final String SETTINGS_CONFIG_NAME;
public final String getSESSIONS_CONFIG_NAME() {
return SESSIONS_CONFIG_NAME;
}
public final String getSETTINGS_CONFIG_NAME() {
return SETTINGS_CONFIG_NAME;
}
static {
byte[] encodeToByteArray;
encodeToByteArray = StringsKt__StringsJVMKt.encodeToByteArray(ProcessDetailsProvider.INSTANCE.getProcessName$com_google_firebase_firebase_sessions());
String encodeToString = Base64.encodeToString(encodeToByteArray, 10);
PROCESS_NAME = encodeToString;
SESSIONS_CONFIG_NAME = "firebase_session_" + encodeToString + "_data";
SETTINGS_CONFIG_NAME = "firebase_session_" + encodeToString + "_settings";
}
}

View File

@@ -0,0 +1,24 @@
package com.google.firebase.sessions;
import com.google.firebase.Firebase;
import com.google.firebase.FirebaseKt;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public interface SessionDatastore {
public static final Companion Companion = Companion.$$INSTANCE;
String getCurrentSessionId();
void updateSessionId(String str);
public static final class Companion {
public static final /* synthetic */ Companion $$INSTANCE = new Companion();
public final SessionDatastore getInstance() {
Object obj = FirebaseKt.getApp(Firebase.INSTANCE).get(SessionDatastore.class);
Intrinsics.checkNotNullExpressionValue(obj, "Firebase.app[SessionDatastore::class.java]");
return (SessionDatastore) obj;
}
}
}

View File

@@ -0,0 +1,55 @@
package com.google.firebase.sessions;
import android.util.Log;
import androidx.datastore.preferences.core.Preferences;
import androidx.datastore.preferences.core.PreferencesFactory;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function3;
import kotlinx.coroutines.flow.FlowCollector;
/* loaded from: classes3.dex */
public final class SessionDatastoreImpl$firebaseSessionDataFlow$1 extends SuspendLambda implements Function3 {
public /* synthetic */ Object L$0;
public /* synthetic */ Object L$1;
public int label;
public SessionDatastoreImpl$firebaseSessionDataFlow$1(Continuation continuation) {
super(3, continuation);
}
@Override // kotlin.jvm.functions.Function3
public final Object invoke(FlowCollector flowCollector, Throwable th, Continuation continuation) {
SessionDatastoreImpl$firebaseSessionDataFlow$1 sessionDatastoreImpl$firebaseSessionDataFlow$1 = new SessionDatastoreImpl$firebaseSessionDataFlow$1(continuation);
sessionDatastoreImpl$firebaseSessionDataFlow$1.L$0 = flowCollector;
sessionDatastoreImpl$firebaseSessionDataFlow$1.L$1 = th;
return sessionDatastoreImpl$firebaseSessionDataFlow$1.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);
FlowCollector flowCollector = (FlowCollector) this.L$0;
Log.e("FirebaseSessionsRepo", "Error reading stored session data.", (Throwable) this.L$1);
Preferences createEmpty = PreferencesFactory.createEmpty();
this.L$0 = null;
this.label = 1;
if (flowCollector.emit(createEmpty, 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,106 @@
package com.google.firebase.sessions;
import android.content.Context;
import android.util.Log;
import androidx.datastore.core.DataStore;
import androidx.datastore.preferences.core.MutablePreferences;
import androidx.datastore.preferences.core.PreferencesKt;
import com.google.firebase.sessions.SessionDatastoreImpl;
import java.io.IOException;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.CoroutineScope;
/* loaded from: classes3.dex */
public final class SessionDatastoreImpl$updateSessionId$1 extends SuspendLambda implements Function2 {
public final /* synthetic */ String $sessionId;
public int label;
public final /* synthetic */ SessionDatastoreImpl this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SessionDatastoreImpl$updateSessionId$1(SessionDatastoreImpl sessionDatastoreImpl, String str, Continuation continuation) {
super(2, continuation);
this.this$0 = sessionDatastoreImpl;
this.$sessionId = str;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new SessionDatastoreImpl$updateSessionId$1(this.this$0, this.$sessionId, continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((SessionDatastoreImpl$updateSessionId$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
SessionDatastoreImpl.Companion companion;
Context context;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
try {
if (i == 0) {
ResultKt.throwOnFailure(obj);
companion = SessionDatastoreImpl.Companion;
context = this.this$0.context;
DataStore dataStore = companion.getDataStore(context);
AnonymousClass1 anonymousClass1 = new AnonymousClass1(this.$sessionId, null);
this.label = 1;
if (PreferencesKt.edit(dataStore, anonymousClass1, this) == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
} catch (IOException e) {
Log.w("FirebaseSessionsRepo", "Failed to update session Id: " + e);
}
return Unit.INSTANCE;
}
/* renamed from: com.google.firebase.sessions.SessionDatastoreImpl$updateSessionId$1$1, reason: invalid class name */
public static final class AnonymousClass1 extends SuspendLambda implements Function2 {
public final /* synthetic */ String $sessionId;
public /* synthetic */ Object L$0;
public int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public AnonymousClass1(String str, Continuation continuation) {
super(2, continuation);
this.$sessionId = str;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
AnonymousClass1 anonymousClass1 = new AnonymousClass1(this.$sessionId, continuation);
anonymousClass1.L$0 = obj;
return anonymousClass1;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(MutablePreferences mutablePreferences, Continuation continuation) {
return ((AnonymousClass1) create(mutablePreferences, 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);
((MutablePreferences) this.L$0).set(SessionDatastoreImpl.FirebaseSessionDataKeys.INSTANCE.getSESSION_ID(), this.$sessionId);
return Unit.INSTANCE;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}
}

View File

@@ -0,0 +1,245 @@
package com.google.firebase.sessions;
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 androidx.datastore.preferences.core.PreferencesKeys;
import com.facebook.gamingservices.cloudgaming.internal.SDKAnalyticsEvents;
import java.util.concurrent.atomic.AtomicReference;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
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 kotlinx.coroutines.BuildersKt__Builders_commonKt;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.CoroutineScopeKt;
import kotlinx.coroutines.flow.Flow;
import kotlinx.coroutines.flow.FlowCollector;
import kotlinx.coroutines.flow.FlowKt;
/* loaded from: classes3.dex */
public final class SessionDatastoreImpl implements SessionDatastore {
public static final Companion Companion = new Companion(null);
public static final ReadOnlyProperty dataStore$delegate = PreferenceDataStoreDelegateKt.preferencesDataStore$default(SessionDataStoreConfigs.INSTANCE.getSESSIONS_CONFIG_NAME(), new ReplaceFileCorruptionHandler(new Function1() { // from class: com.google.firebase.sessions.SessionDatastoreImpl$Companion$dataStore$2
@Override // kotlin.jvm.functions.Function1
public final Preferences invoke(CorruptionException ex) {
Intrinsics.checkNotNullParameter(ex, "ex");
Log.w("FirebaseSessionsRepo", "CorruptionException in sessions DataStore in " + ProcessDetailsProvider.INSTANCE.getProcessName$com_google_firebase_firebase_sessions() + '.', ex);
return PreferencesFactory.createEmpty();
}
}), null, null, 12, null);
public final CoroutineContext backgroundDispatcher;
public final Context context;
public final AtomicReference currentSessionFromDatastore;
public final Flow firebaseSessionDataFlow;
public static final class FirebaseSessionDataKeys {
public static final FirebaseSessionDataKeys INSTANCE = new FirebaseSessionDataKeys();
public static final Preferences.Key SESSION_ID = PreferencesKeys.stringKey(SDKAnalyticsEvents.PARAMETER_SESSION_ID);
public final Preferences.Key getSESSION_ID() {
return SESSION_ID;
}
}
public SessionDatastoreImpl(Context context, CoroutineContext backgroundDispatcher) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(backgroundDispatcher, "backgroundDispatcher");
this.context = context;
this.backgroundDispatcher = backgroundDispatcher;
this.currentSessionFromDatastore = new AtomicReference();
final Flow m4143catch = FlowKt.m4143catch(Companion.getDataStore(context).getData(), new SessionDatastoreImpl$firebaseSessionDataFlow$1(null));
this.firebaseSessionDataFlow = new Flow() { // from class: com.google.firebase.sessions.SessionDatastoreImpl$special$$inlined$map$1
/* renamed from: com.google.firebase.sessions.SessionDatastoreImpl$special$$inlined$map$1$2, reason: invalid class name */
public static final class AnonymousClass2 implements FlowCollector {
public final /* synthetic */ FlowCollector $this_unsafeFlow;
public final /* synthetic */ SessionDatastoreImpl this$0;
/* renamed from: com.google.firebase.sessions.SessionDatastoreImpl$special$$inlined$map$1$2$1, reason: invalid class name */
public static final class AnonymousClass1 extends ContinuationImpl {
public int label;
public /* 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, SessionDatastoreImpl sessionDatastoreImpl) {
this.$this_unsafeFlow = flowCollector;
this.this$0 = sessionDatastoreImpl;
}
/* 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 final java.lang.Object emit(java.lang.Object r5, kotlin.coroutines.Continuation r6) {
/*
r4 = this;
boolean r0 = r6 instanceof com.google.firebase.sessions.SessionDatastoreImpl$special$$inlined$map$1.AnonymousClass2.AnonymousClass1
if (r0 == 0) goto L13
r0 = r6
com.google.firebase.sessions.SessionDatastoreImpl$special$$inlined$map$1$2$1 r0 = (com.google.firebase.sessions.SessionDatastoreImpl$special$$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:
com.google.firebase.sessions.SessionDatastoreImpl$special$$inlined$map$1$2$1 r0 = new com.google.firebase.sessions.SessionDatastoreImpl$special$$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 L47
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
androidx.datastore.preferences.core.Preferences r5 = (androidx.datastore.preferences.core.Preferences) r5
com.google.firebase.sessions.SessionDatastoreImpl r2 = r4.this$0
com.google.firebase.sessions.FirebaseSessionsData r5 = com.google.firebase.sessions.SessionDatastoreImpl.access$mapSessionsData(r2, r5)
r0.label = r3
java.lang.Object r5 = r6.emit(r5, r0)
if (r5 != r1) goto L47
return r1
L47:
kotlin.Unit r5 = kotlin.Unit.INSTANCE
return r5
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.sessions.SessionDatastoreImpl$special$$inlined$map$1.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
}
}
@Override // kotlinx.coroutines.flow.Flow
public Object collect(FlowCollector flowCollector, Continuation continuation) {
Object coroutine_suspended;
Object collect = Flow.this.collect(new AnonymousClass2(flowCollector, this), continuation);
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
return collect == coroutine_suspended ? collect : Unit.INSTANCE;
}
};
BuildersKt__Builders_commonKt.launch$default(CoroutineScopeKt.CoroutineScope(backgroundDispatcher), null, null, new AnonymousClass1(null), 3, null);
}
/* renamed from: com.google.firebase.sessions.SessionDatastoreImpl$1, reason: invalid class name */
public static final class AnonymousClass1 extends SuspendLambda implements Function2 {
public int label;
public AnonymousClass1(Continuation continuation) {
super(2, continuation);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return SessionDatastoreImpl.this.new AnonymousClass1(continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((AnonymousClass1) 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);
Flow flow = SessionDatastoreImpl.this.firebaseSessionDataFlow;
final SessionDatastoreImpl sessionDatastoreImpl = SessionDatastoreImpl.this;
FlowCollector flowCollector = new FlowCollector() { // from class: com.google.firebase.sessions.SessionDatastoreImpl.1.1
@Override // kotlinx.coroutines.flow.FlowCollector
public final Object emit(FirebaseSessionsData firebaseSessionsData, Continuation continuation) {
SessionDatastoreImpl.this.currentSessionFromDatastore.set(firebaseSessionsData);
return Unit.INSTANCE;
}
};
this.label = 1;
if (flow.collect(flowCollector, 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;
}
}
@Override // com.google.firebase.sessions.SessionDatastore
public void updateSessionId(String sessionId) {
Intrinsics.checkNotNullParameter(sessionId, "sessionId");
BuildersKt__Builders_commonKt.launch$default(CoroutineScopeKt.CoroutineScope(this.backgroundDispatcher), null, null, new SessionDatastoreImpl$updateSessionId$1(this, sessionId, null), 3, null);
}
@Override // com.google.firebase.sessions.SessionDatastore
public String getCurrentSessionId() {
FirebaseSessionsData firebaseSessionsData = (FirebaseSessionsData) this.currentSessionFromDatastore.get();
if (firebaseSessionsData != null) {
return firebaseSessionsData.getSessionId();
}
return null;
}
public final FirebaseSessionsData mapSessionsData(Preferences preferences) {
return new FirebaseSessionsData((String) preferences.get(FirebaseSessionDataKeys.INSTANCE.getSESSION_ID()));
}
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 DataStore getDataStore(Context context) {
return (DataStore) SessionDatastoreImpl.dataStore$delegate.getValue(context, $$delegatedProperties[0]);
}
}
}

View File

@@ -0,0 +1,55 @@
package com.google.firebase.sessions;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public final class SessionDetails {
public final String firstSessionId;
public final String sessionId;
public final int sessionIndex;
public final long sessionStartTimestampUs;
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof SessionDetails)) {
return false;
}
SessionDetails sessionDetails = (SessionDetails) obj;
return Intrinsics.areEqual(this.sessionId, sessionDetails.sessionId) && Intrinsics.areEqual(this.firstSessionId, sessionDetails.firstSessionId) && this.sessionIndex == sessionDetails.sessionIndex && this.sessionStartTimestampUs == sessionDetails.sessionStartTimestampUs;
}
public final String getFirstSessionId() {
return this.firstSessionId;
}
public final String getSessionId() {
return this.sessionId;
}
public final int getSessionIndex() {
return this.sessionIndex;
}
public final long getSessionStartTimestampUs() {
return this.sessionStartTimestampUs;
}
public int hashCode() {
return (((((this.sessionId.hashCode() * 31) + this.firstSessionId.hashCode()) * 31) + Integer.hashCode(this.sessionIndex)) * 31) + Long.hashCode(this.sessionStartTimestampUs);
}
public String toString() {
return "SessionDetails(sessionId=" + this.sessionId + ", firstSessionId=" + this.firstSessionId + ", sessionIndex=" + this.sessionIndex + ", sessionStartTimestampUs=" + this.sessionStartTimestampUs + ')';
}
public SessionDetails(String sessionId, String firstSessionId, int i, long j) {
Intrinsics.checkNotNullParameter(sessionId, "sessionId");
Intrinsics.checkNotNullParameter(firstSessionId, "firstSessionId");
this.sessionId = sessionId;
this.firstSessionId = firstSessionId;
this.sessionIndex = i;
this.sessionStartTimestampUs = j;
}
}

View File

@@ -0,0 +1,50 @@
package com.google.firebase.sessions;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public final class SessionEvent {
public final ApplicationInfo applicationInfo;
public final EventType eventType;
public final SessionInfo sessionData;
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof SessionEvent)) {
return false;
}
SessionEvent sessionEvent = (SessionEvent) obj;
return this.eventType == sessionEvent.eventType && Intrinsics.areEqual(this.sessionData, sessionEvent.sessionData) && Intrinsics.areEqual(this.applicationInfo, sessionEvent.applicationInfo);
}
public final ApplicationInfo getApplicationInfo() {
return this.applicationInfo;
}
public final EventType getEventType() {
return this.eventType;
}
public final SessionInfo getSessionData() {
return this.sessionData;
}
public int hashCode() {
return (((this.eventType.hashCode() * 31) + this.sessionData.hashCode()) * 31) + this.applicationInfo.hashCode();
}
public String toString() {
return "SessionEvent(eventType=" + this.eventType + ", sessionData=" + this.sessionData + ", applicationInfo=" + this.applicationInfo + ')';
}
public SessionEvent(EventType eventType, SessionInfo sessionData, ApplicationInfo applicationInfo) {
Intrinsics.checkNotNullParameter(eventType, "eventType");
Intrinsics.checkNotNullParameter(sessionData, "sessionData");
Intrinsics.checkNotNullParameter(applicationInfo, "applicationInfo");
this.eventType = eventType;
this.sessionData = sessionData;
this.applicationInfo = applicationInfo;
}
}

View File

@@ -0,0 +1,84 @@
package com.google.firebase.sessions;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.os.Build;
import com.google.firebase.FirebaseApp;
import com.google.firebase.encoders.DataEncoder;
import com.google.firebase.encoders.json.JsonDataEncoderBuilder;
import com.google.firebase.sessions.api.SessionSubscriber;
import com.google.firebase.sessions.settings.SessionsSettings;
import java.util.Map;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public final class SessionEvents {
public static final SessionEvents INSTANCE = new SessionEvents();
public static final DataEncoder SESSION_EVENT_ENCODER;
public final DataEncoder getSESSION_EVENT_ENCODER$com_google_firebase_firebase_sessions() {
return SESSION_EVENT_ENCODER;
}
static {
DataEncoder build = new JsonDataEncoderBuilder().configureWith(AutoSessionEventEncoder.CONFIG).ignoreNullValues(true).build();
Intrinsics.checkNotNullExpressionValue(build, "JsonDataEncoderBuilder()…lues(true)\n .build()");
SESSION_EVENT_ENCODER = build;
}
public final SessionEvent buildSession(FirebaseApp firebaseApp, SessionDetails sessionDetails, SessionsSettings sessionsSettings, Map subscribers, String firebaseInstallationId, String firebaseAuthenticationToken) {
Intrinsics.checkNotNullParameter(firebaseApp, "firebaseApp");
Intrinsics.checkNotNullParameter(sessionDetails, "sessionDetails");
Intrinsics.checkNotNullParameter(sessionsSettings, "sessionsSettings");
Intrinsics.checkNotNullParameter(subscribers, "subscribers");
Intrinsics.checkNotNullParameter(firebaseInstallationId, "firebaseInstallationId");
Intrinsics.checkNotNullParameter(firebaseAuthenticationToken, "firebaseAuthenticationToken");
return new SessionEvent(EventType.SESSION_START, new SessionInfo(sessionDetails.getSessionId(), sessionDetails.getFirstSessionId(), sessionDetails.getSessionIndex(), sessionDetails.getSessionStartTimestampUs(), new DataCollectionStatus(toDataCollectionState((SessionSubscriber) subscribers.get(SessionSubscriber.Name.PERFORMANCE)), toDataCollectionState((SessionSubscriber) subscribers.get(SessionSubscriber.Name.CRASHLYTICS)), sessionsSettings.getSamplingRate()), firebaseInstallationId, firebaseAuthenticationToken), getApplicationInfo(firebaseApp));
}
public final ApplicationInfo getApplicationInfo(FirebaseApp firebaseApp) {
String valueOf;
long longVersionCode;
Intrinsics.checkNotNullParameter(firebaseApp, "firebaseApp");
Context applicationContext = firebaseApp.getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext, "firebaseApp.applicationContext");
String packageName = applicationContext.getPackageName();
PackageInfo packageInfo = applicationContext.getPackageManager().getPackageInfo(packageName, 0);
if (Build.VERSION.SDK_INT >= 28) {
longVersionCode = packageInfo.getLongVersionCode();
valueOf = String.valueOf(longVersionCode);
} else {
valueOf = String.valueOf(packageInfo.versionCode);
}
String str = valueOf;
String applicationId = firebaseApp.getOptions().getApplicationId();
Intrinsics.checkNotNullExpressionValue(applicationId, "firebaseApp.options.applicationId");
String MODEL = Build.MODEL;
Intrinsics.checkNotNullExpressionValue(MODEL, "MODEL");
String RELEASE = Build.VERSION.RELEASE;
Intrinsics.checkNotNullExpressionValue(RELEASE, "RELEASE");
LogEnvironment logEnvironment = LogEnvironment.LOG_ENVIRONMENT_PROD;
Intrinsics.checkNotNullExpressionValue(packageName, "packageName");
String str2 = packageInfo.versionName;
String str3 = str2 == null ? str : str2;
String MANUFACTURER = Build.MANUFACTURER;
Intrinsics.checkNotNullExpressionValue(MANUFACTURER, "MANUFACTURER");
ProcessDetailsProvider processDetailsProvider = ProcessDetailsProvider.INSTANCE;
Context applicationContext2 = firebaseApp.getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext2, "firebaseApp.applicationContext");
ProcessDetails currentProcessDetails = processDetailsProvider.getCurrentProcessDetails(applicationContext2);
Context applicationContext3 = firebaseApp.getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext3, "firebaseApp.applicationContext");
return new ApplicationInfo(applicationId, MODEL, "2.0.1", RELEASE, logEnvironment, new AndroidApplicationInfo(packageName, str3, str, MANUFACTURER, currentProcessDetails, processDetailsProvider.getAppProcessDetails(applicationContext3)));
}
public final DataCollectionState toDataCollectionState(SessionSubscriber sessionSubscriber) {
if (sessionSubscriber == null) {
return DataCollectionState.COLLECTION_SDK_NOT_INSTALLED;
}
if (sessionSubscriber.isDataCollectionEnabled()) {
return DataCollectionState.COLLECTION_ENABLED;
}
return DataCollectionState.COLLECTION_DISABLED;
}
}

View File

@@ -0,0 +1,22 @@
package com.google.firebase.sessions;
import com.google.firebase.Firebase;
import com.google.firebase.FirebaseKt;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public interface SessionFirelogPublisher {
public static final Companion Companion = Companion.$$INSTANCE;
void logSession(SessionDetails sessionDetails);
public static final class Companion {
public static final /* synthetic */ Companion $$INSTANCE = new Companion();
public final SessionFirelogPublisher getInstance() {
Object obj = FirebaseKt.getApp(Firebase.INSTANCE).get(SessionFirelogPublisher.class);
Intrinsics.checkNotNullExpressionValue(obj, "Firebase.app[SessionFirelogPublisher::class.java]");
return (SessionFirelogPublisher) obj;
}
}
}

View File

@@ -0,0 +1,149 @@
package com.google.firebase.sessions;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.CoroutineScope;
/* loaded from: classes3.dex */
public final class SessionFirelogPublisherImpl$logSession$1 extends SuspendLambda implements Function2 {
public final /* synthetic */ SessionDetails $sessionDetails;
public Object L$0;
public Object L$1;
public Object L$2;
public Object L$3;
public Object L$4;
public Object L$5;
public int label;
public final /* synthetic */ SessionFirelogPublisherImpl this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SessionFirelogPublisherImpl$logSession$1(SessionFirelogPublisherImpl sessionFirelogPublisherImpl, SessionDetails sessionDetails, Continuation continuation) {
super(2, continuation);
this.this$0 = sessionFirelogPublisherImpl;
this.$sessionDetails = sessionDetails;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new SessionFirelogPublisherImpl$logSession$1(this.this$0, this.$sessionDetails, continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((SessionFirelogPublisherImpl$logSession$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
/* JADX WARN: Removed duplicated region for block: B:16:0x0095 A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:17:0x0096 */
@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 = 3
r3 = 2
r4 = 1
if (r1 == 0) goto L45
if (r1 == r4) goto L41
if (r1 == r3) goto L3d
if (r1 != r2) goto L35
java.lang.Object r0 = r10.L$5
com.google.firebase.sessions.settings.SessionsSettings r0 = (com.google.firebase.sessions.settings.SessionsSettings) r0
java.lang.Object r1 = r10.L$4
com.google.firebase.sessions.SessionDetails r1 = (com.google.firebase.sessions.SessionDetails) r1
java.lang.Object r2 = r10.L$3
com.google.firebase.FirebaseApp r2 = (com.google.firebase.FirebaseApp) r2
java.lang.Object r3 = r10.L$2
com.google.firebase.sessions.SessionEvents r3 = (com.google.firebase.sessions.SessionEvents) r3
java.lang.Object r4 = r10.L$1
com.google.firebase.sessions.SessionFirelogPublisherImpl r4 = (com.google.firebase.sessions.SessionFirelogPublisherImpl) r4
java.lang.Object r5 = r10.L$0
com.google.firebase.sessions.InstallationId r5 = (com.google.firebase.sessions.InstallationId) r5
kotlin.ResultKt.throwOnFailure(r11)
r7 = r4
r8 = r3
r3 = r0
r0 = r8
r9 = r2
r2 = r1
r1 = r9
goto L9d
L35:
java.lang.IllegalStateException r11 = new java.lang.IllegalStateException
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
r11.<init>(r0)
throw r11
L3d:
kotlin.ResultKt.throwOnFailure(r11)
goto L6c
L41:
kotlin.ResultKt.throwOnFailure(r11)
goto L53
L45:
kotlin.ResultKt.throwOnFailure(r11)
com.google.firebase.sessions.SessionFirelogPublisherImpl r11 = r10.this$0
r10.label = r4
java.lang.Object r11 = com.google.firebase.sessions.SessionFirelogPublisherImpl.access$shouldLogSession(r11, r10)
if (r11 != r0) goto L53
return r0
L53:
java.lang.Boolean r11 = (java.lang.Boolean) r11
boolean r11 = r11.booleanValue()
if (r11 == 0) goto Lb0
com.google.firebase.sessions.InstallationId$Companion r11 = com.google.firebase.sessions.InstallationId.Companion
com.google.firebase.sessions.SessionFirelogPublisherImpl r1 = r10.this$0
com.google.firebase.installations.FirebaseInstallationsApi r1 = com.google.firebase.sessions.SessionFirelogPublisherImpl.access$getFirebaseInstallations$p(r1)
r10.label = r3
java.lang.Object r11 = r11.create(r1, r10)
if (r11 != r0) goto L6c
return r0
L6c:
r5 = r11
com.google.firebase.sessions.InstallationId r5 = (com.google.firebase.sessions.InstallationId) r5
com.google.firebase.sessions.SessionFirelogPublisherImpl r4 = r10.this$0
com.google.firebase.sessions.SessionEvents r3 = com.google.firebase.sessions.SessionEvents.INSTANCE
com.google.firebase.FirebaseApp r11 = com.google.firebase.sessions.SessionFirelogPublisherImpl.access$getFirebaseApp$p(r4)
com.google.firebase.sessions.SessionDetails r1 = r10.$sessionDetails
com.google.firebase.sessions.SessionFirelogPublisherImpl r6 = r10.this$0
com.google.firebase.sessions.settings.SessionsSettings r6 = com.google.firebase.sessions.SessionFirelogPublisherImpl.access$getSessionSettings$p(r6)
com.google.firebase.sessions.api.FirebaseSessionsDependencies r7 = com.google.firebase.sessions.api.FirebaseSessionsDependencies.INSTANCE
r10.L$0 = r5
r10.L$1 = r4
r10.L$2 = r3
r10.L$3 = r11
r10.L$4 = r1
r10.L$5 = r6
r10.label = r2
java.lang.Object r2 = r7.getRegisteredSubscribers$com_google_firebase_firebase_sessions(r10)
if (r2 != r0) goto L96
return r0
L96:
r0 = r3
r7 = r4
r3 = r6
r8 = r1
r1 = r11
r11 = r2
r2 = r8
L9d:
r4 = r11
java.util.Map r4 = (java.util.Map) r4
java.lang.String r11 = r5.getFid()
java.lang.String r6 = r5.getAuthToken()
r5 = r11
com.google.firebase.sessions.SessionEvent r11 = r0.buildSession(r1, r2, r3, r4, r5, r6)
com.google.firebase.sessions.SessionFirelogPublisherImpl.access$attemptLoggingSessionEvent(r7, r11)
Lb0:
kotlin.Unit r11 = kotlin.Unit.INSTANCE
return r11
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.sessions.SessionFirelogPublisherImpl$logSession$1.invokeSuspend(java.lang.Object):java.lang.Object");
}
}

View File

@@ -0,0 +1,27 @@
package com.google.firebase.sessions;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
/* loaded from: classes3.dex */
public final class SessionFirelogPublisherImpl$shouldLogSession$1 extends ContinuationImpl {
public Object L$0;
public int label;
public /* synthetic */ Object result;
public final /* synthetic */ SessionFirelogPublisherImpl this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SessionFirelogPublisherImpl$shouldLogSession$1(SessionFirelogPublisherImpl sessionFirelogPublisherImpl, Continuation continuation) {
super(continuation);
this.this$0 = sessionFirelogPublisherImpl;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object shouldLogSession;
this.result = obj;
this.label |= Integer.MIN_VALUE;
shouldLogSession = this.this$0.shouldLogSession(this);
return shouldLogSession;
}
}

View File

@@ -0,0 +1,135 @@
package com.google.firebase.sessions;
import android.util.Log;
import com.google.firebase.FirebaseApp;
import com.google.firebase.installations.FirebaseInstallationsApi;
import com.google.firebase.sessions.settings.SessionsSettings;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
import kotlinx.coroutines.CoroutineScopeKt;
/* loaded from: classes3.dex */
public final class SessionFirelogPublisherImpl implements SessionFirelogPublisher {
public static final Companion Companion = new Companion(null);
public static final double randomValueForSampling = Math.random();
public final CoroutineContext backgroundDispatcher;
public final EventGDTLoggerInterface eventGDTLogger;
public final FirebaseApp firebaseApp;
public final FirebaseInstallationsApi firebaseInstallations;
public final SessionsSettings sessionSettings;
public SessionFirelogPublisherImpl(FirebaseApp firebaseApp, FirebaseInstallationsApi firebaseInstallations, SessionsSettings sessionSettings, EventGDTLoggerInterface eventGDTLogger, CoroutineContext backgroundDispatcher) {
Intrinsics.checkNotNullParameter(firebaseApp, "firebaseApp");
Intrinsics.checkNotNullParameter(firebaseInstallations, "firebaseInstallations");
Intrinsics.checkNotNullParameter(sessionSettings, "sessionSettings");
Intrinsics.checkNotNullParameter(eventGDTLogger, "eventGDTLogger");
Intrinsics.checkNotNullParameter(backgroundDispatcher, "backgroundDispatcher");
this.firebaseApp = firebaseApp;
this.firebaseInstallations = firebaseInstallations;
this.sessionSettings = sessionSettings;
this.eventGDTLogger = eventGDTLogger;
this.backgroundDispatcher = backgroundDispatcher;
}
@Override // com.google.firebase.sessions.SessionFirelogPublisher
public void logSession(SessionDetails sessionDetails) {
Intrinsics.checkNotNullParameter(sessionDetails, "sessionDetails");
BuildersKt__Builders_commonKt.launch$default(CoroutineScopeKt.CoroutineScope(this.backgroundDispatcher), null, null, new SessionFirelogPublisherImpl$logSession$1(this, sessionDetails, null), 3, null);
}
public final void attemptLoggingSessionEvent(SessionEvent sessionEvent) {
try {
this.eventGDTLogger.log(sessionEvent);
StringBuilder sb = new StringBuilder();
sb.append("Successfully logged Session Start event: ");
sb.append(sessionEvent.getSessionData().getSessionId());
} catch (RuntimeException e) {
Log.e("SessionFirelogPublisher", "Error logging Session Start event to DataTransport: ", e);
}
}
/* 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:23:0x0035 */
/* 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 shouldLogSession(kotlin.coroutines.Continuation r5) {
/*
r4 = this;
boolean r0 = r5 instanceof com.google.firebase.sessions.SessionFirelogPublisherImpl$shouldLogSession$1
if (r0 == 0) goto L13
r0 = r5
com.google.firebase.sessions.SessionFirelogPublisherImpl$shouldLogSession$1 r0 = (com.google.firebase.sessions.SessionFirelogPublisherImpl$shouldLogSession$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.SessionFirelogPublisherImpl$shouldLogSession$1 r0 = new com.google.firebase.sessions.SessionFirelogPublisherImpl$shouldLogSession$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 L35
if (r2 != r3) goto L2d
java.lang.Object r0 = r0.L$0
com.google.firebase.sessions.SessionFirelogPublisherImpl r0 = (com.google.firebase.sessions.SessionFirelogPublisherImpl) r0
kotlin.ResultKt.throwOnFailure(r5)
goto L46
L2d:
java.lang.IllegalStateException r5 = new java.lang.IllegalStateException
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
r5.<init>(r0)
throw r5
L35:
kotlin.ResultKt.throwOnFailure(r5)
com.google.firebase.sessions.settings.SessionsSettings r5 = r4.sessionSettings
r0.L$0 = r4
r0.label = r3
java.lang.Object r5 = r5.updateSettings(r0)
if (r5 != r1) goto L45
return r1
L45:
r0 = r4
L46:
com.google.firebase.sessions.settings.SessionsSettings r5 = r0.sessionSettings
boolean r5 = r5.getSessionsEnabled()
r1 = 0
if (r5 != 0) goto L54
java.lang.Boolean r5 = kotlin.coroutines.jvm.internal.Boxing.boxBoolean(r1)
return r5
L54:
boolean r5 = r0.shouldCollectEvents()
if (r5 != 0) goto L5f
java.lang.Boolean r5 = kotlin.coroutines.jvm.internal.Boxing.boxBoolean(r1)
return r5
L5f:
java.lang.Boolean r5 = kotlin.coroutines.jvm.internal.Boxing.boxBoolean(r3)
return r5
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.sessions.SessionFirelogPublisherImpl.shouldLogSession(kotlin.coroutines.Continuation):java.lang.Object");
}
public final boolean shouldCollectEvents() {
return randomValueForSampling <= this.sessionSettings.getSamplingRate();
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
}

View File

@@ -0,0 +1,89 @@
package com.google.firebase.sessions;
import com.google.firebase.Firebase;
import com.google.firebase.FirebaseKt;
import java.util.Locale;
import java.util.UUID;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.FunctionReferenceImpl;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt__StringsJVMKt;
/* loaded from: classes3.dex */
public final class SessionGenerator {
public static final Companion Companion = new Companion(null);
public SessionDetails currentSession;
public final String firstSessionId;
public int sessionIndex;
public final TimeProvider timeProvider;
public final Function0 uuidGenerator;
public SessionGenerator(TimeProvider timeProvider, Function0 uuidGenerator) {
Intrinsics.checkNotNullParameter(timeProvider, "timeProvider");
Intrinsics.checkNotNullParameter(uuidGenerator, "uuidGenerator");
this.timeProvider = timeProvider;
this.uuidGenerator = uuidGenerator;
this.firstSessionId = generateSessionId();
this.sessionIndex = -1;
}
/* renamed from: com.google.firebase.sessions.SessionGenerator$1, reason: invalid class name */
public /* synthetic */ class AnonymousClass1 extends FunctionReferenceImpl implements Function0 {
public static final AnonymousClass1 INSTANCE = new AnonymousClass1();
public AnonymousClass1() {
super(0, UUID.class, "randomUUID", "randomUUID()Ljava/util/UUID;", 0);
}
@Override // kotlin.jvm.functions.Function0
public final UUID invoke() {
return UUID.randomUUID();
}
}
public /* synthetic */ SessionGenerator(TimeProvider timeProvider, Function0 function0, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(timeProvider, (i & 2) != 0 ? AnonymousClass1.INSTANCE : function0);
}
public final SessionDetails getCurrentSession() {
SessionDetails sessionDetails = this.currentSession;
if (sessionDetails != null) {
return sessionDetails;
}
Intrinsics.throwUninitializedPropertyAccessException("currentSession");
return null;
}
public final SessionDetails generateNewSession() {
int i = this.sessionIndex + 1;
this.sessionIndex = i;
this.currentSession = new SessionDetails(i == 0 ? this.firstSessionId : generateSessionId(), this.firstSessionId, this.sessionIndex, this.timeProvider.currentTimeUs());
return getCurrentSession();
}
public final String generateSessionId() {
String replace$default;
String uuid = ((UUID) this.uuidGenerator.invoke()).toString();
Intrinsics.checkNotNullExpressionValue(uuid, "uuidGenerator().toString()");
replace$default = StringsKt__StringsJVMKt.replace$default(uuid, "-", "", false, 4, (Object) null);
String lowerCase = replace$default.toLowerCase(Locale.ROOT);
Intrinsics.checkNotNullExpressionValue(lowerCase, "this as java.lang.String).toLowerCase(Locale.ROOT)");
return lowerCase;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
public final SessionGenerator getInstance() {
Object obj = FirebaseKt.getApp(Firebase.INSTANCE).get(SessionGenerator.class);
Intrinsics.checkNotNullExpressionValue(obj, "Firebase.app[SessionGenerator::class.java]");
return (SessionGenerator) obj;
}
}
}

View File

@@ -0,0 +1,76 @@
package com.google.firebase.sessions;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public final class SessionInfo {
public final DataCollectionStatus dataCollectionStatus;
public final long eventTimestampUs;
public final String firebaseAuthenticationToken;
public final String firebaseInstallationId;
public final String firstSessionId;
public final String sessionId;
public final int sessionIndex;
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof SessionInfo)) {
return false;
}
SessionInfo sessionInfo = (SessionInfo) obj;
return Intrinsics.areEqual(this.sessionId, sessionInfo.sessionId) && Intrinsics.areEqual(this.firstSessionId, sessionInfo.firstSessionId) && this.sessionIndex == sessionInfo.sessionIndex && this.eventTimestampUs == sessionInfo.eventTimestampUs && Intrinsics.areEqual(this.dataCollectionStatus, sessionInfo.dataCollectionStatus) && Intrinsics.areEqual(this.firebaseInstallationId, sessionInfo.firebaseInstallationId) && Intrinsics.areEqual(this.firebaseAuthenticationToken, sessionInfo.firebaseAuthenticationToken);
}
public final DataCollectionStatus getDataCollectionStatus() {
return this.dataCollectionStatus;
}
public final long getEventTimestampUs() {
return this.eventTimestampUs;
}
public final String getFirebaseAuthenticationToken() {
return this.firebaseAuthenticationToken;
}
public final String getFirebaseInstallationId() {
return this.firebaseInstallationId;
}
public final String getFirstSessionId() {
return this.firstSessionId;
}
public final String getSessionId() {
return this.sessionId;
}
public final int getSessionIndex() {
return this.sessionIndex;
}
public int hashCode() {
return (((((((((((this.sessionId.hashCode() * 31) + this.firstSessionId.hashCode()) * 31) + Integer.hashCode(this.sessionIndex)) * 31) + Long.hashCode(this.eventTimestampUs)) * 31) + this.dataCollectionStatus.hashCode()) * 31) + this.firebaseInstallationId.hashCode()) * 31) + this.firebaseAuthenticationToken.hashCode();
}
public String toString() {
return "SessionInfo(sessionId=" + this.sessionId + ", firstSessionId=" + this.firstSessionId + ", sessionIndex=" + this.sessionIndex + ", eventTimestampUs=" + this.eventTimestampUs + ", dataCollectionStatus=" + this.dataCollectionStatus + ", firebaseInstallationId=" + this.firebaseInstallationId + ", firebaseAuthenticationToken=" + this.firebaseAuthenticationToken + ')';
}
public SessionInfo(String sessionId, String firstSessionId, int i, long j, DataCollectionStatus dataCollectionStatus, String firebaseInstallationId, String firebaseAuthenticationToken) {
Intrinsics.checkNotNullParameter(sessionId, "sessionId");
Intrinsics.checkNotNullParameter(firstSessionId, "firstSessionId");
Intrinsics.checkNotNullParameter(dataCollectionStatus, "dataCollectionStatus");
Intrinsics.checkNotNullParameter(firebaseInstallationId, "firebaseInstallationId");
Intrinsics.checkNotNullParameter(firebaseAuthenticationToken, "firebaseAuthenticationToken");
this.sessionId = sessionId;
this.firstSessionId = firstSessionId;
this.sessionIndex = i;
this.eventTimestampUs = j;
this.dataCollectionStatus = dataCollectionStatus;
this.firebaseInstallationId = firebaseInstallationId;
this.firebaseAuthenticationToken = firebaseAuthenticationToken;
}
}

View File

@@ -0,0 +1,67 @@
package com.google.firebase.sessions;
import com.google.firebase.sessions.api.FirebaseSessionsDependencies;
import com.google.firebase.sessions.api.SessionSubscriber;
import java.util.Collection;
import java.util.Map;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.CoroutineScope;
/* loaded from: classes3.dex */
public final class SessionLifecycleClient$ClientUpdateHandler$handleSessionUpdate$1 extends SuspendLambda implements Function2 {
public final /* synthetic */ String $sessionId;
public int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SessionLifecycleClient$ClientUpdateHandler$handleSessionUpdate$1(String str, Continuation continuation) {
super(2, continuation);
this.$sessionId = str;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new SessionLifecycleClient$ClientUpdateHandler$handleSessionUpdate$1(this.$sessionId, continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((SessionLifecycleClient$ClientUpdateHandler$handleSessionUpdate$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) {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
} else {
ResultKt.throwOnFailure(obj);
FirebaseSessionsDependencies firebaseSessionsDependencies = FirebaseSessionsDependencies.INSTANCE;
this.label = 1;
obj = firebaseSessionsDependencies.getRegisteredSubscribers$com_google_firebase_firebase_sessions(this);
if (obj == coroutine_suspended) {
return coroutine_suspended;
}
}
Collection<SessionSubscriber> values = ((Map) obj).values();
String str = this.$sessionId;
for (SessionSubscriber sessionSubscriber : values) {
sessionSubscriber.onSessionChanged(new SessionSubscriber.SessionDetails(str));
StringBuilder sb = new StringBuilder();
sb.append("Notified ");
sb.append(sessionSubscriber.getSessionSubscriberName());
sb.append(" of new session ");
sb.append(str);
}
return Unit.INSTANCE;
}
}

View File

@@ -0,0 +1,102 @@
package com.google.firebase.sessions;
import android.os.Message;
import com.google.firebase.sessions.api.FirebaseSessionsDependencies;
import com.google.firebase.sessions.api.SessionSubscriber;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.comparisons.ComparisonsKt__ComparisonsKt;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.CoroutineScope;
/* loaded from: classes3.dex */
public final class SessionLifecycleClient$sendLifecycleEvents$1 extends SuspendLambda implements Function2 {
public final /* synthetic */ List $messages;
public int label;
public final /* synthetic */ SessionLifecycleClient this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SessionLifecycleClient$sendLifecycleEvents$1(SessionLifecycleClient sessionLifecycleClient, List list, Continuation continuation) {
super(2, continuation);
this.this$0 = sessionLifecycleClient;
this.$messages = list;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new SessionLifecycleClient$sendLifecycleEvents$1(this.this$0, this.$messages, continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((SessionLifecycleClient$sendLifecycleEvents$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
Message latestByCode;
Message latestByCode2;
List mutableListOf;
List filterNotNull;
List sortedWith;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
FirebaseSessionsDependencies firebaseSessionsDependencies = FirebaseSessionsDependencies.INSTANCE;
this.label = 1;
obj = firebaseSessionsDependencies.getRegisteredSubscribers$com_google_firebase_firebase_sessions(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);
}
Map map = (Map) obj;
if (!map.isEmpty()) {
Collection values = map.values();
if (!(values instanceof Collection) || !values.isEmpty()) {
Iterator it = values.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
if (((SessionSubscriber) it.next()).isDataCollectionEnabled()) {
latestByCode = this.this$0.getLatestByCode(this.$messages, 2);
latestByCode2 = this.this$0.getLatestByCode(this.$messages, 1);
mutableListOf = CollectionsKt__CollectionsKt.mutableListOf(latestByCode, latestByCode2);
filterNotNull = CollectionsKt___CollectionsKt.filterNotNull(mutableListOf);
sortedWith = CollectionsKt___CollectionsKt.sortedWith(filterNotNull, new Comparator() { // from class: com.google.firebase.sessions.SessionLifecycleClient$sendLifecycleEvents$1$invokeSuspend$$inlined$sortedBy$1
@Override // java.util.Comparator
public final int compare(Object obj2, Object obj3) {
int compareValues;
compareValues = ComparisonsKt__ComparisonsKt.compareValues(Long.valueOf(((Message) obj2).getWhen()), Long.valueOf(((Message) obj3).getWhen()));
return compareValues;
}
});
SessionLifecycleClient sessionLifecycleClient = this.this$0;
Iterator it2 = sortedWith.iterator();
while (it2.hasNext()) {
sessionLifecycleClient.sendMessageToServer((Message) it2.next());
}
}
}
}
}
return Unit.INSTANCE;
}
}

View File

@@ -0,0 +1,203 @@
package com.google.firebase.sessions;
import android.content.ComponentName;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
import android.util.Log;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.LinkedBlockingDeque;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
import kotlinx.coroutines.CoroutineScopeKt;
import kotlinx.coroutines.Job;
/* loaded from: classes3.dex */
public final class SessionLifecycleClient {
public static final Companion Companion = new Companion(null);
public final CoroutineContext backgroundDispatcher;
public final LinkedBlockingDeque queuedMessages;
public Messenger service;
public boolean serviceBound;
public final SessionLifecycleClient$serviceConnection$1 serviceConnection;
/* JADX WARN: Type inference failed for: r2v2, types: [com.google.firebase.sessions.SessionLifecycleClient$serviceConnection$1] */
public SessionLifecycleClient(CoroutineContext backgroundDispatcher) {
Intrinsics.checkNotNullParameter(backgroundDispatcher, "backgroundDispatcher");
this.backgroundDispatcher = backgroundDispatcher;
this.queuedMessages = new LinkedBlockingDeque(20);
this.serviceConnection = new ServiceConnection() { // from class: com.google.firebase.sessions.SessionLifecycleClient$serviceConnection$1
@Override // android.content.ServiceConnection
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
LinkedBlockingDeque linkedBlockingDeque;
List drainQueue;
StringBuilder sb = new StringBuilder();
sb.append("Connected to SessionLifecycleService. Queue size ");
linkedBlockingDeque = SessionLifecycleClient.this.queuedMessages;
sb.append(linkedBlockingDeque.size());
SessionLifecycleClient.this.service = new Messenger(iBinder);
SessionLifecycleClient.this.serviceBound = true;
SessionLifecycleClient sessionLifecycleClient = SessionLifecycleClient.this;
drainQueue = sessionLifecycleClient.drainQueue();
sessionLifecycleClient.sendLifecycleEvents(drainQueue);
}
@Override // android.content.ServiceConnection
public void onServiceDisconnected(ComponentName componentName) {
SessionLifecycleClient.this.service = null;
SessionLifecycleClient.this.serviceBound = false;
}
};
}
public static final class ClientUpdateHandler extends Handler {
public final CoroutineContext backgroundDispatcher;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public ClientUpdateHandler(CoroutineContext backgroundDispatcher) {
super(Looper.getMainLooper());
Intrinsics.checkNotNullParameter(backgroundDispatcher, "backgroundDispatcher");
this.backgroundDispatcher = backgroundDispatcher;
}
@Override // android.os.Handler
public void handleMessage(Message msg) {
String str;
Intrinsics.checkNotNullParameter(msg, "msg");
if (msg.what == 3) {
Bundle data = msg.getData();
if (data == null || (str = data.getString("SessionUpdateExtra")) == null) {
str = "";
}
handleSessionUpdate(str);
return;
}
Log.w("SessionLifecycleClient", "Received unexpected event from the SessionLifecycleService: " + msg);
super.handleMessage(msg);
}
public final void handleSessionUpdate(String str) {
StringBuilder sb = new StringBuilder();
sb.append("Session update received: ");
sb.append(str);
BuildersKt__Builders_commonKt.launch$default(CoroutineScopeKt.CoroutineScope(this.backgroundDispatcher), null, null, new SessionLifecycleClient$ClientUpdateHandler$handleSessionUpdate$1(str, null), 3, null);
}
}
public final void bindToService(SessionLifecycleServiceBinder sessionLifecycleServiceBinder) {
Intrinsics.checkNotNullParameter(sessionLifecycleServiceBinder, "sessionLifecycleServiceBinder");
sessionLifecycleServiceBinder.bindToService(new Messenger(new ClientUpdateHandler(this.backgroundDispatcher)), this.serviceConnection);
}
public final void foregrounded() {
sendLifecycleEvent(1);
}
public final void backgrounded() {
sendLifecycleEvent(2);
}
public final void sendLifecycleEvent(int i) {
List drainQueue = drainQueue();
Message obtain = Message.obtain(null, i, 0, 0);
Intrinsics.checkNotNullExpressionValue(obtain, "obtain(null, messageCode, 0, 0)");
drainQueue.add(obtain);
sendLifecycleEvents(drainQueue);
}
public final Job sendLifecycleEvents(List list) {
Job launch$default;
launch$default = BuildersKt__Builders_commonKt.launch$default(CoroutineScopeKt.CoroutineScope(this.backgroundDispatcher), null, null, new SessionLifecycleClient$sendLifecycleEvents$1(this, list, null), 3, null);
return launch$default;
}
public final void sendMessageToServer(Message message) {
if (this.service != null) {
try {
StringBuilder sb = new StringBuilder();
sb.append("Sending lifecycle ");
sb.append(message.what);
sb.append(" to service");
Messenger messenger = this.service;
if (messenger != null) {
messenger.send(message);
return;
}
return;
} catch (RemoteException e) {
Log.w("SessionLifecycleClient", "Unable to deliver message: " + message.what, e);
queueMessage(message);
return;
}
}
queueMessage(message);
}
public final void queueMessage(Message message) {
if (this.queuedMessages.offer(message)) {
StringBuilder sb = new StringBuilder();
sb.append("Queued message ");
sb.append(message.what);
sb.append(". Queue size ");
sb.append(this.queuedMessages.size());
return;
}
StringBuilder sb2 = new StringBuilder();
sb2.append("Failed to enqueue message ");
sb2.append(message.what);
sb2.append(". Dropping.");
}
public final List drainQueue() {
ArrayList arrayList = new ArrayList();
this.queuedMessages.drainTo(arrayList);
return arrayList;
}
public final Message getLatestByCode(List list, int i) {
Object obj;
ArrayList arrayList = new ArrayList();
for (Object obj2 : list) {
if (((Message) obj2).what == i) {
arrayList.add(obj2);
}
}
Iterator it = arrayList.iterator();
if (it.hasNext()) {
Object next = it.next();
if (it.hasNext()) {
long when = ((Message) next).getWhen();
do {
Object next2 = it.next();
long when2 = ((Message) next2).getWhen();
if (when < when2) {
next = next2;
when = when2;
}
} while (it.hasNext());
}
obj = next;
} else {
obj = null;
}
return (Message) obj;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
}

View File

@@ -0,0 +1,220 @@
package com.google.firebase.sessions;
import android.app.Service;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.DeadObjectException;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.Messenger;
import android.util.Log;
import com.google.firebase.sessions.SessionGenerator;
import com.google.firebase.sessions.settings.SessionsSettings;
import java.util.ArrayList;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.time.Duration;
/* loaded from: classes3.dex */
public final class SessionLifecycleService extends Service {
public static final Companion Companion = new Companion(null);
public final HandlerThread handlerThread = new HandlerThread("FirebaseSessions_HandlerThread");
public MessageHandler messageHandler;
public Messenger messenger;
public static final class MessageHandler extends Handler {
public final ArrayList boundClients;
public boolean hasForegrounded;
public long lastMsgTimeMs;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public MessageHandler(Looper looper) {
super(looper);
Intrinsics.checkNotNullParameter(looper, "looper");
this.boundClients = new ArrayList();
}
@Override // android.os.Handler
public void handleMessage(Message msg) {
Intrinsics.checkNotNullParameter(msg, "msg");
if (this.lastMsgTimeMs > msg.getWhen()) {
StringBuilder sb = new StringBuilder();
sb.append("Ignoring old message from ");
sb.append(msg.getWhen());
sb.append(" which is older than ");
sb.append(this.lastMsgTimeMs);
sb.append('.');
return;
}
int i = msg.what;
if (i == 1) {
handleForegrounding(msg);
return;
}
if (i == 2) {
handleBackgrounding(msg);
return;
}
if (i == 4) {
handleClientBound(msg);
return;
}
Log.w("SessionLifecycleService", "Received unexpected event from the SessionLifecycleClient: " + msg);
super.handleMessage(msg);
}
public final void handleForegrounding(Message message) {
StringBuilder sb = new StringBuilder();
sb.append("Activity foregrounding at ");
sb.append(message.getWhen());
sb.append('.');
if (!this.hasForegrounded) {
this.hasForegrounded = true;
newSession();
} else if (isSessionRestart(message.getWhen())) {
newSession();
}
this.lastMsgTimeMs = message.getWhen();
}
public final void handleBackgrounding(Message message) {
StringBuilder sb = new StringBuilder();
sb.append("Activity backgrounding at ");
sb.append(message.getWhen());
this.lastMsgTimeMs = message.getWhen();
}
public final void handleClientBound(Message message) {
this.boundClients.add(message.replyTo);
Messenger messenger = message.replyTo;
Intrinsics.checkNotNullExpressionValue(messenger, "msg.replyTo");
maybeSendSessionToClient(messenger);
StringBuilder sb = new StringBuilder();
sb.append("Client ");
sb.append(message.replyTo);
sb.append(" bound at ");
sb.append(message.getWhen());
sb.append(". Clients: ");
sb.append(this.boundClients.size());
}
public final void newSession() {
SessionGenerator.Companion companion = SessionGenerator.Companion;
companion.getInstance().generateNewSession();
StringBuilder sb = new StringBuilder();
sb.append("Generated new session ");
sb.append(companion.getInstance().getCurrentSession().getSessionId());
broadcastSession();
SessionDatastore.Companion.getInstance().updateSessionId(companion.getInstance().getCurrentSession().getSessionId());
}
public final void broadcastSession() {
StringBuilder sb = new StringBuilder();
sb.append("Broadcasting new session: ");
SessionGenerator.Companion companion = SessionGenerator.Companion;
sb.append(companion.getInstance().getCurrentSession());
SessionFirelogPublisher.Companion.getInstance().logSession(companion.getInstance().getCurrentSession());
for (Messenger it : new ArrayList(this.boundClients)) {
Intrinsics.checkNotNullExpressionValue(it, "it");
maybeSendSessionToClient(it);
}
}
public final void maybeSendSessionToClient(Messenger messenger) {
if (this.hasForegrounded) {
sendSessionToClient(messenger, SessionGenerator.Companion.getInstance().getCurrentSession().getSessionId());
return;
}
String currentSessionId = SessionDatastore.Companion.getInstance().getCurrentSessionId();
StringBuilder sb = new StringBuilder();
sb.append("App has not yet foregrounded. Using previously stored session: ");
sb.append(currentSessionId);
if (currentSessionId != null) {
sendSessionToClient(messenger, currentSessionId);
}
}
public final void sendSessionToClient(Messenger messenger, String str) {
try {
Bundle bundle = new Bundle();
bundle.putString("SessionUpdateExtra", str);
Message obtain = Message.obtain(null, 3, 0, 0);
obtain.setData(bundle);
messenger.send(obtain);
} catch (DeadObjectException unused) {
StringBuilder sb = new StringBuilder();
sb.append("Removing dead client from list: ");
sb.append(messenger);
this.boundClients.remove(messenger);
} catch (Exception e) {
Log.w("SessionLifecycleService", "Unable to push new session to " + messenger + '.', e);
}
}
public final boolean isSessionRestart(long j) {
return j - this.lastMsgTimeMs > Duration.m4081getInWholeMillisecondsimpl(SessionsSettings.Companion.getInstance().m853getSessionRestartTimeoutUwyO8pc());
}
}
@Override // android.app.Service
public void onCreate() {
super.onCreate();
this.handlerThread.start();
Looper looper = this.handlerThread.getLooper();
Intrinsics.checkNotNullExpressionValue(looper, "handlerThread.looper");
this.messageHandler = new MessageHandler(looper);
this.messenger = new Messenger(this.messageHandler);
}
@Override // android.app.Service
public IBinder onBind(Intent intent) {
if (intent == null) {
return null;
}
StringBuilder sb = new StringBuilder();
sb.append("Service bound to new client on process ");
sb.append(intent.getAction());
Messenger clientCallback = getClientCallback(intent);
if (clientCallback != null) {
Message obtain = Message.obtain(null, 4, 0, 0);
obtain.replyTo = clientCallback;
MessageHandler messageHandler = this.messageHandler;
if (messageHandler != null) {
messageHandler.sendMessage(obtain);
}
}
Messenger messenger = this.messenger;
if (messenger != null) {
return messenger.getBinder();
}
return null;
}
@Override // android.app.Service
public void onDestroy() {
super.onDestroy();
this.handlerThread.quit();
}
public final Messenger getClientCallback(Intent intent) {
Object parcelableExtra;
if (Build.VERSION.SDK_INT >= 33) {
parcelableExtra = intent.getParcelableExtra("ClientCallbackMessenger", Messenger.class);
return (Messenger) parcelableExtra;
}
return (Messenger) intent.getParcelableExtra("ClientCallbackMessenger");
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
}

View File

@@ -0,0 +1,9 @@
package com.google.firebase.sessions;
import android.content.ServiceConnection;
import android.os.Messenger;
/* loaded from: classes3.dex */
public interface SessionLifecycleServiceBinder {
void bindToService(Messenger messenger, ServiceConnection serviceConnection);
}

View File

@@ -0,0 +1,60 @@
package com.google.firebase.sessions;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Messenger;
import android.os.Process;
import android.util.Log;
import com.google.firebase.FirebaseApp;
import kotlin.Unit;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public final class SessionLifecycleServiceBinderImpl implements SessionLifecycleServiceBinder {
public static final Companion Companion = new Companion(null);
public final FirebaseApp firebaseApp;
public SessionLifecycleServiceBinderImpl(FirebaseApp firebaseApp) {
Intrinsics.checkNotNullParameter(firebaseApp, "firebaseApp");
this.firebaseApp = firebaseApp;
}
@Override // com.google.firebase.sessions.SessionLifecycleServiceBinder
public void bindToService(Messenger callback, ServiceConnection serviceConnection) {
Intrinsics.checkNotNullParameter(callback, "callback");
Intrinsics.checkNotNullParameter(serviceConnection, "serviceConnection");
Context appContext = this.firebaseApp.getApplicationContext().getApplicationContext();
Intent intent = new Intent(appContext, (Class<?>) SessionLifecycleService.class);
intent.setAction(String.valueOf(Process.myPid()));
intent.putExtra("ClientCallbackMessenger", callback);
try {
if (appContext.bindService(intent, serviceConnection, 65)) {
return;
}
} catch (SecurityException e) {
Log.w("LifecycleServiceBinder", "Failed to bind session lifecycle service to application.", e);
}
Intrinsics.checkNotNullExpressionValue(appContext, "appContext");
unbindServiceSafely(appContext, serviceConnection);
}
public final Object unbindServiceSafely(Context context, ServiceConnection serviceConnection) {
try {
context.unbindService(serviceConnection);
return Unit.INSTANCE;
} catch (IllegalArgumentException e) {
return Integer.valueOf(Log.w("LifecycleServiceBinder", "Session lifecycle service binding failed.", e));
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
}

View File

@@ -0,0 +1,74 @@
package com.google.firebase.sessions;
import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import kotlin.Unit;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public final class SessionsActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
public static final SessionsActivityLifecycleCallbacks INSTANCE = new SessionsActivityLifecycleCallbacks();
public static boolean hasPendingForeground;
public static SessionLifecycleClient lifecycleClient;
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityCreated(Activity activity, Bundle bundle) {
Intrinsics.checkNotNullParameter(activity, "activity");
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityDestroyed(Activity activity) {
Intrinsics.checkNotNullParameter(activity, "activity");
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
Intrinsics.checkNotNullParameter(activity, "activity");
Intrinsics.checkNotNullParameter(outState, "outState");
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStarted(Activity activity) {
Intrinsics.checkNotNullParameter(activity, "activity");
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStopped(Activity activity) {
Intrinsics.checkNotNullParameter(activity, "activity");
}
public final void setLifecycleClient(SessionLifecycleClient sessionLifecycleClient) {
lifecycleClient = sessionLifecycleClient;
if (sessionLifecycleClient == null || !hasPendingForeground) {
return;
}
hasPendingForeground = false;
sessionLifecycleClient.foregrounded();
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityResumed(Activity activity) {
Unit unit;
Intrinsics.checkNotNullParameter(activity, "activity");
SessionLifecycleClient sessionLifecycleClient = lifecycleClient;
if (sessionLifecycleClient != null) {
sessionLifecycleClient.foregrounded();
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
hasPendingForeground = true;
}
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityPaused(Activity activity) {
Intrinsics.checkNotNullParameter(activity, "activity");
SessionLifecycleClient sessionLifecycleClient = lifecycleClient;
if (sessionLifecycleClient != null) {
sessionLifecycleClient.backgrounded();
}
}
}

View File

@@ -0,0 +1,6 @@
package com.google.firebase.sessions;
/* loaded from: classes3.dex */
public interface TimeProvider {
long currentTimeUs();
}

View File

@@ -0,0 +1,11 @@
package com.google.firebase.sessions;
/* loaded from: classes3.dex */
public final class WallClock implements TimeProvider {
public static final WallClock INSTANCE = new WallClock();
@Override // com.google.firebase.sessions.TimeProvider
public long currentTimeUs() {
return System.currentTimeMillis() * 1000;
}
}

View File

@@ -0,0 +1,30 @@
package com.google.firebase.sessions.api;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
/* loaded from: classes3.dex */
public final class FirebaseSessionsDependencies$getRegisteredSubscribers$1 extends ContinuationImpl {
public Object L$0;
public Object L$1;
public Object L$2;
public Object L$3;
public Object L$4;
public Object L$5;
public int label;
public /* synthetic */ Object result;
public final /* synthetic */ FirebaseSessionsDependencies this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public FirebaseSessionsDependencies$getRegisteredSubscribers$1(FirebaseSessionsDependencies firebaseSessionsDependencies, Continuation continuation) {
super(continuation);
this.this$0 = firebaseSessionsDependencies;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return this.this$0.getRegisteredSubscribers$com_google_firebase_firebase_sessions(this);
}
}

View File

@@ -0,0 +1,231 @@
package com.google.firebase.sessions.api;
import com.google.firebase.sessions.api.SessionSubscriber;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.sync.Mutex;
import kotlinx.coroutines.sync.MutexKt;
/* loaded from: classes3.dex */
public final class FirebaseSessionsDependencies {
public static final FirebaseSessionsDependencies INSTANCE = new FirebaseSessionsDependencies();
public static final Map dependencies = Collections.synchronizedMap(new LinkedHashMap());
/* JADX WARN: Multi-variable type inference failed */
public static final void addDependency(SessionSubscriber.Name subscriberName) {
Intrinsics.checkNotNullParameter(subscriberName, "subscriberName");
if (subscriberName == SessionSubscriber.Name.PERFORMANCE) {
throw new IllegalArgumentException("Incompatible versions of Firebase Perf and Firebase Sessions.\nA safe combination would be:\n firebase-sessions:1.1.0\n firebase-crashlytics:18.5.0\n firebase-perf:20.5.0\nFor more information contact Firebase Support.");
}
Map dependencies2 = dependencies;
if (dependencies2.containsKey(subscriberName)) {
StringBuilder sb = new StringBuilder();
sb.append("Dependency ");
sb.append(subscriberName);
sb.append(" already added.");
return;
}
Intrinsics.checkNotNullExpressionValue(dependencies2, "dependencies");
dependencies2.put(subscriberName, new Dependency(MutexKt.Mutex(true), null, 2, 0 == true ? 1 : 0));
StringBuilder sb2 = new StringBuilder();
sb2.append("Dependency to ");
sb2.append(subscriberName);
sb2.append(" added.");
}
public static final void register(SessionSubscriber subscriber) {
Intrinsics.checkNotNullParameter(subscriber, "subscriber");
SessionSubscriber.Name sessionSubscriberName = subscriber.getSessionSubscriberName();
Dependency dependency = INSTANCE.getDependency(sessionSubscriberName);
if (dependency.getSubscriber() != null) {
StringBuilder sb = new StringBuilder();
sb.append("Subscriber ");
sb.append(sessionSubscriberName);
sb.append(" already registered.");
return;
}
dependency.setSubscriber(subscriber);
StringBuilder sb2 = new StringBuilder();
sb2.append("Subscriber ");
sb2.append(sessionSubscriberName);
sb2.append(" registered.");
Mutex.DefaultImpls.unlock$default(dependency.getMutex(), null, 1, null);
}
/* JADX WARN: Removed duplicated region for block: B:15:0x006f */
/* JADX WARN: Removed duplicated region for block: B:20:0x00b3 A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:27:0x0048 */
/* JADX WARN: Removed duplicated region for block: B:8:0x0024 */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:19:0x009f -> B:10:0x00a0). 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 java.lang.Object getRegisteredSubscribers$com_google_firebase_firebase_sessions(kotlin.coroutines.Continuation r11) {
/*
r10 = this;
boolean r0 = r11 instanceof com.google.firebase.sessions.api.FirebaseSessionsDependencies$getRegisteredSubscribers$1
if (r0 == 0) goto L13
r0 = r11
com.google.firebase.sessions.api.FirebaseSessionsDependencies$getRegisteredSubscribers$1 r0 = (com.google.firebase.sessions.api.FirebaseSessionsDependencies$getRegisteredSubscribers$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.api.FirebaseSessionsDependencies$getRegisteredSubscribers$1 r0 = new com.google.firebase.sessions.api.FirebaseSessionsDependencies$getRegisteredSubscribers$1
r0.<init>(r10, r11)
L18:
java.lang.Object r11 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 0
r4 = 1
if (r2 == 0) goto L48
if (r2 != r4) goto L40
java.lang.Object r2 = r0.L$5
java.lang.Object r5 = r0.L$4
java.util.Map r5 = (java.util.Map) r5
java.lang.Object r6 = r0.L$3
kotlinx.coroutines.sync.Mutex r6 = (kotlinx.coroutines.sync.Mutex) r6
java.lang.Object r7 = r0.L$2
com.google.firebase.sessions.api.SessionSubscriber$Name r7 = (com.google.firebase.sessions.api.SessionSubscriber.Name) r7
java.lang.Object r8 = r0.L$1
java.util.Iterator r8 = (java.util.Iterator) r8
java.lang.Object r9 = r0.L$0
java.util.Map r9 = (java.util.Map) r9
kotlin.ResultKt.throwOnFailure(r11)
goto La0
L40:
java.lang.IllegalStateException r11 = new java.lang.IllegalStateException
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
r11.<init>(r0)
throw r11
L48:
kotlin.ResultKt.throwOnFailure(r11)
java.util.Map r11 = com.google.firebase.sessions.api.FirebaseSessionsDependencies.dependencies
java.lang.String r2 = "dependencies"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r11, r2)
java.util.LinkedHashMap r2 = new java.util.LinkedHashMap
int r5 = r11.size()
int r5 = kotlin.collections.MapsKt.mapCapacity(r5)
r2.<init>(r5)
java.util.Set r11 = r11.entrySet()
java.util.Iterator r11 = r11.iterator()
r8 = r11
r5 = r2
L69:
boolean r11 = r8.hasNext()
if (r11 == 0) goto Lb3
java.lang.Object r11 = r8.next()
java.util.Map$Entry r11 = (java.util.Map.Entry) r11
java.lang.Object r2 = r11.getKey()
java.lang.Object r6 = r11.getKey()
r7 = r6
com.google.firebase.sessions.api.SessionSubscriber$Name r7 = (com.google.firebase.sessions.api.SessionSubscriber.Name) r7
java.lang.Object r11 = r11.getValue()
com.google.firebase.sessions.api.FirebaseSessionsDependencies$Dependency r11 = (com.google.firebase.sessions.api.FirebaseSessionsDependencies.Dependency) r11
kotlinx.coroutines.sync.Mutex r6 = r11.getMutex()
r0.L$0 = r5
r0.L$1 = r8
r0.L$2 = r7
r0.L$3 = r6
r0.L$4 = r5
r0.L$5 = r2
r0.label = r4
java.lang.Object r11 = r6.lock(r3, r0)
if (r11 != r1) goto L9f
return r1
L9f:
r9 = r5
La0:
com.google.firebase.sessions.api.FirebaseSessionsDependencies r11 = com.google.firebase.sessions.api.FirebaseSessionsDependencies.INSTANCE // Catch: java.lang.Throwable -> Lae
com.google.firebase.sessions.api.SessionSubscriber r11 = r11.getSubscriber$com_google_firebase_firebase_sessions(r7) // Catch: java.lang.Throwable -> Lae
r6.unlock(r3)
r5.put(r2, r11)
r5 = r9
goto L69
Lae:
r11 = move-exception
r6.unlock(r3)
throw r11
Lb3:
return r5
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.sessions.api.FirebaseSessionsDependencies.getRegisteredSubscribers$com_google_firebase_firebase_sessions(kotlin.coroutines.Continuation):java.lang.Object");
}
public final SessionSubscriber getSubscriber$com_google_firebase_firebase_sessions(SessionSubscriber.Name subscriberName) {
Intrinsics.checkNotNullParameter(subscriberName, "subscriberName");
SessionSubscriber subscriber = getDependency(subscriberName).getSubscriber();
if (subscriber != null) {
return subscriber;
}
throw new IllegalStateException("Subscriber " + subscriberName + " has not been registered.");
}
public final Dependency getDependency(SessionSubscriber.Name name) {
Map dependencies2 = dependencies;
Intrinsics.checkNotNullExpressionValue(dependencies2, "dependencies");
Object obj = dependencies2.get(name);
if (obj != null) {
Intrinsics.checkNotNullExpressionValue(obj, "dependencies.getOrElse(s…load time.\"\n )\n }");
return (Dependency) obj;
}
throw new IllegalStateException("Cannot get dependency " + name + ". Dependencies should be added at class load time.");
}
public static final class Dependency {
public final Mutex mutex;
public SessionSubscriber subscriber;
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Dependency)) {
return false;
}
Dependency dependency = (Dependency) obj;
return Intrinsics.areEqual(this.mutex, dependency.mutex) && Intrinsics.areEqual(this.subscriber, dependency.subscriber);
}
public final Mutex getMutex() {
return this.mutex;
}
public final SessionSubscriber getSubscriber() {
return this.subscriber;
}
public int hashCode() {
int hashCode = this.mutex.hashCode() * 31;
SessionSubscriber sessionSubscriber = this.subscriber;
return hashCode + (sessionSubscriber == null ? 0 : sessionSubscriber.hashCode());
}
public final void setSubscriber(SessionSubscriber sessionSubscriber) {
this.subscriber = sessionSubscriber;
}
public String toString() {
return "Dependency(mutex=" + this.mutex + ", subscriber=" + this.subscriber + ')';
}
public Dependency(Mutex mutex, SessionSubscriber sessionSubscriber) {
Intrinsics.checkNotNullParameter(mutex, "mutex");
this.mutex = mutex;
this.subscriber = sessionSubscriber;
}
public /* synthetic */ Dependency(Mutex mutex, SessionSubscriber sessionSubscriber, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(mutex, (i & 2) != 0 ? null : sessionSubscriber);
}
}
}

View File

@@ -0,0 +1,47 @@
package com.google.firebase.sessions.api;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public interface SessionSubscriber {
public enum Name {
CRASHLYTICS,
PERFORMANCE,
MATT_SAYS_HI
}
Name getSessionSubscriberName();
boolean isDataCollectionEnabled();
void onSessionChanged(SessionDetails sessionDetails);
public static final class SessionDetails {
public final String sessionId;
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
return (obj instanceof SessionDetails) && Intrinsics.areEqual(this.sessionId, ((SessionDetails) obj).sessionId);
}
public final String getSessionId() {
return this.sessionId;
}
public int hashCode() {
return this.sessionId.hashCode();
}
public String toString() {
return "SessionDetails(sessionId=" + this.sessionId + ')';
}
public SessionDetails(String sessionId) {
Intrinsics.checkNotNullParameter(sessionId, "sessionId");
this.sessionId = sessionId;
}
}
}

View File

@@ -0,0 +1,10 @@
package com.google.firebase.sessions.settings;
import java.util.Map;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function2;
/* loaded from: classes3.dex */
public interface CrashlyticsSettingsFetcher {
Object doConfigFetch(Map map, Function2 function2, Function2 function22, Continuation continuation);
}

View File

@@ -0,0 +1,62 @@
package com.google.firebase.sessions.settings;
import android.content.Context;
import android.os.Bundle;
import com.google.firebase.sessions.settings.SettingsProvider;
import kotlin.coroutines.Continuation;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.time.Duration;
import kotlin.time.DurationKt;
import kotlin.time.DurationUnit;
/* loaded from: classes3.dex */
public final class LocalOverrideSettings implements SettingsProvider {
public static final Companion Companion = new Companion(null);
public final Bundle metadata;
public LocalOverrideSettings(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
Bundle bundle = context.getPackageManager().getApplicationInfo(context.getPackageName(), 128).metaData;
this.metadata = bundle == null ? Bundle.EMPTY : bundle;
}
@Override // com.google.firebase.sessions.settings.SettingsProvider
public Object updateSettings(Continuation continuation) {
return SettingsProvider.DefaultImpls.updateSettings(this, continuation);
}
@Override // com.google.firebase.sessions.settings.SettingsProvider
public Boolean getSessionEnabled() {
if (this.metadata.containsKey("firebase_sessions_enabled")) {
return Boolean.valueOf(this.metadata.getBoolean("firebase_sessions_enabled"));
}
return null;
}
@Override // com.google.firebase.sessions.settings.SettingsProvider
/* renamed from: getSessionRestartTimeout-FghU774, reason: not valid java name */
public Duration mo852getSessionRestartTimeoutFghU774() {
if (this.metadata.containsKey("firebase_sessions_sessions_restart_timeout")) {
return Duration.m4073boximpl(DurationKt.toDuration(this.metadata.getInt("firebase_sessions_sessions_restart_timeout"), DurationUnit.SECONDS));
}
return null;
}
@Override // com.google.firebase.sessions.settings.SettingsProvider
public Double getSamplingRate() {
if (this.metadata.containsKey("firebase_sessions_sampling_rate")) {
return Double.valueOf(this.metadata.getDouble("firebase_sessions_sampling_rate"));
}
return null;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
}

View File

@@ -0,0 +1,26 @@
package com.google.firebase.sessions.settings;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
/* loaded from: classes3.dex */
public final class RemoteSettings$updateSettings$1 extends ContinuationImpl {
public Object L$0;
public Object L$1;
public int label;
public /* synthetic */ Object result;
public final /* synthetic */ RemoteSettings this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public RemoteSettings$updateSettings$1(RemoteSettings remoteSettings, Continuation continuation) {
super(continuation);
this.this$0 = remoteSettings;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return this.this$0.updateSettings(this);
}
}

View File

@@ -0,0 +1,59 @@
package com.google.firebase.sessions.settings;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import org.json.JSONObject;
/* loaded from: classes3.dex */
public final class RemoteSettings$updateSettings$2$1 extends SuspendLambda implements Function2 {
public /* synthetic */ Object L$0;
public Object L$1;
public Object L$2;
public int label;
public final /* synthetic */ RemoteSettings this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public RemoteSettings$updateSettings$2$1(RemoteSettings remoteSettings, Continuation continuation) {
super(2, continuation);
this.this$0 = remoteSettings;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
RemoteSettings$updateSettings$2$1 remoteSettings$updateSettings$2$1 = new RemoteSettings$updateSettings$2$1(this.this$0, continuation);
remoteSettings$updateSettings$2$1.L$0 = obj;
return remoteSettings$updateSettings$2$1;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(JSONObject jSONObject, Continuation continuation) {
return ((RemoteSettings$updateSettings$2$1) create(jSONObject, continuation)).invokeSuspend(Unit.INSTANCE);
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Removed duplicated region for block: B:12:0x0191 A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:16:0x0157 */
/* JADX WARN: Removed duplicated region for block: B:22:0x0137 */
/* JADX WARN: Removed duplicated region for block: B:25:0x0154 */
/* JADX WARN: Removed duplicated region for block: B:29:0x0117 */
/* JADX WARN: Removed duplicated region for block: B:36:0x00f7 */
/* JADX WARN: Removed duplicated region for block: B:59:0x00d0 */
/* JADX WARN: Removed duplicated region for block: B:63:0x00ef */
/* JADX WARN: Type inference failed for: r12v12, types: [T, java.lang.Integer] */
/* JADX WARN: Type inference failed for: r1v6, types: [T, java.lang.Integer] */
/* JADX WARN: Type inference failed for: r2v4, types: [T, java.lang.Double] */
@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 r12) {
/*
Method dump skipped, instructions count: 424
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.sessions.settings.RemoteSettings$updateSettings$2$1.invokeSuspend(java.lang.Object):java.lang.Object");
}
}

View File

@@ -0,0 +1,42 @@
package com.google.firebase.sessions.settings;
import android.util.Log;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
/* loaded from: classes3.dex */
public final class RemoteSettings$updateSettings$2$2 extends SuspendLambda implements Function2 {
public /* synthetic */ Object L$0;
public int label;
public RemoteSettings$updateSettings$2$2(Continuation continuation) {
super(2, continuation);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
RemoteSettings$updateSettings$2$2 remoteSettings$updateSettings$2$2 = new RemoteSettings$updateSettings$2$2(continuation);
remoteSettings$updateSettings$2$2.L$0 = obj;
return remoteSettings$updateSettings$2$2;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(String str, Continuation continuation) {
return ((RemoteSettings$updateSettings$2$2) create(str, 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);
Log.e("SessionConfigFetcher", "Error failing to fetch the remote configs: " + ((String) this.L$0));
return Unit.INSTANCE;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}

View File

@@ -0,0 +1,110 @@
package com.google.firebase.sessions.settings;
import androidx.datastore.core.DataStore;
import com.google.firebase.installations.FirebaseInstallationsApi;
import com.google.firebase.sessions.ApplicationInfo;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.Regex;
import kotlin.time.Duration;
import kotlin.time.DurationKt;
import kotlin.time.DurationUnit;
import kotlinx.coroutines.sync.Mutex;
import kotlinx.coroutines.sync.MutexKt;
/* loaded from: classes3.dex */
public final class RemoteSettings implements SettingsProvider {
public static final Companion Companion = new Companion(null);
public final ApplicationInfo appInfo;
public final CoroutineContext backgroundDispatcher;
public final CrashlyticsSettingsFetcher configsFetcher;
public final Mutex fetchInProgress;
public final FirebaseInstallationsApi firebaseInstallationsApi;
public final Lazy settingsCache$delegate;
public RemoteSettings(CoroutineContext backgroundDispatcher, FirebaseInstallationsApi firebaseInstallationsApi, ApplicationInfo appInfo, CrashlyticsSettingsFetcher configsFetcher, final DataStore dataStore) {
Lazy lazy;
Intrinsics.checkNotNullParameter(backgroundDispatcher, "backgroundDispatcher");
Intrinsics.checkNotNullParameter(firebaseInstallationsApi, "firebaseInstallationsApi");
Intrinsics.checkNotNullParameter(appInfo, "appInfo");
Intrinsics.checkNotNullParameter(configsFetcher, "configsFetcher");
Intrinsics.checkNotNullParameter(dataStore, "dataStore");
this.backgroundDispatcher = backgroundDispatcher;
this.firebaseInstallationsApi = firebaseInstallationsApi;
this.appInfo = appInfo;
this.configsFetcher = configsFetcher;
lazy = LazyKt__LazyJVMKt.lazy(new Function0() { // from class: com.google.firebase.sessions.settings.RemoteSettings$settingsCache$2
{
super(0);
}
@Override // kotlin.jvm.functions.Function0
public final SettingsCache invoke() {
return new SettingsCache(DataStore.this);
}
});
this.settingsCache$delegate = lazy;
this.fetchInProgress = MutexKt.Mutex$default(false, 1, null);
}
public final SettingsCache getSettingsCache() {
return (SettingsCache) this.settingsCache$delegate.getValue();
}
@Override // com.google.firebase.sessions.settings.SettingsProvider
public Boolean getSessionEnabled() {
return getSettingsCache().sessionsEnabled();
}
@Override // com.google.firebase.sessions.settings.SettingsProvider
/* renamed from: getSessionRestartTimeout-FghU774 */
public Duration mo852getSessionRestartTimeoutFghU774() {
Integer sessionRestartTimeout = getSettingsCache().sessionRestartTimeout();
if (sessionRestartTimeout == null) {
return null;
}
Duration.Companion companion = Duration.Companion;
return Duration.m4073boximpl(DurationKt.toDuration(sessionRestartTimeout.intValue(), DurationUnit.SECONDS));
}
@Override // com.google.firebase.sessions.settings.SettingsProvider
public Double getSamplingRate() {
return getSettingsCache().sessionSamplingRate();
}
/* JADX WARN: Removed duplicated region for block: B:29:0x00be A[Catch: all -> 0x004d, TRY_LEAVE, TryCatch #2 {all -> 0x004d, blocks: (B:26:0x0048, B:27:0x00b0, B:29:0x00be, B:33:0x00cc), top: B:25:0x0048 }] */
/* JADX WARN: Removed duplicated region for block: B:32:0x00cb */
/* JADX WARN: Removed duplicated region for block: B:43:0x0090 A[Catch: all -> 0x0096, TRY_LEAVE, TryCatch #1 {all -> 0x0096, blocks: (B:41:0x0086, B:43:0x0090, B:46:0x009c), top: B:40:0x0086 }] */
/* JADX WARN: Removed duplicated region for block: B:46:0x009c A[Catch: all -> 0x0096, TRY_ENTER, TRY_LEAVE, TryCatch #1 {all -> 0x0096, blocks: (B:41:0x0086, B:43:0x0090, B:46:0x009c), top: B:40:0x0086 }] */
/* JADX WARN: Removed duplicated region for block: B:52:0x005e */
/* JADX WARN: Removed duplicated region for block: B:8:0x0026 */
@Override // com.google.firebase.sessions.settings.SettingsProvider
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public java.lang.Object updateSettings(kotlin.coroutines.Continuation r15) {
/*
Method dump skipped, instructions count: 349
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.sessions.settings.RemoteSettings.updateSettings(kotlin.coroutines.Continuation):java.lang.Object");
}
public final String removeForwardSlashesIn(String str) {
return new Regex("/").replace(str, "");
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
}

View File

@@ -0,0 +1,120 @@
package com.google.firebase.sessions.settings;
import com.ironsource.nb;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.Map;
import javax.net.ssl.HttpsURLConnection;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Ref;
import kotlinx.coroutines.CoroutineScope;
import org.json.JSONObject;
/* loaded from: classes3.dex */
public final class RemoteSettingsFetcher$doConfigFetch$2 extends SuspendLambda implements Function2 {
public final /* synthetic */ Map $headerOptions;
public final /* synthetic */ Function2 $onFailure;
public final /* synthetic */ Function2 $onSuccess;
public int label;
public final /* synthetic */ RemoteSettingsFetcher this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public RemoteSettingsFetcher$doConfigFetch$2(RemoteSettingsFetcher remoteSettingsFetcher, Map map, Function2 function2, Function2 function22, Continuation continuation) {
super(2, continuation);
this.this$0 = remoteSettingsFetcher;
this.$headerOptions = map;
this.$onSuccess = function2;
this.$onFailure = function22;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new RemoteSettingsFetcher$doConfigFetch$2(this.this$0, this.$headerOptions, this.$onSuccess, this.$onFailure, continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((RemoteSettingsFetcher$doConfigFetch$2) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r6v0, types: [T, java.lang.String] */
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
URL url;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
try {
if (i == 0) {
ResultKt.throwOnFailure(obj);
url = this.this$0.settingsUrl();
URLConnection openConnection = url.openConnection();
Intrinsics.checkNotNull(openConnection, "null cannot be cast to non-null type javax.net.ssl.HttpsURLConnection");
HttpsURLConnection httpsURLConnection = (HttpsURLConnection) openConnection;
httpsURLConnection.setRequestMethod("GET");
httpsURLConnection.setRequestProperty("Accept", nb.L);
for (Map.Entry entry : this.$headerOptions.entrySet()) {
httpsURLConnection.setRequestProperty((String) entry.getKey(), (String) entry.getValue());
}
int responseCode = httpsURLConnection.getResponseCode();
if (responseCode == 200) {
InputStream inputStream = httpsURLConnection.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
StringBuilder sb = new StringBuilder();
Ref.ObjectRef objectRef = new Ref.ObjectRef();
while (true) {
?? readLine = bufferedReader.readLine();
objectRef.element = readLine;
if (readLine == 0) {
break;
}
sb.append((String) readLine);
}
bufferedReader.close();
inputStream.close();
JSONObject jSONObject = new JSONObject(sb.toString());
Function2 function2 = this.$onSuccess;
this.label = 1;
if (function2.invoke(jSONObject, this) == coroutine_suspended) {
return coroutine_suspended;
}
} else {
Function2 function22 = this.$onFailure;
String str = "Bad response code: " + responseCode;
this.label = 2;
if (function22.invoke(str, this) == coroutine_suspended) {
return coroutine_suspended;
}
}
} else if (i == 1 || i == 2) {
ResultKt.throwOnFailure(obj);
} else {
if (i != 3) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
} catch (Exception e) {
Function2 function23 = this.$onFailure;
String message = e.getMessage();
if (message == null) {
message = e.toString();
}
this.label = 3;
if (function23.invoke(message, this) == coroutine_suspended) {
return coroutine_suspended;
}
}
return Unit.INSTANCE;
}
}

View File

@@ -0,0 +1,56 @@
package com.google.firebase.sessions.settings;
import android.net.Uri;
import com.google.firebase.sessions.ApplicationInfo;
import java.net.URL;
import java.util.Map;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.BuildersKt;
/* loaded from: classes3.dex */
public final class RemoteSettingsFetcher implements CrashlyticsSettingsFetcher {
public static final Companion Companion = new Companion(null);
public final ApplicationInfo appInfo;
public final String baseUrl;
public final CoroutineContext blockingDispatcher;
public RemoteSettingsFetcher(ApplicationInfo appInfo, CoroutineContext blockingDispatcher, String baseUrl) {
Intrinsics.checkNotNullParameter(appInfo, "appInfo");
Intrinsics.checkNotNullParameter(blockingDispatcher, "blockingDispatcher");
Intrinsics.checkNotNullParameter(baseUrl, "baseUrl");
this.appInfo = appInfo;
this.blockingDispatcher = blockingDispatcher;
this.baseUrl = baseUrl;
}
public /* synthetic */ RemoteSettingsFetcher(ApplicationInfo applicationInfo, CoroutineContext coroutineContext, String str, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(applicationInfo, coroutineContext, (i & 4) != 0 ? "firebase-settings.crashlytics.com" : str);
}
@Override // com.google.firebase.sessions.settings.CrashlyticsSettingsFetcher
public Object doConfigFetch(Map map, Function2 function2, Function2 function22, Continuation continuation) {
Object coroutine_suspended;
Object withContext = BuildersKt.withContext(this.blockingDispatcher, new RemoteSettingsFetcher$doConfigFetch$2(this, map, function2, function22, null), continuation);
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
return withContext == coroutine_suspended ? withContext : Unit.INSTANCE;
}
public final URL settingsUrl() {
return new URL(new Uri.Builder().scheme("https").authority(this.baseUrl).appendPath("spi").appendPath("v2").appendPath("platforms").appendPath("android").appendPath("gmp").appendPath(this.appInfo.getAppId()).appendPath("settings").appendQueryParameter("build_version", this.appInfo.getAndroidAppInfo().getAppBuildVersion()).appendQueryParameter("display_version", this.appInfo.getAndroidAppInfo().getVersionName()).build().toString());
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
}

View File

@@ -0,0 +1,68 @@
package com.google.firebase.sessions.settings;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes3.dex */
public final class SessionConfigs {
public final Integer cacheDuration;
public final Long cacheUpdatedTime;
public final Boolean sessionEnabled;
public final Integer sessionRestartTimeout;
public final Double sessionSamplingRate;
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof SessionConfigs)) {
return false;
}
SessionConfigs sessionConfigs = (SessionConfigs) obj;
return Intrinsics.areEqual(this.sessionEnabled, sessionConfigs.sessionEnabled) && Intrinsics.areEqual((Object) this.sessionSamplingRate, (Object) sessionConfigs.sessionSamplingRate) && Intrinsics.areEqual(this.sessionRestartTimeout, sessionConfigs.sessionRestartTimeout) && Intrinsics.areEqual(this.cacheDuration, sessionConfigs.cacheDuration) && Intrinsics.areEqual(this.cacheUpdatedTime, sessionConfigs.cacheUpdatedTime);
}
public final Integer getCacheDuration() {
return this.cacheDuration;
}
public final Long getCacheUpdatedTime() {
return this.cacheUpdatedTime;
}
public final Boolean getSessionEnabled() {
return this.sessionEnabled;
}
public final Integer getSessionRestartTimeout() {
return this.sessionRestartTimeout;
}
public final Double getSessionSamplingRate() {
return this.sessionSamplingRate;
}
public int hashCode() {
Boolean bool = this.sessionEnabled;
int hashCode = (bool == null ? 0 : bool.hashCode()) * 31;
Double d = this.sessionSamplingRate;
int hashCode2 = (hashCode + (d == null ? 0 : d.hashCode())) * 31;
Integer num = this.sessionRestartTimeout;
int hashCode3 = (hashCode2 + (num == null ? 0 : num.hashCode())) * 31;
Integer num2 = this.cacheDuration;
int hashCode4 = (hashCode3 + (num2 == null ? 0 : num2.hashCode())) * 31;
Long l = this.cacheUpdatedTime;
return hashCode4 + (l != null ? l.hashCode() : 0);
}
public String toString() {
return "SessionConfigs(sessionEnabled=" + this.sessionEnabled + ", sessionSamplingRate=" + this.sessionSamplingRate + ", sessionRestartTimeout=" + this.sessionRestartTimeout + ", cacheDuration=" + this.cacheDuration + ", cacheUpdatedTime=" + this.cacheUpdatedTime + ')';
}
public SessionConfigs(Boolean bool, Double d, Integer num, Integer num2, Long l) {
this.sessionEnabled = bool;
this.sessionSamplingRate = d;
this.sessionRestartTimeout = num;
this.cacheDuration = num2;
this.cacheUpdatedTime = l;
}
}

View File

@@ -0,0 +1,25 @@
package com.google.firebase.sessions.settings;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
/* loaded from: classes3.dex */
public final class SessionsSettings$updateSettings$1 extends ContinuationImpl {
public Object L$0;
public int label;
public /* synthetic */ Object result;
public final /* synthetic */ SessionsSettings this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SessionsSettings$updateSettings$1(SessionsSettings sessionsSettings, Continuation continuation) {
super(continuation);
this.this$0 = sessionsSettings;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
this.result = obj;
this.label |= Integer.MIN_VALUE;
return this.this$0.updateSettings(this);
}
}

View File

@@ -0,0 +1,235 @@
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]);
}
}
}

View File

@@ -0,0 +1,26 @@
package com.google.firebase.sessions.settings;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
/* loaded from: classes3.dex */
public final class SettingsCache$updateConfigValue$1 extends ContinuationImpl {
public int label;
public /* synthetic */ Object result;
public final /* synthetic */ SettingsCache this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SettingsCache$updateConfigValue$1(SettingsCache settingsCache, Continuation continuation) {
super(continuation);
this.this$0 = settingsCache;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object updateConfigValue;
this.result = obj;
this.label |= Integer.MIN_VALUE;
updateConfigValue = this.this$0.updateConfigValue(null, null, this);
return updateConfigValue;
}
}

View File

@@ -0,0 +1,57 @@
package com.google.firebase.sessions.settings;
import androidx.datastore.preferences.core.MutablePreferences;
import androidx.datastore.preferences.core.Preferences;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
/* loaded from: classes3.dex */
public final class SettingsCache$updateConfigValue$2 extends SuspendLambda implements Function2 {
public final /* synthetic */ Preferences.Key $key;
public final /* synthetic */ Object $value;
public /* synthetic */ Object L$0;
public int label;
public final /* synthetic */ SettingsCache this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SettingsCache$updateConfigValue$2(Object obj, Preferences.Key key, SettingsCache settingsCache, Continuation continuation) {
super(2, continuation);
this.$value = obj;
this.$key = key;
this.this$0 = settingsCache;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
SettingsCache$updateConfigValue$2 settingsCache$updateConfigValue$2 = new SettingsCache$updateConfigValue$2(this.$value, this.$key, this.this$0, continuation);
settingsCache$updateConfigValue$2.L$0 = obj;
return settingsCache$updateConfigValue$2;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(MutablePreferences mutablePreferences, Continuation continuation) {
return ((SettingsCache$updateConfigValue$2) create(mutablePreferences, 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);
MutablePreferences mutablePreferences = (MutablePreferences) this.L$0;
Object obj2 = this.$value;
if (obj2 != null) {
mutablePreferences.set(this.$key, obj2);
} else {
mutablePreferences.remove(this.$key);
}
this.this$0.updateSessionConfigs(mutablePreferences);
return Unit.INSTANCE;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}

View File

@@ -0,0 +1,252 @@
package com.google.firebase.sessions.settings;
import androidx.datastore.core.DataStore;
import androidx.datastore.preferences.core.Preferences;
import androidx.datastore.preferences.core.PreferencesKeys;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.BuildersKt__BuildersKt;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.flow.Flow;
import kotlinx.coroutines.flow.FlowKt;
/* loaded from: classes3.dex */
public final class SettingsCache {
public final DataStore dataStore;
public SessionConfigs sessionConfigs;
public static final Companion Companion = new Companion(null);
public static final Preferences.Key SESSIONS_ENABLED = PreferencesKeys.booleanKey("firebase_sessions_enabled");
public static final Preferences.Key SAMPLING_RATE = PreferencesKeys.doubleKey("firebase_sessions_sampling_rate");
public static final Preferences.Key RESTART_TIMEOUT_SECONDS = PreferencesKeys.intKey("firebase_sessions_restart_timeout");
public static final Preferences.Key CACHE_DURATION_SECONDS = PreferencesKeys.intKey("firebase_sessions_cache_duration");
public static final Preferences.Key CACHE_UPDATED_TIME = PreferencesKeys.longKey("firebase_sessions_cache_updated_time");
public SettingsCache(DataStore dataStore) {
Intrinsics.checkNotNullParameter(dataStore, "dataStore");
this.dataStore = dataStore;
BuildersKt__BuildersKt.runBlocking$default(null, new AnonymousClass1(null), 1, null);
}
/* renamed from: com.google.firebase.sessions.settings.SettingsCache$1, reason: invalid class name */
public static final class AnonymousClass1 extends SuspendLambda implements Function2 {
public Object L$0;
public int label;
public AnonymousClass1(Continuation continuation) {
super(2, continuation);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return SettingsCache.this.new AnonymousClass1(continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((AnonymousClass1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
SettingsCache settingsCache;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
SettingsCache settingsCache2 = SettingsCache.this;
Flow data = settingsCache2.dataStore.getData();
this.L$0 = settingsCache2;
this.label = 1;
Object first = FlowKt.first(data, this);
if (first == coroutine_suspended) {
return coroutine_suspended;
}
settingsCache = settingsCache2;
obj = first;
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
settingsCache = (SettingsCache) this.L$0;
ResultKt.throwOnFailure(obj);
}
settingsCache.updateSessionConfigs(((Preferences) obj).toPreferences());
return Unit.INSTANCE;
}
}
public final void updateSessionConfigs(Preferences preferences) {
this.sessionConfigs = new SessionConfigs((Boolean) preferences.get(SESSIONS_ENABLED), (Double) preferences.get(SAMPLING_RATE), (Integer) preferences.get(RESTART_TIMEOUT_SECONDS), (Integer) preferences.get(CACHE_DURATION_SECONDS), (Long) preferences.get(CACHE_UPDATED_TIME));
}
public final boolean hasCacheExpired$com_google_firebase_firebase_sessions() {
SessionConfigs sessionConfigs = this.sessionConfigs;
SessionConfigs sessionConfigs2 = null;
if (sessionConfigs == null) {
Intrinsics.throwUninitializedPropertyAccessException("sessionConfigs");
sessionConfigs = null;
}
Long cacheUpdatedTime = sessionConfigs.getCacheUpdatedTime();
SessionConfigs sessionConfigs3 = this.sessionConfigs;
if (sessionConfigs3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("sessionConfigs");
} else {
sessionConfigs2 = sessionConfigs3;
}
Integer cacheDuration = sessionConfigs2.getCacheDuration();
return cacheUpdatedTime == null || cacheDuration == null || (System.currentTimeMillis() - cacheUpdatedTime.longValue()) / ((long) 1000) >= ((long) cacheDuration.intValue());
}
public final Boolean sessionsEnabled() {
SessionConfigs sessionConfigs = this.sessionConfigs;
if (sessionConfigs == null) {
Intrinsics.throwUninitializedPropertyAccessException("sessionConfigs");
sessionConfigs = null;
}
return sessionConfigs.getSessionEnabled();
}
public final Double sessionSamplingRate() {
SessionConfigs sessionConfigs = this.sessionConfigs;
if (sessionConfigs == null) {
Intrinsics.throwUninitializedPropertyAccessException("sessionConfigs");
sessionConfigs = null;
}
return sessionConfigs.getSessionSamplingRate();
}
public final Integer sessionRestartTimeout() {
SessionConfigs sessionConfigs = this.sessionConfigs;
if (sessionConfigs == null) {
Intrinsics.throwUninitializedPropertyAccessException("sessionConfigs");
sessionConfigs = null;
}
return sessionConfigs.getSessionRestartTimeout();
}
public final Object updateSettingsEnabled(Boolean bool, Continuation continuation) {
Object coroutine_suspended;
Object updateConfigValue = updateConfigValue(SESSIONS_ENABLED, bool, continuation);
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
return updateConfigValue == coroutine_suspended ? updateConfigValue : Unit.INSTANCE;
}
public final Object updateSamplingRate(Double d, Continuation continuation) {
Object coroutine_suspended;
Object updateConfigValue = updateConfigValue(SAMPLING_RATE, d, continuation);
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
return updateConfigValue == coroutine_suspended ? updateConfigValue : Unit.INSTANCE;
}
public final Object updateSessionRestartTimeout(Integer num, Continuation continuation) {
Object coroutine_suspended;
Object updateConfigValue = updateConfigValue(RESTART_TIMEOUT_SECONDS, num, continuation);
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
return updateConfigValue == coroutine_suspended ? updateConfigValue : Unit.INSTANCE;
}
public final Object updateSessionCacheDuration(Integer num, Continuation continuation) {
Object coroutine_suspended;
Object updateConfigValue = updateConfigValue(CACHE_DURATION_SECONDS, num, continuation);
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
return updateConfigValue == coroutine_suspended ? updateConfigValue : Unit.INSTANCE;
}
public final Object updateSessionCacheUpdatedTime(Long l, Continuation continuation) {
Object coroutine_suspended;
Object updateConfigValue = updateConfigValue(CACHE_UPDATED_TIME, l, continuation);
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
return updateConfigValue == coroutine_suspended ? updateConfigValue : Unit.INSTANCE;
}
/* JADX WARN: Can't wrap try/catch for region: R(10:0|1|(2:3|(7:5|6|7|(1:(1:10)(2:16|17))(3:18|19|(1:21))|11|12|13))|24|6|7|(0)(0)|11|12|13) */
/* JADX WARN: Code restructure failed: missing block: B:22:0x0029, code lost:
r6 = move-exception;
*/
/* JADX WARN: Code restructure failed: missing block: B:23:0x0047, code lost:
android.util.Log.w("SettingsCache", "Failed to update cache config value: " + r6);
*/
/* JADX WARN: Removed duplicated region for block: B:18:0x0033 */
/* JADX WARN: Removed duplicated region for block: B:9:0x0023 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object updateConfigValue(androidx.datastore.preferences.core.Preferences.Key r6, java.lang.Object r7, kotlin.coroutines.Continuation r8) {
/*
r5 = this;
boolean r0 = r8 instanceof com.google.firebase.sessions.settings.SettingsCache$updateConfigValue$1
if (r0 == 0) goto L13
r0 = r8
com.google.firebase.sessions.settings.SettingsCache$updateConfigValue$1 r0 = (com.google.firebase.sessions.settings.SettingsCache$updateConfigValue$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.SettingsCache$updateConfigValue$1 r0 = new com.google.firebase.sessions.settings.SettingsCache$updateConfigValue$1
r0.<init>(r5, r8)
L18:
java.lang.Object r8 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 1
if (r2 == 0) goto L33
if (r2 != r3) goto L2b
kotlin.ResultKt.throwOnFailure(r8) // Catch: java.io.IOException -> L29
goto L5d
L29:
r6 = move-exception
goto L47
L2b:
java.lang.IllegalStateException r6 = new java.lang.IllegalStateException
java.lang.String r7 = "call to 'resume' before 'invoke' with coroutine"
r6.<init>(r7)
throw r6
L33:
kotlin.ResultKt.throwOnFailure(r8)
androidx.datastore.core.DataStore r8 = r5.dataStore // Catch: java.io.IOException -> L29
com.google.firebase.sessions.settings.SettingsCache$updateConfigValue$2 r2 = new com.google.firebase.sessions.settings.SettingsCache$updateConfigValue$2 // Catch: java.io.IOException -> L29
r4 = 0
r2.<init>(r7, r6, r5, r4) // Catch: java.io.IOException -> L29
r0.label = r3 // Catch: java.io.IOException -> L29
java.lang.Object r6 = androidx.datastore.preferences.core.PreferencesKt.edit(r8, r2, r0) // Catch: java.io.IOException -> L29
if (r6 != r1) goto L5d
return r1
L47:
java.lang.StringBuilder r7 = new java.lang.StringBuilder
r7.<init>()
java.lang.String r8 = "Failed to update cache config value: "
r7.append(r8)
r7.append(r6)
java.lang.String r6 = r7.toString()
java.lang.String r7 = "SettingsCache"
android.util.Log.w(r7, r6)
L5d:
kotlin.Unit r6 = kotlin.Unit.INSTANCE
return r6
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.sessions.settings.SettingsCache.updateConfigValue(androidx.datastore.preferences.core.Preferences$Key, java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public Companion() {
}
}
}

View File

@@ -0,0 +1,23 @@
package com.google.firebase.sessions.settings;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.time.Duration;
/* loaded from: classes3.dex */
public interface SettingsProvider {
Double getSamplingRate();
Boolean getSessionEnabled();
/* renamed from: getSessionRestartTimeout-FghU774 */
Duration mo852getSessionRestartTimeoutFghU774();
Object updateSettings(Continuation continuation);
public static final class DefaultImpls {
public static Object updateSettings(SettingsProvider settingsProvider, Continuation continuation) {
return Unit.INSTANCE;
}
}
}