- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
77 lines
3.1 KiB
Java
77 lines
3.1 KiB
Java
package com.facebook.appevents;
|
|
|
|
import android.content.Context;
|
|
import com.facebook.FacebookSdk;
|
|
import com.facebook.internal.AttributionIdentifiers;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class AppEventCollection {
|
|
private final HashMap<AccessTokenAppIdPair, SessionEventsState> stateMap = new HashMap<>();
|
|
|
|
public final synchronized void addPersistedEvents(PersistedEvents persistedEvents) {
|
|
if (persistedEvents == null) {
|
|
return;
|
|
}
|
|
for (Map.Entry<AccessTokenAppIdPair, List<AppEvent>> entry : persistedEvents.entrySet()) {
|
|
SessionEventsState sessionEventsState = getSessionEventsState(entry.getKey());
|
|
if (sessionEventsState != null) {
|
|
Iterator<AppEvent> it = entry.getValue().iterator();
|
|
while (it.hasNext()) {
|
|
sessionEventsState.addEvent(it.next());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public final synchronized void addEvent(AccessTokenAppIdPair accessTokenAppIdPair, AppEvent appEvent) {
|
|
Intrinsics.checkNotNullParameter(accessTokenAppIdPair, "accessTokenAppIdPair");
|
|
Intrinsics.checkNotNullParameter(appEvent, "appEvent");
|
|
SessionEventsState sessionEventsState = getSessionEventsState(accessTokenAppIdPair);
|
|
if (sessionEventsState != null) {
|
|
sessionEventsState.addEvent(appEvent);
|
|
}
|
|
}
|
|
|
|
public final synchronized Set<AccessTokenAppIdPair> keySet() {
|
|
Set<AccessTokenAppIdPair> keySet;
|
|
keySet = this.stateMap.keySet();
|
|
Intrinsics.checkNotNullExpressionValue(keySet, "stateMap.keys");
|
|
return keySet;
|
|
}
|
|
|
|
public final synchronized SessionEventsState get(AccessTokenAppIdPair accessTokenAppIdPair) {
|
|
Intrinsics.checkNotNullParameter(accessTokenAppIdPair, "accessTokenAppIdPair");
|
|
return this.stateMap.get(accessTokenAppIdPair);
|
|
}
|
|
|
|
public final synchronized int getEventCount() {
|
|
int i;
|
|
Iterator<SessionEventsState> it = this.stateMap.values().iterator();
|
|
i = 0;
|
|
while (it.hasNext()) {
|
|
i += it.next().getAccumulatedEventCount();
|
|
}
|
|
return i;
|
|
}
|
|
|
|
private final synchronized SessionEventsState getSessionEventsState(AccessTokenAppIdPair accessTokenAppIdPair) {
|
|
Context applicationContext;
|
|
AttributionIdentifiers attributionIdentifiers;
|
|
SessionEventsState sessionEventsState = this.stateMap.get(accessTokenAppIdPair);
|
|
if (sessionEventsState == null && (attributionIdentifiers = AttributionIdentifiers.Companion.getAttributionIdentifiers((applicationContext = FacebookSdk.getApplicationContext()))) != null) {
|
|
sessionEventsState = new SessionEventsState(attributionIdentifiers, AppEventsLogger.Companion.getAnonymousAppDeviceGUID(applicationContext));
|
|
}
|
|
if (sessionEventsState == null) {
|
|
return null;
|
|
}
|
|
this.stateMap.put(accessTokenAppIdPair, sessionEventsState);
|
|
return sessionEventsState;
|
|
}
|
|
}
|