- 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
560 lines
25 KiB
Java
560 lines
25 KiB
Java
package com.facebook.appevents.iap;
|
|
|
|
import android.content.Context;
|
|
import android.content.SharedPreferences;
|
|
import android.os.Bundle;
|
|
import android.os.IBinder;
|
|
import androidx.annotation.RestrictTo;
|
|
import com.facebook.FacebookSdk;
|
|
import com.facebook.gamingservices.cloudgaming.internal.SDKConstants;
|
|
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
|
|
import com.unity3d.ads.metadata.InAppPurchaseMetaData;
|
|
import java.lang.reflect.Method;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.text.StringsKt__StringsKt;
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
/* loaded from: classes2.dex */
|
|
public final class InAppPurchaseEventManager {
|
|
private static final String AS_INTERFACE = "asInterface";
|
|
private static final int CACHE_CLEAR_TIME_LIMIT_SEC = 604800;
|
|
private static final String DETAILS_LIST = "DETAILS_LIST";
|
|
private static final String GET_PURCHASES = "getPurchases";
|
|
private static final String GET_PURCHASE_HISTORY = "getPurchaseHistory";
|
|
private static final String GET_SKU_DETAILS = "getSkuDetails";
|
|
private static final String INAPP = "inapp";
|
|
private static final String INAPP_CONTINUATION_TOKEN = "INAPP_CONTINUATION_TOKEN";
|
|
private static final String INAPP_PURCHASE_DATA_LIST = "INAPP_PURCHASE_DATA_LIST";
|
|
private static final String IN_APP_BILLING_SERVICE = "com.android.vending.billing.IInAppBillingService";
|
|
private static final String IN_APP_BILLING_SERVICE_STUB = "com.android.vending.billing.IInAppBillingService$Stub";
|
|
private static final String IS_BILLING_SUPPORTED = "isBillingSupported";
|
|
private static final String ITEM_ID_LIST = "ITEM_ID_LIST";
|
|
private static final String LAST_CLEARED_TIME = "LAST_CLEARED_TIME";
|
|
private static final int MAX_QUERY_PURCHASE_NUM = 30;
|
|
private static final int PURCHASE_EXPIRE_TIME_SEC = 86400;
|
|
private static final int PURCHASE_STOP_QUERY_TIME_SEC = 1200;
|
|
private static final String RESPONSE_CODE = "RESPONSE_CODE";
|
|
private static final int SKU_DETAIL_EXPIRE_TIME_SEC = 43200;
|
|
private static final String SUBSCRIPTION = "subs";
|
|
public static final InAppPurchaseEventManager INSTANCE = new InAppPurchaseEventManager();
|
|
private static final HashMap<String, Method> methodMap = new HashMap<>();
|
|
private static final HashMap<String, Class<?>> classMap = new HashMap<>();
|
|
private static final String PACKAGE_NAME = FacebookSdk.getApplicationContext().getPackageName();
|
|
private static final String SKU_DETAILS_STORE = "com.facebook.internal.SKU_DETAILS";
|
|
private static final SharedPreferences skuDetailSharedPrefs = FacebookSdk.getApplicationContext().getSharedPreferences(SKU_DETAILS_STORE, 0);
|
|
private static final String PURCHASE_INAPP_STORE = "com.facebook.internal.PURCHASE";
|
|
private static final SharedPreferences purchaseInappSharedPrefs = FacebookSdk.getApplicationContext().getSharedPreferences(PURCHASE_INAPP_STORE, 0);
|
|
|
|
private InAppPurchaseEventManager() {
|
|
}
|
|
|
|
public static final Object asInterface(Context context, IBinder iBinder) {
|
|
if (CrashShieldHandler.isObjectCrashing(InAppPurchaseEventManager.class)) {
|
|
return null;
|
|
}
|
|
try {
|
|
Intrinsics.checkNotNullParameter(context, "context");
|
|
return INSTANCE.invokeMethod(context, IN_APP_BILLING_SERVICE_STUB, AS_INTERFACE, null, new Object[]{iBinder});
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, InAppPurchaseEventManager.class);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static final Map<String, String> getSkuDetails(Context context, ArrayList<String> skuList, Object obj, boolean z) {
|
|
if (CrashShieldHandler.isObjectCrashing(InAppPurchaseEventManager.class)) {
|
|
return null;
|
|
}
|
|
try {
|
|
Intrinsics.checkNotNullParameter(context, "context");
|
|
Intrinsics.checkNotNullParameter(skuList, "skuList");
|
|
Map<String, String> readSkuDetailsFromCache = INSTANCE.readSkuDetailsFromCache(skuList);
|
|
ArrayList<String> arrayList = new ArrayList<>();
|
|
Iterator<String> it = skuList.iterator();
|
|
while (it.hasNext()) {
|
|
String next = it.next();
|
|
if (!readSkuDetailsFromCache.containsKey(next)) {
|
|
arrayList.add(next);
|
|
}
|
|
}
|
|
readSkuDetailsFromCache.putAll(INSTANCE.getSkuDetailsFromGoogle(context, arrayList, obj, z));
|
|
return readSkuDetailsFromCache;
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, InAppPurchaseEventManager.class);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
private final Map<String, String> getSkuDetailsFromGoogle(Context context, ArrayList<String> arrayList, Object obj, boolean z) {
|
|
int size;
|
|
if (CrashShieldHandler.isObjectCrashing(this)) {
|
|
return null;
|
|
}
|
|
try {
|
|
Map<String, String> linkedHashMap = new LinkedHashMap<>();
|
|
if (obj != null && !arrayList.isEmpty()) {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putStringArrayList("ITEM_ID_LIST", arrayList);
|
|
Object[] objArr = new Object[4];
|
|
int i = 0;
|
|
objArr[0] = 3;
|
|
objArr[1] = PACKAGE_NAME;
|
|
objArr[2] = z ? "subs" : "inapp";
|
|
objArr[3] = bundle;
|
|
Object invokeMethod = invokeMethod(context, IN_APP_BILLING_SERVICE, GET_SKU_DETAILS, obj, objArr);
|
|
if (invokeMethod != null) {
|
|
Bundle bundle2 = (Bundle) invokeMethod;
|
|
if (bundle2.getInt("RESPONSE_CODE") == 0) {
|
|
ArrayList<String> stringArrayList = bundle2.getStringArrayList("DETAILS_LIST");
|
|
if (stringArrayList != null && arrayList.size() == stringArrayList.size() && arrayList.size() - 1 >= 0) {
|
|
while (true) {
|
|
int i2 = i + 1;
|
|
String str = arrayList.get(i);
|
|
Intrinsics.checkNotNullExpressionValue(str, "skuList[i]");
|
|
String str2 = stringArrayList.get(i);
|
|
Intrinsics.checkNotNullExpressionValue(str2, "skuDetailsList[i]");
|
|
linkedHashMap.put(str, str2);
|
|
if (i2 > size) {
|
|
break;
|
|
}
|
|
i = i2;
|
|
}
|
|
}
|
|
writeSkuDetailsToCache(linkedHashMap);
|
|
}
|
|
}
|
|
}
|
|
return linkedHashMap;
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, this);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
private final Map<String, String> readSkuDetailsFromCache(ArrayList<String> arrayList) {
|
|
List split$default;
|
|
if (CrashShieldHandler.isObjectCrashing(this)) {
|
|
return null;
|
|
}
|
|
try {
|
|
LinkedHashMap linkedHashMap = new LinkedHashMap();
|
|
long currentTimeMillis = System.currentTimeMillis() / 1000;
|
|
Iterator<String> it = arrayList.iterator();
|
|
while (it.hasNext()) {
|
|
String sku = it.next();
|
|
String string = skuDetailSharedPrefs.getString(sku, null);
|
|
if (string != null) {
|
|
split$default = StringsKt__StringsKt.split$default((CharSequence) string, new String[]{";"}, false, 2, 2, (Object) null);
|
|
if (currentTimeMillis - Long.parseLong((String) split$default.get(0)) < 43200) {
|
|
Intrinsics.checkNotNullExpressionValue(sku, "sku");
|
|
linkedHashMap.put(sku, split$default.get(1));
|
|
}
|
|
}
|
|
}
|
|
return linkedHashMap;
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, this);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
private final void writeSkuDetailsToCache(Map<String, String> map) {
|
|
if (CrashShieldHandler.isObjectCrashing(this)) {
|
|
return;
|
|
}
|
|
try {
|
|
long currentTimeMillis = System.currentTimeMillis() / 1000;
|
|
SharedPreferences.Editor edit = skuDetailSharedPrefs.edit();
|
|
for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
edit.putString(entry.getKey(), currentTimeMillis + ';' + entry.getValue());
|
|
}
|
|
edit.apply();
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, this);
|
|
}
|
|
}
|
|
|
|
private final boolean isBillingSupported(Context context, Object obj, String str) {
|
|
if (CrashShieldHandler.isObjectCrashing(this) || obj == null) {
|
|
return false;
|
|
}
|
|
try {
|
|
Object invokeMethod = invokeMethod(context, IN_APP_BILLING_SERVICE, IS_BILLING_SUPPORTED, obj, new Object[]{3, PACKAGE_NAME, str});
|
|
if (invokeMethod != null) {
|
|
return ((Integer) invokeMethod).intValue() == 0;
|
|
}
|
|
return false;
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, this);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static final ArrayList<String> getPurchasesInapp(Context context, Object obj) {
|
|
if (CrashShieldHandler.isObjectCrashing(InAppPurchaseEventManager.class)) {
|
|
return null;
|
|
}
|
|
try {
|
|
Intrinsics.checkNotNullParameter(context, "context");
|
|
InAppPurchaseEventManager inAppPurchaseEventManager = INSTANCE;
|
|
return inAppPurchaseEventManager.filterPurchases(inAppPurchaseEventManager.getPurchases(context, obj, "inapp"));
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, InAppPurchaseEventManager.class);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static final ArrayList<String> getPurchasesSubs(Context context, Object obj) {
|
|
if (CrashShieldHandler.isObjectCrashing(InAppPurchaseEventManager.class)) {
|
|
return null;
|
|
}
|
|
try {
|
|
Intrinsics.checkNotNullParameter(context, "context");
|
|
InAppPurchaseEventManager inAppPurchaseEventManager = INSTANCE;
|
|
return inAppPurchaseEventManager.filterPurchases(inAppPurchaseEventManager.getPurchases(context, obj, "subs"));
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, InAppPurchaseEventManager.class);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:21:0x0062 A[ADDED_TO_REGION] */
|
|
/* JADX WARN: Removed duplicated region for block: B:24:0x0064 A[EDGE_INSN: B:24:0x0064->B:28:0x0064 BREAK A[LOOP:0: B:12:0x0019->B:23:?], SYNTHETIC] */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
private final java.util.ArrayList<java.lang.String> getPurchases(android.content.Context r13, java.lang.Object r14, java.lang.String r15) {
|
|
/*
|
|
r12 = this;
|
|
boolean r0 = com.facebook.internal.instrument.crashshield.CrashShieldHandler.isObjectCrashing(r12)
|
|
r1 = 0
|
|
if (r0 == 0) goto L8
|
|
return r1
|
|
L8:
|
|
java.util.ArrayList r0 = new java.util.ArrayList // Catch: java.lang.Throwable -> L5b
|
|
r0.<init>() // Catch: java.lang.Throwable -> L5b
|
|
if (r14 != 0) goto L10
|
|
return r0
|
|
L10:
|
|
boolean r2 = r12.isBillingSupported(r13, r14, r15) // Catch: java.lang.Throwable -> L5b
|
|
if (r2 == 0) goto L64
|
|
r2 = 0
|
|
r3 = r1
|
|
r4 = r2
|
|
L19:
|
|
r5 = 4
|
|
java.lang.Object[] r11 = new java.lang.Object[r5] // Catch: java.lang.Throwable -> L5b
|
|
r5 = 3
|
|
java.lang.Integer r6 = java.lang.Integer.valueOf(r5) // Catch: java.lang.Throwable -> L5b
|
|
r11[r2] = r6 // Catch: java.lang.Throwable -> L5b
|
|
java.lang.String r6 = com.facebook.appevents.iap.InAppPurchaseEventManager.PACKAGE_NAME // Catch: java.lang.Throwable -> L5b
|
|
r7 = 1
|
|
r11[r7] = r6 // Catch: java.lang.Throwable -> L5b
|
|
r6 = 2
|
|
r11[r6] = r15 // Catch: java.lang.Throwable -> L5b
|
|
r11[r5] = r3 // Catch: java.lang.Throwable -> L5b
|
|
java.lang.String r8 = "com.android.vending.billing.IInAppBillingService"
|
|
java.lang.String r9 = "getPurchases"
|
|
r6 = r12
|
|
r7 = r13
|
|
r10 = r14
|
|
java.lang.Object r3 = r6.invokeMethod(r7, r8, r9, r10, r11) // Catch: java.lang.Throwable -> L5b
|
|
if (r3 == 0) goto L5d
|
|
android.os.Bundle r3 = (android.os.Bundle) r3 // Catch: java.lang.Throwable -> L5b
|
|
java.lang.String r5 = "RESPONSE_CODE"
|
|
int r5 = r3.getInt(r5) // Catch: java.lang.Throwable -> L5b
|
|
if (r5 != 0) goto L5d
|
|
java.lang.String r5 = "INAPP_PURCHASE_DATA_LIST"
|
|
java.util.ArrayList r5 = r3.getStringArrayList(r5) // Catch: java.lang.Throwable -> L5b
|
|
if (r5 == 0) goto L64
|
|
int r6 = r5.size() // Catch: java.lang.Throwable -> L5b
|
|
int r4 = r4 + r6
|
|
r0.addAll(r5) // Catch: java.lang.Throwable -> L5b
|
|
java.lang.String r5 = "INAPP_CONTINUATION_TOKEN"
|
|
java.lang.String r3 = r3.getString(r5) // Catch: java.lang.Throwable -> L5b
|
|
goto L5e
|
|
L5b:
|
|
r13 = move-exception
|
|
goto L65
|
|
L5d:
|
|
r3 = r1
|
|
L5e:
|
|
r5 = 30
|
|
if (r4 >= r5) goto L64
|
|
if (r3 != 0) goto L19
|
|
L64:
|
|
return r0
|
|
L65:
|
|
com.facebook.internal.instrument.crashshield.CrashShieldHandler.handleThrowable(r13, r12)
|
|
return r1
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.facebook.appevents.iap.InAppPurchaseEventManager.getPurchases(android.content.Context, java.lang.Object, java.lang.String):java.util.ArrayList");
|
|
}
|
|
|
|
public final boolean hasFreeTrialPeirod(String skuDetail) {
|
|
if (CrashShieldHandler.isObjectCrashing(this)) {
|
|
return false;
|
|
}
|
|
try {
|
|
Intrinsics.checkNotNullParameter(skuDetail, "skuDetail");
|
|
try {
|
|
String optString = new JSONObject(skuDetail).optString("freeTrialPeriod");
|
|
if (optString != null) {
|
|
return optString.length() > 0;
|
|
}
|
|
return false;
|
|
} catch (JSONException unused) {
|
|
return false;
|
|
}
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, this);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static final ArrayList<String> getPurchaseHistoryInapp(Context context, Object obj) {
|
|
InAppPurchaseEventManager inAppPurchaseEventManager;
|
|
Class<?> cls;
|
|
if (CrashShieldHandler.isObjectCrashing(InAppPurchaseEventManager.class)) {
|
|
return null;
|
|
}
|
|
try {
|
|
Intrinsics.checkNotNullParameter(context, "context");
|
|
ArrayList<String> arrayList = new ArrayList<>();
|
|
return (obj == null || (cls = (inAppPurchaseEventManager = INSTANCE).getClass(context, IN_APP_BILLING_SERVICE)) == null || inAppPurchaseEventManager.getMethod(cls, GET_PURCHASE_HISTORY) == null) ? arrayList : inAppPurchaseEventManager.filterPurchases(inAppPurchaseEventManager.getPurchaseHistory(context, obj, "inapp"));
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, InAppPurchaseEventManager.class);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
private final ArrayList<String> getPurchaseHistory(Context context, Object obj, String str) {
|
|
ArrayList<String> stringArrayList;
|
|
if (CrashShieldHandler.isObjectCrashing(this)) {
|
|
return null;
|
|
}
|
|
try {
|
|
ArrayList<String> arrayList = new ArrayList<>();
|
|
if (isBillingSupported(context, obj, str)) {
|
|
String str2 = null;
|
|
int i = 0;
|
|
boolean z = false;
|
|
do {
|
|
Object invokeMethod = invokeMethod(context, IN_APP_BILLING_SERVICE, GET_PURCHASE_HISTORY, obj, new Object[]{6, PACKAGE_NAME, str, str2, new Bundle()});
|
|
if (invokeMethod != null) {
|
|
long currentTimeMillis = System.currentTimeMillis() / 1000;
|
|
Bundle bundle = (Bundle) invokeMethod;
|
|
if (bundle.getInt("RESPONSE_CODE") == 0 && (stringArrayList = bundle.getStringArrayList("INAPP_PURCHASE_DATA_LIST")) != null) {
|
|
Iterator<String> it = stringArrayList.iterator();
|
|
while (true) {
|
|
if (!it.hasNext()) {
|
|
break;
|
|
}
|
|
String next = it.next();
|
|
if (currentTimeMillis - (new JSONObject(next).getLong("purchaseTime") / 1000) > 1200) {
|
|
z = true;
|
|
break;
|
|
}
|
|
arrayList.add(next);
|
|
i++;
|
|
}
|
|
str2 = bundle.getString("INAPP_CONTINUATION_TOKEN");
|
|
if (i < 30 || str2 == null) {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
str2 = null;
|
|
if (i < 30) {
|
|
break;
|
|
}
|
|
} while (!z);
|
|
}
|
|
return arrayList;
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, this);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
private final ArrayList<String> filterPurchases(ArrayList<String> arrayList) {
|
|
if (CrashShieldHandler.isObjectCrashing(this)) {
|
|
return null;
|
|
}
|
|
try {
|
|
ArrayList<String> arrayList2 = new ArrayList<>();
|
|
SharedPreferences.Editor edit = purchaseInappSharedPrefs.edit();
|
|
long currentTimeMillis = System.currentTimeMillis() / 1000;
|
|
Iterator<String> it = arrayList.iterator();
|
|
while (it.hasNext()) {
|
|
String next = it.next();
|
|
try {
|
|
JSONObject jSONObject = new JSONObject(next);
|
|
String string = jSONObject.getString(InAppPurchaseMetaData.KEY_PRODUCT_ID);
|
|
long j = jSONObject.getLong("purchaseTime");
|
|
String string2 = jSONObject.getString(SDKConstants.PARAM_PURCHASE_TOKEN);
|
|
if (currentTimeMillis - (j / 1000) <= 86400 && !Intrinsics.areEqual(purchaseInappSharedPrefs.getString(string, ""), string2)) {
|
|
edit.putString(string, string2);
|
|
arrayList2.add(next);
|
|
}
|
|
} catch (JSONException unused) {
|
|
}
|
|
}
|
|
edit.apply();
|
|
return arrayList2;
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, this);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
|
|
private final Method getMethod(Class<?> cls, String str) {
|
|
Class[] clsArr;
|
|
Method declaredMethod$facebook_core_release;
|
|
if (CrashShieldHandler.isObjectCrashing(this)) {
|
|
return null;
|
|
}
|
|
try {
|
|
HashMap<String, Method> hashMap = methodMap;
|
|
Method method = hashMap.get(str);
|
|
if (method != null) {
|
|
return method;
|
|
}
|
|
switch (str.hashCode()) {
|
|
case -1801122596:
|
|
if (str.equals(GET_PURCHASES)) {
|
|
Class TYPE = Integer.TYPE;
|
|
Intrinsics.checkNotNullExpressionValue(TYPE, "TYPE");
|
|
clsArr = new Class[]{TYPE, String.class, String.class, String.class};
|
|
break;
|
|
}
|
|
clsArr = null;
|
|
break;
|
|
case -1450694211:
|
|
if (!str.equals(IS_BILLING_SUPPORTED)) {
|
|
clsArr = null;
|
|
break;
|
|
} else {
|
|
Class TYPE2 = Integer.TYPE;
|
|
Intrinsics.checkNotNullExpressionValue(TYPE2, "TYPE");
|
|
clsArr = new Class[]{TYPE2, String.class, String.class};
|
|
break;
|
|
}
|
|
case -1123215065:
|
|
if (!str.equals(AS_INTERFACE)) {
|
|
clsArr = null;
|
|
break;
|
|
} else {
|
|
clsArr = new Class[]{IBinder.class};
|
|
break;
|
|
}
|
|
case -594356707:
|
|
if (!str.equals(GET_PURCHASE_HISTORY)) {
|
|
clsArr = null;
|
|
break;
|
|
} else {
|
|
Class TYPE3 = Integer.TYPE;
|
|
Intrinsics.checkNotNullExpressionValue(TYPE3, "TYPE");
|
|
clsArr = new Class[]{TYPE3, String.class, String.class, String.class, Bundle.class};
|
|
break;
|
|
}
|
|
case -573310373:
|
|
if (!str.equals(GET_SKU_DETAILS)) {
|
|
clsArr = null;
|
|
break;
|
|
} else {
|
|
Class TYPE4 = Integer.TYPE;
|
|
Intrinsics.checkNotNullExpressionValue(TYPE4, "TYPE");
|
|
clsArr = new Class[]{TYPE4, String.class, String.class, Bundle.class};
|
|
break;
|
|
}
|
|
default:
|
|
clsArr = null;
|
|
break;
|
|
}
|
|
if (clsArr == null) {
|
|
declaredMethod$facebook_core_release = InAppPurchaseUtils.getDeclaredMethod$facebook_core_release(cls, str, null);
|
|
} else {
|
|
InAppPurchaseUtils inAppPurchaseUtils = InAppPurchaseUtils.INSTANCE;
|
|
declaredMethod$facebook_core_release = InAppPurchaseUtils.getDeclaredMethod$facebook_core_release(cls, str, (Class[]) Arrays.copyOf(clsArr, clsArr.length));
|
|
}
|
|
if (declaredMethod$facebook_core_release != null) {
|
|
hashMap.put(str, declaredMethod$facebook_core_release);
|
|
}
|
|
return declaredMethod$facebook_core_release;
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, this);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
private final Class<?> getClass(Context context, String str) {
|
|
if (CrashShieldHandler.isObjectCrashing(this)) {
|
|
return null;
|
|
}
|
|
try {
|
|
HashMap<String, Class<?>> hashMap = classMap;
|
|
Class<?> cls = hashMap.get(str);
|
|
if (cls != null) {
|
|
return cls;
|
|
}
|
|
Class<?> classFromContext$facebook_core_release = InAppPurchaseUtils.getClassFromContext$facebook_core_release(context, str);
|
|
if (classFromContext$facebook_core_release != null) {
|
|
hashMap.put(str, classFromContext$facebook_core_release);
|
|
}
|
|
return classFromContext$facebook_core_release;
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, this);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
private final Object invokeMethod(Context context, String str, String str2, Object obj, Object[] objArr) {
|
|
Method method;
|
|
if (CrashShieldHandler.isObjectCrashing(this)) {
|
|
return null;
|
|
}
|
|
try {
|
|
Class<?> cls = getClass(context, str);
|
|
if (cls == null || (method = getMethod(cls, str2)) == null) {
|
|
return null;
|
|
}
|
|
InAppPurchaseUtils inAppPurchaseUtils = InAppPurchaseUtils.INSTANCE;
|
|
return InAppPurchaseUtils.invokeMethod(cls, method, obj, Arrays.copyOf(objArr, objArr.length));
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, this);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static final void clearSkuDetailsCache() {
|
|
if (CrashShieldHandler.isObjectCrashing(InAppPurchaseEventManager.class)) {
|
|
return;
|
|
}
|
|
try {
|
|
long currentTimeMillis = System.currentTimeMillis() / 1000;
|
|
SharedPreferences sharedPreferences = skuDetailSharedPrefs;
|
|
long j = sharedPreferences.getLong(LAST_CLEARED_TIME, 0L);
|
|
if (j == 0) {
|
|
sharedPreferences.edit().putLong(LAST_CLEARED_TIME, currentTimeMillis).apply();
|
|
} else if (currentTimeMillis - j > CACHE_CLEAR_TIME_LIMIT_SEC) {
|
|
sharedPreferences.edit().clear().putLong(LAST_CLEARED_TIME, currentTimeMillis).apply();
|
|
}
|
|
} catch (Throwable th) {
|
|
CrashShieldHandler.handleThrowable(th, InAppPurchaseEventManager.class);
|
|
}
|
|
}
|
|
}
|