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,372 @@
package com.facebook.appevents.internal;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import androidx.annotation.RestrictTo;
import com.facebook.FacebookSdk;
import com.facebook.LoggingBehavior;
import com.facebook.appevents.AppEventsLogger;
import com.facebook.appevents.aam.MetadataIndexer;
import com.facebook.appevents.codeless.CodelessManager;
import com.facebook.appevents.iap.InAppPurchaseManager;
import com.facebook.appevents.suggestedevents.SuggestedEventsManager;
import com.facebook.internal.FeatureManager;
import com.facebook.internal.FetchedAppSettings;
import com.facebook.internal.FetchedAppSettingsManager;
import com.facebook.internal.Logger;
import com.facebook.internal.Utility;
import java.lang.ref.WeakReference;
import java.util.UUID;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import kotlin.Unit;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class ActivityLifecycleTracker {
private static final String INCORRECT_IMPL_WARNING = "Unexpected activity pause without a matching activity resume. Logging data may be incorrect. Make sure you call activateApp from your Application's onCreate method";
public static final ActivityLifecycleTracker INSTANCE = new ActivityLifecycleTracker();
private static final long INTERRUPTION_THRESHOLD_MILLISECONDS = 1000;
private static final String TAG;
private static int activityReferences;
private static String appId;
private static WeakReference<Activity> currActivity;
private static long currentActivityAppearTime;
private static volatile ScheduledFuture<?> currentFuture;
private static final Object currentFutureLock;
private static volatile SessionInfo currentSession;
private static final AtomicInteger foregroundActivityCount;
private static final ScheduledExecutorService singleThreadExecutor;
private static final AtomicBoolean tracking;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public static final boolean isInBackground() {
return activityReferences == 0;
}
private ActivityLifecycleTracker() {
}
static {
String canonicalName = ActivityLifecycleTracker.class.getCanonicalName();
if (canonicalName == null) {
canonicalName = "com.facebook.appevents.internal.ActivityLifecycleTracker";
}
TAG = canonicalName;
singleThreadExecutor = Executors.newSingleThreadScheduledExecutor();
currentFutureLock = new Object();
foregroundActivityCount = new AtomicInteger(0);
tracking = new AtomicBoolean(false);
}
public static final void startTracking(Application application, String str) {
Intrinsics.checkNotNullParameter(application, "application");
if (tracking.compareAndSet(false, true)) {
FeatureManager featureManager = FeatureManager.INSTANCE;
FeatureManager.checkFeature(FeatureManager.Feature.CodelessEvents, new FeatureManager.Callback() { // from class: com.facebook.appevents.internal.ActivityLifecycleTracker$$ExternalSyntheticLambda3
@Override // com.facebook.internal.FeatureManager.Callback
public final void onCompleted(boolean z) {
ActivityLifecycleTracker.m511startTracking$lambda0(z);
}
});
appId = str;
application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() { // from class: com.facebook.appevents.internal.ActivityLifecycleTracker$startTracking$2
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityCreated(Activity activity, Bundle bundle) {
String str2;
Intrinsics.checkNotNullParameter(activity, "activity");
Logger.Companion companion = Logger.Companion;
LoggingBehavior loggingBehavior = LoggingBehavior.APP_EVENTS;
str2 = ActivityLifecycleTracker.TAG;
companion.log(loggingBehavior, str2, "onActivityCreated");
AppEventUtility.assertIsMainThread();
ActivityLifecycleTracker.onActivityCreated(activity);
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStarted(Activity activity) {
int i;
String str2;
Intrinsics.checkNotNullParameter(activity, "activity");
i = ActivityLifecycleTracker.activityReferences;
ActivityLifecycleTracker.activityReferences = i + 1;
Logger.Companion companion = Logger.Companion;
LoggingBehavior loggingBehavior = LoggingBehavior.APP_EVENTS;
str2 = ActivityLifecycleTracker.TAG;
companion.log(loggingBehavior, str2, "onActivityStarted");
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityResumed(Activity activity) {
String str2;
Intrinsics.checkNotNullParameter(activity, "activity");
Logger.Companion companion = Logger.Companion;
LoggingBehavior loggingBehavior = LoggingBehavior.APP_EVENTS;
str2 = ActivityLifecycleTracker.TAG;
companion.log(loggingBehavior, str2, "onActivityResumed");
AppEventUtility.assertIsMainThread();
ActivityLifecycleTracker.onActivityResumed(activity);
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityPaused(Activity activity) {
String str2;
Intrinsics.checkNotNullParameter(activity, "activity");
Logger.Companion companion = Logger.Companion;
LoggingBehavior loggingBehavior = LoggingBehavior.APP_EVENTS;
str2 = ActivityLifecycleTracker.TAG;
companion.log(loggingBehavior, str2, "onActivityPaused");
AppEventUtility.assertIsMainThread();
ActivityLifecycleTracker.INSTANCE.onActivityPaused(activity);
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStopped(Activity activity) {
String str2;
int i;
Intrinsics.checkNotNullParameter(activity, "activity");
Logger.Companion companion = Logger.Companion;
LoggingBehavior loggingBehavior = LoggingBehavior.APP_EVENTS;
str2 = ActivityLifecycleTracker.TAG;
companion.log(loggingBehavior, str2, "onActivityStopped");
AppEventsLogger.Companion.onContextStop();
i = ActivityLifecycleTracker.activityReferences;
ActivityLifecycleTracker.activityReferences = i - 1;
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
String str2;
Intrinsics.checkNotNullParameter(activity, "activity");
Intrinsics.checkNotNullParameter(outState, "outState");
Logger.Companion companion = Logger.Companion;
LoggingBehavior loggingBehavior = LoggingBehavior.APP_EVENTS;
str2 = ActivityLifecycleTracker.TAG;
companion.log(loggingBehavior, str2, "onActivitySaveInstanceState");
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityDestroyed(Activity activity) {
String str2;
Intrinsics.checkNotNullParameter(activity, "activity");
Logger.Companion companion = Logger.Companion;
LoggingBehavior loggingBehavior = LoggingBehavior.APP_EVENTS;
str2 = ActivityLifecycleTracker.TAG;
companion.log(loggingBehavior, str2, "onActivityDestroyed");
ActivityLifecycleTracker.INSTANCE.onActivityDestroyed(activity);
}
});
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: startTracking$lambda-0, reason: not valid java name */
public static final void m511startTracking$lambda0(boolean z) {
if (z) {
CodelessManager.enable();
} else {
CodelessManager.disable();
}
}
public static final boolean isTracking() {
return tracking.get();
}
public static final UUID getCurrentSessionGuid() {
SessionInfo sessionInfo;
if (currentSession == null || (sessionInfo = currentSession) == null) {
return null;
}
return sessionInfo.getSessionId();
}
public static final void onActivityCreated(Activity activity) {
singleThreadExecutor.execute(new Runnable() { // from class: com.facebook.appevents.internal.ActivityLifecycleTracker$$ExternalSyntheticLambda4
@Override // java.lang.Runnable
public final void run() {
ActivityLifecycleTracker.m507onActivityCreated$lambda1();
}
});
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: onActivityCreated$lambda-1, reason: not valid java name */
public static final void m507onActivityCreated$lambda1() {
if (currentSession == null) {
currentSession = SessionInfo.Companion.getStoredSessionInfo();
}
}
public static final void onActivityResumed(Activity activity) {
Intrinsics.checkNotNullParameter(activity, "activity");
currActivity = new WeakReference<>(activity);
foregroundActivityCount.incrementAndGet();
INSTANCE.cancelCurrentTask();
final long currentTimeMillis = System.currentTimeMillis();
currentActivityAppearTime = currentTimeMillis;
final String activityName = Utility.getActivityName(activity);
CodelessManager.onActivityResumed(activity);
MetadataIndexer.onActivityResumed(activity);
SuggestedEventsManager.trackActivity(activity);
InAppPurchaseManager.startTracking();
final Context applicationContext = activity.getApplicationContext();
singleThreadExecutor.execute(new Runnable() { // from class: com.facebook.appevents.internal.ActivityLifecycleTracker$$ExternalSyntheticLambda2
@Override // java.lang.Runnable
public final void run() {
ActivityLifecycleTracker.m510onActivityResumed$lambda2(currentTimeMillis, activityName, applicationContext);
}
});
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: onActivityResumed$lambda-2, reason: not valid java name */
public static final void m510onActivityResumed$lambda2(long j, String activityName, Context appContext) {
SessionInfo sessionInfo;
Intrinsics.checkNotNullParameter(activityName, "$activityName");
SessionInfo sessionInfo2 = currentSession;
Long sessionLastEventTime = sessionInfo2 == null ? null : sessionInfo2.getSessionLastEventTime();
if (currentSession == null) {
currentSession = new SessionInfo(Long.valueOf(j), null, null, 4, null);
SessionLogger sessionLogger = SessionLogger.INSTANCE;
String str = appId;
Intrinsics.checkNotNullExpressionValue(appContext, "appContext");
SessionLogger.logActivateApp(activityName, null, str, appContext);
} else if (sessionLastEventTime != null) {
long longValue = j - sessionLastEventTime.longValue();
if (longValue > INSTANCE.getSessionTimeoutInSeconds() * 1000) {
SessionLogger sessionLogger2 = SessionLogger.INSTANCE;
SessionLogger.logDeactivateApp(activityName, currentSession, appId);
String str2 = appId;
Intrinsics.checkNotNullExpressionValue(appContext, "appContext");
SessionLogger.logActivateApp(activityName, null, str2, appContext);
currentSession = new SessionInfo(Long.valueOf(j), null, null, 4, null);
} else if (longValue > 1000 && (sessionInfo = currentSession) != null) {
sessionInfo.incrementInterruptionCount();
}
}
SessionInfo sessionInfo3 = currentSession;
if (sessionInfo3 != null) {
sessionInfo3.setSessionLastEventTime(Long.valueOf(j));
}
SessionInfo sessionInfo4 = currentSession;
if (sessionInfo4 == null) {
return;
}
sessionInfo4.writeSessionToDisk();
}
/* JADX INFO: Access modifiers changed from: private */
public final void onActivityPaused(Activity activity) {
AtomicInteger atomicInteger = foregroundActivityCount;
if (atomicInteger.decrementAndGet() < 0) {
atomicInteger.set(0);
Log.w(TAG, INCORRECT_IMPL_WARNING);
}
cancelCurrentTask();
final long currentTimeMillis = System.currentTimeMillis();
final String activityName = Utility.getActivityName(activity);
CodelessManager.onActivityPaused(activity);
singleThreadExecutor.execute(new Runnable() { // from class: com.facebook.appevents.internal.ActivityLifecycleTracker$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
ActivityLifecycleTracker.m508onActivityPaused$lambda6(currentTimeMillis, activityName);
}
});
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: onActivityPaused$lambda-6, reason: not valid java name */
public static final void m508onActivityPaused$lambda6(final long j, final String activityName) {
Intrinsics.checkNotNullParameter(activityName, "$activityName");
if (currentSession == null) {
currentSession = new SessionInfo(Long.valueOf(j), null, null, 4, null);
}
SessionInfo sessionInfo = currentSession;
if (sessionInfo != null) {
sessionInfo.setSessionLastEventTime(Long.valueOf(j));
}
if (foregroundActivityCount.get() <= 0) {
Runnable runnable = new Runnable() { // from class: com.facebook.appevents.internal.ActivityLifecycleTracker$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
ActivityLifecycleTracker.m509onActivityPaused$lambda6$lambda4(j, activityName);
}
};
synchronized (currentFutureLock) {
currentFuture = singleThreadExecutor.schedule(runnable, INSTANCE.getSessionTimeoutInSeconds(), TimeUnit.SECONDS);
Unit unit = Unit.INSTANCE;
}
}
long j2 = currentActivityAppearTime;
AutomaticAnalyticsLogger.logActivityTimeSpentEvent(activityName, j2 > 0 ? (j - j2) / 1000 : 0L);
SessionInfo sessionInfo2 = currentSession;
if (sessionInfo2 == null) {
return;
}
sessionInfo2.writeSessionToDisk();
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: onActivityPaused$lambda-6$lambda-4, reason: not valid java name */
public static final void m509onActivityPaused$lambda6$lambda4(long j, String activityName) {
Intrinsics.checkNotNullParameter(activityName, "$activityName");
if (currentSession == null) {
currentSession = new SessionInfo(Long.valueOf(j), null, null, 4, null);
}
if (foregroundActivityCount.get() <= 0) {
SessionLogger sessionLogger = SessionLogger.INSTANCE;
SessionLogger.logDeactivateApp(activityName, currentSession, appId);
SessionInfo.Companion.clearSavedSessionFromDisk();
currentSession = null;
}
synchronized (currentFutureLock) {
currentFuture = null;
Unit unit = Unit.INSTANCE;
}
}
/* JADX INFO: Access modifiers changed from: private */
public final void onActivityDestroyed(Activity activity) {
CodelessManager.onActivityDestroyed(activity);
}
private final int getSessionTimeoutInSeconds() {
FetchedAppSettingsManager fetchedAppSettingsManager = FetchedAppSettingsManager.INSTANCE;
FetchedAppSettings appSettingsWithoutQuery = FetchedAppSettingsManager.getAppSettingsWithoutQuery(FacebookSdk.getApplicationId());
if (appSettingsWithoutQuery == null) {
return Constants.getDefaultAppEventsSessionTimeoutInSeconds();
}
return appSettingsWithoutQuery.getSessionTimeoutInSeconds();
}
private final void cancelCurrentTask() {
ScheduledFuture<?> scheduledFuture;
synchronized (currentFutureLock) {
try {
if (currentFuture != null && (scheduledFuture = currentFuture) != null) {
scheduledFuture.cancel(false);
}
currentFuture = null;
Unit unit = Unit.INSTANCE;
} catch (Throwable th) {
throw th;
}
}
}
public static final Activity getCurrentActivity() {
WeakReference<Activity> weakReference = currActivity;
if (weakReference == null || weakReference == null) {
return null;
}
return weakReference.get();
}
}

View File

@@ -0,0 +1,161 @@
package com.facebook.appevents.internal;
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Looper;
import android.view.View;
import android.view.Window;
import com.facebook.FacebookSdk;
import com.facebook.internal.Utility;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import java.text.NumberFormat;
import java.text.ParseException;
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
/* loaded from: classes2.dex */
public final class AppEventUtility {
public static final AppEventUtility INSTANCE = new AppEventUtility();
private static final String PRICE_REGEX = "[-+]*\\d+([.,]\\d+)*([.,]\\d+)?";
public static final void assertIsMainThread() {
}
public static final void assertIsNotMainThread() {
}
private AppEventUtility() {
}
public static final double normalizePrice(String str) {
try {
Matcher matcher = Pattern.compile(PRICE_REGEX, 8).matcher(str);
if (!matcher.find()) {
return 0.0d;
}
return NumberFormat.getNumberInstance(Utility.getCurrentLocale()).parse(matcher.group(0)).doubleValue();
} catch (ParseException unused) {
return 0.0d;
}
}
public static final String bytesToHex(byte[] bytes) {
Intrinsics.checkNotNullParameter(bytes, "bytes");
StringBuffer stringBuffer = new StringBuffer();
int length = bytes.length;
int i = 0;
while (i < length) {
byte b = bytes[i];
i++;
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
String format = String.format("%02x", Arrays.copyOf(new Object[]{Byte.valueOf(b)}, 1));
Intrinsics.checkNotNullExpressionValue(format, "java.lang.String.format(format, *args)");
stringBuffer.append(format);
}
String stringBuffer2 = stringBuffer.toString();
Intrinsics.checkNotNullExpressionValue(stringBuffer2, "sb.toString()");
return stringBuffer2;
}
/* JADX WARN: Code restructure failed: missing block: B:16:0x0069, code lost:
if (kotlin.text.StringsKt__StringsJVMKt.startsWith$default(r0, "generic", false, 2, null) == false) goto L18;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static final boolean isEmulator() {
/*
java.lang.String r0 = android.os.Build.FINGERPRINT
java.lang.String r1 = "FINGERPRINT"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r0, r1)
java.lang.String r2 = "generic"
r3 = 0
r4 = 2
r5 = 0
boolean r6 = kotlin.text.StringsKt.startsWith$default(r0, r2, r3, r4, r5)
if (r6 != 0) goto L73
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r0, r1)
java.lang.String r1 = "unknown"
boolean r0 = kotlin.text.StringsKt.startsWith$default(r0, r1, r3, r4, r5)
if (r0 != 0) goto L73
java.lang.String r0 = android.os.Build.MODEL
java.lang.String r1 = "MODEL"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r0, r1)
java.lang.String r6 = "google_sdk"
boolean r7 = kotlin.text.StringsKt.contains$default(r0, r6, r3, r4, r5)
if (r7 != 0) goto L73
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r0, r1)
java.lang.String r7 = "Emulator"
boolean r7 = kotlin.text.StringsKt.contains$default(r0, r7, r3, r4, r5)
if (r7 != 0) goto L73
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r0, r1)
java.lang.String r1 = "Android SDK built for x86"
boolean r0 = kotlin.text.StringsKt.contains$default(r0, r1, r3, r4, r5)
if (r0 != 0) goto L73
java.lang.String r0 = android.os.Build.MANUFACTURER
java.lang.String r1 = "MANUFACTURER"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r0, r1)
java.lang.String r1 = "Genymotion"
boolean r0 = kotlin.text.StringsKt.contains$default(r0, r1, r3, r4, r5)
if (r0 != 0) goto L73
java.lang.String r0 = android.os.Build.BRAND
java.lang.String r1 = "BRAND"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r0, r1)
boolean r0 = kotlin.text.StringsKt.startsWith$default(r0, r2, r3, r4, r5)
if (r0 == 0) goto L6b
java.lang.String r0 = android.os.Build.DEVICE
java.lang.String r1 = "DEVICE"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r0, r1)
boolean r0 = kotlin.text.StringsKt.startsWith$default(r0, r2, r3, r4, r5)
if (r0 != 0) goto L73
L6b:
java.lang.String r0 = android.os.Build.PRODUCT
boolean r0 = kotlin.jvm.internal.Intrinsics.areEqual(r6, r0)
if (r0 == 0) goto L74
L73:
r3 = 1
L74:
return r3
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.appevents.internal.AppEventUtility.isEmulator():boolean");
}
private static final boolean isMainThread() {
return Intrinsics.areEqual(Looper.myLooper(), Looper.getMainLooper());
}
public static final String getAppVersion() {
Context applicationContext = FacebookSdk.getApplicationContext();
try {
String str = applicationContext.getPackageManager().getPackageInfo(applicationContext.getPackageName(), 0).versionName;
Intrinsics.checkNotNullExpressionValue(str, "{\n val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)\n packageInfo.versionName\n }");
return str;
} catch (PackageManager.NameNotFoundException unused) {
return "";
}
}
public static final View getRootView(Activity activity) {
if (CrashShieldHandler.isObjectCrashing(AppEventUtility.class) || activity == null) {
return null;
}
try {
Window window = activity.getWindow();
if (window == null) {
return null;
}
return window.getDecorView().getRootView();
} catch (Exception unused) {
return null;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, AppEventUtility.class);
return null;
}
}
}

View File

@@ -0,0 +1,71 @@
package com.facebook.appevents.internal;
import android.content.Context;
import androidx.core.app.NotificationCompat;
import com.facebook.LoggingBehavior;
import com.facebook.appevents.AppEventsLogger;
import com.facebook.internal.AttributionIdentifiers;
import com.facebook.internal.Logger;
import com.facebook.internal.Utility;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import kotlin.TuplesKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class AppEventsLoggerUtility {
private static final Map<GraphAPIActivityType, String> API_ACTIVITY_TYPE_TO_STRING;
public static final AppEventsLoggerUtility INSTANCE = new AppEventsLoggerUtility();
private AppEventsLoggerUtility() {
}
static {
HashMap hashMapOf;
hashMapOf = MapsKt__MapsKt.hashMapOf(TuplesKt.to(GraphAPIActivityType.MOBILE_INSTALL_EVENT, "MOBILE_APP_INSTALL"), TuplesKt.to(GraphAPIActivityType.CUSTOM_APP_EVENTS, "CUSTOM_APP_EVENTS"));
API_ACTIVITY_TYPE_TO_STRING = hashMapOf;
}
public static final JSONObject getJSONObjectForGraphAPICall(GraphAPIActivityType activityType, AttributionIdentifiers attributionIdentifiers, String str, boolean z, Context context) throws JSONException {
Intrinsics.checkNotNullParameter(activityType, "activityType");
Intrinsics.checkNotNullParameter(context, "context");
JSONObject jSONObject = new JSONObject();
jSONObject.put(NotificationCompat.CATEGORY_EVENT, API_ACTIVITY_TYPE_TO_STRING.get(activityType));
String userID = AppEventsLogger.Companion.getUserID();
if (userID != null) {
jSONObject.put("app_user_id", userID);
}
Utility.setAppEventAttributionParameters(jSONObject, attributionIdentifiers, str, z, context);
try {
Utility.setAppEventExtendedDeviceInfoParameters(jSONObject, context);
} catch (Exception e) {
Logger.Companion.log(LoggingBehavior.APP_EVENTS, "AppEvents", "Fetching extended device info parameters failed: '%s'", e.toString());
}
JSONObject dataProcessingOptions = Utility.getDataProcessingOptions();
if (dataProcessingOptions != null) {
Iterator<String> keys = dataProcessingOptions.keys();
while (keys.hasNext()) {
String next = keys.next();
jSONObject.put(next, dataProcessingOptions.get(next));
}
}
jSONObject.put("application_package_name", context.getPackageName());
return jSONObject;
}
public enum GraphAPIActivityType {
MOBILE_INSTALL_EVENT,
CUSTOM_APP_EVENTS;
/* renamed from: values, reason: to resolve conflict with enum method */
public static GraphAPIActivityType[] valuesCustom() {
GraphAPIActivityType[] valuesCustom = values();
return (GraphAPIActivityType[]) Arrays.copyOf(valuesCustom, valuesCustom.length);
}
}
}

View File

@@ -0,0 +1,166 @@
package com.facebook.appevents.internal;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import androidx.annotation.RestrictTo;
import com.facebook.FacebookSdk;
import com.facebook.appevents.AppEventsConstants;
import com.facebook.appevents.AppEventsLogger;
import com.facebook.appevents.InternalAppEventsLogger;
import com.facebook.appevents.iap.InAppPurchaseEventManager;
import com.facebook.gamingservices.cloudgaming.internal.SDKConstants;
import com.facebook.internal.FetchedAppGateKeepersManager;
import com.facebook.internal.FetchedAppSettings;
import com.facebook.internal.FetchedAppSettingsManager;
import com.firemonkeys.cloudcellapi.Consts;
import com.unity3d.ads.core.domain.HandleInvocationsFromAdViewer;
import com.unity3d.ads.metadata.InAppPurchaseMetaData;
import java.math.BigDecimal;
import java.util.Currency;
import java.util.HashMap;
import java.util.Map;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONException;
import org.json.JSONObject;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes2.dex */
public final class AutomaticAnalyticsLogger {
private static final String APP_EVENTS_IF_AUTO_LOG_SUBS = "app_events_if_auto_log_subs";
public static final AutomaticAnalyticsLogger INSTANCE = new AutomaticAnalyticsLogger();
private static final String TAG = AutomaticAnalyticsLogger.class.getCanonicalName();
private static final InternalAppEventsLogger internalAppEventsLogger = new InternalAppEventsLogger(FacebookSdk.getApplicationContext());
private AutomaticAnalyticsLogger() {
}
public static final void logActivateAppEvent() {
Context applicationContext = FacebookSdk.getApplicationContext();
String applicationId = FacebookSdk.getApplicationId();
if (FacebookSdk.getAutoLogAppEventsEnabled()) {
if (applicationContext instanceof Application) {
AppEventsLogger.Companion.activateApp((Application) applicationContext, applicationId);
} else {
Log.w(TAG, "Automatic logging of basic events will not happen, because FacebookSdk.getApplicationContext() returns object that is not instance of android.app.Application. Make sure you call FacebookSdk.sdkInitialize() from Application class and pass application context.");
}
}
}
public static final void logActivityTimeSpentEvent(String str, long j) {
Context applicationContext = FacebookSdk.getApplicationContext();
FetchedAppSettings queryAppSettings = FetchedAppSettingsManager.queryAppSettings(FacebookSdk.getApplicationId(), false);
if (queryAppSettings == null || !queryAppSettings.getAutomaticLoggingEnabled() || j <= 0) {
return;
}
InternalAppEventsLogger internalAppEventsLogger2 = new InternalAppEventsLogger(applicationContext);
Bundle bundle = new Bundle(1);
bundle.putCharSequence(Constants.AA_TIME_SPENT_SCREEN_PARAMETER_NAME, str);
internalAppEventsLogger2.logEvent(Constants.AA_TIME_SPENT_EVENT_NAME, j, bundle);
}
public static final void logPurchase(String purchase, String skuDetails, boolean z) {
PurchaseLoggingParameters purchaseLoggingParameters;
Intrinsics.checkNotNullParameter(purchase, "purchase");
Intrinsics.checkNotNullParameter(skuDetails, "skuDetails");
if (isImplicitPurchaseLoggingEnabled() && (purchaseLoggingParameters = INSTANCE.getPurchaseLoggingParameters(purchase, skuDetails)) != null) {
if (z) {
FetchedAppGateKeepersManager fetchedAppGateKeepersManager = FetchedAppGateKeepersManager.INSTANCE;
if (FetchedAppGateKeepersManager.getGateKeeperForKey(APP_EVENTS_IF_AUTO_LOG_SUBS, FacebookSdk.getApplicationId(), false)) {
internalAppEventsLogger.logEventImplicitly(InAppPurchaseEventManager.INSTANCE.hasFreeTrialPeirod(skuDetails) ? AppEventsConstants.EVENT_NAME_START_TRIAL : AppEventsConstants.EVENT_NAME_SUBSCRIBE, purchaseLoggingParameters.getPurchaseAmount(), purchaseLoggingParameters.getCurrency(), purchaseLoggingParameters.getParam());
return;
}
}
internalAppEventsLogger.logPurchaseImplicitly(purchaseLoggingParameters.getPurchaseAmount(), purchaseLoggingParameters.getCurrency(), purchaseLoggingParameters.getParam());
}
}
public static final boolean isImplicitPurchaseLoggingEnabled() {
FetchedAppSettings appSettingsWithoutQuery = FetchedAppSettingsManager.getAppSettingsWithoutQuery(FacebookSdk.getApplicationId());
return appSettingsWithoutQuery != null && FacebookSdk.getAutoLogAppEventsEnabled() && appSettingsWithoutQuery.getIAPAutomaticLoggingEnabled();
}
private final PurchaseLoggingParameters getPurchaseLoggingParameters(String str, String str2) {
return getPurchaseLoggingParameters(str, str2, new HashMap());
}
private final PurchaseLoggingParameters getPurchaseLoggingParameters(String str, String str2, Map<String, String> map) {
try {
JSONObject jSONObject = new JSONObject(str);
JSONObject jSONObject2 = new JSONObject(str2);
Bundle bundle = new Bundle(1);
bundle.putCharSequence(Constants.IAP_PRODUCT_ID, jSONObject.getString(InAppPurchaseMetaData.KEY_PRODUCT_ID));
bundle.putCharSequence(Constants.IAP_PURCHASE_TIME, jSONObject.getString("purchaseTime"));
bundle.putCharSequence(Constants.IAP_PURCHASE_TOKEN, jSONObject.getString(SDKConstants.PARAM_PURCHASE_TOKEN));
bundle.putCharSequence(Constants.IAP_PACKAGE_NAME, jSONObject.optString(HandleInvocationsFromAdViewer.KEY_PACKAGE_NAME));
bundle.putCharSequence(Constants.IAP_PRODUCT_TITLE, jSONObject2.optString("title"));
bundle.putCharSequence(Constants.IAP_PRODUCT_DESCRIPTION, jSONObject2.optString("description"));
String optString = jSONObject2.optString("type");
bundle.putCharSequence(Constants.IAP_PRODUCT_TYPE, optString);
if (Intrinsics.areEqual(optString, Consts.ITEM_TYPE_SUBSCRIPTION)) {
bundle.putCharSequence(Constants.IAP_SUBSCRIPTION_AUTORENEWING, Boolean.toString(jSONObject.optBoolean("autoRenewing", false)));
bundle.putCharSequence(Constants.IAP_SUBSCRIPTION_PERIOD, jSONObject2.optString("subscriptionPeriod"));
bundle.putCharSequence(Constants.IAP_FREE_TRIAL_PERIOD, jSONObject2.optString("freeTrialPeriod"));
String introductoryPriceCycles = jSONObject2.optString("introductoryPriceCycles");
Intrinsics.checkNotNullExpressionValue(introductoryPriceCycles, "introductoryPriceCycles");
if (introductoryPriceCycles.length() != 0) {
bundle.putCharSequence(Constants.IAP_INTRO_PRICE_AMOUNT_MICROS, jSONObject2.optString("introductoryPriceAmountMicros"));
bundle.putCharSequence(Constants.IAP_INTRO_PRICE_CYCLES, introductoryPriceCycles);
}
}
for (Map.Entry<String, String> entry : map.entrySet()) {
bundle.putCharSequence(entry.getKey(), entry.getValue());
}
BigDecimal bigDecimal = new BigDecimal(jSONObject2.getLong("price_amount_micros") / 1000000.0d);
Currency currency = Currency.getInstance(jSONObject2.getString("price_currency_code"));
Intrinsics.checkNotNullExpressionValue(currency, "getInstance(skuDetailsJSON.getString(\"price_currency_code\"))");
return new PurchaseLoggingParameters(bigDecimal, currency, bundle);
} catch (JSONException e) {
Log.e(TAG, "Error parsing in-app subscription data.", e);
return null;
}
}
public static final class PurchaseLoggingParameters {
private Currency currency;
private Bundle param;
private BigDecimal purchaseAmount;
public final Currency getCurrency() {
return this.currency;
}
public final Bundle getParam() {
return this.param;
}
public final BigDecimal getPurchaseAmount() {
return this.purchaseAmount;
}
public final void setCurrency(Currency currency) {
Intrinsics.checkNotNullParameter(currency, "<set-?>");
this.currency = currency;
}
public final void setParam(Bundle bundle) {
Intrinsics.checkNotNullParameter(bundle, "<set-?>");
this.param = bundle;
}
public final void setPurchaseAmount(BigDecimal bigDecimal) {
Intrinsics.checkNotNullParameter(bigDecimal, "<set-?>");
this.purchaseAmount = bigDecimal;
}
public PurchaseLoggingParameters(BigDecimal purchaseAmount, Currency currency, Bundle param) {
Intrinsics.checkNotNullParameter(purchaseAmount, "purchaseAmount");
Intrinsics.checkNotNullParameter(currency, "currency");
Intrinsics.checkNotNullParameter(param, "param");
this.purchaseAmount = purchaseAmount;
this.currency = currency;
this.param = param;
}
}
}

View File

@@ -0,0 +1,42 @@
package com.facebook.appevents.internal;
/* loaded from: classes2.dex */
public final class Constants {
public static final String AA_TIME_SPENT_EVENT_NAME = "fb_aa_time_spent_on_view";
public static final String AA_TIME_SPENT_SCREEN_PARAMETER_NAME = "fb_aa_time_spent_view_name";
public static final String EVENT_NAME_EVENT_KEY = "_eventName";
public static final String EVENT_NAME_MD5_EVENT_KEY = "_eventName_md5";
public static final String EVENT_PARAM_PRODUCT_AVAILABILITY = "fb_product_availability";
public static final String EVENT_PARAM_PRODUCT_BRAND = "fb_product_brand";
public static final String EVENT_PARAM_PRODUCT_CONDITION = "fb_product_condition";
public static final String EVENT_PARAM_PRODUCT_DESCRIPTION = "fb_product_description";
public static final String EVENT_PARAM_PRODUCT_GTIN = "fb_product_gtin";
public static final String EVENT_PARAM_PRODUCT_IMAGE_LINK = "fb_product_image_link";
public static final String EVENT_PARAM_PRODUCT_ITEM_ID = "fb_product_item_id";
public static final String EVENT_PARAM_PRODUCT_LINK = "fb_product_link";
public static final String EVENT_PARAM_PRODUCT_MPN = "fb_product_mpn";
public static final String EVENT_PARAM_PRODUCT_PRICE_AMOUNT = "fb_product_price_amount";
public static final String EVENT_PARAM_PRODUCT_PRICE_CURRENCY = "fb_product_price_currency";
public static final String EVENT_PARAM_PRODUCT_TITLE = "fb_product_title";
public static final String IAP_FREE_TRIAL_PERIOD = "fb_free_trial_period";
public static final String IAP_INTRO_PRICE_AMOUNT_MICROS = "fb_intro_price_amount_micros";
public static final String IAP_INTRO_PRICE_CYCLES = "fb_intro_price_cycles";
public static final String IAP_PACKAGE_NAME = "fb_iap_package_name";
public static final String IAP_PRODUCT_DESCRIPTION = "fb_iap_product_description";
public static final String IAP_PRODUCT_ID = "fb_iap_product_id";
public static final String IAP_PRODUCT_TITLE = "fb_iap_product_title";
public static final String IAP_PRODUCT_TYPE = "fb_iap_product_type";
public static final String IAP_PURCHASE_TIME = "fb_iap_purchase_time";
public static final String IAP_PURCHASE_TOKEN = "fb_iap_purchase_token";
public static final String IAP_SUBSCRIPTION_AUTORENEWING = "fb_iap_subs_auto_renewing";
public static final String IAP_SUBSCRIPTION_PERIOD = "fb_iap_subs_period";
public static final Constants INSTANCE = new Constants();
public static final String LOG_TIME_APP_EVENT_KEY = "_logTime";
public static final int getDefaultAppEventsSessionTimeoutInSeconds() {
return 60;
}
private Constants() {
}
}

View File

@@ -0,0 +1,157 @@
package com.facebook.appevents.internal;
import android.os.AsyncTask;
import androidx.annotation.VisibleForTesting;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import com.google.firebase.perf.network.FirebasePerfUrlConnection;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.net.URL;
import java.net.URLConnection;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class FileDownloadTask extends AsyncTask<String, Void, Boolean> {
private final File destFile;
private final Callback onSuccess;
private final String uriStr;
public interface Callback {
void onComplete(File file);
}
@Override // android.os.AsyncTask
public /* bridge */ /* synthetic */ Boolean doInBackground(String[] strArr) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
return doInBackground2(strArr);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
} catch (Throwable th2) {
CrashShieldHandler.handleThrowable(th2, this);
return null;
}
} catch (Throwable th3) {
CrashShieldHandler.handleThrowable(th3, this);
return null;
}
}
@Override // android.os.AsyncTask
public /* bridge */ /* synthetic */ void onPostExecute(Boolean bool) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
onPostExecute(bool.booleanValue());
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
} catch (Throwable th2) {
CrashShieldHandler.handleThrowable(th2, this);
}
} catch (Throwable th3) {
CrashShieldHandler.handleThrowable(th3, this);
}
}
public FileDownloadTask(String uriStr, File destFile, Callback onSuccess) {
Intrinsics.checkNotNullParameter(uriStr, "uriStr");
Intrinsics.checkNotNullParameter(destFile, "destFile");
Intrinsics.checkNotNullParameter(onSuccess, "onSuccess");
this.uriStr = uriStr;
this.destFile = destFile;
this.onSuccess = onSuccess;
}
@VisibleForTesting(otherwise = 4)
/* renamed from: doInBackground, reason: avoid collision after fix types in other method */
public Boolean doInBackground2(String... args) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
Intrinsics.checkNotNullParameter(args, "args");
try {
URL url = new URL(this.uriStr);
int contentLength = ((URLConnection) FirebasePerfUrlConnection.instrument(url.openConnection())).getContentLength();
DataInputStream dataInputStream = new DataInputStream(FirebasePerfUrlConnection.openStream(url));
byte[] bArr = new byte[contentLength];
dataInputStream.readFully(bArr);
dataInputStream.close();
DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(this.destFile));
dataOutputStream.write(bArr);
dataOutputStream.flush();
dataOutputStream.close();
return Boolean.TRUE;
} catch (Exception unused) {
return Boolean.FALSE;
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
} catch (Throwable th2) {
CrashShieldHandler.handleThrowable(th2, this);
return null;
}
} catch (Throwable th3) {
CrashShieldHandler.handleThrowable(th3, this);
return null;
}
}
public void onPostExecute(boolean z) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (!CrashShieldHandler.isObjectCrashing(this) && z) {
try {
this.onSuccess.onComplete(this.destFile);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
} catch (Throwable th2) {
CrashShieldHandler.handleThrowable(th2, this);
}
} catch (Throwable th3) {
CrashShieldHandler.handleThrowable(th3, this);
}
}
}

