- 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
81 lines
3.3 KiB
Java
81 lines
3.3 KiB
Java
package com.facebook.appevents.iap;
|
|
|
|
import android.content.Context;
|
|
import android.content.pm.ApplicationInfo;
|
|
import androidx.annotation.RestrictTo;
|
|
import com.facebook.FacebookSdk;
|
|
import com.facebook.internal.FeatureManager;
|
|
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
|
|
import csdk.gluads.Consts;
|
|
import java.util.List;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.text.StringsKt__StringsKt;
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
/* loaded from: classes2.dex */
|
|
public final class InAppPurchaseManager {
|
|
private static final String GOOGLE_BILLINGCLIENT_VERSION = "com.google.android.play.billingclient.version";
|
|
public static final InAppPurchaseManager INSTANCE = new InAppPurchaseManager();
|
|
private static final AtomicBoolean enabled = new AtomicBoolean(false);
|
|
|
|
private InAppPurchaseManager() {
|
|
}
|
|
|
|
public static final void enableAutoLogging() {
|
|
if (CrashShieldHandler.isObjectCrashing(InAppPurchaseManager.class)) {
|
|
return;
|
|
}
|
|
try {
|
|
enabled.set(true);
|
|
startTracking();
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, InAppPurchaseManager.class);
|
|
}
|
|
}
|
|
|
|
public static final void startTracking() {
|
|
if (CrashShieldHandler.isObjectCrashing(InAppPurchaseManager.class)) {
|
|
return;
|
|
}
|
|
try {
|
|
if (enabled.get()) {
|
|
if (INSTANCE.usingBillingLib2Plus()) {
|
|
FeatureManager featureManager = FeatureManager.INSTANCE;
|
|
if (FeatureManager.isEnabled(FeatureManager.Feature.IapLoggingLib2)) {
|
|
InAppPurchaseAutoLogger inAppPurchaseAutoLogger = InAppPurchaseAutoLogger.INSTANCE;
|
|
InAppPurchaseAutoLogger.startIapLogging(FacebookSdk.getApplicationContext());
|
|
return;
|
|
}
|
|
}
|
|
InAppPurchaseActivityLifecycleTracker.startIapLogging();
|
|
}
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, InAppPurchaseManager.class);
|
|
}
|
|
}
|
|
|
|
private final boolean usingBillingLib2Plus() {
|
|
List split$default;
|
|
if (CrashShieldHandler.isObjectCrashing(this)) {
|
|
return false;
|
|
}
|
|
try {
|
|
Context applicationContext = FacebookSdk.getApplicationContext();
|
|
ApplicationInfo applicationInfo = applicationContext.getPackageManager().getApplicationInfo(applicationContext.getPackageName(), 128);
|
|
Intrinsics.checkNotNullExpressionValue(applicationInfo, "context.packageManager.getApplicationInfo(\n context.packageName, PackageManager.GET_META_DATA)");
|
|
String string = applicationInfo.metaData.getString(GOOGLE_BILLINGCLIENT_VERSION);
|
|
if (string == null) {
|
|
return false;
|
|
}
|
|
split$default = StringsKt__StringsKt.split$default((CharSequence) string, new String[]{Consts.STRING_PERIOD}, false, 3, 2, (Object) null);
|
|
return Integer.parseInt((String) split$default.get(0)) >= 2;
|
|
} catch (Exception unused) {
|
|
return false;
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, this);
|
|
return false;
|
|
}
|
|
}
|
|
}
|