View File

@@ -0,0 +1,142 @@
package com.facebook.appevents.internal;
import android.content.Context;
import android.content.pm.PackageManager;
import android.util.Base64;
import com.unity3d.ads.core.data.datasource.AndroidStaticDeviceInfoDataSource;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.cert.CertificateFactory;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.io.CloseableKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Ref;
/* loaded from: classes2.dex */
public final class HashUtils {
private static final int BUFFER_SIZE = 1024;
private static final String MD5 = "MD5";
public static final HashUtils INSTANCE = new HashUtils();
private static final String TAG = HashUtils.class.getSimpleName();
private static final String[] TRUSTED_CERTS = {"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"};
private HashUtils() {
}
public static final String computeChecksum(String str) throws Exception {
return INSTANCE.computeFileMd5(new File(str));
}
private final String computeFileMd5(File file) throws Exception {
int read;
BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(file), 1024);
try {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
byte[] bArr = new byte[1024];
do {
read = bufferedInputStream.read(bArr);
if (read > 0) {
messageDigest.update(bArr, 0, read);
}
} while (read != -1);
String bigInteger = new BigInteger(1, messageDigest.digest()).toString(16);
Intrinsics.checkNotNullExpressionValue(bigInteger, "BigInteger(1, md.digest()).toString(16)");
CloseableKt.closeFinally(bufferedInputStream, null);
return bigInteger;
} finally {
}
}
/* JADX WARN: Multi-variable type inference failed */
public static final String computeChecksumWithPackageManager(Context context, Long l) {
Intrinsics.checkNotNullParameter(context, "context");
CertificateFactory certificateFactory = CertificateFactory.getInstance(AndroidStaticDeviceInfoDataSource.CERTIFICATE_TYPE_X509);
String[] strArr = TRUSTED_CERTS;
ArrayList arrayList = new ArrayList(strArr.length);
for (String str : strArr) {
arrayList.add(certificateFactory.generateCertificate(new ByteArrayInputStream(Base64.decode(str, 0))));
}
List mutableList = CollectionsKt___CollectionsKt.toMutableList((Collection) arrayList);
final Ref.ObjectRef objectRef = new Ref.ObjectRef();
final ReentrantLock reentrantLock = new ReentrantLock();
final Condition newCondition = reentrantLock.newCondition();
reentrantLock.lock();
try {
Field field = Class.forName("android.content.pm.Checksum").getField("TYPE_WHOLE_MD5");
Intrinsics.checkNotNullExpressionValue(field, "checksumClass.getField(\"TYPE_WHOLE_MD5\")");
final Object obj = field.get(null);
Class<?> cls = Class.forName("android.content.pm.PackageManager$OnChecksumsReadyListener");
Object newProxyInstance = Proxy.newProxyInstance(HashUtils.class.getClassLoader(), new Class[]{cls}, new InvocationHandler() { // from class: com.facebook.appevents.internal.HashUtils$computeChecksumWithPackageManager$listener$1
/* JADX WARN: Type inference failed for: r8v10, types: [T, java.lang.String] */
@Override // java.lang.reflect.InvocationHandler
public Object invoke(Object obj2, Method method, Object[] objects) {
String unused;
Intrinsics.checkNotNullParameter(method, "method");
Intrinsics.checkNotNullParameter(objects, "objects");
try {
if (Intrinsics.areEqual(method.getName(), "onChecksumsReady") && objects.length == 1) {
Object obj3 = objects[0];
if (obj3 instanceof List) {
for (Object obj4 : (List) obj3) {
if (obj4 != null) {
Method method2 = obj4.getClass().getMethod("getSplitName", new Class[0]);
Intrinsics.checkNotNullExpressionValue(method2, "c.javaClass.getMethod(\"getSplitName\")");
Method method3 = obj4.getClass().getMethod("getType", new Class[0]);
Intrinsics.checkNotNullExpressionValue(method3, "c.javaClass.getMethod(\"getType\")");
if (method2.invoke(obj4, new Object[0]) == null && Intrinsics.areEqual(method3.invoke(obj4, new Object[0]), obj)) {
Method method4 = obj4.getClass().getMethod("getValue", new Class[0]);
Intrinsics.checkNotNullExpressionValue(method4, "c.javaClass.getMethod(\"getValue\")");
Object invoke = method4.invoke(obj4, new Object[0]);
if (invoke == null) {
throw new NullPointerException("null cannot be cast to non-null type kotlin.ByteArray");
}
objectRef.element = new BigInteger(1, (byte[]) invoke).toString(16);
reentrantLock.lock();
try {
newCondition.signalAll();
return null;
} finally {
reentrantLock.unlock();
}
}
}
}
}
}
} catch (Throwable unused2) {
unused = HashUtils.TAG;
}
return null;
}
});
Intrinsics.checkNotNullExpressionValue(newProxyInstance, "var resultChecksum: String? = null\n val lock = ReentrantLock()\n val checksumReady = lock.newCondition()\n lock.lock()\n\n try {\n val checksumClass = Class.forName(\"android.content.pm.Checksum\")\n val typeWholeMd5Field: Field = checksumClass.getField(\"TYPE_WHOLE_MD5\")\n val TYPE_WHOLE_MD5 = typeWholeMd5Field.get(null)\n val checksumReadyListenerClass =\n Class.forName(\"android.content.pm.PackageManager\\$OnChecksumsReadyListener\")\n val listener: Any =\n Proxy.newProxyInstance(\n HashUtils::class.java.classLoader,\n arrayOf(checksumReadyListenerClass),\n object : InvocationHandler {\n override operator fun invoke(o: Any?, method: Method, objects: Array<Any>): Any? {\n try {\n if (method.name == \"onChecksumsReady\" &&\n objects.size == 1 &&\n objects[0] is List<*>) {\n val list = objects[0] as List<*>\n for (c in list) {\n if (c != null) {\n val getSplitNameMethod: Method = c.javaClass.getMethod(\"getSplitName\")\n val getTypeMethod: Method = c.javaClass.getMethod(\"getType\")\n if (getSplitNameMethod.invoke(c) == null &&\n getTypeMethod.invoke(c) == TYPE_WHOLE_MD5) {\n val getValueMethod: Method = c.javaClass.getMethod(\"getValue\")\n val checksumValue = getValueMethod.invoke(c) as ByteArray\n resultChecksum = BigInteger(1, checksumValue).toString(16)\n lock.lock()\n try {\n checksumReady.signalAll()\n } finally {\n lock.unlock()\n }\n return null\n }\n }\n }\n }\n } catch (t: Throwable) {\n Log.d(TAG, \"Can't fetch checksum.\", t)\n }\n return null\n }\n })");
Method method = PackageManager.class.getMethod("requestChecksums", String.class, Boolean.TYPE, Integer.TYPE, List.class, cls);
Intrinsics.checkNotNullExpressionValue(method, "PackageManager::class\n .java\n .getMethod(\n \"requestChecksums\",\n String::class.java,\n Boolean::class.javaPrimitiveType,\n Int::class.javaPrimitiveType,\n MutableList::class.java,\n checksumReadyListenerClass)");
method.invoke(context.getPackageManager(), context.getPackageName(), Boolean.FALSE, obj, CollectionsKt___CollectionsKt.toMutableList((Collection) mutableList), newProxyInstance);
if (l == null) {
newCondition.await();
} else {
newCondition.awaitNanos(l.longValue());
}
String str2 = (String) objectRef.element;
reentrantLock.unlock();
return str2;
} catch (Throwable unused) {
reentrantLock.unlock();
return null;
}
}
}

View File

@@ -0,0 +1,175 @@
package com.facebook.appevents.internal;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import com.facebook.FacebookSdk;
import java.util.UUID;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class SessionInfo {
public static final Companion Companion = new Companion(null);
private static final String INTERRUPTION_COUNT_KEY = "com.facebook.appevents.SessionInfo.interruptionCount";
private static final String LAST_SESSION_INFO_END_KEY = "com.facebook.appevents.SessionInfo.sessionEndTime";
private static final String LAST_SESSION_INFO_START_KEY = "com.facebook.appevents.SessionInfo.sessionStartTime";
private static final String SESSION_ID_KEY = "com.facebook.appevents.SessionInfo.sessionId";
private Long diskRestoreTime;
private int interruptionCount;
private UUID sessionId;
private Long sessionLastEventTime;
private final Long sessionStartTime;
private SourceApplicationInfo sourceApplicationInfo;
public SessionInfo(Long l, Long l2) {
this(l, l2, null, 4, null);
}
public static final void clearSavedSessionFromDisk() {
Companion.clearSavedSessionFromDisk();
}
public static final SessionInfo getStoredSessionInfo() {
return Companion.getStoredSessionInfo();
}
public final int getInterruptionCount() {
return this.interruptionCount;
}
public final UUID getSessionId() {
return this.sessionId;
}
public final Long getSessionLastEventTime() {
return this.sessionLastEventTime;
}
public final Long getSessionStartTime() {
return this.sessionStartTime;
}
public final SourceApplicationInfo getSourceApplicationInfo() {
return this.sourceApplicationInfo;
}
public final void incrementInterruptionCount() {
this.interruptionCount++;
}
public final void setDiskRestoreTime(Long l) {
this.diskRestoreTime = l;
}
public final void setSessionId(UUID uuid) {
Intrinsics.checkNotNullParameter(uuid, "<set-?>");
this.sessionId = uuid;
}
public final void setSessionLastEventTime(Long l) {
this.sessionLastEventTime = l;
}
public final void setSourceApplicationInfo(SourceApplicationInfo sourceApplicationInfo) {
this.sourceApplicationInfo = sourceApplicationInfo;
}
public SessionInfo(Long l, Long l2, UUID sessionId) {
Intrinsics.checkNotNullParameter(sessionId, "sessionId");
this.sessionStartTime = l;
this.sessionLastEventTime = l2;
this.sessionId = sessionId;
}
/* 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 /* synthetic */ SessionInfo(java.lang.Long r1, java.lang.Long r2, java.util.UUID r3, int r4, kotlin.jvm.internal.DefaultConstructorMarker r5) {
/*
r0 = this;
r4 = r4 & 4
if (r4 == 0) goto Ld
java.util.UUID r3 = java.util.UUID.randomUUID()
java.lang.String r4 = "randomUUID()"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r3, r4)
Ld:
r0.<init>(r1, r2, r3)
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.appevents.internal.SessionInfo.<init>(java.lang.Long, java.lang.Long, java.util.UUID, int, kotlin.jvm.internal.DefaultConstructorMarker):void");
}
public final Long getDiskRestoreTime() {
Long l = this.diskRestoreTime;
if (l == null) {
return 0L;
}
return l;
}
public final long getSessionLength() {
Long l;
if (this.sessionStartTime == null || (l = this.sessionLastEventTime) == null) {
return 0L;
}
if (l != null) {
return l.longValue() - this.sessionStartTime.longValue();
}
throw new IllegalStateException("Required value was null.".toString());
}
public final void writeSessionToDisk() {
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(FacebookSdk.getApplicationContext()).edit();
Long l = this.sessionStartTime;
edit.putLong(LAST_SESSION_INFO_START_KEY, l == null ? 0L : l.longValue());
Long l2 = this.sessionLastEventTime;
edit.putLong(LAST_SESSION_INFO_END_KEY, l2 != null ? l2.longValue() : 0L);
edit.putInt(INTERRUPTION_COUNT_KEY, this.interruptionCount);
edit.putString(SESSION_ID_KEY, this.sessionId.toString());
edit.apply();
SourceApplicationInfo sourceApplicationInfo = this.sourceApplicationInfo;
if (sourceApplicationInfo == null || sourceApplicationInfo == null) {
return;
}
sourceApplicationInfo.writeSourceApplicationInfoToDisk();
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final SessionInfo getStoredSessionInfo() {
SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(FacebookSdk.getApplicationContext());
long j = defaultSharedPreferences.getLong(SessionInfo.LAST_SESSION_INFO_START_KEY, 0L);
long j2 = defaultSharedPreferences.getLong(SessionInfo.LAST_SESSION_INFO_END_KEY, 0L);
String string = defaultSharedPreferences.getString(SessionInfo.SESSION_ID_KEY, null);
if (j == 0 || j2 == 0 || string == null) {
return null;
}
SessionInfo sessionInfo = new SessionInfo(Long.valueOf(j), Long.valueOf(j2), null, 4, null);
sessionInfo.interruptionCount = defaultSharedPreferences.getInt(SessionInfo.INTERRUPTION_COUNT_KEY, 0);
sessionInfo.setSourceApplicationInfo(SourceApplicationInfo.Companion.getStoredSourceApplicatioInfo());
sessionInfo.setDiskRestoreTime(Long.valueOf(System.currentTimeMillis()));
UUID fromString = UUID.fromString(string);
Intrinsics.checkNotNullExpressionValue(fromString, "fromString(sessionIDStr)");
sessionInfo.setSessionId(fromString);
return sessionInfo;
}
public final void clearSavedSessionFromDisk() {
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(FacebookSdk.getApplicationContext()).edit();
edit.remove(SessionInfo.LAST_SESSION_INFO_START_KEY);
edit.remove(SessionInfo.LAST_SESSION_INFO_END_KEY);
edit.remove(SessionInfo.INTERRUPTION_COUNT_KEY);
edit.remove(SessionInfo.SESSION_ID_KEY);
edit.apply();
SourceApplicationInfo.Companion.clearSavedSourceApplicationInfoFromDisk();
}
}
}

View File

@@ -0,0 +1,173 @@
package com.facebook.appevents.internal;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import androidx.work.PeriodicWorkRequest;
import com.facebook.FacebookSdk;
import com.facebook.LoggingBehavior;
import com.facebook.appevents.AppEventsConstants;
import com.facebook.appevents.AppEventsLogger;
import com.facebook.appevents.InternalAppEventsLogger;
import com.facebook.internal.Logger;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import com.facebook.internal.security.CertificateUtil;
import com.vungle.ads.internal.signals.SignalManager;
import java.util.Arrays;
import java.util.Locale;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
/* loaded from: classes2.dex */
public final class SessionLogger {
private static final String PACKAGE_CHECKSUM = "PCKGCHKSUM";
public static final SessionLogger INSTANCE = new SessionLogger();
private static final String TAG = SessionLogger.class.getCanonicalName();
private static final long[] INACTIVE_SECONDS_QUANTA = {PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS, PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS, 1800000, 3600000, 21600000, 43200000, SignalManager.TWENTY_FOUR_HOURS_MILLIS, 172800000, 259200000, 604800000, 1209600000, 1814400000, 2419200000L, 5184000000L, 7776000000L, 10368000000L, 12960000000L, 15552000000L, 31536000000L};
private SessionLogger() {
}
public static final void logActivateApp(String activityName, SourceApplicationInfo sourceApplicationInfo, String str, Context context) {
String sourceApplicationInfo2;
if (CrashShieldHandler.isObjectCrashing(SessionLogger.class)) {
return;
}
try {
Intrinsics.checkNotNullParameter(activityName, "activityName");
Intrinsics.checkNotNullParameter(context, "context");
String str2 = "Unclassified";
if (sourceApplicationInfo != null && (sourceApplicationInfo2 = sourceApplicationInfo.toString()) != null) {
str2 = sourceApplicationInfo2;
}
Bundle bundle = new Bundle();
bundle.putString(AppEventsConstants.EVENT_PARAM_SOURCE_APPLICATION, str2);
bundle.putString(AppEventsConstants.EVENT_PARAM_PACKAGE_FP, INSTANCE.computePackageChecksum(context));
bundle.putString(AppEventsConstants.EVENT_PARAM_APP_CERT_HASH, CertificateUtil.getCertificateHash(context));
InternalAppEventsLogger.Companion companion = InternalAppEventsLogger.Companion;
InternalAppEventsLogger createInstance = companion.createInstance(activityName, str, null);
createInstance.logEvent(AppEventsConstants.EVENT_NAME_ACTIVATED_APP, bundle);
if (companion.getFlushBehavior() != AppEventsLogger.FlushBehavior.EXPLICIT_ONLY) {
createInstance.flush();
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, SessionLogger.class);
}
}
public static final void logDeactivateApp(String activityName, SessionInfo sessionInfo, String str) {
long longValue;
String sourceApplicationInfo;
if (CrashShieldHandler.isObjectCrashing(SessionLogger.class)) {
return;
}
try {
Intrinsics.checkNotNullParameter(activityName, "activityName");
if (sessionInfo == null) {
return;
}
Long diskRestoreTime = sessionInfo.getDiskRestoreTime();
long j = 0;
if (diskRestoreTime == null) {
Long sessionLastEventTime = sessionInfo.getSessionLastEventTime();
longValue = 0 - (sessionLastEventTime == null ? 0L : sessionLastEventTime.longValue());
} else {
longValue = diskRestoreTime.longValue();
}
if (longValue < 0) {
INSTANCE.logClockSkewEvent();
longValue = 0;
}
long sessionLength = sessionInfo.getSessionLength();
if (sessionLength < 0) {
INSTANCE.logClockSkewEvent();
sessionLength = 0;
}
Bundle bundle = new Bundle();
bundle.putInt(AppEventsConstants.EVENT_NAME_SESSION_INTERRUPTIONS, sessionInfo.getInterruptionCount());
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
String format = String.format(Locale.ROOT, "session_quanta_%d", Arrays.copyOf(new Object[]{Integer.valueOf(getQuantaIndex(longValue))}, 1));
Intrinsics.checkNotNullExpressionValue(format, "java.lang.String.format(locale, format, *args)");
bundle.putString(AppEventsConstants.EVENT_NAME_TIME_BETWEEN_SESSIONS, format);
SourceApplicationInfo sourceApplicationInfo2 = sessionInfo.getSourceApplicationInfo();
String str2 = "Unclassified";
if (sourceApplicationInfo2 != null && (sourceApplicationInfo = sourceApplicationInfo2.toString()) != null) {
str2 = sourceApplicationInfo;
}
bundle.putString(AppEventsConstants.EVENT_PARAM_SOURCE_APPLICATION, str2);
Long sessionLastEventTime2 = sessionInfo.getSessionLastEventTime();
if (sessionLastEventTime2 != null) {
j = sessionLastEventTime2.longValue();
}
bundle.putLong(Constants.LOG_TIME_APP_EVENT_KEY, j / 1000);
InternalAppEventsLogger.Companion.createInstance(activityName, str, null).logEvent(AppEventsConstants.EVENT_NAME_DEACTIVATED_APP, sessionLength / 1000, bundle);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, SessionLogger.class);
}
}
private final void logClockSkewEvent() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
Logger.Companion companion = Logger.Companion;
LoggingBehavior loggingBehavior = LoggingBehavior.APP_EVENTS;
String str = TAG;
Intrinsics.checkNotNull(str);
companion.log(loggingBehavior, str, "Clock skew detected");
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
public static final int getQuantaIndex(long j) {
if (CrashShieldHandler.isObjectCrashing(SessionLogger.class)) {
return 0;
}
int i = 0;
while (true) {
try {
long[] jArr = INACTIVE_SECONDS_QUANTA;
if (i >= jArr.length || jArr[i] >= j) {
break;
}
i++;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, SessionLogger.class);
return 0;
}
}
return i;
}
private final String computePackageChecksum(Context context) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
PackageManager packageManager = context.getPackageManager();
String stringPlus = Intrinsics.stringPlus("PCKGCHKSUM;", packageManager.getPackageInfo(context.getPackageName(), 0).versionName);
SharedPreferences sharedPreferences = context.getSharedPreferences(FacebookSdk.APP_EVENT_PREFERENCES, 0);
String string = sharedPreferences.getString(stringPlus, null);
if (string != null && string.length() == 32) {
return string;
}
String computeChecksumWithPackageManager = HashUtils.computeChecksumWithPackageManager(context, null);
if (computeChecksumWithPackageManager == null) {
ApplicationInfo applicationInfo = packageManager.getApplicationInfo(context.getPackageName(), 0);
Intrinsics.checkNotNullExpressionValue(applicationInfo, "pm.getApplicationInfo(context.packageName, 0)");
computeChecksumWithPackageManager = HashUtils.computeChecksum(applicationInfo.sourceDir);
}
sharedPreferences.edit().putString(stringPlus, computeChecksumWithPackageManager).apply();
return computeChecksumWithPackageManager;
} catch (Exception unused) {
return null;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
}

View File

@@ -0,0 +1,126 @@
package com.facebook.appevents.internal;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import com.facebook.FacebookSdk;
import com.facebook.bolts.AppLinks;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class SourceApplicationInfo {
private static final String CALL_APPLICATION_PACKAGE_KEY = "com.facebook.appevents.SourceApplicationInfo.callingApplicationPackage";
public static final Companion Companion = new Companion(null);
private static final String OPENED_BY_APP_LINK_KEY = "com.facebook.appevents.SourceApplicationInfo.openedByApplink";
private static final String SOURCE_APPLICATION_HAS_BEEN_SET_BY_THIS_INTENT = "_fbSourceApplicationHasBeenSet";
private final String callingApplicationPackage;
private final boolean isOpenedByAppLink;
public /* synthetic */ SourceApplicationInfo(String str, boolean z, DefaultConstructorMarker defaultConstructorMarker) {
this(str, z);
}
public static final void clearSavedSourceApplicationInfoFromDisk() {
Companion.clearSavedSourceApplicationInfoFromDisk();
}
public static final SourceApplicationInfo getStoredSourceApplicatioInfo() {
return Companion.getStoredSourceApplicatioInfo();
}
public final String getCallingApplicationPackage() {
return this.callingApplicationPackage;
}
public final boolean isOpenedByAppLink() {
return this.isOpenedByAppLink;
}
private SourceApplicationInfo(String str, boolean z) {
this.callingApplicationPackage = str;
this.isOpenedByAppLink = z;
}
public String toString() {
String str = this.isOpenedByAppLink ? "Applink" : "Unclassified";
if (this.callingApplicationPackage == null) {
return str;
}
return str + '(' + ((Object) this.callingApplicationPackage) + ')';
}
public final void writeSourceApplicationInfoToDisk() {
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(FacebookSdk.getApplicationContext()).edit();
edit.putString(CALL_APPLICATION_PACKAGE_KEY, this.callingApplicationPackage);
edit.putBoolean(OPENED_BY_APP_LINK_KEY, this.isOpenedByAppLink);
edit.apply();
}
public static final class Factory {
public static final Factory INSTANCE = new Factory();
private Factory() {
}
public static final SourceApplicationInfo create(Activity activity) {
String str;
Intrinsics.checkNotNullParameter(activity, "activity");
ComponentName callingActivity = activity.getCallingActivity();
DefaultConstructorMarker defaultConstructorMarker = null;
if (callingActivity != null) {
str = callingActivity.getPackageName();
if (Intrinsics.areEqual(str, activity.getPackageName())) {
return null;
}
} else {
str = "";
}
Intent intent = activity.getIntent();
boolean z = false;
if (intent != null && !intent.getBooleanExtra(SourceApplicationInfo.SOURCE_APPLICATION_HAS_BEEN_SET_BY_THIS_INTENT, false)) {
intent.putExtra(SourceApplicationInfo.SOURCE_APPLICATION_HAS_BEEN_SET_BY_THIS_INTENT, true);
Bundle appLinkData = AppLinks.getAppLinkData(intent);
if (appLinkData != null) {
Bundle bundle = appLinkData.getBundle("referer_app_link");
if (bundle != null) {
str = bundle.getString("package");
}
z = true;
}
}
if (intent != null) {
intent.putExtra(SourceApplicationInfo.SOURCE_APPLICATION_HAS_BEEN_SET_BY_THIS_INTENT, true);
}
return new SourceApplicationInfo(str, z, defaultConstructorMarker);
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final SourceApplicationInfo getStoredSourceApplicatioInfo() {
SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(FacebookSdk.getApplicationContext());
DefaultConstructorMarker defaultConstructorMarker = null;
if (defaultSharedPreferences.contains(SourceApplicationInfo.CALL_APPLICATION_PACKAGE_KEY)) {
return new SourceApplicationInfo(defaultSharedPreferences.getString(SourceApplicationInfo.CALL_APPLICATION_PACKAGE_KEY, null), defaultSharedPreferences.getBoolean(SourceApplicationInfo.OPENED_BY_APP_LINK_KEY, false), defaultConstructorMarker);
}
return null;
}
public final void clearSavedSourceApplicationInfoFromDisk() {
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(FacebookSdk.getApplicationContext()).edit();
edit.remove(SourceApplicationInfo.CALL_APPLICATION_PACKAGE_KEY);
edit.remove(SourceApplicationInfo.OPENED_BY_APP_LINK_KEY);
edit.apply();
}
}
}

View File

@@ -0,0 +1,68 @@
package com.facebook.appevents.internal;
import androidx.annotation.RestrictTo;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes2.dex */
public final class ViewHierarchyConstants {
public static final int ADAPTER_VIEW_ITEM_BITMASK = 9;
public static final String ADD_PAYMENT_INFO = "ADD_PAYMENT_INFO";
public static final String ADD_TO_CART = "ADD_TO_CART";
public static final String ADD_TO_WISHLIST = "ADD_TO_WISHLIST";
public static final int BUTTON_BITMASK = 2;
public static final String BUTTON_ID = "BUTTON_ID";
public static final String BUTTON_TEXT = "BUTTON_TEXT";
public static final int CHECKBOX_BITMASK = 15;
public static final String CHILDREN_VIEW_KEY = "childviews";
public static final String CLASS_NAME_KEY = "classname";
public static final String CLASS_TYPE_BITMASK_KEY = "classtypebitmask";
public static final int CLICKABLE_VIEW_BITMASK = 5;
public static final String COMPLETE_REGISTRATION = "COMPLETE_REGISTRATION";
public static final String DESC_KEY = "description";
public static final String DIMENSION_HEIGHT_KEY = "height";
public static final String DIMENSION_KEY = "dimension";
public static final String DIMENSION_LEFT_KEY = "left";
public static final String DIMENSION_SCROLL_X_KEY = "scrollx";
public static final String DIMENSION_SCROLL_Y_KEY = "scrolly";
public static final String DIMENSION_TOP_KEY = "top";
public static final String DIMENSION_VISIBILITY_KEY = "visibility";
public static final String DIMENSION_WIDTH_KEY = "width";
public static final String ENGLISH = "ENGLISH";
public static final String GERMAN = "GERMAN";
public static final String HINT_KEY = "hint";
public static final String ICON_BITMAP = "icon_image";
public static final String ID_KEY = "id";
public static final int IMAGEVIEW_BITMASK = 1;
public static final String INITIATE_CHECKOUT = "INITIATE_CHECKOUT";
public static final int INPUT_BITMASK = 11;
public static final String INPUT_TYPE_KEY = "inputtype";
public static final ViewHierarchyConstants INSTANCE = new ViewHierarchyConstants();
public static final String IS_INTERACTED_KEY = "is_interacted";
public static final String IS_USER_INPUT_KEY = "is_user_input";
public static final String JAPANESE = "JAPANESE";
public static final int LABEL_BITMASK = 10;
public static final String LEAD = "LEAD";
public static final String PAGE_TITLE = "PAGE_TITLE";
public static final int PICKER_BITMASK = 12;
public static final String PURCHASE = "PURCHASE";
public static final int RADIO_GROUP_BITMASK = 14;
public static final int RATINGBAR_BITMASK = 16;
public static final int REACT_NATIVE_BUTTON_BITMASK = 6;
public static final String RESOLVED_DOCUMENT_LINK = "RESOLVED_DOCUMENT_LINK";
public static final String SCREEN_NAME_KEY = "screenname";
public static final String SEARCH = "SEARCH";
public static final String SPANISH = "SPANISH";
public static final int SWITCH_BITMASK = 13;
public static final String TAG_KEY = "tag";
public static final int TEXTVIEW_BITMASK = 0;
public static final String TEXT_IS_BOLD = "is_bold";
public static final String TEXT_IS_ITALIC = "is_italic";
public static final String TEXT_KEY = "text";
public static final String TEXT_SIZE = "font_size";
public static final String TEXT_STYLE = "text_style";
public static final String VIEW_CONTENT = "VIEW_CONTENT";
public static final String VIEW_KEY = "view";
private ViewHierarchyConstants() {
}
}