Roblox v2.616.655版本的 MD5 值为:0bc7d8a921fe7f043454ac7c31685936
以下内容为反编译后的 ae.java 源代码,内容仅作参考
package com.appsflyer.internal;
import android.app.Activity;
import android.app.Application;
import android.app.UiModeManager;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
import android.location.Location;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.StatFs;
import android.os.SystemClock;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Base64;
import android.view.ViewConfiguration;
import android.view.WindowManager;
import backtraceio.library.services.BacktraceMetrics;
import com.appsflyer.AFInAppEventParameterName;
import com.appsflyer.AFInAppEventType;
import com.appsflyer.AFKeystoreWrapper;
import com.appsflyer.AFLogger;
import com.appsflyer.AFVersionDeclaration;
import com.appsflyer.AppsFlyerConversionListener;
import com.appsflyer.AppsFlyerInAppPurchaseValidatorListener;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerProperties;
import com.appsflyer.attribution.AppsFlyerRequestListener;
import com.appsflyer.attribution.RequestError;
import com.appsflyer.deeplink.DeepLinkListener;
import com.appsflyer.deeplink.DeepLinkResult;
import com.appsflyer.internal.ag;
import com.appsflyer.internal.ao;
import com.appsflyer.internal.bt;
import com.appsflyer.internal.c;
import com.appsflyer.internal.d;
import com.appsflyer.internal.l;
import com.appsflyer.internal.u;
import com.appsflyer.internal.v;
import com.appsflyer.internal.y;
import com.appsflyer.oaid.BuildConfig;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.lang.ref.WeakReference;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.net.HttpURLConnection;
import java.net.NetworkInterface;
import java.net.URI;
import java.net.URL;
import java.security.KeyStoreException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.TimeZone;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public final class ae extends AppsFlyerLib {
static final String AFInAppEventParameterName = "113";
public static final String AFInAppEventType = "6.3";
public static final String AFKeystoreWrapper;
private static String onAppOpenAttribution = null;
private static String onAttributionFailure = null;
private static String onAttributionFailureNative = null;
private static String onConversionDataFail = null;
private static ae onConversionDataSuccess = null;
private static final String onDeepLinkingNative;
private static String onInstallConversionDataLoadedNative = null;
private static String onInstallConversionFailureNative = "https://%sstats.%s/stats";
public static AppsFlyerConversionListener valueOf;
static AppsFlyerInAppPurchaseValidatorListener values;
String AFLogger$LogLevel;
long AFVersionDeclaration;
String AppsFlyer2dXConversionCallback;
private long AppsFlyerConversionListener;
private Map<Long, String> getInstance;
public String[] getLevel;
public au init;
public bt[] onAppOpenAttributionNative;
private boolean onPause;
private SharedPreferences sendPushNotificationData;
private av setAdditionalData;
private Map<String, Object> setCustomerIdAndLogSession;
private String setCustomerUserId;
private boolean setDebugLog;
private Application setImeiData;
private long stop;
private String updateServerUninstallToken;
private Map<String, Object> waitForCustomerUserId;
private long onDeepLinking = -1;
private long AppsFlyerInAppPurchaseValidatorListener = -1;
private long AppsFlyerLib = TimeUnit.SECONDS.toMillis(5);
private boolean onValidateInApp = false;
private ScheduledExecutorService onValidateInAppFailure = null;
private boolean getSdkVersion = false;
private final al enableLocationCollection = new al();
private boolean setAndroidIdData = false;
private boolean setOaidData = false;
private boolean setPhoneNumber = false;
private boolean getOutOfStore = false;
private final JSONObject setUserEmails = new JSONObject();
private final Executor setAppInviteOneLink = Executors.newSingleThreadExecutor();
static class AnonymousClass9 {
static final int[] AFInAppEventType;
static final int[] valueOf;
static {
int[] iArr = new int[bt.e.values().length];
valueOf = iArr;
try {
iArr[bt.e.FINISHED.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
valueOf[bt.e.STARTED.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
int[] iArr2 = new int[AppsFlyerProperties.EmailsCryptType.values().length];
AFInAppEventType = iArr2;
try {
iArr2[AppsFlyerProperties.EmailsCryptType.SHA256.ordinal()] = 1;
} catch (NoSuchFieldError unused3) {
}
try {
AFInAppEventType[AppsFlyerProperties.EmailsCryptType.NONE.ordinal()] = 2;
} catch (NoSuchFieldError unused4) {
}
}
}
public class c implements Runnable {
private final g AFInAppEventParameterName;
c(ae aeVar, g gVar, byte b10) {
this(gVar);
}
@Override
public final void run() {
ae.AFKeystoreWrapper(ae.this, this.AFInAppEventParameterName);
}
private c(g gVar) {
this.AFInAppEventParameterName = gVar;
}
}
public class d implements Runnable {
private final g AFInAppEventType;
d(ae aeVar, g gVar, byte b10) {
this(gVar);
}
@Override
public final void run() {
IOException iOException;
AppsFlyerRequestListener appsFlyerRequestListener;
Throwable th;
File AFKeystoreWrapper;
String str;
bt[] btVarArr;
Map<String, Object> AFInAppEventType = this.AFInAppEventType.AFInAppEventType();
boolean AFKeystoreWrapper2 = this.AFInAppEventType.AFKeystoreWrapper();
g gVar = this.AFInAppEventType;
String str2 = gVar.onAppOpenAttributionNative;
int i10 = gVar.onInstallConversionFailureNative;
Application application = gVar.valueOf;
if (ae.this.isStopped()) {
AppsFlyerRequestListener appsFlyerRequestListener2 = this.AFInAppEventType.AFKeystoreWrapper;
if (appsFlyerRequestListener2 != null) {
appsFlyerRequestListener2.onError(RequestError.STOP_TRACKING, ax.values);
return;
}
return;
}
byte[] bArr = new byte[0];
if (AFKeystoreWrapper2 && i10 <= 2) {
ArrayList arrayList = new ArrayList();
if (ae.this.onAppOpenAttributionNative != null) {
for (bt btVar : ae.this.onAppOpenAttributionNative) {
boolean z10 = btVar instanceof bo;
int i11 = AnonymousClass9.valueOf[btVar.AFInAppEventParameterName.ordinal()];
if (i11 == 1) {
if (z10) {
AFInAppEventType.put("rfr", ((bo) btVar).AFInAppEventType);
ae.values(application).edit().putBoolean(AppsFlyerProperties.NEW_REFERRER_SENT, true).apply();
}
arrayList.add(btVar.AFKeystoreWrapper);
} else if (i11 == 2 && i10 == 2 && !z10) {
HashMap hashMap = new HashMap();
hashMap.put("source", btVar.valueOf);
hashMap.put("response", "TIMEOUT");
hashMap.putAll(new bu());
arrayList.add(hashMap);
}
}
}
if (!arrayList.isEmpty()) {
AFInAppEventType.put("referrers", arrayList);
}
if (ae.this.waitForCustomerUserId != null) {
AFInAppEventType.put("fb_ddl", ae.this.waitForCustomerUserId);
}
}
if (!(this.AFInAppEventType instanceof bg)) {
AFInAppEventType.putAll(new d.e(AFInAppEventType, application));
AFInAppEventType.putAll(ae.this.AFInAppEventParameterName());
}
OutputStreamWriter outputStreamWriter = null;
try {
try {
g gVar2 = this.AFInAppEventType;
if (gVar2 instanceof bg) {
str = (String) AFInAppEventType.get("af_key");
} else {
str = (String) AFInAppEventType.get("appsflyerKey");
}
gVar2.AFVersionDeclaration = str;
synchronized (AFInAppEventType) {
try {
byte[] bArr2 = (byte[]) ((Class) a.AFKeystoreWrapper((ViewConfiguration.getTapTimeout() >> 16) + 48, TextUtils.getOffsetAfter(BuildConfig.FLAVOR, 0) + 24, (char) (ViewConfiguration.getFadingEdgeLength() >> 16))).getDeclaredMethod("values", g.class).invoke(null, this.AFInAppEventType);
try {
try {
ae aeVar = ae.this;
g gVar3 = this.AFInAppEventType;
gVar3.AppsFlyer2dXConversionCallback = bArr2;
ae.valueOf(aeVar, gVar3);
return;
} catch (IOException e10) {
iOException = e10;
bArr = bArr2;
AFLogger.AFInAppEventType("Exception while sending request to server. ", iOException);
if (bArr != null && application != null && !str2.contains("&isCachedRequest=true&timeincache=")) {
ai.AFKeystoreWrapper();
h hVar = new h(str2, bArr, "6.3.2");
try {
try {
try {
AFKeystoreWrapper = ai.AFKeystoreWrapper(application);
} catch (IOException e11) {
AFLogger.values(e11);
}
} catch (Exception e12) {
e = e12;
}
if (!AFKeystoreWrapper.exists()) {
AFKeystoreWrapper.mkdir();
} else {
File[] listFiles = AFKeystoreWrapper.listFiles();
if (listFiles != null && listFiles.length > 40) {
AFLogger.AFKeystoreWrapper("reached cache limit, not caching request");
} else {
AFLogger.AFKeystoreWrapper("caching request...");
File file = new File(ai.AFKeystoreWrapper(application), Long.toString(System.currentTimeMillis()));
file.createNewFile();
OutputStreamWriter outputStreamWriter2 = new OutputStreamWriter(new FileOutputStream(file.getPath(), true));
try {
outputStreamWriter2.write("version=");
outputStreamWriter2.write(hVar.AFKeystoreWrapper);
outputStreamWriter2.write(10);
outputStreamWriter2.write("url=");
outputStreamWriter2.write(hVar.AFInAppEventParameterName);
outputStreamWriter2.write(10);
?? r32 = "data=";
outputStreamWriter2.write("data=");
outputStreamWriter2.write(Base64.encodeToString(hVar.values(), 2));
outputStreamWriter2.write(10);
outputStreamWriter2.flush();
outputStreamWriter2.close();
outputStreamWriter = r32;
} catch (Exception e13) {
e = e13;
outputStreamWriter = outputStreamWriter2;
AFLogger.AFInAppEventType("Could not cache request", e);
if (outputStreamWriter != null) {
outputStreamWriter.close();
outputStreamWriter = outputStreamWriter;
}
AFLogger.AFInAppEventType(iOException.getMessage(), iOException);
appsFlyerRequestListener = this.AFInAppEventType.AFKeystoreWrapper;
if (appsFlyerRequestListener != null) {
}
ae aeVar2 = ae.this;
g gVar4 = this.AFInAppEventType;
ba.values(aeVar2, gVar4, gVar4.AFVersionDeclaration, application, ae.values(application), null, iOException);
return;
} catch (Throwable th2) {
th = th2;
outputStreamWriter = outputStreamWriter2;
if (outputStreamWriter != null) {
try {
outputStreamWriter.close();
} catch (IOException e14) {
AFLogger.values(e14);
}
}
throw th;
}
}
}
AFLogger.AFInAppEventType(iOException.getMessage(), iOException);
} catch (Throwable th3) {
th = th3;
}
}
appsFlyerRequestListener = this.AFInAppEventType.AFKeystoreWrapper;
if (appsFlyerRequestListener != null) {
appsFlyerRequestListener.onError(RequestError.NETWORK_FAILURE, iOException.getMessage());
}
ae aeVar22 = ae.this;
g gVar42 = this.AFInAppEventType;
ba.values(aeVar22, gVar42, gVar42.AFVersionDeclaration, application, ae.values(application), null, iOException);
return;
}
} catch (Throwable th4) {
th = th4;
bArr = bArr2;
}
} catch (Throwable th5) {
th = th5;
}
}
throw th;
} catch (IOException e15) {
iOException = e15;
}
} catch (Throwable th6) {
AFLogger.AFInAppEventParameterName(th6.getMessage(), th6);
AppsFlyerRequestListener appsFlyerRequestListener3 = this.AFInAppEventType.AFKeystoreWrapper;
if (appsFlyerRequestListener3 != null) {
appsFlyerRequestListener3.onError(RequestError.NETWORK_FAILURE, th6.getMessage());
}
}
}
private d(g gVar) {
this.AFInAppEventType = gVar;
}
}
public class e implements Runnable {
private final Application valueOf;
public e(Context context) {
this.valueOf = (Application) context.getApplicationContext();
}
@Override
public final void run() {
if (ae.this.onValidateInApp) {
return;
}
ae.this.AFVersionDeclaration = System.currentTimeMillis();
ae.this.onValidateInApp = true;
try {
try {
String AFKeystoreWrapper = ae.AFKeystoreWrapper(AppsFlyerProperties.AF_KEY);
ai.AFKeystoreWrapper();
for (h hVar : ai.AFInAppEventParameterName(this.valueOf)) {
StringBuilder sb2 = new StringBuilder("resending request: ");
sb2.append(hVar.AFInAppEventParameterName);
AFLogger.AFKeystoreWrapper(sb2.toString());
try {
long currentTimeMillis = System.currentTimeMillis();
long parseLong = Long.parseLong(hVar.valueOf, 10);
ae aeVar = ae.this;
be beVar = new be();
StringBuilder sb3 = new StringBuilder();
sb3.append(hVar.AFInAppEventParameterName);
sb3.append("&isCachedRequest=true&timeincache=");
sb3.append((currentTimeMillis - parseLong) / 1000);
g AFInAppEventParameterName = beVar.AFInAppEventParameterName(sb3.toString());
AFInAppEventParameterName.AppsFlyer2dXConversionCallback = hVar.values();
AFInAppEventParameterName.AFVersionDeclaration = AFKeystoreWrapper;
Application application = this.valueOf;
if (application != null) {
AFInAppEventParameterName.valueOf = (Application) application.getApplicationContext();
}
AFInAppEventParameterName.getLevel = hVar.valueOf;
AFInAppEventParameterName.onAttributionFailureNative = false;
ae.valueOf(aeVar, AFInAppEventParameterName);
} catch (Exception e10) {
AFLogger.AFInAppEventType("Failed to resend cached request", e10);
}
}
} catch (Throwable th) {
ae.this.onValidateInApp = false;
throw th;
}
} catch (Exception e11) {
AFLogger.AFInAppEventType("failed to check cache. ", e11);
}
ae.this.onValidateInApp = false;
ae.this.onValidateInAppFailure.shutdown();
ae.AppsFlyer2dXConversionCallback(ae.this);
}
}
static {
StringBuilder sb2 = new StringBuilder();
sb2.append(AFInAppEventType);
sb2.append("/androidevent?buildnumber=6.3.2&app_id=");
AFKeystoreWrapper = sb2.toString();
StringBuilder sb3 = new StringBuilder("https://%sadrevenue.%s/api/v");
sb3.append(AFInAppEventType);
sb3.append("/android?buildnumber=6.3.2&app_id=");
onInstallConversionDataLoadedNative = sb3.toString();
StringBuilder sb4 = new StringBuilder();
sb4.append(AFInAppEventType);
sb4.append("/androidevent?app_id=");
String obj = sb4.toString();
onDeepLinkingNative = obj;
StringBuilder sb5 = new StringBuilder("https://%sconversions.%s/api/v");
sb5.append(obj);
onAttributionFailureNative = sb5.toString();
StringBuilder sb6 = new StringBuilder("https://%slaunches.%s/api/v");
sb6.append(obj);
onAppOpenAttribution = sb6.toString();
StringBuilder sb7 = new StringBuilder("https://%sinapps.%s/api/v");
sb7.append(obj);
onConversionDataFail = sb7.toString();
StringBuilder sb8 = new StringBuilder("https://%sattr.%s/api/v");
sb8.append(obj);
onAttributionFailure = sb8.toString();
values = null;
valueOf = null;
onConversionDataSuccess = new ae();
}
public ae() {
AFVersionDeclaration.init();
}
static ScheduledExecutorService AppsFlyer2dXConversionCallback(ae aeVar) {
aeVar.onValidateInAppFailure = null;
return null;
}
@Override
public final void addPushNotificationDeepLinkPath(String... strArr) {
List<String> asList = Arrays.asList(strArr);
List<List<String>> list = j.AFInAppEventType().getLevel;
if (list.contains(asList)) {
return;
}
list.add(asList);
}
@Override
public final void anonymizeUser(boolean z10) {
aj.valueOf().AFInAppEventType("public_api_call", "anonymizeUser", String.valueOf(z10));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.DEVICE_TRACKING_DISABLED, z10);
}
@Override
public final void appendParametersToDeepLinkingURL(String str, Map<String, String> map) {
j AFInAppEventType2 = j.AFInAppEventType();
AFInAppEventType2.AFVersionDeclaration = str;
AFInAppEventType2.AFLogger$LogLevel = map;
}
@Override
public final void enableFacebookDeferredApplinks(boolean z10) {
this.setPhoneNumber = z10;
}
@Override
public final AppsFlyerLib enableLocationCollection(boolean z10) {
this.getSdkVersion = z10;
return this;
}
@Override
public final String getAppsFlyerUID(Context context) {
aj.valueOf().AFInAppEventType("public_api_call", "getAppsFlyerUID", new String[0]);
return an.AFKeystoreWrapper(new WeakReference(context));
}
@Override
public final String getAttributionId(Context context) {
try {
return new ah(context).AFInAppEventParameterName();
} catch (Throwable th) {
AFLogger.AFInAppEventType("Could not collect facebook attribution id. ", th);
return null;
}
}
@Override
public final String getHostName() {
String string = AppsFlyerProperties.getInstance().getString("custom_host");
return string != null ? string : "appsflyer.com";
}
@Override
public final String getHostPrefix() {
String string = AppsFlyerProperties.getInstance().getString("custom_host_prefix");
return string != null ? string : BuildConfig.FLAVOR;
}
@Override
public final String getOutOfStore(Context context) {
String string = AppsFlyerProperties.getInstance().getString("api_store_value");
if (string != null) {
return string;
}
String AFKeystoreWrapper2 = context == null ? null : AFKeystoreWrapper("AF_STORE", context.getPackageManager(), context.getPackageName());
if (AFKeystoreWrapper2 != null) {
return AFKeystoreWrapper2;
}
AFLogger.AFKeystoreWrapper("No out-of-store value set");
return null;
}
@Override
public final String getSdkVersion() {
aj.valueOf().AFInAppEventType("public_api_call", "getSdkVersion", new String[0]);
StringBuilder sb2 = new StringBuilder("version: 6.3.2 (build ");
sb2.append(AFInAppEventParameterName);
sb2.append(")");
return sb2.toString();
}
@Override
public final boolean isPreInstalledApp(Context context) {
try {
} catch (PackageManager.NameNotFoundException e10) {
AFLogger.AFInAppEventType("Could not check if app is pre installed", e10);
}
return (context.getPackageManager().getApplicationInfo(context.getPackageName(), 0).flags & 1) != 0;
}
@Override
public final boolean isStopped() {
return this.setOaidData;
}
@Override
public final void logEvent(Context context, String str, Map<String, Object> map, AppsFlyerRequestListener appsFlyerRequestListener) {
bj bjVar = new bj();
if (context != null) {
bjVar.valueOf = (Application) context.getApplicationContext();
}
bjVar.AFLogger$LogLevel = str;
bjVar.values = map == null ? null : new HashMap(map);
bjVar.AFKeystoreWrapper = appsFlyerRequestListener;
aj valueOf2 = aj.valueOf();
String[] strArr = new String[2];
strArr[0] = str;
Map map2 = bjVar.values;
if (map2 == null) {
map2 = new HashMap();
}
strArr[1] = new JSONObject(map2).toString();
valueOf2.AFInAppEventType("public_api_call", "logEvent", strArr);
if (str != null) {
z.AFKeystoreWrapper(context).AFInAppEventType();
}
values(bjVar, context instanceof Activity ? (Activity) context : null);
}
@Override
public final void logLocation(Context context, double d10, double d11) {
aj.valueOf().AFInAppEventType("public_api_call", "logLocation", String.valueOf(d10), String.valueOf(d11));
HashMap hashMap = new HashMap();
hashMap.put(AFInAppEventParameterName.LONGTITUDE, Double.toString(d11));
hashMap.put(AFInAppEventParameterName.LATITUDE, Double.toString(d10));
AFKeystoreWrapper(context, AFInAppEventType.LOCATION_COORDINATES, hashMap);
}
@Override
public final void logSession(Context context) {
aj.valueOf().AFInAppEventType("public_api_call", "logSession", new String[0]);
aj.valueOf().AFInAppEventParameterName = false;
AFKeystoreWrapper(context, (String) null, (Map<String, Object>) null);
}
@Override
public final void onPause(Context context) {
ag.b bVar = ag.AFInAppEventParameterName;
if (bVar != null) {
bVar.values(context);
}
}
@Override
@Deprecated
public final void performOnAppAttribution(Context context, URI uri) {
if (uri == null || uri.toString().isEmpty()) {
StringBuilder sb2 = new StringBuilder("Link is \"");
sb2.append(uri);
sb2.append("\"");
ap.valueOf(sb2.toString(), DeepLinkResult.Error.NETWORK);
} else if (context == null) {
StringBuilder sb3 = new StringBuilder("Context is \"");
sb3.append(context);
sb3.append("\"");
ap.valueOf(sb3.toString(), DeepLinkResult.Error.NETWORK);
} else {
j.AFInAppEventType().AFInAppEventType(context, new HashMap(), Uri.parse(uri.toString()));
}
}
@Override
public final void performOnDeepLinking(final Intent intent, Context context) {
if (intent == null) {
ap.valueOf("performOnDeepLinking was called with null intent", DeepLinkResult.Error.DEVELOPER_ERROR);
} else if (context == null) {
ap.valueOf("performOnDeepLinking was called with null context", DeepLinkResult.Error.DEVELOPER_ERROR);
} else {
final Context applicationContext = context.getApplicationContext();
this.setAppInviteOneLink.execute(new Runnable() {
@Override
public final void run() {
j.AFInAppEventType();
Intent intent2 = intent;
Context context2 = applicationContext;
ae aeVar = ae.this;
if (aeVar.init == null) {
aeVar.init = new au(context2);
}
au auVar = aeVar.init;
Uri AFInAppEventType2 = j.AFInAppEventType(intent2);
boolean z10 = (AFInAppEventType2 == null || AFInAppEventType2.toString().isEmpty()) ? false : true;
if (ae.values(context2).getBoolean("ddl_sent", false) && !z10) {
ap.valueOf("No direct deep link", null);
} else {
j.AFInAppEventType().AFKeystoreWrapper(new HashMap(), auVar, intent2, context2);
}
}
});
}
}
@Override
public final void registerConversionListener(Context context, AppsFlyerConversionListener appsFlyerConversionListener) {
aj.valueOf().AFInAppEventType("public_api_call", "registerConversionListener", new String[0]);
if (appsFlyerConversionListener != null) {
valueOf = appsFlyerConversionListener;
}
}
@Override
public final void registerValidatorListener(Context context, AppsFlyerInAppPurchaseValidatorListener appsFlyerInAppPurchaseValidatorListener) {
aj.valueOf().AFInAppEventType("public_api_call", "registerValidatorListener", new String[0]);
AFLogger.values("registerValidatorListener called");
if (appsFlyerInAppPurchaseValidatorListener == null) {
AFLogger.values("registerValidatorListener null listener");
} else {
values = appsFlyerInAppPurchaseValidatorListener;
}
}
@Override
public final void sendAdRevenue(Context context, Map<String, Object> map) {
bg bgVar = new bg();
if (context != null) {
bgVar.valueOf = (Application) context.getApplicationContext();
}
bgVar.values = map;
Application application = bgVar.valueOf;
String format = String.format(onInstallConversionDataLoadedNative, AppsFlyerLib.getInstance().getHostPrefix(), onConversionDataSuccess.getHostName());
StringBuilder sb2 = new StringBuilder();
sb2.append(format);
sb2.append(application.getPackageName());
String obj = sb2.toString();
SharedPreferences values2 = values(application);
int valueOf2 = valueOf(values2, "appsFlyerCount", false);
int valueOf3 = valueOf(values2, "appsFlyerAdRevenueCount", true);
HashMap hashMap = new HashMap();
hashMap.put("ad_network", bgVar.values);
hashMap.put("adrevenue_counter", Integer.valueOf(valueOf3));
String string = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
hashMap.put("af_key", string);
hashMap.put("launch_counter", Integer.valueOf(valueOf2));
hashMap.put("af_timestamp", Long.toString(new Date().getTime()));
hashMap.put("uid", an.AFKeystoreWrapper(new WeakReference(application)));
String string2 = AppsFlyerProperties.getInstance().getString("advertiserId");
String string3 = AppsFlyerProperties.getInstance().getString("advertiserIdEnabled");
if (string3 != null) {
hashMap.put("advertiserIdEnabled", string3);
}
if (string2 != null) {
hashMap.put("advertiserId", string2);
}
hashMap.put("device", Build.DEVICE);
values(application, hashMap);
try {
PackageInfo packageInfo = application.getPackageManager().getPackageInfo(application.getPackageName(), 0);
hashMap.put("app_version_code", Integer.toString(packageInfo.versionCode));
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", Locale.US);
long j10 = packageInfo.firstInstallTime;
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
hashMap.put("install_date", simpleDateFormat.format(new Date(j10)));
String string4 = values2.getString("appsFlyerFirstInstall", null);
if (string4 == null) {
string4 = AFInAppEventParameterName(simpleDateFormat, application);
}
hashMap.put("first_launch_date", string4);
} catch (Throwable th) {
AFLogger.AFInAppEventType("AdRevenue - Exception while collecting app version data ", th);
}
g valueOf4 = bgVar.AFInAppEventParameterName(obj).valueOf(hashMap);
valueOf4.onInstallConversionFailureNative = valueOf2;
valueOf4.AFVersionDeclaration = string;
d dVar = new d(this, valueOf4, (byte) 0);
if (k.valueOf == null) {
k.valueOf = new k();
}
AFInAppEventType(k.valueOf.AFInAppEventParameterName(), dVar, 1L, TimeUnit.MILLISECONDS);
}
@Override
public final void sendPushNotificationData(Activity activity) {
long j10;
if (activity != null && activity.getIntent() != null) {
aj valueOf2 = aj.valueOf();
StringBuilder sb2 = new StringBuilder("activity_intent_");
sb2.append(activity.getIntent().toString());
valueOf2.AFInAppEventType("public_api_call", "sendPushNotificationData", activity.getLocalClassName(), sb2.toString());
} else if (activity != null) {
aj.valueOf().AFInAppEventType("public_api_call", "sendPushNotificationData", activity.getLocalClassName(), "activity_intent_null");
} else {
aj.valueOf().AFInAppEventType("public_api_call", "sendPushNotificationData", "activity_null");
}
String AFInAppEventParameterName2 = AFInAppEventParameterName(activity);
this.updateServerUninstallToken = AFInAppEventParameterName2;
if (AFInAppEventParameterName2 != null) {
long currentTimeMillis = System.currentTimeMillis();
if (this.getInstance == null) {
AFLogger.AFKeystoreWrapper("pushes: initializing pushes history..");
this.getInstance = new ConcurrentHashMap();
j10 = currentTimeMillis;
} else {
try {
long j11 = AppsFlyerProperties.getInstance().getLong("pushPayloadMaxAging", BacktraceMetrics.defaultTimeIntervalMs);
j10 = currentTimeMillis;
for (Long l10 : this.getInstance.keySet()) {
try {
JSONObject jSONObject = new JSONObject(this.updateServerUninstallToken);
JSONObject jSONObject2 = new JSONObject(this.getInstance.get(l10));
if (jSONObject.opt("pid").equals(jSONObject2.opt("pid")) && jSONObject.opt("c").equals(jSONObject2.opt("c"))) {
StringBuilder sb3 = new StringBuilder("PushNotificationMeasurement: A previous payload with same PID and campaign was already acknowledged! (old: ");
sb3.append(jSONObject2);
sb3.append(", new: ");
sb3.append(jSONObject);
sb3.append(")");
AFLogger.AFKeystoreWrapper(sb3.toString());
this.updateServerUninstallToken = null;
return;
}
if (currentTimeMillis - l10.longValue() > j11) {
this.getInstance.remove(l10);
}
if (l10.longValue() <= j10) {
j10 = l10.longValue();
}
} catch (Throwable th) {
th = th;
StringBuilder sb4 = new StringBuilder("Error while handling push notification measurement: ");
sb4.append(th.getClass().getSimpleName());
AFLogger.AFInAppEventType(sb4.toString(), th);
if (this.getInstance.size() == AppsFlyerProperties.getInstance().getInt("pushPayloadHistorySize", 2)) {
}
this.getInstance.put(Long.valueOf(currentTimeMillis), this.updateServerUninstallToken);
start(activity);
}
}
} catch (Throwable th2) {
th = th2;
j10 = currentTimeMillis;
}
}
if (this.getInstance.size() == AppsFlyerProperties.getInstance().getInt("pushPayloadHistorySize", 2)) {
StringBuilder sb5 = new StringBuilder("pushes: removing oldest overflowing push (oldest push:");
sb5.append(j10);
sb5.append(")");
AFLogger.AFKeystoreWrapper(sb5.toString());
this.getInstance.remove(Long.valueOf(j10));
}
this.getInstance.put(Long.valueOf(currentTimeMillis), this.updateServerUninstallToken);
start(activity);
}
}
@Override
public final void setAdditionalData(Map<String, Object> map) {
if (map != null) {
aj.valueOf().AFInAppEventType("public_api_call", "setAdditionalData", map.toString());
AppsFlyerProperties.getInstance().setCustomData(new JSONObject(map).toString());
}
}
@Override
public final void setAndroidIdData(String str) {
aj.valueOf().AFInAppEventType("public_api_call", "setAndroidIdData", str);
this.AFLogger$LogLevel = str;
}
@Override
public final void setAppId(String str) {
aj.valueOf().AFInAppEventType("public_api_call", "setAppId", str);
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.APP_ID, str);
}
@Override
public final void setAppInviteOneLink(String str) {
aj.valueOf().AFInAppEventType("public_api_call", "setAppInviteOneLink", str);
AFLogger.AFKeystoreWrapper("setAppInviteOneLink = ".concat(String.valueOf(str)));
if (str == null || !str.equals(AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.ONELINK_ID))) {
AppsFlyerProperties.getInstance().remove(AppsFlyerProperties.ONELINK_DOMAIN);
AppsFlyerProperties.getInstance().remove("onelinkVersion");
AppsFlyerProperties.getInstance().remove(AppsFlyerProperties.ONELINK_SCHEME);
}
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.ONELINK_ID, str);
}
@Override
public final void setCollectAndroidID(boolean z10) {
aj.valueOf().AFInAppEventType("public_api_call", "setCollectAndroidID", String.valueOf(z10));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.COLLECT_ANDROID_ID, Boolean.toString(z10));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.COLLECT_ANDROID_ID_FORCE_BY_USER, Boolean.toString(z10));
}
@Override
public final void setCollectIMEI(boolean z10) {
aj.valueOf().AFInAppEventType("public_api_call", "setCollectIMEI", String.valueOf(z10));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.COLLECT_IMEI, Boolean.toString(z10));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.COLLECT_IMEI_FORCE_BY_USER, Boolean.toString(z10));
}
@Override
@Deprecated
public final void setCollectOaid(boolean z10) {
aj.valueOf().AFInAppEventType("public_api_call", "setCollectOaid", String.valueOf(z10));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.COLLECT_OAID, Boolean.toString(z10));
}
@Override
public final void setCurrencyCode(String str) {
aj.valueOf().AFInAppEventType("public_api_call", "setCurrencyCode", str);
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.CURRENCY_CODE, str);
}
@Override
public final void setCustomerIdAndLogSession(String str, Context context) {
if (context != null) {
if (valueOf()) {
setCustomerUserId(str);
StringBuilder sb2 = new StringBuilder("CustomerUserId set: ");
sb2.append(str);
sb2.append(" - Initializing AppsFlyer Tacking");
AFLogger.AFInAppEventType(sb2.toString(), true);
String referrer = AppsFlyerProperties.getInstance().getReferrer(context);
String string = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
if (referrer == null) {
referrer = BuildConfig.FLAVOR;
}
if (context instanceof Activity) {
((Activity) context).getIntent();
}
bl blVar = new bl();
blVar.valueOf = (Application) context.getApplicationContext();
blVar.AFLogger$LogLevel = null;
blVar.AFVersionDeclaration = string;
blVar.values = null;
blVar.init = referrer;
blVar.AFInAppEventParameterName = null;
AFInAppEventType(blVar);
return;
}
setCustomerUserId(str);
AFLogger.AFInAppEventType("waitForCustomerUserId is false; setting CustomerUserID: ".concat(String.valueOf(str)), true);
}
}
@Override
public final void setCustomerUserId(String str) {
aj.valueOf().AFInAppEventType("public_api_call", "setCustomerUserId", str);
AFLogger.AFKeystoreWrapper("setCustomerUserId = ".concat(String.valueOf(str)));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.APP_USER_ID, str);
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.AF_WAITFOR_CUSTOMERID, false);
}
@Override
public final void setDebugLog(boolean z10) {
setLogLevel(z10 ? AFLogger.LogLevel.DEBUG : AFLogger.LogLevel.NONE);
}
@Override
public final void setDisableAdvertisingIdentifiers(boolean z10) {
AFLogger.values("setDisableAdvertisingIdentifiers: ".concat(String.valueOf(z10)));
ab.AFInAppEventType = Boolean.valueOf(!z10);
AppsFlyerProperties.getInstance().remove("advertiserIdEnabled");
AppsFlyerProperties.getInstance().remove("advertiserId");
}
@Override
public final void setExtension(String str) {
aj.valueOf().AFInAppEventType("public_api_call", "setExtension", str);
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.EXTENSION, str);
}
@Override
public final void setHost(String str, String str2) {
if (str != null) {
AppsFlyerProperties.getInstance().set("custom_host_prefix", str);
}
if (str2 != null && !str2.isEmpty()) {
AppsFlyerProperties.getInstance().set("custom_host", str2);
} else {
AFLogger.init("hostName cannot be null or empty");
}
}
@Override
public final void setImeiData(String str) {
aj.valueOf().AFInAppEventType("public_api_call", "setImeiData", str);
this.AppsFlyer2dXConversionCallback = str;
}
@Override
public final void setIsUpdate(boolean z10) {
aj.valueOf().AFInAppEventType("public_api_call", "setIsUpdate", String.valueOf(z10));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.IS_UPDATE, z10);
}
@Override
public final void setLogLevel(AFLogger.LogLevel logLevel) {
aj.valueOf().AFInAppEventType("public_api_call", "log", String.valueOf(logLevel.getLevel() > AFLogger.LogLevel.NONE.getLevel()));
AppsFlyerProperties.getInstance().set("logLevel", logLevel.getLevel());
}
@Override
public final void setMinTimeBetweenSessions(int i10) {
this.AppsFlyerLib = TimeUnit.SECONDS.toMillis(i10);
}
@Override
public final void setOaidData(String str) {
aj.valueOf().AFInAppEventType("public_api_call", "setOaidData", str);
ab.valueOf = str;
}
@Override
public final void setOneLinkCustomDomain(String... strArr) {
AFLogger.values(String.format("setOneLinkCustomDomain %s", Arrays.toString(strArr)));
j.AppsFlyer2dXConversionCallback = strArr;
}
@Override
public final void setOutOfStore(String str) {
if (str != null) {
String lowerCase = str.toLowerCase();
AppsFlyerProperties.getInstance().set("api_store_value", lowerCase);
AFLogger.AFInAppEventType("Store API set with value: ".concat(String.valueOf(lowerCase)), true);
return;
}
AFLogger.valueOf("Cannot set setOutOfStore with null");
}
@Override
public final void setPartnerData(String str, Map<String, Object> map) {
if (this.setAdditionalData == null) {
this.setAdditionalData = new av();
}
av avVar = this.setAdditionalData;
if (str != null && !str.isEmpty()) {
if (map != null && !map.isEmpty()) {
StringBuilder sb2 = new StringBuilder("Setting partner data for ");
sb2.append(str);
sb2.append(": ");
sb2.append(map);
AFLogger.values(sb2.toString());
int length = new JSONObject(map).toString().length();
if (length > 1000) {
AFLogger.init("Partner data 1000 characters limit exceeded");
HashMap hashMap = new HashMap();
hashMap.put("error", "limit exceeded: ".concat(String.valueOf(length)));
avVar.AFKeystoreWrapper.put(str, hashMap);
return;
}
avVar.valueOf.put(str, map);
avVar.AFKeystoreWrapper.remove(str);
return;
}
AFLogger.init(avVar.valueOf.remove(str) == null ? "Partner data is missing or `null`" : "Cleared partner data for ".concat(str));
return;
}
AFLogger.init("Partner ID is missing or `null`");
}
@Override
public final void setPhoneNumber(String str) {
this.setCustomerUserId = af.values(str);
}
@Override
public final void setPreinstallAttribution(String str, String str2, String str3) {
AFLogger.values("setPreinstallAttribution API called");
JSONObject jSONObject = new JSONObject();
if (str != null) {
try {
jSONObject.put("pid", str);
} catch (JSONException e10) {
AFLogger.AFInAppEventType(e10.getMessage(), e10);
}
}
if (str2 != null) {
jSONObject.put("c", str2);
}
if (str3 != null) {
jSONObject.put("af_siteid", str3);
}
if (jSONObject.has("pid")) {
AppsFlyerProperties.getInstance().set("preInstallName", jSONObject.toString());
return;
}
AFLogger.init("Cannot set preinstall attribution data without a media source");
}
@Override
public final void setResolveDeepLinkURLs(String... strArr) {
AFLogger.values(String.format("setResolveDeepLinkURLs %s", Arrays.toString(strArr)));
j.AFKeystoreWrapper = strArr;
}
@Override
public final void setSharingFilter(String... strArr) {
if (strArr == null || Arrays.equals(this.getLevel, new String[]{"all"})) {
return;
}
Pattern compile = Pattern.compile("[\\d\\w_]{1,45}");
ArrayList arrayList = new ArrayList();
for (String str : strArr) {
if (str == null || !compile.matcher(str).matches()) {
AFLogger.init("Invalid partner name :".concat(String.valueOf(str)));
} else {
arrayList.add(str);
}
}
if (arrayList.isEmpty()) {
this.getLevel = null;
} else {
this.getLevel = (String[]) arrayList.toArray(new String[0]);
}
}
@Override
public final void setSharingFilterForAllPartners() {
this.getLevel = new String[]{"all"};
}
@Override
public final void setUserEmails(String... strArr) {
aj.valueOf().AFInAppEventType("public_api_call", "setUserEmails", strArr);
setUserEmails(AppsFlyerProperties.EmailsCryptType.NONE, strArr);
}
@Override
public final void start(Context context) {
start(context, null);
}
@Override
public final void stop(boolean z10, Context context) {
File[] listFiles;
this.setOaidData = z10;
ai.AFKeystoreWrapper();
try {
File AFKeystoreWrapper2 = ai.AFKeystoreWrapper(context);
if (!AFKeystoreWrapper2.exists()) {
AFKeystoreWrapper2.mkdir();
} else {
for (File file : AFKeystoreWrapper2.listFiles()) {
StringBuilder sb2 = new StringBuilder("Found cached request");
sb2.append(file.getName());
AFLogger.AFKeystoreWrapper(sb2.toString());
ai.valueOf(ai.AFInAppEventParameterName(file).valueOf, context);
}
}
} catch (Exception e10) {
AFLogger.AFInAppEventType("Could not cache request", e10);
}
if (this.setOaidData) {
SharedPreferences.Editor edit = values(context).edit();
edit.putBoolean("is_stop_tracking_used", true);
edit.apply();
}
}
@Override
public final void subscribeForDeepLink(DeepLinkListener deepLinkListener) {
subscribeForDeepLink(deepLinkListener, TimeUnit.SECONDS.toMillis(3L));
}
@Override
public final void unregisterConversionListener() {
aj.valueOf().AFInAppEventType("public_api_call", "unregisterConversionListener", new String[0]);
valueOf = null;
}
@Override
public final void updateServerUninstallToken(Context context, String str) {
new bb(context).valueOf(str);
}
@Override
public final void validateAndLogInAppPurchase(Context context, String str, String str2, String str3, String str4, String str5, Map<String, String> map) {
aj valueOf2 = aj.valueOf();
String[] strArr = new String[6];
strArr[0] = str;
strArr[1] = str2;
strArr[2] = str3;
strArr[3] = str4;
strArr[4] = str5;
strArr[5] = map == null ? BuildConfig.FLAVOR : map.toString();
valueOf2.AFInAppEventType("public_api_call", "validateAndTrackInAppPurchase", strArr);
if (!isStopped()) {
StringBuilder sb2 = new StringBuilder("Validate in app called with parameters: ");
sb2.append(str3);
sb2.append(" ");
sb2.append(str4);
sb2.append(" ");
sb2.append(str5);
AFLogger.AFKeystoreWrapper(sb2.toString());
}
if (str != null && str4 != null && str2 != null && str5 != null && str3 != null) {
Context applicationContext = context.getApplicationContext();
String string = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
if (context instanceof Activity) {
((Activity) context).getIntent();
}
new Thread(new ad(applicationContext, string, str, str2, str3, str4, str5, map)).start();
return;
}
AppsFlyerInAppPurchaseValidatorListener appsFlyerInAppPurchaseValidatorListener = values;
if (appsFlyerInAppPurchaseValidatorListener != null) {
appsFlyerInAppPurchaseValidatorListener.onValidateInAppFailure("Please provide purchase parameters");
}
}
@Override
public final void waitForCustomerUserId(boolean z10) {
AFLogger.AFInAppEventType("initAfterCustomerUserID: ".concat(String.valueOf(z10)), true);
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.AF_WAITFOR_CUSTOMERID, z10);
}
private static boolean AFInAppEventType(String str, boolean z10) {
return AppsFlyerProperties.getInstance().getBoolean(str, z10);
}
private boolean AFLogger$LogLevel() {
Map<String, Object> map = this.setCustomerIdAndLogSession;
return (map == null || map.isEmpty()) ? false : true;
}
private static float AFVersionDeclaration(Context context) {
try {
Intent registerReceiver = context.getApplicationContext().registerReceiver(null, new IntentFilter("android.intent.action.BATTERY_CHANGED"));
int intExtra = registerReceiver.getIntExtra("level", -1);
int intExtra2 = registerReceiver.getIntExtra("scale", -1);
if (intExtra == -1 || intExtra2 == -1) {
return 50.0f;
}
return (intExtra / intExtra2) * 100.0f;
} catch (Throwable th) {
AFLogger.AFInAppEventType(th.getMessage(), th);
return 1.0f;
}
}
private static boolean AppsFlyer2dXConversionCallback(Context context) {
return (AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.COLLECT_ANDROID_ID_FORCE_BY_USER, false) || AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.COLLECT_IMEI_FORCE_BY_USER, false)) || !AFLogger$LogLevel(context);
}
private static boolean getLevel(Context context) {
if (context != null) {
if (Build.VERSION.SDK_INT >= 23) {
try {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
for (Network network : connectivityManager.getAllNetworks()) {
NetworkCapabilities networkCapabilities = connectivityManager.getNetworkCapabilities(network);
if (networkCapabilities.hasTransport(4) && !networkCapabilities.hasCapability(15)) {
return true;
}
}
return false;
} catch (Exception e10) {
AFLogger.AFInAppEventType("Failed collecting ivc data", e10);
}
} else {
ArrayList arrayList = new ArrayList();
try {
Iterator it = Collections.list(NetworkInterface.getNetworkInterfaces()).iterator();
while (it.hasNext()) {
NetworkInterface networkInterface = (NetworkInterface) it.next();
if (networkInterface.isUp()) {
arrayList.add(networkInterface.getName());
}
}
return arrayList.contains("tun0");
} catch (Exception e11) {
AFLogger.AFInAppEventType("Failed collecting ivc data", e11);
}
}
}
return false;
}
public static ae values() {
return onConversionDataSuccess;
}
public final void AFInAppEventParameterName(Context context, Intent intent) {
if (intent.getStringExtra("appsflyer_preinstall") != null) {
String stringExtra = intent.getStringExtra("appsflyer_preinstall");
try {
if (new JSONObject(stringExtra).has("pid")) {
AppsFlyerProperties.getInstance().set("preInstallName", stringExtra);
} else {
AFLogger.init("Cannot set preinstall attribution data without a media source");
}
} catch (JSONException e10) {
AFLogger.AFInAppEventType("Error parsing JSON for preinstall", e10);
}
}
AFLogger.AFKeystoreWrapper("****** onReceive called *******");
AppsFlyerProperties.getInstance();
String stringExtra2 = intent.getStringExtra("referrer");
AFLogger.AFKeystoreWrapper("Play store referrer: ".concat(String.valueOf(stringExtra2)));
if (stringExtra2 != null) {
SharedPreferences.Editor edit = values(context).edit();
edit.putString("referrer", stringExtra2);
edit.apply();
AppsFlyerProperties appsFlyerProperties = AppsFlyerProperties.getInstance();
appsFlyerProperties.set("AF_REFERRER", stringExtra2);
appsFlyerProperties.valueOf = stringExtra2;
if (AppsFlyerProperties.getInstance().values()) {
AFLogger.AFKeystoreWrapper("onReceive: isLaunchCalled");
bd bdVar = new bd();
if (context != null) {
bdVar.valueOf = (Application) context.getApplicationContext();
}
bdVar.init = stringExtra2;
if (stringExtra2.length() <= 5 || !AFInAppEventParameterName(bdVar, values(context))) {
return;
}
if (k.valueOf == null) {
k.valueOf = new k();
}
AFInAppEventType(k.valueOf.AFInAppEventParameterName(), new c(this, bdVar, (byte) 0), 5L, TimeUnit.MILLISECONDS);
}
}
}
@Override
public final AppsFlyerLib init(String str, AppsFlyerConversionListener appsFlyerConversionListener, Context context) {
if (this.setDebugLog) {
return this;
}
this.setDebugLog = true;
if (context != null) {
if (this.init == null) {
this.init = new au(context);
}
au auVar = this.init;
if (auVar.AFInAppEventType()) {
auVar.valueOf.edit().putLong("init_ts", System.currentTimeMillis()).apply();
}
this.setImeiData = (Application) context.getApplicationContext();
final bo boVar = new bo(new Runnable() {
@Override
public final void run() {
if (k.valueOf == null) {
k.valueOf = new k();
}
ae.AFInAppEventType(k.valueOf.AFInAppEventParameterName(), new Runnable() {
@Override
public final void run() {
try {
bh bhVar = new bh();
Application application = ae.this.setImeiData;
if (application != null) {
bhVar.valueOf = (Application) application.getApplicationContext();
}
ae aeVar = ae.this;
if (aeVar.AFInAppEventParameterName(bhVar, ae.values(aeVar.setImeiData))) {
ae.AFKeystoreWrapper(ae.this, bhVar);
}
} catch (Throwable th) {
AFLogger.AFInAppEventType(th.getMessage(), th);
}
}
}, 0L, TimeUnit.MILLISECONDS);
}
});
Runnable runnable = new Runnable() {
@Override
public final void run() {
SharedPreferences values2 = ae.values(ae.this.setImeiData);
int valueOf2 = ae.valueOf(values2, "appsFlyerCount", false);
boolean z10 = values2.getBoolean(AppsFlyerProperties.NEW_REFERRER_SENT, false);
boolean z11 = boVar.AFInAppEventParameterName == bt.e.NOT_STARTED;
if (valueOf2 == 1) {
if (z11 || z10) {
ae aeVar = ae.this;
bh bhVar = new bh();
Application application = ae.this.setImeiData;
if (application != null) {
bhVar.valueOf = (Application) application.getApplicationContext();
}
ae.AFKeystoreWrapper(aeVar, bhVar);
}
}
}
};
bt[] btVarArr = {boVar, new br(runnable), new bw(runnable)};
this.onAppOpenAttributionNative = btVarArr;
for (bt btVar : btVarArr) {
btVar.AFInAppEventParameterName(this.setImeiData);
}
this.getOutOfStore = AFInAppEventType(context);
at.AFInAppEventParameterName = this.setImeiData;
} else {
AFLogger.init("context is null, Google Install Referrer will be not initialized");
}
aj valueOf2 = aj.valueOf();
String[] strArr = new String[2];
strArr[0] = str;
strArr[1] = appsFlyerConversionListener == null ? "null" : "conversionDataListener";
valueOf2.AFInAppEventType("public_api_call", "init", strArr);
AFLogger.AFInAppEventType(String.format("Initializing AppsFlyer SDK: (v%s.%s)", "6.3.2", AFInAppEventParameterName));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.AF_KEY, str);
am.valueOf(str);
valueOf = appsFlyerConversionListener;
return this;
}
@Override
public final void start(Context context, String str) {
start(context, str, null);
}
@Override
public final void subscribeForDeepLink(DeepLinkListener deepLinkListener, long j10) {
j.AFInAppEventType().AFInAppEventParameterName = deepLinkListener;
aq.onInstallConversionDataLoadedNative = j10;
}
private boolean AFInAppEventType(Context context) {
try {
Class.forName("com.appsflyer.lvl.AppsFlyerLVL");
final long currentTimeMillis = System.currentTimeMillis();
this.setCustomerIdAndLogSession = new ConcurrentHashMap();
final v.d dVar = new v.d() {
@Override
public final void AFInAppEventParameterName(String str, String str2) {
ae.this.setCustomerIdAndLogSession.put("signedData", str);
ae.this.setCustomerIdAndLogSession.put("signature", str2);
ae.this.setCustomerIdAndLogSession.put("ttr", Long.valueOf(System.currentTimeMillis() - currentTimeMillis));
AFLogger.AFKeystoreWrapper("Successfully retrieved Google LVL data.");
}
@Override
public final void AFKeystoreWrapper(String str, Exception exc) {
String message = exc.getMessage();
if (message == null) {
message = "unknown";
}
ae.this.setCustomerIdAndLogSession.put("error", message);
AFLogger.AFInAppEventParameterName(str, exc);
}
};
try {
try {
Class<?> cls = Class.forName("com.appsflyer.lvl.AppsFlyerLVL");
Class<?> cls2 = Class.forName("com.appsflyer.lvl.AppsFlyerLVL$resultListener");
cls.getMethod("checkLicense", Long.TYPE, Context.class, cls2).invoke(null, Long.valueOf(currentTimeMillis), context, Proxy.newProxyInstance(cls2.getClassLoader(), new Class[]{cls2}, new InvocationHandler() {
@Override
public final Object invoke(Object obj, Method method, Object[] objArr) {
if (method.getName().equals("onLvlResult")) {
String str = objArr[0] != null ? (String) objArr[0] : null;
String str2 = objArr[1] != null ? (String) objArr[1] : null;
d dVar2 = dVar;
if (dVar2 == null) {
AFLogger.values("onLvlResult invocation succeeded, but listener is null");
} else if (str != null && str2 != null) {
dVar2.AFInAppEventParameterName(str, str2);
} else if (str2 == null) {
dVar2.AFKeystoreWrapper("onLvlResult with error", new Exception("AFLVL Invalid signature"));
} else {
dVar2.AFKeystoreWrapper("onLvlResult with error", new Exception("AFLVL Invalid signedData"));
}
} else if (method.getName().equals("onLvlFailure")) {
d dVar3 = dVar;
if (dVar3 != null) {
if (objArr[0] != null) {
dVar3.AFKeystoreWrapper("onLvlFailure with exception", (Exception) objArr[0]);
} else {
dVar3.AFKeystoreWrapper("onLvlFailure", new Exception("unknown"));
}
} else {
AFLogger.values("onLvlFailure: listener is null");
}
} else {
d dVar4 = dVar;
if (dVar4 != null) {
dVar4.AFKeystoreWrapper("lvlInvocation failed", new Exception("com.appsflyer.lvl.AppsFlyerLVL$resultListener invocation failed"));
}
}
return null;
}
}));
} catch (ClassNotFoundException e10) {
dVar.AFKeystoreWrapper(e10.getClass().getSimpleName(), e10);
} catch (IllegalAccessException e11) {
dVar.AFKeystoreWrapper(e11.getClass().getSimpleName(), e11);
}
} catch (NoSuchMethodException e12) {
dVar.AFKeystoreWrapper(e12.getClass().getSimpleName(), e12);
} catch (InvocationTargetException e13) {
dVar.AFKeystoreWrapper(e13.getClass().getSimpleName(), e13);
}
return true;
} catch (ClassNotFoundException unused) {
return false;
}
}
private static boolean AFLogger$LogLevel(Context context) {
try {
if (com.google.android.gms.common.a.o().g(context) == 0) {
return true;
}
} catch (Throwable th) {
AFLogger.AFInAppEventType("WARNING: Google play services is unavailable. ", th);
}
try {
context.getPackageManager().getPackageInfo("com.google.android.gms", 0);
return true;
} catch (PackageManager.NameNotFoundException e10) {
AFLogger.AFInAppEventType("WARNING: Google Play Services is unavailable. ", e10);
return false;
}
}
public static void valueOf(Context context, String str) {
SharedPreferences.Editor edit = values(context).edit();
edit.putBoolean(str, true);
edit.apply();
}
@Override
public final void start(Context context, final String str, final AppsFlyerRequestListener appsFlyerRequestListener) {
if (ag.AFInAppEventParameterName != null) {
return;
}
if (!this.setDebugLog) {
AFLogger.init("ERROR: AppsFlyer SDK is not initialized! The API call 'start()' must be called after the 'init(String, AppsFlyerConversionListener)' API method, which should be called on the Application's onCreate.");
if (str == null) {
if (appsFlyerRequestListener != null) {
appsFlyerRequestListener.onError(RequestError.NO_DEV_KEY, ax.AFKeystoreWrapper);
return;
}
return;
}
}
this.setImeiData = (Application) context.getApplicationContext();
aj.valueOf().AFInAppEventType("public_api_call", "start", str);
String str2 = AFInAppEventParameterName;
AFLogger.AFKeystoreWrapper(String.format("Starting AppsFlyer: (v%s.%s)", "6.3.2", str2));
StringBuilder sb2 = new StringBuilder("Build Number: ");
sb2.append(str2);
AFLogger.AFKeystoreWrapper(sb2.toString());
AppsFlyerProperties.getInstance().loadProperties(this.setImeiData.getApplicationContext());
if (!TextUtils.isEmpty(str)) {
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.AF_KEY, str);
am.valueOf(str);
} else if (TextUtils.isEmpty(AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY))) {
AFLogger.init("ERROR: AppsFlyer SDK is not initialized! You must provide AppsFlyer Dev-Key either in the 'init' API method (should be called on Application's onCreate),or in the start() API (should be called on Activity's onCreate).");
if (appsFlyerRequestListener != null) {
appsFlyerRequestListener.onError(RequestError.NO_DEV_KEY, ax.AFKeystoreWrapper);
return;
}
return;
}
Context baseContext = this.setImeiData.getBaseContext();
try {
if ((baseContext.getPackageManager().getPackageInfo(baseContext.getPackageName(), 0).applicationInfo.flags & 32768) != 0) {
if (baseContext.getResources().getIdentifier("appsflyer_backup_rules", "xml", baseContext.getPackageName()) != 0) {
AFLogger.AFInAppEventType("appsflyer_backup_rules.xml detected, using AppsFlyer defined backup rules for AppsFlyer SDK data", true);
} else {
AFLogger.valueOf("'allowBackup' is set to true; appsflyer_backup_rules.xml not detected.\nAppsFlyer shared preferences should be excluded from auto backup by adding: <exclude domain=\"sharedpref\" path=\"appsflyer-data\"/> to the Application's <full-backup-content> rules");
}
}
} catch (Exception e10) {
StringBuilder sb3 = new StringBuilder("checkBackupRules Exception: ");
sb3.append(e10.toString());
AFLogger.AFInAppEventParameterName(sb3.toString());
}
if (this.setPhoneNumber) {
Context applicationContext = this.setImeiData.getApplicationContext();
this.waitForCustomerUserId = new HashMap();
final long currentTimeMillis = System.currentTimeMillis();
final l.a aVar = new l.a() {
@Override
public final void AFInAppEventType(String str3, String str4, String str5) {
if (str3 != null) {
AFLogger.AFKeystoreWrapper("Facebook Deferred AppLink data received: ".concat(str3));
ae.this.waitForCustomerUserId.put("link", str3);
if (str4 != null) {
ae.this.waitForCustomerUserId.put("target_url", str4);
}
if (str5 != null) {
HashMap hashMap = new HashMap();
HashMap hashMap2 = new HashMap();
hashMap2.put("promo_code", str5);
hashMap.put("deeplink_context", hashMap2);
ae.this.waitForCustomerUserId.put("extras", hashMap);
}
} else {
ae.this.waitForCustomerUserId.put("link", BuildConfig.FLAVOR);
}
ae.this.waitForCustomerUserId.put("ttr", String.valueOf(System.currentTimeMillis() - currentTimeMillis));
}
@Override
public final void values(String str3) {
ae.this.waitForCustomerUserId.put("error", str3);
}
};
try {
Class.forName("com.facebook.FacebookSdk").getMethod("sdkInitialize", Context.class).invoke(null, applicationContext);
final Class<?> cls = Class.forName("com.facebook.applinks.AppLinkData");
Class<?> cls2 = Class.forName("com.facebook.applinks.AppLinkData$CompletionHandler");
Method method = cls.getMethod("fetchDeferredAppLinkData", Context.class, String.class, cls2);
Object newProxyInstance = Proxy.newProxyInstance(cls2.getClassLoader(), new Class[]{cls2}, new InvocationHandler() {
@Override
public final Object invoke(Object obj, Method method2, Object[] objArr) throws Throwable {
String str3;
String str4;
String str5;
Bundle bundle;
if (method2.getName().equals("onDeferredAppLinkDataFetched")) {
if (objArr[0] != null) {
Bundle bundle2 = (Bundle) Bundle.class.cast(cls.getMethod("getArgumentBundle", new Class[0]).invoke(cls.cast(objArr[0]), new Object[0]));
if (bundle2 != null) {
str4 = bundle2.getString("com.facebook.platform.APPLINK_NATIVE_URL");
str5 = bundle2.getString("target_url");
Bundle bundle3 = bundle2.getBundle("extras");
str3 = (bundle3 == null || (bundle = bundle3.getBundle("deeplink_context")) == null) ? null : bundle.getString("promo_code");
} else {
str3 = null;
str4 = null;
str5 = null;
}
a aVar2 = aVar;
if (aVar2 != null) {
aVar2.AFInAppEventType(str4, str5, str3);
}
} else {
a aVar3 = aVar;
if (aVar3 != null) {
aVar3.AFInAppEventType(null, null, null);
}
}
return null;
}
a aVar4 = aVar;
if (aVar4 != null) {
aVar4.values("onDeferredAppLinkDataFetched invocation failed");
}
return null;
}
});
String string = applicationContext.getString(applicationContext.getResources().getIdentifier("facebook_app_id", "string", applicationContext.getPackageName()));
if (TextUtils.isEmpty(string)) {
aVar.values("Facebook app id not defined in resources");
} else {
method.invoke(null, applicationContext, string, newProxyInstance);
}
} catch (ClassNotFoundException e11) {
aVar.values(e11.toString());
} catch (IllegalAccessException e12) {
aVar.values(e12.toString());
} catch (NoSuchMethodException e13) {
aVar.values(e13.toString());
} catch (InvocationTargetException e14) {
aVar.values(e14.toString());
}
}
ag.valueOf(context, new ag.b() {
@Override
public final void AFKeystoreWrapper(Activity activity) {
ae.this.AppsFlyerConversionListener = System.currentTimeMillis();
ae aeVar = ae.this;
if (aeVar.init == null) {
aeVar.init = new au(activity);
}
au auVar = aeVar.init;
if (auVar.AFInAppEventType()) {
auVar.valueOf.edit().putLong("fg_ts", System.currentTimeMillis()).apply();
}
int valueOf2 = ae.valueOf(ae.values(activity), "appsFlyerCount", false);
if (valueOf2 == 0) {
try {
ae.this.setUserEmails.put("init_to_fg", ae.this.AppsFlyerConversionListener - auVar.valueOf.getLong("init_ts", 0L));
} catch (JSONException unused) {
}
}
AFLogger.AFKeystoreWrapper("onBecameForeground");
if (valueOf2 < 2) {
z AFKeystoreWrapper2 = z.AFKeystoreWrapper(activity);
AFKeystoreWrapper2.valueOf.post(AFKeystoreWrapper2.AFVersionDeclaration);
AFKeystoreWrapper2.valueOf.post(AFKeystoreWrapper2.AFKeystoreWrapper);
}
bl blVar = new bl();
j.AFInAppEventType().AFKeystoreWrapper(blVar.AFInAppEventType(), auVar, activity.getIntent(), activity.getApplication());
ae aeVar2 = ae.this;
blVar.valueOf = (Application) activity.getApplicationContext();
blVar.AFVersionDeclaration = str;
blVar.AFKeystoreWrapper = appsFlyerRequestListener;
aeVar2.values(blVar, activity);
}
@Override
public final void values(Context context2) {
AFLogger.AFKeystoreWrapper("onBecameBackground");
ae.this.stop = System.currentTimeMillis();
long j10 = ae.this.stop - ae.this.AppsFlyerConversionListener;
if (j10 > 0 && j10 < 1000) {
j10 = 1000;
}
ae aeVar = ae.this;
if (aeVar.init == null) {
aeVar.init = new au(context2);
}
aeVar.init.valueOf.edit().putLong("prev_session_dur", TimeUnit.MILLISECONDS.toSeconds(j10)).apply();
AFLogger.AFKeystoreWrapper("callStatsBackground background call");
ae.this.AFKeystoreWrapper(new WeakReference<>(context2));
aj valueOf2 = aj.valueOf();
if (valueOf2.getLevel()) {
valueOf2.AFInAppEventParameterName();
if (context2 != null) {
aj.valueOf(context2.getPackageName(), context2.getPackageManager());
}
valueOf2.AFInAppEventType();
} else {
AFLogger.values("RD status is OFF");
}
if (k.valueOf == null) {
k.valueOf = new k();
}
k kVar = k.valueOf;
try {
k.AFKeystoreWrapper(kVar.values);
Executor executor = kVar.AFKeystoreWrapper;
if (executor instanceof ThreadPoolExecutor) {
k.AFKeystoreWrapper((ThreadPoolExecutor) executor);
}
} catch (Throwable th) {
AFLogger.AFInAppEventType("failed to stop Executors", th);
}
z AFKeystoreWrapper2 = z.AFKeystoreWrapper(context2);
AFKeystoreWrapper2.valueOf.post(AFKeystoreWrapper2.AFVersionDeclaration);
}
}, this.setAppInviteOneLink);
}
public final void values(Context context, String str) {
JSONArray jSONArray;
JSONArray jSONArray2;
JSONObject jSONObject;
AFLogger.values("received a new (extra) referrer: ".concat(String.valueOf(str)));
try {
long currentTimeMillis = System.currentTimeMillis();
String string = values(context).getString("extraReferrers", null);
if (string == null) {
jSONObject = new JSONObject();
jSONArray2 = new JSONArray();
} else {
JSONObject jSONObject2 = new JSONObject(string);
if (jSONObject2.has(str)) {
jSONArray = new JSONArray((String) jSONObject2.get(str));
} else {
jSONArray = new JSONArray();
}
jSONArray2 = jSONArray;
jSONObject = jSONObject2;
}
if (jSONArray2.length() < 5) {
jSONArray2.put(currentTimeMillis);
}
if (jSONObject.length() >= 4) {
AFKeystoreWrapper(jSONObject);
}
jSONObject.put(str, jSONArray2.toString());
String jSONObject3 = jSONObject.toString();
SharedPreferences.Editor edit = values(context).edit();
edit.putString("extraReferrers", jSONObject3);
edit.apply();
} catch (JSONException unused) {
} catch (Throwable th) {
StringBuilder sb2 = new StringBuilder("Couldn't save referrer - ");
sb2.append(str);
sb2.append(": ");
AFLogger.AFInAppEventType(sb2.toString(), th);
}
}
@Override
public final void setUserEmails(AppsFlyerProperties.EmailsCryptType emailsCryptType, String... strArr) {
ArrayList arrayList = new ArrayList(strArr.length + 1);
arrayList.add(emailsCryptType.toString());
arrayList.addAll(Arrays.asList(strArr));
aj.valueOf().AFInAppEventType("public_api_call", "setUserEmails", (String[]) arrayList.toArray(new String[strArr.length + 1]));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.EMAIL_CRYPT_TYPE, emailsCryptType.getValue());
HashMap hashMap = new HashMap();
ArrayList arrayList2 = new ArrayList();
String str = null;
for (String str2 : strArr) {
if (AnonymousClass9.AFInAppEventType[emailsCryptType.ordinal()] != 2) {
arrayList2.add(af.values(str2));
str = "sha256_el_arr";
} else {
arrayList2.add(str2);
str = "plain_el_arr";
}
}
hashMap.put(str, arrayList2);
AppsFlyerProperties.getInstance().setUserEmails(new JSONObject(hashMap).toString());
}
private static void AFKeystoreWrapper(JSONObject jSONObject) {
String str;
ArrayList arrayList = new ArrayList();
Iterator<String> keys = jSONObject.keys();
while (true) {
if (!keys.hasNext()) {
break;
}
try {
JSONArray jSONArray = new JSONArray((String) jSONObject.get(keys.next()));
for (int i10 = 0; i10 < jSONArray.length(); i10++) {
arrayList.add(Long.valueOf(jSONArray.getLong(i10)));
}
} catch (JSONException unused) {
}
}
Collections.sort(arrayList);
Iterator<String> keys2 = jSONObject.keys();
loop2: while (true) {
str = null;
while (keys2.hasNext() && str == null) {
String next = keys2.next();
try {
JSONArray jSONArray2 = new JSONArray((String) jSONObject.get(next));
int i11 = 0;
while (i11 < jSONArray2.length()) {
if (jSONArray2.getLong(i11) != ((Long) arrayList.get(0)).longValue() && jSONArray2.getLong(i11) != ((Long) arrayList.get(1)).longValue() && jSONArray2.getLong(i11) != ((Long) arrayList.get(arrayList.size() - 1)).longValue()) {
i11++;
str = next;
}
}
continue;
} catch (JSONException unused2) {
}
}
}
if (str != null) {
jSONObject.remove(str);
}
}
public final void valueOf(Context context, String str, long j10) {
SharedPreferences.Editor edit = values(context).edit();
edit.putLong(str, j10);
edit.apply();
}
public static boolean valueOf() {
return AFInAppEventType(AppsFlyerProperties.AF_WAITFOR_CUSTOMERID, false) && AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.APP_USER_ID) == null;
}
@Override
public final void logEvent(Context context, String str, Map<String, Object> map) {
logEvent(context, str, map, null);
}
private static String valueOf(String str) {
if (str == null) {
return null;
}
if (str.matches("fb\\d*?://authorize.*") && str.contains("access_token")) {
int indexOf = str.indexOf(63);
String substring = indexOf == -1 ? BuildConfig.FLAVOR : str.substring(indexOf);
if (substring.length() == 0) {
return str;
}
ArrayList arrayList = new ArrayList();
if (substring.contains("&")) {
arrayList = new ArrayList(Arrays.asList(substring.split("&")));
} else {
arrayList.add(substring);
}
StringBuilder sb2 = new StringBuilder();
Iterator it = arrayList.iterator();
while (it.hasNext()) {
String str2 = (String) it.next();
if (str2.contains("access_token")) {
it.remove();
} else {
if (sb2.length() != 0) {
sb2.append("&");
} else if (!str2.startsWith("?")) {
sb2.append("?");
}
sb2.append(str2);
}
}
return str.replace(substring, sb2.toString());
}
return str;
}
private boolean AFInAppEventType() {
Map<String, Object> map = this.waitForCustomerUserId;
return (map == null || map.isEmpty()) ? false : true;
}
private static String AFInAppEventType(String str) {
try {
return (String) Class.forName("android.os.SystemProperties").getMethod("get", String.class).invoke(null, str);
} catch (Throwable th) {
AFLogger.AFInAppEventType(th.getMessage(), th);
return null;
}
}
private static String AFInAppEventType(File file, String str) {
FileReader fileReader;
Properties properties;
try {
try {
try {
properties = new Properties();
fileReader = new FileReader(file);
} catch (Throwable th) {
AFLogger.AFInAppEventType(th.getMessage(), th);
return null;
}
} catch (FileNotFoundException unused) {
fileReader = null;
} catch (Throwable th2) {
th = th2;
fileReader = null;
}
try {
properties.load(fileReader);
AFLogger.AFKeystoreWrapper("Found PreInstall property!");
String property = properties.getProperty(str);
try {
fileReader.close();
} catch (Throwable th3) {
AFLogger.AFInAppEventType(th3.getMessage(), th3);
}
return property;
} catch (FileNotFoundException unused2) {
StringBuilder sb2 = new StringBuilder("PreInstall file wasn't found: ");
sb2.append(file.getAbsolutePath());
AFLogger.values(sb2.toString());
if (fileReader != null) {
fileReader.close();
}
return null;
} catch (Throwable th4) {
th = th4;
AFLogger.AFInAppEventType(th.getMessage(), th);
if (fileReader != null) {
fileReader.close();
}
return null;
}
} catch (Throwable th5) {
if (fileReader != null) {
try {
fileReader.close();
} catch (Throwable th6) {
AFLogger.AFInAppEventType(th6.getMessage(), th6);
}
}
throw th5;
}
}
public static void AFKeystoreWrapper(Context context, String str, String str2) {
SharedPreferences.Editor edit = values(context).edit();
edit.putString(str, str2);
edit.apply();
}
public static boolean values(SharedPreferences sharedPreferences) {
return Boolean.parseBoolean(sharedPreferences.getString("sentSuccessfully", null));
}
private static void values(Context context, Map<String, Object> map) {
WindowManager windowManager = (WindowManager) context.getSystemService("window");
if (windowManager != null) {
int rotation = windowManager.getDefaultDisplay().getRotation();
map.put("sc_o", rotation != 0 ? rotation != 1 ? rotation != 2 ? rotation != 3 ? BuildConfig.FLAVOR : "lr" : "pr" : "l" : "p");
}
}
public static String AFKeystoreWrapper(String str) {
return AppsFlyerProperties.getInstance().getString(str);
}
private static void AFKeystoreWrapper(Context context) {
int i10;
if (aa.values()) {
i10 = 23;
AFLogger.AFInAppEventParameterName("OPPO device found");
} else {
i10 = 18;
}
int i11 = Build.VERSION.SDK_INT;
if (i11 >= i10 && !AFInAppEventType(AppsFlyerProperties.DISABLE_KEYSTORE, true)) {
StringBuilder sb2 = new StringBuilder("OS SDK is=");
sb2.append(i11);
sb2.append("; use KeyStore");
AFLogger.AFInAppEventParameterName(sb2.toString());
AFKeystoreWrapper aFKeystoreWrapper = new AFKeystoreWrapper(context);
if (!aFKeystoreWrapper.AFInAppEventParameterName()) {
aFKeystoreWrapper.AFInAppEventType = an.AFKeystoreWrapper(new WeakReference(context));
aFKeystoreWrapper.valueOf = 0;
aFKeystoreWrapper.AFInAppEventType(aFKeystoreWrapper.AFInAppEventType());
} else {
String AFInAppEventType2 = aFKeystoreWrapper.AFInAppEventType();
synchronized (aFKeystoreWrapper.values) {
aFKeystoreWrapper.valueOf++;
AFLogger.AFKeystoreWrapper("Deleting key with alias: ".concat(String.valueOf(AFInAppEventType2)));
try {
synchronized (aFKeystoreWrapper.values) {
aFKeystoreWrapper.AFInAppEventParameterName.deleteEntry(AFInAppEventType2);
}
} catch (KeyStoreException e10) {
StringBuilder sb3 = new StringBuilder("Exception ");
sb3.append(e10.getMessage());
sb3.append(" occurred");
AFLogger.AFInAppEventType(sb3.toString(), e10);
}
}
aFKeystoreWrapper.AFInAppEventType(aFKeystoreWrapper.AFInAppEventType());
}
AppsFlyerProperties.getInstance().set("KSAppsFlyerId", aFKeystoreWrapper.values());
AppsFlyerProperties.getInstance().set("KSAppsFlyerRICounter", String.valueOf(aFKeystoreWrapper.valueOf()));
return;
}
StringBuilder sb4 = new StringBuilder("OS SDK is=");
sb4.append(i11);
sb4.append("; no KeyStore usage");
AFLogger.AFInAppEventParameterName(sb4.toString());
}
private static boolean values(File file) {
return file == null || !file.exists();
}
final void values(g gVar, Activity activity) {
Uri AFInAppEventType2;
Application application = gVar.valueOf;
String str = BuildConfig.FLAVOR;
String obj = (activity == null || (AFInAppEventType2 = as.AFInAppEventType(activity)) == null) ? BuildConfig.FLAVOR : AFInAppEventType2.toString();
if (AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY) == null) {
AFLogger.init("[LogEvent/Launch] AppsFlyer's SDK cannot send any event without providing DevKey.");
AppsFlyerRequestListener appsFlyerRequestListener = gVar.AFKeystoreWrapper;
if (appsFlyerRequestListener != null) {
appsFlyerRequestListener.onError(RequestError.NO_DEV_KEY, ax.AFKeystoreWrapper);
return;
}
return;
}
String referrer = AppsFlyerProperties.getInstance().getReferrer(application);
if (referrer != null) {
str = referrer;
}
gVar.init = str;
gVar.AFInAppEventParameterName = obj;
AFInAppEventType(gVar);
}
public static String AFInAppEventParameterName(SimpleDateFormat simpleDateFormat, long j10) {
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
return simpleDateFormat.format(new Date(j10));
}
public final String valueOf(Context context) {
String string = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.CHANNEL);
if (string == null) {
string = context == null ? null : AFKeystoreWrapper("CHANNEL", context.getPackageManager(), context.getPackageName());
}
if (string == null || !string.equals(BuildConfig.FLAVOR)) {
return string;
}
return null;
}
private static String AFInAppEventParameterName(Activity activity) {
Intent intent;
String str = null;
if (activity != null && (intent = activity.getIntent()) != null) {
try {
Bundle extras = intent.getExtras();
if (extras != null && (str = extras.getString("af")) != null) {
AFLogger.AFKeystoreWrapper("Push Notification received af payload = ".concat(str));
extras.remove("af");
activity.setIntent(intent.putExtras(extras));
}
} catch (Throwable th) {
AFLogger.AFInAppEventType(th.getMessage(), th);
}
}
return str;
}
public static void AFInAppEventType(ScheduledExecutorService scheduledExecutorService, Runnable runnable, long j10, TimeUnit timeUnit) {
if (scheduledExecutorService != null) {
try {
if (!scheduledExecutorService.isShutdown() && !scheduledExecutorService.isTerminated()) {
scheduledExecutorService.schedule(runnable, j10, timeUnit);
return;
}
} catch (RejectedExecutionException e10) {
AFLogger.AFInAppEventType("scheduleJob failed with RejectedExecutionException Exception", e10);
return;
} catch (Throwable th) {
AFLogger.AFInAppEventType("scheduleJob failed with Exception", th);
return;
}
}
AFLogger.init("scheduler is null, shut downed or terminated");
}
public static int valueOf(SharedPreferences sharedPreferences, String str, boolean z10) {
int i10 = sharedPreferences.getInt(str, 0);
if (z10) {
i10++;
SharedPreferences.Editor edit = sharedPreferences.edit();
edit.putInt(str, i10);
edit.apply();
}
if (aj.valueOf().getLevel()) {
aj.valueOf().AFInAppEventParameterName(String.valueOf(i10));
}
return i10;
}
private void AFInAppEventType(g gVar) {
boolean z10 = gVar.AFLogger$LogLevel == null;
if (valueOf()) {
AFLogger.AFInAppEventType("CustomerUserId not set, reporting is disabled", true);
return;
}
if (z10) {
if (AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.LAUNCH_PROTECT_ENABLED, true)) {
if (AFKeystoreWrapper()) {
AppsFlyerRequestListener appsFlyerRequestListener = gVar.AFKeystoreWrapper;
if (appsFlyerRequestListener != null) {
appsFlyerRequestListener.onError(RequestError.EVENT_TIMEOUT, ax.valueOf);
return;
}
return;
}
} else {
AFLogger.AFKeystoreWrapper("Allowing multiple launches within a 5 second time window.");
}
this.onDeepLinking = System.currentTimeMillis();
}
if (k.valueOf == null) {
k.valueOf = new k();
}
AFInAppEventType(k.valueOf.AFInAppEventParameterName(), new c(this, gVar, (byte) 0), 0L, TimeUnit.MILLISECONDS);
}
public final Map<String, Object> values(g gVar) {
String str;
String str2;
String str3;
boolean z10;
SharedPreferences sharedPreferences;
AppsFlyerProperties appsFlyerProperties;
au auVar;
String string;
String string2;
String string3;
AppsFlyerProperties appsFlyerProperties2;
String string4;
String valueOf2;
String AFKeystoreWrapper2;
SharedPreferences values2;
String str4;
String string5;
String string6;
String string7;
String str5;
String str6;
boolean z11;
String str7;
d.e.C0080d values3;
String str8;
String str9;
Object obj;
String str10;
d.e.C0080d AFInAppEventParameterName2;
boolean z12;
SharedPreferences sharedPreferences2;
int valueOf3;
au auVar2;
boolean z13;
String[] strArr;
SharedPreferences sharedPreferences3;
int i10;
int i11;
String AFKeystoreWrapper3;
String installerPackageName;
UiModeManager uiModeManager;
Application application = gVar.valueOf;
String str11 = gVar.AFVersionDeclaration;
String str12 = gVar.AFLogger$LogLevel;
Map map = gVar.values;
if (map == null) {
map = new HashMap();
}
String jSONObject = new JSONObject(map).toString();
String str13 = gVar.init;
SharedPreferences values4 = values(application);
boolean AFKeystoreWrapper4 = gVar.AFKeystoreWrapper();
String str14 = gVar.AFInAppEventParameterName;
Map<String, Object> map2 = gVar.AFInAppEventType;
ab.valueOf(application, map2);
Boolean bool = ab.AFInAppEventType;
if (bool == null || bool.booleanValue()) {
str = "preInstallName";
str2 = str11;
} else {
Map<String, Object> AFKeystoreWrapper5 = AFKeystoreWrapper(map2);
str2 = str11;
Boolean valueOf4 = Boolean.valueOf(!bool.booleanValue());
str = "preInstallName";
AFKeystoreWrapper5.put("ad_ids_disabled", valueOf4);
}
long time = new Date().getTime();
map2.put("af_timestamp", Long.toString(time));
String values5 = com.appsflyer.internal.d.values(application, time);
if (values5 != null) {
map2.put("cksm_v1", values5);
}
try {
if (!isStopped()) {
StringBuilder sb2 = new StringBuilder("******* sendTrackingWithEvent: ");
sb2.append(AFKeystoreWrapper4 ? "Launch" : str12);
AFLogger.AFKeystoreWrapper(sb2.toString());
} else {
AFLogger.AFKeystoreWrapper("Reporting has been stopped");
}
ai.AFKeystoreWrapper();
try {
if (!ai.AFKeystoreWrapper(application).exists()) {
ai.AFKeystoreWrapper(application).mkdir();
}
} catch (Exception e10) {
AFLogger.AFInAppEventType("Could not create cache directory", e10);
}
try {
List asList = Arrays.asList(application.getPackageManager().getPackageInfo(application.getPackageName(), 4096).requestedPermissions);
if (!asList.contains("android.permission.INTERNET")) {
AFLogger.init("Permission android.permission.INTERNET is missing in the AndroidManifest.xml");
}
if (!asList.contains("android.permission.ACCESS_NETWORK_STATE")) {
AFLogger.init("Permission android.permission.ACCESS_NETWORK_STATE is missing in the AndroidManifest.xml");
}
if (!asList.contains("android.permission.ACCESS_WIFI_STATE")) {
AFLogger.init("Permission android.permission.ACCESS_WIFI_STATE is missing in the AndroidManifest.xml");
}
} catch (Exception e11) {
AFLogger.AFInAppEventType("Exception while validation permissions. ", e11);
}
map2.put("af_events_api", "1");
map2.put("brand", Build.BRAND);
map2.put("device", Build.DEVICE);
map2.put("product", Build.PRODUCT);
int i12 = Build.VERSION.SDK_INT;
map2.put("sdk", Integer.toString(i12));
map2.put("model", Build.MODEL);
map2.put("deviceType", Build.TYPE);
values(application, map2);
AppsFlyerProperties appsFlyerProperties3 = AppsFlyerProperties.getInstance();
if (this.init == null) {
this.init = new au(application);
}
au auVar3 = this.init;
if (AFKeystoreWrapper4) {
if (AFInAppEventParameterName(application)) {
if (!appsFlyerProperties3.isOtherSdkStringDisabled()) {
map2.put("batteryLevel", String.valueOf(AFVersionDeclaration(application)));
}
AFKeystoreWrapper(application);
if (i12 >= 23) {
uiModeManager = (UiModeManager) application.getSystemService(UiModeManager.class);
} else {
uiModeManager = (UiModeManager) application.getSystemService("uimode");
}
if (uiModeManager != null && uiModeManager.getCurrentModeType() == 4) {
map2.put("tv", Boolean.TRUE);
}
if (bc.valueOf(application)) {
map2.put("inst_app", Boolean.TRUE);
}
}
str3 = jSONObject;
z10 = AFKeystoreWrapper4;
long j10 = values(application).getLong("AppsFlyerTimePassedSincePrevLaunch", 0L);
long currentTimeMillis = System.currentTimeMillis();
valueOf(application, "AppsFlyerTimePassedSincePrevLaunch", currentTimeMillis);
map2.put("timepassedsincelastlaunch", Long.toString(j10 > 0 ? (currentTimeMillis - j10) / 1000 : -1L));
String string8 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.ONELINK_ID);
String string9 = AppsFlyerProperties.getInstance().getString("onelinkVersion");
if (string8 != null) {
map2.put("onelink_id", string8);
}
if (string9 != null) {
map2.put("onelink_ver", string9);
}
String string10 = this.init.valueOf.getString("gcd", null);
if (string10 != null) {
try {
Map<String, Object> AFInAppEventType2 = m.AFInAppEventType(new JSONObject(string10));
if (!AFInAppEventType2.isEmpty()) {
AFKeystoreWrapper(map2).put("gcd", AFInAppEventType2);
this.init.valueOf.edit().putString("gcd", null).apply();
}
} catch (JSONException unused) {
}
}
String str15 = this.setCustomerUserId;
if (str15 != null) {
map2.put("phone", str15);
}
if (!TextUtils.isEmpty(str13)) {
map2.put("referrer", str13);
}
String string11 = values4.getString("extraReferrers", null);
if (string11 != null) {
map2.put("extraReferrers", string11);
}
String referrer = appsFlyerProperties3.getReferrer(application);
if (!TextUtils.isEmpty(referrer) && map2.get("referrer") == null) {
map2.put("referrer", referrer);
}
long j11 = auVar3.valueOf.getLong("prev_session_dur", 0L);
if (j11 != 0) {
map2.put("prev_session_dur", Long.valueOf(j11));
}
Application application2 = at.AFInAppEventParameterName;
map2.put("exception_number", Long.valueOf(application2 == null ? -1L : values(application2).getLong("exception_number", 0L)));
av avVar = this.setAdditionalData;
if (avVar != null) {
if (!avVar.valueOf.isEmpty()) {
map2.put("partner_data", avVar.valueOf);
}
if (!avVar.AFKeystoreWrapper.isEmpty()) {
AFKeystoreWrapper(map2).put("partner_data", avVar.AFKeystoreWrapper);
avVar.AFKeystoreWrapper = new HashMap();
}
}
sharedPreferences = values4;
appsFlyerProperties = appsFlyerProperties3;
auVar = auVar3;
} else {
str3 = jSONObject;
z10 = AFKeystoreWrapper4;
SharedPreferences values6 = values(application);
SharedPreferences.Editor edit = values6.edit();
try {
String string12 = values6.getString("prev_event_name", null);
if (string12 != null) {
JSONObject jSONObject2 = new JSONObject();
auVar = auVar3;
try {
StringBuilder sb3 = new StringBuilder();
sharedPreferences = values4;
appsFlyerProperties = appsFlyerProperties3;
try {
sb3.append(values6.getLong("prev_event_timestamp", -1L));
jSONObject2.put("prev_event_timestamp", sb3.toString());
jSONObject2.put("prev_event_value", values6.getString("prev_event_value", null));
jSONObject2.put("prev_event_name", string12);
map2.put("prev_event", jSONObject2.toString());
} catch (Exception e12) {
e = e12;
AFLogger.AFInAppEventType("Error while processing previous event.", e);
string = AppsFlyerProperties.getInstance().getString("KSAppsFlyerId");
string2 = AppsFlyerProperties.getInstance().getString("KSAppsFlyerRICounter");
if (string != null) {
map2.put("reinstallCounter", string2);
map2.put("originalAppsflyerId", string);
}
string3 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.ADDITIONAL_CUSTOM_DATA);
if (string3 != null) {
}
installerPackageName = application.getPackageManager().getInstallerPackageName(application.getPackageName());
if (installerPackageName != null) {
}
appsFlyerProperties2 = appsFlyerProperties;
string4 = appsFlyerProperties2.getString(AppsFlyerProperties.EXTENSION);
if (string4 != null) {
map2.put(AppsFlyerProperties.EXTENSION, string4);
}
valueOf2 = valueOf(application);
AFKeystoreWrapper2 = AFKeystoreWrapper(application, valueOf2);
if (AFKeystoreWrapper2 != null) {
map2.put("af_latestchannel", valueOf2);
values2 = values(application);
if (!values2.contains("INSTALL_STORE")) {
}
if (str4 != null) {
}
SharedPreferences values7 = values(application);
String str16 = str;
string5 = AppsFlyerProperties.getInstance().getString(str16);
if (string5 == null) {
}
if (string5 != null) {
}
string6 = AppsFlyerProperties.getInstance().getString("api_store_value");
if (string6 == null) {
}
if (string6 != null) {
}
if (str2 == null) {
}
string7 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
if (string7 == null) {
}
AFLogger.AFKeystoreWrapper("AppsFlyer dev key is missing!!! Please use AppsFlyerLib.getInstance().setAppsFlyerKey(...) to set it. ");
AFLogger.AFKeystoreWrapper("AppsFlyer will not track this event.");
return null;
}
map2.put("af_latestchannel", valueOf2);
values2 = values(application);
if (!values2.contains("INSTALL_STORE")) {
}
if (str4 != null) {
}
SharedPreferences values72 = values(application);
String str162 = str;
string5 = AppsFlyerProperties.getInstance().getString(str162);
if (string5 == null) {
}
if (string5 != null) {
}
string6 = AppsFlyerProperties.getInstance().getString("api_store_value");
if (string6 == null) {
}
if (string6 != null) {
}
if (str2 == null) {
}
string7 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
if (string7 == null) {
}
AFLogger.AFKeystoreWrapper("AppsFlyer dev key is missing!!! Please use AppsFlyerLib.getInstance().setAppsFlyerKey(...) to set it. ");
AFLogger.AFKeystoreWrapper("AppsFlyer will not track this event.");
return null;
}
} catch (Exception e13) {
e = e13;
sharedPreferences = values4;
appsFlyerProperties = appsFlyerProperties3;
AFLogger.AFInAppEventType("Error while processing previous event.", e);
string = AppsFlyerProperties.getInstance().getString("KSAppsFlyerId");
string2 = AppsFlyerProperties.getInstance().getString("KSAppsFlyerRICounter");
if (string != null) {
}
string3 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.ADDITIONAL_CUSTOM_DATA);
if (string3 != null) {
}
installerPackageName = application.getPackageManager().getInstallerPackageName(application.getPackageName());
if (installerPackageName != null) {
}
appsFlyerProperties2 = appsFlyerProperties;
string4 = appsFlyerProperties2.getString(AppsFlyerProperties.EXTENSION);
if (string4 != null) {
}
valueOf2 = valueOf(application);
AFKeystoreWrapper2 = AFKeystoreWrapper(application, valueOf2);
if (AFKeystoreWrapper2 != null) {
}
map2.put("af_latestchannel", valueOf2);
values2 = values(application);
if (!values2.contains("INSTALL_STORE")) {
}
if (str4 != null) {
}
SharedPreferences values722 = values(application);
String str1622 = str;
string5 = AppsFlyerProperties.getInstance().getString(str1622);
if (string5 == null) {
}
if (string5 != null) {
}
string6 = AppsFlyerProperties.getInstance().getString("api_store_value");
if (string6 == null) {
}
if (string6 != null) {
}
if (str2 == null) {
}
string7 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
if (string7 == null) {
}
AFLogger.AFKeystoreWrapper("AppsFlyer dev key is missing!!! Please use AppsFlyerLib.getInstance().setAppsFlyerKey(...) to set it. ");
AFLogger.AFKeystoreWrapper("AppsFlyer will not track this event.");
return null;
}
} else {
sharedPreferences = values4;
appsFlyerProperties = appsFlyerProperties3;
auVar = auVar3;
}
edit.putString("prev_event_name", str12);
edit.putString("prev_event_value", str3);
edit.putLong("prev_event_timestamp", System.currentTimeMillis());
edit.apply();
} catch (Exception e14) {
e = e14;
sharedPreferences = values4;
appsFlyerProperties = appsFlyerProperties3;
auVar = auVar3;
}
}
string = AppsFlyerProperties.getInstance().getString("KSAppsFlyerId");
string2 = AppsFlyerProperties.getInstance().getString("KSAppsFlyerRICounter");
if (string != null && string2 != null && Integer.valueOf(string2).intValue() > 0) {
map2.put("reinstallCounter", string2);
map2.put("originalAppsflyerId", string);
}
string3 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.ADDITIONAL_CUSTOM_DATA);
if (string3 != null) {
map2.put("customData", string3);
}
try {
installerPackageName = application.getPackageManager().getInstallerPackageName(application.getPackageName());
if (installerPackageName != null) {
map2.put("installer_package", installerPackageName);
}
} catch (Exception e15) {
AFLogger.AFInAppEventType("Exception while getting the app's installer package. ", e15);
}
appsFlyerProperties2 = appsFlyerProperties;
string4 = appsFlyerProperties2.getString(AppsFlyerProperties.EXTENSION);
if (string4 != null && string4.length() > 0) {
map2.put(AppsFlyerProperties.EXTENSION, string4);
}
valueOf2 = valueOf(application);
AFKeystoreWrapper2 = AFKeystoreWrapper(application, valueOf2);
if ((AFKeystoreWrapper2 != null && !AFKeystoreWrapper2.equals(valueOf2)) || (AFKeystoreWrapper2 == null && valueOf2 != null)) {
map2.put("af_latestchannel", valueOf2);
}
values2 = values(application);
if (!values2.contains("INSTALL_STORE")) {
str4 = values2.getString("INSTALL_STORE", null);
} else {
if (AFInAppEventParameterName(application)) {
str4 = AppsFlyerProperties.getInstance().getString("api_store_value");
if (str4 == null) {
if (application != null) {
str4 = AFKeystoreWrapper("AF_STORE", application.getPackageManager(), application.getPackageName());
}
}
SharedPreferences.Editor edit2 = values(application).edit();
edit2.putString("INSTALL_STORE", str4);
edit2.apply();
}
str4 = null;
SharedPreferences.Editor edit22 = values(application).edit();
edit22.putString("INSTALL_STORE", str4);
edit22.apply();
}
if (str4 != null) {
map2.put("af_installstore", str4.toLowerCase());
}
SharedPreferences values7222 = values(application);
String str16222 = str;
string5 = AppsFlyerProperties.getInstance().getString(str16222);
if (string5 == null) {
if (values7222.contains(str16222)) {
string5 = values7222.getString(str16222, null);
} else {
if (AFInAppEventParameterName(application)) {
File AFInAppEventParameterName3 = AFInAppEventParameterName(AFInAppEventType("ro.appsflyer.preinstall.path"));
if (values(AFInAppEventParameterName3)) {
AFInAppEventParameterName3 = AFInAppEventParameterName(AFKeystoreWrapper("AF_PRE_INSTALL_PATH", application.getPackageManager(), application.getPackageName()));
}
if (values(AFInAppEventParameterName3)) {
AFInAppEventParameterName3 = AFInAppEventParameterName("/data/local/tmp/pre_install.appsflyer");
}
if (values(AFInAppEventParameterName3)) {
AFInAppEventParameterName3 = AFInAppEventParameterName("/etc/pre_install.appsflyer");
}
String AFInAppEventType3 = values(AFInAppEventParameterName3) ? null : AFInAppEventType(AFInAppEventParameterName3, application.getPackageName());
if (AFInAppEventType3 == null) {
AFInAppEventType3 = application == null ? null : AFKeystoreWrapper("AF_PRE_INSTALL_NAME", application.getPackageManager(), application.getPackageName());
}
string5 = AFInAppEventType3;
}
if (string5 != null) {
SharedPreferences.Editor edit3 = values(application).edit();
edit3.putString(str16222, string5);
edit3.apply();
}
}
if (string5 != null) {
AppsFlyerProperties.getInstance().set(str16222, string5);
}
}
if (string5 != null) {
map2.put("af_preinstall_name", string5.toLowerCase());
}
string6 = AppsFlyerProperties.getInstance().getString("api_store_value");
if (string6 == null) {
string6 = application == null ? null : AFKeystoreWrapper("AF_STORE", application.getPackageManager(), application.getPackageName());
}
if (string6 != null) {
map2.put("af_currentstore", string6.toLowerCase());
}
if (str2 == null && str2.length() > 0) {
map2.put("appsflyerKey", str2);
} else {
string7 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
if (string7 == null && string7.length() > 0) {
map2.put("appsflyerKey", string7);
} else {
AFLogger.AFKeystoreWrapper("AppsFlyer dev key is missing!!! Please use AppsFlyerLib.getInstance().setAppsFlyerKey(...) to set it. ");
AFLogger.AFKeystoreWrapper("AppsFlyer will not track this event.");
return null;
}
}
String string13 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.APP_USER_ID);
if (string13 != null) {
map2.put("appUserId", string13);
}
String string14 = appsFlyerProperties2.getString(AppsFlyerProperties.USER_EMAILS);
if (string14 != null) {
map2.put("user_emails", string14);
} else {
String string15 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.USER_EMAIL);
if (string15 != null) {
map2.put("sha1_el", af.AFKeystoreWrapper(string15));
}
}
if (str12 != null) {
map2.put("eventName", str12);
if (str3 != null) {
map2.put("eventValue", str3);
}
}
if (AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.APP_ID) != null) {
map2.put(AppsFlyerProperties.APP_ID, AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.APP_ID));
}
String string16 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.CURRENCY_CODE);
if (string16 != null) {
if (string16.length() != 3) {
StringBuilder sb4 = new StringBuilder("WARNING: currency code should be 3 characters!!! '");
sb4.append(string16);
sb4.append("' is not a legal value.");
AFLogger.init(sb4.toString());
}
map2.put("currency", string16);
}
String string17 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.IS_UPDATE);
if (string17 != null) {
map2.put("isUpdate", string17);
}
map2.put("af_preinstalled", Boolean.toString(isPreInstalledApp(application)));
if (appsFlyerProperties2.getBoolean(AppsFlyerProperties.COLLECT_FACEBOOK_ATTR_ID, true)) {
try {
application.getPackageManager().getApplicationInfo("com.facebook.katana", 0);
str5 = getAttributionId(application);
} catch (PackageManager.NameNotFoundException unused2) {
AFLogger.init("Exception while collecting facebook's attribution ID. ");
str5 = null;
}
if (str5 != null) {
map2.put("fb", str5);
}
}
AppsFlyerProperties appsFlyerProperties4 = AppsFlyerProperties.getInstance();
if (appsFlyerProperties4.getBoolean(AppsFlyerProperties.DEVICE_TRACKING_DISABLED, false)) {
map2.put(AppsFlyerProperties.DEVICE_TRACKING_DISABLED, "true");
} else {
SharedPreferences values8 = values(application);
boolean z14 = appsFlyerProperties4.getBoolean(AppsFlyerProperties.COLLECT_IMEI, true);
String string18 = values8.getString("imeiCached", null);
if (z14 && TextUtils.isEmpty(this.AppsFlyer2dXConversionCallback)) {
if (AppsFlyer2dXConversionCallback(application)) {
try {
TelephonyManager telephonyManager = (TelephonyManager) application.getSystemService("phone");
str6 = (String) telephonyManager.getClass().getMethod("getDeviceId", new Class[0]).invoke(telephonyManager, new Object[0]);
if (str6 == null) {
if (string18 != null) {
str8 = "use cached IMEI: ";
try {
AFLogger.values(str8.concat(string18));
} catch (InvocationTargetException unused3) {
if (string18 != null) {
AFLogger.values(str8.concat(string18));
} else {
string18 = null;
}
AFLogger.init("WARNING: READ_PHONE_STATE is missing.");
if (string18 != null) {
}
z11 = appsFlyerProperties4.getBoolean(AppsFlyerProperties.COLLECT_ANDROID_ID, true);
String string19 = values8.getString("androidIdCached", null);
if (!z11) {
}
str7 = this.AFLogger$LogLevel;
if (str7 != null) {
}
str7 = null;
if (str7 != null) {
}
values3 = ab.values(application);
if (values3 != null) {
}
AFKeystoreWrapper3 = an.AFKeystoreWrapper(new WeakReference(application));
str9 = "uid";
if (AFKeystoreWrapper3 != null) {
}
map2.put("lang", Locale.getDefault().getDisplayLanguage());
map2.put("lang_code", Locale.getDefault().getLanguage());
map2.put("country", Locale.getDefault().getCountry());
map2.put("platformextension", this.enableLocationCollection.AFInAppEventParameterName());
valueOf(application, map2);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", Locale.US);
long j12 = application.getPackageManager().getPackageInfo(application.getPackageName(), 0).firstInstallTime;
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
map2.put("installDate", simpleDateFormat.format(new Date(j12)));
PackageInfo packageInfo = application.getPackageManager().getPackageInfo(application.getPackageName(), 0);
sharedPreferences3 = sharedPreferences;
i10 = sharedPreferences3.getInt("versionCode", 0);
i11 = packageInfo.versionCode;
if (i11 > i10) {
}
map2.put("app_version_code", Integer.toString(packageInfo.versionCode));
map2.put("app_version_name", packageInfo.versionName);
str10 = str9;
try {
long j13 = packageInfo.firstInstallTime;
sharedPreferences = sharedPreferences3;
try {
long j14 = packageInfo.lastUpdateTime;
Locale locale = Locale.US;
obj = "appsflyerKey";
try {
map2.put("date1", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale).format(new Date(j13)));
map2.put("date2", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale).format(new Date(j14)));
map2.put("firstLaunchDate", AFInAppEventParameterName(simpleDateFormat, application));
} catch (Throwable th) {
th = th;
AFLogger.AFInAppEventType("Exception while collecting app version data ", th);
this.onPause = bb.values(application);
StringBuilder sb5 = new StringBuilder("didConfigureTokenRefreshService=");
sb5.append(this.onPause);
AFLogger.values(sb5.toString());
if (!this.onPause) {
}
if (z10) {
}
if (!z10) {
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
}
AFInAppEventParameterName2 = ab.AFInAppEventParameterName(application.getContentResolver());
if (AFInAppEventParameterName2 != null) {
}
map2.put("registeredUninstall", Boolean.valueOf(bb.AFInAppEventParameterName(sharedPreferences)));
z12 = z10;
sharedPreferences2 = sharedPreferences;
valueOf3 = valueOf(sharedPreferences2, "appsFlyerCount", z12);
map2.put("counter", Integer.toString(valueOf3));
map2.put("iaecounter", Integer.toString(valueOf(sharedPreferences2, "appsFlyerInAppEventCount", str12 == null)));
if (z12) {
}
auVar2 = auVar;
z13 = true;
if (!values(sharedPreferences2)) {
}
map2.put("isFirstCall", Boolean.toString(z13));
HashMap hashMap = new HashMap();
hashMap.put("cpu_abi", AFInAppEventType("ro.product.cpu.abi"));
hashMap.put("cpu_abi2", AFInAppEventType("ro.product.cpu.abi2"));
hashMap.put("arch", AFInAppEventType("os.arch"));
hashMap.put("build_display_id", AFInAppEventType("ro.build.display.id"));
if (z12) {
}
hashMap.put("dim", w.AFInAppEventParameterName(application));
map2.put("deviceData", hashMap);
Object obj2 = obj;
String str17 = (String) map2.get("af_timestamp");
String str18 = str10;
StringBuilder sb6 = new StringBuilder();
sb6.append(((String) map2.get(obj2)).substring(0, 7));
sb6.append(((String) map2.get(str18)).substring(0, 7));
sb6.append(str17.substring(str17.length() - 7));
map2.put("af_v", af.AFKeystoreWrapper(sb6.toString()));
StringBuilder sb7 = new StringBuilder();
sb7.append((String) map2.get(obj2));
sb7.append(map2.get("af_timestamp"));
String obj3 = sb7.toString();
StringBuilder sb8 = new StringBuilder();
sb8.append(obj3);
sb8.append(map2.get(str18));
String obj4 = sb8.toString();
StringBuilder sb9 = new StringBuilder();
sb9.append(obj4);
sb9.append(map2.get("installDate"));
String obj5 = sb9.toString();
StringBuilder sb10 = new StringBuilder();
sb10.append(obj5);
sb10.append(map2.get("counter"));
String obj6 = sb10.toString();
StringBuilder sb11 = new StringBuilder();
sb11.append(obj6);
sb11.append(map2.get("iaecounter"));
map2.put("af_v2", af.AFKeystoreWrapper(af.AFInAppEventType(sb11.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application)));
if (sharedPreferences2.contains("is_stop_tracking_used")) {
}
HashMap hashMap2 = new HashMap();
hashMap2.put("mcc", Integer.valueOf(application.getResources().getConfiguration().mcc));
hashMap2.put("mnc", Integer.valueOf(application.getResources().getConfiguration().mnc));
map2.put("cell", hashMap2);
map2.put("sig", aa.values(auVar2.AFKeystoreWrapper.getPackageManager(), auVar2.AFKeystoreWrapper.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong = statFs.getBlockSizeLong();
double pow = Math.pow(2.0d, 20.0d);
long blockCountLong = (long) ((statFs.getBlockCountLong() * blockSizeLong) / pow);
StringBuilder sb12 = new StringBuilder();
sb12.append((long) ((statFs.getAvailableBlocksLong() * blockSizeLong) / pow));
sb12.append("/");
sb12.append(blockCountLong);
map2.put("disk", sb12.toString());
strArr = this.getLevel;
if (strArr != null) {
}
return map2;
}
} catch (Throwable th2) {
th = th2;
obj = "appsflyerKey";
}
} catch (Throwable th3) {
th = th3;
obj = "appsflyerKey";
sharedPreferences = sharedPreferences3;
AFLogger.AFInAppEventType("Exception while collecting app version data ", th);
this.onPause = bb.values(application);
StringBuilder sb52 = new StringBuilder("didConfigureTokenRefreshService=");
sb52.append(this.onPause);
AFLogger.values(sb52.toString());
if (!this.onPause) {
}
if (z10) {
}
if (!z10) {
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
}
AFInAppEventParameterName2 = ab.AFInAppEventParameterName(application.getContentResolver());
if (AFInAppEventParameterName2 != null) {
}
map2.put("registeredUninstall", Boolean.valueOf(bb.AFInAppEventParameterName(sharedPreferences)));
z12 = z10;
sharedPreferences2 = sharedPreferences;
valueOf3 = valueOf(sharedPreferences2, "appsFlyerCount", z12);
map2.put("counter", Integer.toString(valueOf3));
map2.put("iaecounter", Integer.toString(valueOf(sharedPreferences2, "appsFlyerInAppEventCount", str12 == null)));
if (z12) {
}
auVar2 = auVar;
z13 = true;
if (!values(sharedPreferences2)) {
}
map2.put("isFirstCall", Boolean.toString(z13));
HashMap hashMap3 = new HashMap();
hashMap3.put("cpu_abi", AFInAppEventType("ro.product.cpu.abi"));
hashMap3.put("cpu_abi2", AFInAppEventType("ro.product.cpu.abi2"));
hashMap3.put("arch", AFInAppEventType("os.arch"));
hashMap3.put("build_display_id", AFInAppEventType("ro.build.display.id"));
if (z12) {
}
hashMap3.put("dim", w.AFInAppEventParameterName(application));
map2.put("deviceData", hashMap3);
Object obj22 = obj;
String str172 = (String) map2.get("af_timestamp");
String str182 = str10;
StringBuilder sb62 = new StringBuilder();
sb62.append(((String) map2.get(obj22)).substring(0, 7));
sb62.append(((String) map2.get(str182)).substring(0, 7));
sb62.append(str172.substring(str172.length() - 7));
map2.put("af_v", af.AFKeystoreWrapper(sb62.toString()));
StringBuilder sb72 = new StringBuilder();
sb72.append((String) map2.get(obj22));
sb72.append(map2.get("af_timestamp"));
String obj32 = sb72.toString();
StringBuilder sb82 = new StringBuilder();
sb82.append(obj32);
sb82.append(map2.get(str182));
String obj42 = sb82.toString();
StringBuilder sb92 = new StringBuilder();
sb92.append(obj42);
sb92.append(map2.get("installDate"));
String obj52 = sb92.toString();
StringBuilder sb102 = new StringBuilder();
sb102.append(obj52);
sb102.append(map2.get("counter"));
String obj62 = sb102.toString();
StringBuilder sb112 = new StringBuilder();
sb112.append(obj62);
sb112.append(map2.get("iaecounter"));
map2.put("af_v2", af.AFKeystoreWrapper(af.AFInAppEventType(sb112.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application)));
if (sharedPreferences2.contains("is_stop_tracking_used")) {
}
HashMap hashMap22 = new HashMap();
hashMap22.put("mcc", Integer.valueOf(application.getResources().getConfiguration().mcc));
hashMap22.put("mnc", Integer.valueOf(application.getResources().getConfiguration().mnc));
map2.put("cell", hashMap22);
map2.put("sig", aa.values(auVar2.AFKeystoreWrapper.getPackageManager(), auVar2.AFKeystoreWrapper.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs2 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong2 = statFs2.getBlockSizeLong();
double pow2 = Math.pow(2.0d, 20.0d);
long blockCountLong2 = (long) ((statFs2.getBlockCountLong() * blockSizeLong2) / pow2);
StringBuilder sb122 = new StringBuilder();
sb122.append((long) ((statFs2.getAvailableBlocksLong() * blockSizeLong2) / pow2));
sb122.append("/");
sb122.append(blockCountLong2);
map2.put("disk", sb122.toString());
strArr = this.getLevel;
if (strArr != null) {
}
return map2;
}
this.onPause = bb.values(application);
StringBuilder sb522 = new StringBuilder("didConfigureTokenRefreshService=");
sb522.append(this.onPause);
AFLogger.values(sb522.toString());
if (!this.onPause) {
}
if (z10) {
}
if (!z10) {
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
}
AFInAppEventParameterName2 = ab.AFInAppEventParameterName(application.getContentResolver());
if (AFInAppEventParameterName2 != null) {
}
map2.put("registeredUninstall", Boolean.valueOf(bb.AFInAppEventParameterName(sharedPreferences)));
z12 = z10;
sharedPreferences2 = sharedPreferences;
valueOf3 = valueOf(sharedPreferences2, "appsFlyerCount", z12);
map2.put("counter", Integer.toString(valueOf3));
map2.put("iaecounter", Integer.toString(valueOf(sharedPreferences2, "appsFlyerInAppEventCount", str12 == null)));
if (z12) {
}
auVar2 = auVar;
z13 = true;
if (!values(sharedPreferences2)) {
}
map2.put("isFirstCall", Boolean.toString(z13));
HashMap hashMap32 = new HashMap();
hashMap32.put("cpu_abi", AFInAppEventType("ro.product.cpu.abi"));
hashMap32.put("cpu_abi2", AFInAppEventType("ro.product.cpu.abi2"));
hashMap32.put("arch", AFInAppEventType("os.arch"));
hashMap32.put("build_display_id", AFInAppEventType("ro.build.display.id"));
if (z12) {
}
hashMap32.put("dim", w.AFInAppEventParameterName(application));
map2.put("deviceData", hashMap32);
Object obj222 = obj;
String str1722 = (String) map2.get("af_timestamp");
String str1822 = str10;
StringBuilder sb622 = new StringBuilder();
sb622.append(((String) map2.get(obj222)).substring(0, 7));
sb622.append(((String) map2.get(str1822)).substring(0, 7));
sb622.append(str1722.substring(str1722.length() - 7));
map2.put("af_v", af.AFKeystoreWrapper(sb622.toString()));
StringBuilder sb722 = new StringBuilder();
sb722.append((String) map2.get(obj222));
sb722.append(map2.get("af_timestamp"));
String obj322 = sb722.toString();
StringBuilder sb822 = new StringBuilder();
sb822.append(obj322);
sb822.append(map2.get(str1822));
String obj422 = sb822.toString();
StringBuilder sb922 = new StringBuilder();
sb922.append(obj422);
sb922.append(map2.get("installDate"));
String obj522 = sb922.toString();
StringBuilder sb1022 = new StringBuilder();
sb1022.append(obj522);
sb1022.append(map2.get("counter"));
String obj622 = sb1022.toString();
StringBuilder sb1122 = new StringBuilder();
sb1122.append(obj622);
sb1122.append(map2.get("iaecounter"));
map2.put("af_v2", af.AFKeystoreWrapper(af.AFInAppEventType(sb1122.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application)));
if (sharedPreferences2.contains("is_stop_tracking_used")) {
}
HashMap hashMap222 = new HashMap();
hashMap222.put("mcc", Integer.valueOf(application.getResources().getConfiguration().mcc));
hashMap222.put("mnc", Integer.valueOf(application.getResources().getConfiguration().mnc));
map2.put("cell", hashMap222);
map2.put("sig", aa.values(auVar2.AFKeystoreWrapper.getPackageManager(), auVar2.AFKeystoreWrapper.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs22 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong22 = statFs22.getBlockSizeLong();
double pow22 = Math.pow(2.0d, 20.0d);
long blockCountLong22 = (long) ((statFs22.getBlockCountLong() * blockSizeLong22) / pow22);
StringBuilder sb1222 = new StringBuilder();
sb1222.append((long) ((statFs22.getAvailableBlocksLong() * blockSizeLong22) / pow22));
sb1222.append("/");
sb1222.append(blockCountLong22);
map2.put("disk", sb1222.toString());
strArr = this.getLevel;
if (strArr != null) {
}
return map2;
} catch (Exception e16) {
e = e16;
Exception exc = e;
if (string18 != null) {
AFLogger.values(str8.concat(string18));
} else {
string18 = null;
}
AFLogger.AFInAppEventType("WARNING: other reason: ", exc);
if (string18 != null) {
}
z11 = appsFlyerProperties4.getBoolean(AppsFlyerProperties.COLLECT_ANDROID_ID, true);
String string192 = values8.getString("androidIdCached", null);
if (!z11) {
}
str7 = this.AFLogger$LogLevel;
if (str7 != null) {
}
str7 = null;
if (str7 != null) {
}
values3 = ab.values(application);
if (values3 != null) {
}
AFKeystoreWrapper3 = an.AFKeystoreWrapper(new WeakReference(application));
str9 = "uid";
if (AFKeystoreWrapper3 != null) {
}
map2.put("lang", Locale.getDefault().getDisplayLanguage());
map2.put("lang_code", Locale.getDefault().getLanguage());
map2.put("country", Locale.getDefault().getCountry());
map2.put("platformextension", this.enableLocationCollection.AFInAppEventParameterName());
valueOf(application, map2);
SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", Locale.US);
long j122 = application.getPackageManager().getPackageInfo(application.getPackageName(), 0).firstInstallTime;
simpleDateFormat2.setTimeZone(TimeZone.getTimeZone("UTC"));
map2.put("installDate", simpleDateFormat2.format(new Date(j122)));
PackageInfo packageInfo2 = application.getPackageManager().getPackageInfo(application.getPackageName(), 0);
sharedPreferences3 = sharedPreferences;
i10 = sharedPreferences3.getInt("versionCode", 0);
i11 = packageInfo2.versionCode;
if (i11 > i10) {
}
map2.put("app_version_code", Integer.toString(packageInfo2.versionCode));
map2.put("app_version_name", packageInfo2.versionName);
str10 = str9;
long j132 = packageInfo2.firstInstallTime;
sharedPreferences = sharedPreferences3;
long j142 = packageInfo2.lastUpdateTime;
Locale locale2 = Locale.US;
obj = "appsflyerKey";
map2.put("date1", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale2).format(new Date(j132)));
map2.put("date2", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale2).format(new Date(j142)));
map2.put("firstLaunchDate", AFInAppEventParameterName(simpleDateFormat2, application));
this.onPause = bb.values(application);
StringBuilder sb5222 = new StringBuilder("didConfigureTokenRefreshService=");
sb5222.append(this.onPause);
AFLogger.values(sb5222.toString());
if (!this.onPause) {
}
if (z10) {
}
if (!z10) {
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
}
AFInAppEventParameterName2 = ab.AFInAppEventParameterName(application.getContentResolver());
if (AFInAppEventParameterName2 != null) {
}
map2.put("registeredUninstall", Boolean.valueOf(bb.AFInAppEventParameterName(sharedPreferences)));
z12 = z10;
sharedPreferences2 = sharedPreferences;
valueOf3 = valueOf(sharedPreferences2, "appsFlyerCount", z12);
map2.put("counter", Integer.toString(valueOf3));
map2.put("iaecounter", Integer.toString(valueOf(sharedPreferences2, "appsFlyerInAppEventCount", str12 == null)));
if (z12) {
}
auVar2 = auVar;
z13 = true;
if (!values(sharedPreferences2)) {
}
map2.put("isFirstCall", Boolean.toString(z13));
HashMap hashMap322 = new HashMap();
hashMap322.put("cpu_abi", AFInAppEventType("ro.product.cpu.abi"));
hashMap322.put("cpu_abi2", AFInAppEventType("ro.product.cpu.abi2"));
hashMap322.put("arch", AFInAppEventType("os.arch"));
hashMap322.put("build_display_id", AFInAppEventType("ro.build.display.id"));
if (z12) {
}
hashMap322.put("dim", w.AFInAppEventParameterName(application));
map2.put("deviceData", hashMap322);
Object obj2222 = obj;
String str17222 = (String) map2.get("af_timestamp");
String str18222 = str10;
StringBuilder sb6222 = new StringBuilder();
sb6222.append(((String) map2.get(obj2222)).substring(0, 7));
sb6222.append(((String) map2.get(str18222)).substring(0, 7));
sb6222.append(str17222.substring(str17222.length() - 7));
map2.put("af_v", af.AFKeystoreWrapper(sb6222.toString()));
StringBuilder sb7222 = new StringBuilder();
sb7222.append((String) map2.get(obj2222));
sb7222.append(map2.get("af_timestamp"));
String obj3222 = sb7222.toString();
StringBuilder sb8222 = new StringBuilder();
sb8222.append(obj3222);
sb8222.append(map2.get(str18222));
String obj4222 = sb8222.toString();
StringBuilder sb9222 = new StringBuilder();
sb9222.append(obj4222);
sb9222.append(map2.get("installDate"));
String obj5222 = sb9222.toString();
StringBuilder sb10222 = new StringBuilder();
sb10222.append(obj5222);
sb10222.append(map2.get("counter"));
String obj6222 = sb10222.toString();
StringBuilder sb11222 = new StringBuilder();
sb11222.append(obj6222);
sb11222.append(map2.get("iaecounter"));
map2.put("af_v2", af.AFKeystoreWrapper(af.AFInAppEventType(sb11222.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application)));
if (sharedPreferences2.contains("is_stop_tracking_used")) {
}
HashMap hashMap2222 = new HashMap();
hashMap2222.put("mcc", Integer.valueOf(application.getResources().getConfiguration().mcc));
hashMap2222.put("mnc", Integer.valueOf(application.getResources().getConfiguration().mnc));
map2.put("cell", hashMap2222);
map2.put("sig", aa.values(auVar2.AFKeystoreWrapper.getPackageManager(), auVar2.AFKeystoreWrapper.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs222 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong222 = statFs222.getBlockSizeLong();
double pow222 = Math.pow(2.0d, 20.0d);
long blockCountLong222 = (long) ((statFs222.getBlockCountLong() * blockSizeLong222) / pow222);
StringBuilder sb12222 = new StringBuilder();
sb12222.append((long) ((statFs222.getAvailableBlocksLong() * blockSizeLong222) / pow222));
sb12222.append("/");
sb12222.append(blockCountLong222);
map2.put("disk", sb12222.toString());
strArr = this.getLevel;
if (strArr != null) {
}
return map2;
}
}
}
string18 = str6;
} catch (InvocationTargetException unused4) {
str8 = "use cached IMEI: ";
} catch (Exception e17) {
e = e17;
str8 = "use cached IMEI: ";
}
}
string18 = null;
} else {
str6 = this.AppsFlyer2dXConversionCallback;
}
if (string18 != null) {
SharedPreferences.Editor edit4 = values(application).edit();
edit4.putString("imeiCached", string18);
edit4.apply();
map2.put("imei", string18);
} else {
AFLogger.AFKeystoreWrapper("IMEI was not collected.");
}
z11 = appsFlyerProperties4.getBoolean(AppsFlyerProperties.COLLECT_ANDROID_ID, true);
String string1922 = values8.getString("androidIdCached", null);
if (!z11 && TextUtils.isEmpty(this.AFLogger$LogLevel)) {
if (AppsFlyer2dXConversionCallback(application)) {
try {
str7 = Settings.Secure.getString(application.getContentResolver(), "android_id");
} catch (Exception e18) {
if (string1922 != null) {
AFLogger.values("use cached AndroidId: ".concat(string1922));
} else {
string1922 = null;
}
AFLogger.AFInAppEventType(e18.getMessage(), e18);
}
if (str7 == null) {
if (string1922 != null) {
AFLogger.values("use cached AndroidId: ".concat(string1922));
} else {
string1922 = null;
}
str7 = string1922;
if (str7 != null) {
}
values3 = ab.values(application);
if (values3 != null) {
}
} else {
if (str7 != null) {
}
values3 = ab.values(application);
if (values3 != null) {
}
}
}
str7 = null;
if (str7 != null) {
}
values3 = ab.values(application);
if (values3 != null) {
}
} else {
str7 = this.AFLogger$LogLevel;
if (str7 != null) {
if (str7 != null) {
SharedPreferences.Editor edit5 = values(application).edit();
edit5.putString("androidIdCached", str7);
edit5.apply();
map2.put("android_id", str7);
} else {
AFLogger.AFKeystoreWrapper("Android ID was not collected.");
}
values3 = ab.values(application);
if (values3 != null) {
HashMap hashMap4 = new HashMap();
hashMap4.put("isManual", values3.AFInAppEventParameterName);
hashMap4.put("val", values3.values);
Boolean bool2 = values3.valueOf;
if (bool2 != null) {
hashMap4.put("isLat", bool2);
}
map2.put("oaid", hashMap4);
}
}
str7 = null;
if (str7 != null) {
}
values3 = ab.values(application);
if (values3 != null) {
}
}
}
try {
AFKeystoreWrapper3 = an.AFKeystoreWrapper(new WeakReference(application));
str9 = "uid";
if (AFKeystoreWrapper3 != null) {
try {
map2.put(str9, AFKeystoreWrapper3);
} catch (Exception e19) {
e = e19;
Exception exc2 = e;
StringBuilder sb13 = new StringBuilder("ERROR: could not get uid ");
sb13.append(exc2.getMessage());
AFLogger.AFInAppEventType(sb13.toString(), exc2);
map2.put("lang", Locale.getDefault().getDisplayLanguage());
map2.put("lang_code", Locale.getDefault().getLanguage());
map2.put("country", Locale.getDefault().getCountry());
map2.put("platformextension", this.enableLocationCollection.AFInAppEventParameterName());
valueOf(application, map2);
SimpleDateFormat simpleDateFormat22 = new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", Locale.US);
long j1222 = application.getPackageManager().getPackageInfo(application.getPackageName(), 0).firstInstallTime;
simpleDateFormat22.setTimeZone(TimeZone.getTimeZone("UTC"));
map2.put("installDate", simpleDateFormat22.format(new Date(j1222)));
PackageInfo packageInfo22 = application.getPackageManager().getPackageInfo(application.getPackageName(), 0);
sharedPreferences3 = sharedPreferences;
i10 = sharedPreferences3.getInt("versionCode", 0);
i11 = packageInfo22.versionCode;
if (i11 > i10) {
}
map2.put("app_version_code", Integer.toString(packageInfo22.versionCode));
map2.put("app_version_name", packageInfo22.versionName);
str10 = str9;
long j1322 = packageInfo22.firstInstallTime;
sharedPreferences = sharedPreferences3;
long j1422 = packageInfo22.lastUpdateTime;
Locale locale22 = Locale.US;
obj = "appsflyerKey";
map2.put("date1", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale22).format(new Date(j1322)));
map2.put("date2", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale22).format(new Date(j1422)));
map2.put("firstLaunchDate", AFInAppEventParameterName(simpleDateFormat22, application));
this.onPause = bb.values(application);
StringBuilder sb52222 = new StringBuilder("didConfigureTokenRefreshService=");
sb52222.append(this.onPause);
AFLogger.values(sb52222.toString());
if (!this.onPause) {
}
if (z10) {
}
if (!z10) {
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
}
AFInAppEventParameterName2 = ab.AFInAppEventParameterName(application.getContentResolver());
if (AFInAppEventParameterName2 != null) {
}
map2.put("registeredUninstall", Boolean.valueOf(bb.AFInAppEventParameterName(sharedPreferences)));
z12 = z10;
sharedPreferences2 = sharedPreferences;
valueOf3 = valueOf(sharedPreferences2, "appsFlyerCount", z12);
map2.put("counter", Integer.toString(valueOf3));
map2.put("iaecounter", Integer.toString(valueOf(sharedPreferences2, "appsFlyerInAppEventCount", str12 == null)));
if (z12) {
}
auVar2 = auVar;
z13 = true;
if (!values(sharedPreferences2)) {
}
map2.put("isFirstCall", Boolean.toString(z13));
HashMap hashMap3222 = new HashMap();
hashMap3222.put("cpu_abi", AFInAppEventType("ro.product.cpu.abi"));
hashMap3222.put("cpu_abi2", AFInAppEventType("ro.product.cpu.abi2"));
hashMap3222.put("arch", AFInAppEventType("os.arch"));
hashMap3222.put("build_display_id", AFInAppEventType("ro.build.display.id"));
if (z12) {
}
hashMap3222.put("dim", w.AFInAppEventParameterName(application));
map2.put("deviceData", hashMap3222);
Object obj22222 = obj;
String str172222 = (String) map2.get("af_timestamp");
String str182222 = str10;
StringBuilder sb62222 = new StringBuilder();
sb62222.append(((String) map2.get(obj22222)).substring(0, 7));
sb62222.append(((String) map2.get(str182222)).substring(0, 7));
sb62222.append(str172222.substring(str172222.length() - 7));
map2.put("af_v", af.AFKeystoreWrapper(sb62222.toString()));
StringBuilder sb72222 = new StringBuilder();
sb72222.append((String) map2.get(obj22222));
sb72222.append(map2.get("af_timestamp"));
String obj32222 = sb72222.toString();
StringBuilder sb82222 = new StringBuilder();
sb82222.append(obj32222);
sb82222.append(map2.get(str182222));
String obj42222 = sb82222.toString();
StringBuilder sb92222 = new StringBuilder();
sb92222.append(obj42222);
sb92222.append(map2.get("installDate"));
String obj52222 = sb92222.toString();
StringBuilder sb102222 = new StringBuilder();
sb102222.append(obj52222);
sb102222.append(map2.get("counter"));
String obj62222 = sb102222.toString();
StringBuilder sb112222 = new StringBuilder();
sb112222.append(obj62222);
sb112222.append(map2.get("iaecounter"));
map2.put("af_v2", af.AFKeystoreWrapper(af.AFInAppEventType(sb112222.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application)));
if (sharedPreferences2.contains("is_stop_tracking_used")) {
}
HashMap hashMap22222 = new HashMap();
hashMap22222.put("mcc", Integer.valueOf(application.getResources().getConfiguration().mcc));
hashMap22222.put("mnc", Integer.valueOf(application.getResources().getConfiguration().mnc));
map2.put("cell", hashMap22222);
map2.put("sig", aa.values(auVar2.AFKeystoreWrapper.getPackageManager(), auVar2.AFKeystoreWrapper.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs2222 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong2222 = statFs2222.getBlockSizeLong();
double pow2222 = Math.pow(2.0d, 20.0d);
long blockCountLong2222 = (long) ((statFs2222.getBlockCountLong() * blockSizeLong2222) / pow2222);
StringBuilder sb122222 = new StringBuilder();
sb122222.append((long) ((statFs2222.getAvailableBlocksLong() * blockSizeLong2222) / pow2222));
sb122222.append("/");
sb122222.append(blockCountLong2222);
map2.put("disk", sb122222.toString());
strArr = this.getLevel;
if (strArr != null) {
}
return map2;
}
}
} catch (Exception e20) {
e = e20;
str9 = "uid";
}
try {
map2.put("lang", Locale.getDefault().getDisplayLanguage());
} catch (Exception e21) {
AFLogger.AFInAppEventType("Exception while collecting display language name. ", e21);
}
try {
map2.put("lang_code", Locale.getDefault().getLanguage());
} catch (Exception e22) {
AFLogger.AFInAppEventType("Exception while collecting display language code. ", e22);
}
try {
map2.put("country", Locale.getDefault().getCountry());
} catch (Exception e23) {
AFLogger.AFInAppEventType("Exception while collecting country name. ", e23);
}
map2.put("platformextension", this.enableLocationCollection.AFInAppEventParameterName());
valueOf(application, map2);
SimpleDateFormat simpleDateFormat222 = new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", Locale.US);
try {
long j12222 = application.getPackageManager().getPackageInfo(application.getPackageName(), 0).firstInstallTime;
simpleDateFormat222.setTimeZone(TimeZone.getTimeZone("UTC"));
map2.put("installDate", simpleDateFormat222.format(new Date(j12222)));
} catch (Exception e24) {
AFLogger.AFInAppEventType("Exception while collecting install date. ", e24);
}
try {
PackageInfo packageInfo222 = application.getPackageManager().getPackageInfo(application.getPackageName(), 0);
sharedPreferences3 = sharedPreferences;
try {
i10 = sharedPreferences3.getInt("versionCode", 0);
i11 = packageInfo222.versionCode;
if (i11 > i10) {
SharedPreferences.Editor edit6 = values(application).edit();
edit6.putInt("versionCode", i11);
edit6.apply();
}
map2.put("app_version_code", Integer.toString(packageInfo222.versionCode));
map2.put("app_version_name", packageInfo222.versionName);
str10 = str9;
long j13222 = packageInfo222.firstInstallTime;
sharedPreferences = sharedPreferences3;
long j14222 = packageInfo222.lastUpdateTime;
Locale locale222 = Locale.US;
obj = "appsflyerKey";
map2.put("date1", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale222).format(new Date(j13222)));
map2.put("date2", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale222).format(new Date(j14222)));
map2.put("firstLaunchDate", AFInAppEventParameterName(simpleDateFormat222, application));
} catch (Throwable th4) {
th = th4;
obj = "appsflyerKey";
str10 = str9;
}
} catch (Throwable th5) {
th = th5;
obj = "appsflyerKey";
str10 = str9;
}
this.onPause = bb.values(application);
StringBuilder sb522222 = new StringBuilder("didConfigureTokenRefreshService=");
sb522222.append(this.onPause);
AFLogger.values(sb522222.toString());
if (!this.onPause) {
map2.put("tokenRefreshConfigured", Boolean.FALSE);
}
if (z10) {
if (this.updateServerUninstallToken != null) {
if (map2.get("af_deeplink") != null) {
AFLogger.values("Skip 'af' payload as deeplink was found by path");
} else {
JSONObject jSONObject3 = new JSONObject(this.updateServerUninstallToken);
jSONObject3.put("isPush", "true");
map2.put("af_deeplink", jSONObject3.toString());
}
}
this.updateServerUninstallToken = null;
map2.put("open_referrer", str14);
}
if (!z10) {
try {
z AFKeystoreWrapper6 = z.AFKeystoreWrapper(application);
ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap();
List<Map<String, Object>> values9 = AFKeystoreWrapper6.values();
if (!values9.isEmpty()) {
concurrentHashMap.put("sensors", new i().AFInAppEventType(values9));
} else {
concurrentHashMap.put("sensors", "na");
}
map2.putAll(concurrentHashMap);
} catch (Exception e25) {
StringBuilder sb14 = new StringBuilder("Unexpected exception from AFSensorManager: ");
sb14.append(e25.getMessage());
AFLogger.AFInAppEventParameterName(sb14.toString());
}
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
ab.valueOf(application, map2);
map2.put("GAID_retry", String.valueOf(AppsFlyerProperties.getInstance().getString("advertiserId") != null));
}
AFInAppEventParameterName2 = ab.AFInAppEventParameterName(application.getContentResolver());
if (AFInAppEventParameterName2 != null) {
map2.put("amazon_aid", AFInAppEventParameterName2.values);
map2.put("amazon_aid_limit", String.valueOf(AFInAppEventParameterName2.valueOf));
}
map2.put("registeredUninstall", Boolean.valueOf(bb.AFInAppEventParameterName(sharedPreferences)));
z12 = z10;
sharedPreferences2 = sharedPreferences;
valueOf3 = valueOf(sharedPreferences2, "appsFlyerCount", z12);
map2.put("counter", Integer.toString(valueOf3));
map2.put("iaecounter", Integer.toString(valueOf(sharedPreferences2, "appsFlyerInAppEventCount", str12 == null)));
} catch (Throwable th6) {
AFLogger.AFInAppEventParameterName(th6.getLocalizedMessage(), th6);
}
if (z12) {
if (valueOf3 == 1) {
auVar2 = auVar;
z13 = true;
appsFlyerProperties2.AFInAppEventParameterName = true;
if (AFInAppEventType(AppsFlyerProperties.AF_WAITFOR_CUSTOMERID, false)) {
map2.put("wait_cid", Boolean.toString(true));
}
Map<String, Object> AFKeystoreWrapper7 = AFKeystoreWrapper(map2);
String string20 = auVar2.valueOf.getString("ddl", null);
if (string20 != null) {
Map<String, Object> AFInAppEventType4 = m.AFInAppEventType(new JSONObject(string20));
if (!AFInAppEventType4.isEmpty()) {
AFKeystoreWrapper7.put("ddl", AFInAppEventType4);
}
}
Map<String, Object> AFInAppEventType5 = m.AFInAppEventType(this.setUserEmails);
if (!AFInAppEventType5.isEmpty()) {
AFKeystoreWrapper7.put("first_launch", AFInAppEventType5);
}
if (!values(sharedPreferences2)) {
}
map2.put("isFirstCall", Boolean.toString(z13));
HashMap hashMap32222 = new HashMap();
hashMap32222.put("cpu_abi", AFInAppEventType("ro.product.cpu.abi"));
hashMap32222.put("cpu_abi2", AFInAppEventType("ro.product.cpu.abi2"));
hashMap32222.put("arch", AFInAppEventType("os.arch"));
hashMap32222.put("build_display_id", AFInAppEventType("ro.build.display.id"));
if (z12) {
}
hashMap32222.put("dim", w.AFInAppEventParameterName(application));
map2.put("deviceData", hashMap32222);
Object obj222222 = obj;
String str1722222 = (String) map2.get("af_timestamp");
String str1822222 = str10;
StringBuilder sb622222 = new StringBuilder();
sb622222.append(((String) map2.get(obj222222)).substring(0, 7));
sb622222.append(((String) map2.get(str1822222)).substring(0, 7));
sb622222.append(str1722222.substring(str1722222.length() - 7));
map2.put("af_v", af.AFKeystoreWrapper(sb622222.toString()));
StringBuilder sb722222 = new StringBuilder();
sb722222.append((String) map2.get(obj222222));
sb722222.append(map2.get("af_timestamp"));
String obj322222 = sb722222.toString();
StringBuilder sb822222 = new StringBuilder();
sb822222.append(obj322222);
sb822222.append(map2.get(str1822222));
String obj422222 = sb822222.toString();
StringBuilder sb922222 = new StringBuilder();
sb922222.append(obj422222);
sb922222.append(map2.get("installDate"));
String obj522222 = sb922222.toString();
StringBuilder sb1022222 = new StringBuilder();
sb1022222.append(obj522222);
sb1022222.append(map2.get("counter"));
String obj622222 = sb1022222.toString();
StringBuilder sb1122222 = new StringBuilder();
sb1122222.append(obj622222);
sb1122222.append(map2.get("iaecounter"));
map2.put("af_v2", af.AFKeystoreWrapper(af.AFInAppEventType(sb1122222.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application)));
if (sharedPreferences2.contains("is_stop_tracking_used")) {
}
HashMap hashMap222222 = new HashMap();
hashMap222222.put("mcc", Integer.valueOf(application.getResources().getConfiguration().mcc));
hashMap222222.put("mnc", Integer.valueOf(application.getResources().getConfiguration().mnc));
map2.put("cell", hashMap222222);
map2.put("sig", aa.values(auVar2.AFKeystoreWrapper.getPackageManager(), auVar2.AFKeystoreWrapper.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs22222 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong22222 = statFs22222.getBlockSizeLong();
double pow22222 = Math.pow(2.0d, 20.0d);
long blockCountLong22222 = (long) ((statFs22222.getBlockCountLong() * blockSizeLong22222) / pow22222);
StringBuilder sb1222222 = new StringBuilder();
sb1222222.append((long) ((statFs22222.getAvailableBlocksLong() * blockSizeLong22222) / pow22222));
sb1222222.append("/");
sb1222222.append(blockCountLong22222);
map2.put("disk", sb1222222.toString());
strArr = this.getLevel;
if (strArr != null) {
}
return map2;
} else if (valueOf3 == 2) {
Map<String, Object> AFKeystoreWrapper8 = AFKeystoreWrapper(map2);
auVar2 = auVar;
String string21 = auVar2.valueOf.getString("first_launch", null);
if (string21 != null) {
Map<String, Object> AFInAppEventType6 = m.AFInAppEventType(new JSONObject(string21));
if (!AFInAppEventType6.isEmpty()) {
AFKeystoreWrapper8.put("first_launch", AFInAppEventType6);
}
}
z13 = true;
if (!values(sharedPreferences2)) {
z13 = false;
}
map2.put("isFirstCall", Boolean.toString(z13));
HashMap hashMap322222 = new HashMap();
hashMap322222.put("cpu_abi", AFInAppEventType("ro.product.cpu.abi"));
hashMap322222.put("cpu_abi2", AFInAppEventType("ro.product.cpu.abi2"));
hashMap322222.put("arch", AFInAppEventType("os.arch"));
hashMap322222.put("build_display_id", AFInAppEventType("ro.build.display.id"));
if (z12) {
if (this.getSdkVersion) {
Location valueOf5 = u.c.AFInAppEventParameterName.valueOf(application);
HashMap hashMap5 = new HashMap(3);
if (valueOf5 != null) {
hashMap5.put("lat", String.valueOf(valueOf5.getLatitude()));
hashMap5.put("lon", String.valueOf(valueOf5.getLongitude()));
hashMap5.put("ts", String.valueOf(valueOf5.getTime()));
}
if (!hashMap5.isEmpty()) {
hashMap322222.put("loc", hashMap5);
}
}
c.e values10 = c.C0079c.AFKeystoreWrapper.values(application);
hashMap322222.put("btl", Float.toString(values10.values));
String str19 = values10.AFKeystoreWrapper;
if (str19 != null) {
hashMap322222.put("btch", str19);
}
if (valueOf3 <= 2) {
z AFKeystoreWrapper9 = z.AFKeystoreWrapper(application);
ConcurrentHashMap concurrentHashMap2 = new ConcurrentHashMap();
List<Map<String, Object>> AFInAppEventParameterName4 = AFKeystoreWrapper9.AFInAppEventParameterName();
if (!AFInAppEventParameterName4.isEmpty()) {
concurrentHashMap2.put("sensors", AFInAppEventParameterName4);
} else {
List<Map<String, Object>> values11 = AFKeystoreWrapper9.values();
if (!values11.isEmpty()) {
concurrentHashMap2.put("sensors", values11);
}
}
hashMap322222.putAll(concurrentHashMap2);
}
}
hashMap322222.put("dim", w.AFInAppEventParameterName(application));
map2.put("deviceData", hashMap322222);
Object obj2222222 = obj;
String str17222222 = (String) map2.get("af_timestamp");
String str18222222 = str10;
StringBuilder sb6222222 = new StringBuilder();
sb6222222.append(((String) map2.get(obj2222222)).substring(0, 7));
sb6222222.append(((String) map2.get(str18222222)).substring(0, 7));
sb6222222.append(str17222222.substring(str17222222.length() - 7));
map2.put("af_v", af.AFKeystoreWrapper(sb6222222.toString()));
StringBuilder sb7222222 = new StringBuilder();
sb7222222.append((String) map2.get(obj2222222));
sb7222222.append(map2.get("af_timestamp"));
String obj3222222 = sb7222222.toString();
StringBuilder sb8222222 = new StringBuilder();
sb8222222.append(obj3222222);
sb8222222.append(map2.get(str18222222));
String obj4222222 = sb8222222.toString();
StringBuilder sb9222222 = new StringBuilder();
sb9222222.append(obj4222222);
sb9222222.append(map2.get("installDate"));
String obj5222222 = sb9222222.toString();
StringBuilder sb10222222 = new StringBuilder();
sb10222222.append(obj5222222);
sb10222222.append(map2.get("counter"));
String obj6222222 = sb10222222.toString();
StringBuilder sb11222222 = new StringBuilder();
sb11222222.append(obj6222222);
sb11222222.append(map2.get("iaecounter"));
map2.put("af_v2", af.AFKeystoreWrapper(af.AFInAppEventType(sb11222222.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application)));
if (sharedPreferences2.contains("is_stop_tracking_used")) {
map2.put("istu", String.valueOf(sharedPreferences2.getBoolean("is_stop_tracking_used", false)));
}
HashMap hashMap2222222 = new HashMap();
hashMap2222222.put("mcc", Integer.valueOf(application.getResources().getConfiguration().mcc));
hashMap2222222.put("mnc", Integer.valueOf(application.getResources().getConfiguration().mnc));
map2.put("cell", hashMap2222222);
map2.put("sig", aa.values(auVar2.AFKeystoreWrapper.getPackageManager(), auVar2.AFKeystoreWrapper.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs222222 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong222222 = statFs222222.getBlockSizeLong();
double pow222222 = Math.pow(2.0d, 20.0d);
long blockCountLong222222 = (long) ((statFs222222.getBlockCountLong() * blockSizeLong222222) / pow222222);
StringBuilder sb12222222 = new StringBuilder();
sb12222222.append((long) ((statFs222222.getAvailableBlocksLong() * blockSizeLong222222) / pow222222));
sb12222222.append("/");
sb12222222.append(blockCountLong222222);
map2.put("disk", sb12222222.toString());
strArr = this.getLevel;
if (strArr != null) {
map2.put("sharing_filter", strArr);
}
return map2;
}
}
auVar2 = auVar;
z13 = true;
if (!values(sharedPreferences2)) {
}
map2.put("isFirstCall", Boolean.toString(z13));
HashMap hashMap3222222 = new HashMap();
hashMap3222222.put("cpu_abi", AFInAppEventType("ro.product.cpu.abi"));
hashMap3222222.put("cpu_abi2", AFInAppEventType("ro.product.cpu.abi2"));
hashMap3222222.put("arch", AFInAppEventType("os.arch"));
hashMap3222222.put("build_display_id", AFInAppEventType("ro.build.display.id"));
if (z12) {
}
hashMap3222222.put("dim", w.AFInAppEventParameterName(application));
map2.put("deviceData", hashMap3222222);
Object obj22222222 = obj;
String str172222222 = (String) map2.get("af_timestamp");
String str182222222 = str10;
StringBuilder sb62222222 = new StringBuilder();
sb62222222.append(((String) map2.get(obj22222222)).substring(0, 7));
sb62222222.append(((String) map2.get(str182222222)).substring(0, 7));
sb62222222.append(str172222222.substring(str172222222.length() - 7));
map2.put("af_v", af.AFKeystoreWrapper(sb62222222.toString()));
StringBuilder sb72222222 = new StringBuilder();
sb72222222.append((String) map2.get(obj22222222));
sb72222222.append(map2.get("af_timestamp"));
String obj32222222 = sb72222222.toString();
StringBuilder sb82222222 = new StringBuilder();
sb82222222.append(obj32222222);
sb82222222.append(map2.get(str182222222));
String obj42222222 = sb82222222.toString();
StringBuilder sb92222222 = new StringBuilder();
sb92222222.append(obj42222222);
sb92222222.append(map2.get("installDate"));
String obj52222222 = sb92222222.toString();
StringBuilder sb102222222 = new StringBuilder();
sb102222222.append(obj52222222);
sb102222222.append(map2.get("counter"));
String obj62222222 = sb102222222.toString();
StringBuilder sb112222222 = new StringBuilder();
sb112222222.append(obj62222222);
sb112222222.append(map2.get("iaecounter"));
map2.put("af_v2", af.AFKeystoreWrapper(af.AFInAppEventType(sb112222222.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application)));
if (sharedPreferences2.contains("is_stop_tracking_used")) {
}
HashMap hashMap22222222 = new HashMap();
hashMap22222222.put("mcc", Integer.valueOf(application.getResources().getConfiguration().mcc));
hashMap22222222.put("mnc", Integer.valueOf(application.getResources().getConfiguration().mnc));
map2.put("cell", hashMap22222222);
map2.put("sig", aa.values(auVar2.AFKeystoreWrapper.getPackageManager(), auVar2.AFKeystoreWrapper.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs2222222 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong2222222 = statFs2222222.getBlockSizeLong();
double pow2222222 = Math.pow(2.0d, 20.0d);
long blockCountLong2222222 = (long) ((statFs2222222.getBlockCountLong() * blockSizeLong2222222) / pow2222222);
StringBuilder sb122222222 = new StringBuilder();
sb122222222.append((long) ((statFs2222222.getAvailableBlocksLong() * blockSizeLong2222222) / pow2222222));
sb122222222.append("/");
sb122222222.append(blockCountLong2222222);
map2.put("disk", sb122222222.toString());
strArr = this.getLevel;
if (strArr != null) {
}
return map2;
}
public final void AFInAppEventParameterName(Context context, Map<String, Object> map, Uri uri) {
if (!map.containsKey("af_deeplink")) {
String valueOf2 = valueOf(uri.toString());
j AFInAppEventType2 = j.AFInAppEventType();
String str = AFInAppEventType2.AFVersionDeclaration;
if (str != null && AFInAppEventType2.AFLogger$LogLevel != null && valueOf2.contains(str)) {
Uri.Builder buildUpon = Uri.parse(valueOf2).buildUpon();
Uri.Builder buildUpon2 = Uri.EMPTY.buildUpon();
for (Map.Entry<String, String> entry : AFInAppEventType2.AFLogger$LogLevel.entrySet()) {
buildUpon.appendQueryParameter(entry.getKey(), entry.getValue());
buildUpon2.appendQueryParameter(entry.getKey(), entry.getValue());
}
valueOf2 = buildUpon.build().toString();
map.put("appended_query_params", buildUpon2.build().getEncodedQuery());
}
map.put("af_deeplink", valueOf2);
}
final HashMap hashMap = new HashMap();
hashMap.put("link", uri.toString());
ao aoVar = new ao(uri, this, context);
if (aoVar.valueOf) {
map.put("isBrandedDomain", Boolean.TRUE);
}
aa.AFKeystoreWrapper(context, hashMap, uri);
if (aoVar.AFKeystoreWrapper()) {
aoVar.values = new ao.b() {
@Override
public final void AFInAppEventParameterName(Map<String, String> map2) {
for (String str2 : map2.keySet()) {
hashMap.put(str2, map2.get(str2));
}
ap.AFInAppEventParameterName(hashMap);
}
@Override
public final void AFInAppEventParameterName(String str2) {
ap.valueOf(str2, DeepLinkResult.Error.NETWORK);
}
};
if (k.valueOf == null) {
k.valueOf = new k();
}
k.valueOf.valueOf().execute(aoVar);
return;
}
ap.AFInAppEventParameterName(hashMap);
}
public static void valueOf(Context context, Map<String, ? super String> map) {
y yVar = y.a.valueOf;
y.d AFKeystoreWrapper2 = y.AFKeystoreWrapper(context);
map.put("network", AFKeystoreWrapper2.AFKeystoreWrapper);
String str = AFKeystoreWrapper2.AFInAppEventType;
if (str != null) {
map.put("operator", str);
}
String str2 = AFKeystoreWrapper2.valueOf;
if (str2 != null) {
map.put("carrier", str2);
}
}
static void valueOf(ae aeVar, g gVar) throws IOException {
String jSONObject;
StringBuilder sb2 = new StringBuilder("url: ");
sb2.append(gVar.onAppOpenAttributionNative);
AFLogger.AFKeystoreWrapper(sb2.toString());
if (gVar.getLevel != null) {
jSONObject = Base64.encodeToString(gVar.AFInAppEventParameterName(), 2);
AFLogger.AFKeystoreWrapper("cached data: ".concat(String.valueOf(jSONObject)));
} else {
jSONObject = new JSONObject(gVar.AFInAppEventType()).toString();
String replaceAll = jSONObject.replaceAll("\\p{C}", "*Non-printing character*");
if (!replaceAll.equals(jSONObject)) {
AFLogger.init("Payload contains non-printing characters");
jSONObject = replaceAll;
}
am.AFKeystoreWrapper("data: ".concat(jSONObject));
}
aj.valueOf().AFInAppEventType("server_request", gVar.onAppOpenAttributionNative, jSONObject);
try {
aeVar.AFKeystoreWrapper(gVar);
} catch (IOException e10) {
AFLogger.AFInAppEventType("Exception in sendRequestToServer. ", e10);
if (AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.USE_HTTP_FALLBACK, false)) {
aeVar.AFKeystoreWrapper(gVar.AFInAppEventParameterName(gVar.onAppOpenAttributionNative.replace("https:", "http:")));
return;
}
StringBuilder sb3 = new StringBuilder("failed to send request to server. ");
sb3.append(e10.getLocalizedMessage());
AFLogger.AFKeystoreWrapper(sb3.toString());
throw e10;
}
}
final void AFKeystoreWrapper(WeakReference<Context> weakReference) {
if (weakReference.get() == null) {
return;
}
AFLogger.AFKeystoreWrapper("app went to background");
SharedPreferences values2 = values(weakReference.get());
AppsFlyerProperties.getInstance().saveProperties(values2);
long j10 = this.stop - this.AppsFlyerConversionListener;
HashMap hashMap = new HashMap();
String string = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
if (string == null) {
AFLogger.init("[callStats] AppsFlyer's SDK cannot send any event without providing DevKey.");
return;
}
String string2 = AppsFlyerProperties.getInstance().getString("KSAppsFlyerId");
if (AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.DEVICE_TRACKING_DISABLED, false)) {
hashMap.put(AppsFlyerProperties.DEVICE_TRACKING_DISABLED, "true");
}
d.e.C0080d AFInAppEventParameterName2 = ab.AFInAppEventParameterName(weakReference.get().getContentResolver());
if (AFInAppEventParameterName2 != null) {
hashMap.put("amazon_aid", AFInAppEventParameterName2.values);
hashMap.put("amazon_aid_limit", String.valueOf(AFInAppEventParameterName2.valueOf));
}
String string3 = AppsFlyerProperties.getInstance().getString("advertiserId");
if (string3 != null) {
hashMap.put("advertiserId", string3);
}
hashMap.put("app_id", weakReference.get().getPackageName());
hashMap.put("devkey", string);
hashMap.put("uid", an.AFKeystoreWrapper(weakReference));
hashMap.put("time_in_app", String.valueOf(j10 / 1000));
hashMap.put("statType", "user_closed_app");
hashMap.put("platform", "Android");
hashMap.put("launch_counter", Integer.toString(valueOf(values2, "appsFlyerCount", false)));
hashMap.put(AppsFlyerProperties.CHANNEL, valueOf(weakReference.get()));
if (string2 == null) {
string2 = BuildConfig.FLAVOR;
}
hashMap.put("originalAppsflyerId", string2);
if (this.setAndroidIdData) {
try {
AFLogger.values("Running callStats task");
bp bpVar = new bp();
bpVar.onConversionDataFail = isStopped();
new Thread(new m((bf) bpVar.valueOf(hashMap).AFInAppEventParameterName(String.format(onInstallConversionFailureNative, AppsFlyerLib.getInstance().getHostPrefix(), onConversionDataSuccess.getHostName())))).start();
return;
} catch (Throwable th) {
AFLogger.AFInAppEventType("Could not send callStats request", th);
return;
}
}
AFLogger.values("Stats call is disabled, ignore ...");
}
public static boolean AFInAppEventParameterName(Context context) {
return !values(context).contains("appsFlyerCount");
}
private static File AFInAppEventParameterName(String str) {
if (str != null) {
try {
if (str.trim().length() > 0) {
return new File(str.trim());
}
return null;
} catch (Throwable th) {
AFLogger.AFInAppEventType(th.getMessage(), th);
return null;
}
}
return null;
}
private String AFInAppEventParameterName(SimpleDateFormat simpleDateFormat, Context context) {
String str;
String string = values(context).getString("appsFlyerFirstInstall", null);
if (string == null) {
if (AFInAppEventParameterName(context)) {
AFLogger.values("AppsFlyer: first launch detected");
str = simpleDateFormat.format(new Date());
} else {
str = BuildConfig.FLAVOR;
}
string = str;
SharedPreferences.Editor edit = values(context).edit();
edit.putString("appsFlyerFirstInstall", string);
edit.apply();
}
AFLogger.AFKeystoreWrapper("AppsFlyer: first launch date: ".concat(String.valueOf(string)));
return string;
}
public final Map<String, Object> AFInAppEventParameterName() {
HashMap hashMap = new HashMap();
if (AFLogger$LogLevel()) {
hashMap.put("lvl", this.setCustomerIdAndLogSession);
} else if (this.getOutOfStore) {
HashMap hashMap2 = new HashMap();
this.setCustomerIdAndLogSession = hashMap2;
hashMap2.put("error", "operation timed out.");
hashMap.put("lvl", this.setCustomerIdAndLogSession);
}
return hashMap;
}
public boolean AFInAppEventParameterName(g gVar, SharedPreferences sharedPreferences) {
int valueOf2 = valueOf(sharedPreferences, "appsFlyerCount", false);
return (!sharedPreferences.getBoolean(AppsFlyerProperties.NEW_REFERRER_SENT, false) && valueOf2 == 1) || (valueOf2 == 1 && !(gVar instanceof bh));
}
private void AFKeystoreWrapper(Context context, String str, Map<String, Object> map) {
bj bjVar = new bj();
if (context != null) {
bjVar.valueOf = (Application) context.getApplicationContext();
}
bjVar.AFLogger$LogLevel = str;
bjVar.values = map;
values(bjVar, context instanceof Activity ? (Activity) context : null);
}
private boolean AFKeystoreWrapper() {
if (this.onDeepLinking > 0) {
long currentTimeMillis = System.currentTimeMillis() - this.onDeepLinking;
Locale locale = Locale.US;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSS Z", locale);
long j10 = this.onDeepLinking;
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
String format = simpleDateFormat.format(new Date(j10));
long j11 = this.AppsFlyerInAppPurchaseValidatorListener;
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
String format2 = simpleDateFormat.format(new Date(j11));
if (currentTimeMillis < this.AppsFlyerLib && !isStopped()) {
AFLogger.AFKeystoreWrapper(String.format(locale, "Last Launch attempt: %s;\nLast successful Launch event: %s;\nThis launch is blocked: %s ms < %s ms", format, format2, Long.valueOf(currentTimeMillis), Long.valueOf(this.AppsFlyerLib)));
return true;
} else if (!isStopped()) {
AFLogger.AFKeystoreWrapper(String.format(locale, "Last Launch attempt: %s;\nLast successful Launch event: %s;\nSending launch (+%s ms)", format, format2, Long.valueOf(currentTimeMillis)));
}
} else if (!isStopped()) {
AFLogger.AFKeystoreWrapper("Sending first launch for this session!");
}
return false;
}
public static Map<String, Object> AFKeystoreWrapper(Map<String, Object> map) {
if (map.containsKey("meta")) {
return (Map) map.get("meta");
}
HashMap hashMap = new HashMap();
map.put("meta", hashMap);
return hashMap;
}
private static String AFKeystoreWrapper(String str, PackageManager packageManager, String str2) {
Object obj;
try {
Bundle bundle = ((PackageItemInfo) packageManager.getApplicationInfo(str2, 128)).metaData;
if (bundle == null || (obj = bundle.get(str)) == null) {
return null;
}
return obj.toString();
} catch (Throwable th) {
StringBuilder sb2 = new StringBuilder("Could not find ");
sb2.append(str);
sb2.append(" value in the manifest");
AFLogger.AFInAppEventType(sb2.toString(), th);
return null;
}
}
public final String AFKeystoreWrapper(Context context, String str) {
SharedPreferences values2 = values(context);
if (values2.contains("CACHED_CHANNEL")) {
return values2.getString("CACHED_CHANNEL", null);
}
SharedPreferences.Editor edit = values(context).edit();
edit.putString("CACHED_CHANNEL", str);
edit.apply();
return str;
}
public static String AFKeystoreWrapper(HttpURLConnection httpURLConnection) {
String obj;
InputStreamReader inputStreamReader;
StringBuilder sb2 = new StringBuilder();
BufferedReader bufferedReader = null;
try {
try {
InputStream errorStream = httpURLConnection.getErrorStream();
if (errorStream == null) {
errorStream = httpURLConnection.getInputStream();
}
inputStreamReader = new InputStreamReader(errorStream);
try {
BufferedReader bufferedReader2 = new BufferedReader(inputStreamReader);
boolean z10 = false;
while (true) {
try {
String readLine = bufferedReader2.readLine();
if (readLine == null) {
break;
}
sb2.append(z10 ? '\n' : BuildConfig.FLAVOR);
sb2.append(readLine);
z10 = true;
} catch (Throwable th) {
th = th;
bufferedReader = bufferedReader2;
try {
StringBuilder sb3 = new StringBuilder("Could not read connection response from: ");
sb3.append(httpURLConnection.getURL().toString());
AFLogger.AFInAppEventType(sb3.toString(), th);
if (bufferedReader != null) {
bufferedReader.close();
}
if (inputStreamReader != null) {
inputStreamReader.close();
}
obj = sb2.toString();
new JSONObject(obj);
return obj;
} catch (Throwable th2) {
if (bufferedReader != null) {
try {
bufferedReader.close();
} catch (Throwable th3) {
AFLogger.values(th3);
throw th2;
}
}
if (inputStreamReader != null) {
inputStreamReader.close();
}
throw th2;
}
}
}
bufferedReader2.close();
inputStreamReader.close();
} catch (Throwable th4) {
th = th4;
}
} catch (Throwable th5) {
th = th5;
inputStreamReader = null;
}
} catch (Throwable th6) {
AFLogger.values(th6);
}
obj = sb2.toString();
try {
new JSONObject(obj);
return obj;
} catch (JSONException unused) {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("string_response", obj);
return jSONObject.toString();
} catch (JSONException unused2) {
return new JSONObject().toString();
}
}
}
private void AFKeystoreWrapper(g gVar) throws IOException {
long currentTimeMillis;
HttpURLConnection httpURLConnection;
HttpURLConnection httpURLConnection2;
DataOutputStream dataOutputStream;
URL url = new URL(gVar.onAppOpenAttributionNative);
byte[] AFInAppEventParameterName2 = gVar.AFInAppEventParameterName();
String str = gVar.AFVersionDeclaration;
String str2 = gVar.getLevel;
boolean AFKeystoreWrapper2 = gVar.AFKeystoreWrapper();
Application application = gVar.valueOf;
AppsFlyerRequestListener appsFlyerRequestListener = gVar.AFKeystoreWrapper;
boolean z10 = AFKeystoreWrapper2 && gVar.onInstallConversionFailureNative == 1;
if (z10) {
try {
this.setUserEmails.put("from_fg", System.currentTimeMillis() - this.AppsFlyerConversionListener);
} catch (JSONException unused) {
}
currentTimeMillis = System.currentTimeMillis();
} else {
currentTimeMillis = 0;
}
try {
httpURLConnection2 = (HttpURLConnection) url.openConnection();
} catch (Throwable th) {
th = th;
httpURLConnection = null;
}
try {
httpURLConnection2.setRequestMethod("POST");
httpURLConnection2.setRequestProperty("Content-Length", String.valueOf(AFInAppEventParameterName2.length));
httpURLConnection2.setRequestProperty("Content-Type", gVar.values() ? "application/octet-stream" : "application/json");
httpURLConnection2.setConnectTimeout(10000);
httpURLConnection2.setDoOutput(true);
if (!AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.HTTP_CACHE, true)) {
httpURLConnection2.setUseCaches(false);
}
try {
dataOutputStream = new DataOutputStream(httpURLConnection2.getOutputStream());
try {
dataOutputStream.write(AFInAppEventParameterName2);
dataOutputStream.close();
int responseCode = httpURLConnection2.getResponseCode();
if (z10) {
try {
this.setUserEmails.put("net", System.currentTimeMillis() - currentTimeMillis);
} catch (JSONException unused2) {
}
}
if (this.init == null) {
this.init = new au(application);
}
this.init.valueOf.edit().putString("first_launch", this.setUserEmails.toString()).apply();
String AFKeystoreWrapper3 = AFKeystoreWrapper(httpURLConnection2);
aj.valueOf().AFInAppEventType("server_response", url.toString(), String.valueOf(responseCode), AFKeystoreWrapper3);
AFLogger.AFKeystoreWrapper("response code: ".concat(String.valueOf(responseCode)));
SharedPreferences values2 = values(application);
if (responseCode == 200) {
if (application != null && AFKeystoreWrapper2) {
this.AppsFlyerInAppPurchaseValidatorListener = System.currentTimeMillis();
}
if (appsFlyerRequestListener != null) {
appsFlyerRequestListener.onSuccess();
}
if (str2 != null) {
ai.AFKeystoreWrapper();
ai.valueOf(str2, application);
} else {
SharedPreferences.Editor edit = values(application).edit();
edit.putString("sentSuccessfully", "true");
edit.apply();
if (!this.onValidateInApp && System.currentTimeMillis() - this.AFVersionDeclaration >= 15000 && this.onValidateInAppFailure == null) {
if (k.valueOf == null) {
k.valueOf = new k();
}
this.onValidateInAppFailure = k.valueOf.AFInAppEventParameterName();
AFInAppEventType(this.onValidateInAppFailure, new e(application), 1L, TimeUnit.SECONDS);
}
}
bb bbVar = new bb(application);
l valueOf2 = bbVar.valueOf();
if (valueOf2 != null && valueOf2.AFInAppEventParameterName()) {
String str3 = valueOf2.values;
AFLogger.values("Resending Uninstall token to AF servers: ".concat(String.valueOf(str3)));
bbVar.AFInAppEventType(str3);
}
this.setAndroidIdData = ar.AFKeystoreWrapper(AFKeystoreWrapper3).optBoolean("send_background", false);
} else if (appsFlyerRequestListener != null) {
int i10 = RequestError.RESPONSE_CODE_FAILURE;
StringBuilder sb2 = new StringBuilder();
sb2.append(ax.AFInAppEventType);
sb2.append(" ");
sb2.append(responseCode);
appsFlyerRequestListener.onError(i10, sb2.toString());
}
ba.values(this, gVar, str, application, values2, Integer.valueOf(responseCode), null);
httpURLConnection2.disconnect();
} catch (Throwable th2) {
th = th2;
if (dataOutputStream != null) {
dataOutputStream.close();
}
throw th;
}
} catch (Throwable th3) {
th = th3;
dataOutputStream = null;
}
} catch (Throwable th4) {
th = th4;
httpURLConnection = httpURLConnection2;
if (httpURLConnection != null) {
httpURLConnection.disconnect();
}
throw th;
}
}
static void AFKeystoreWrapper(ae aeVar, g gVar) {
String format;
ScheduledExecutorService AFInAppEventParameterName2;
Application application = gVar.valueOf;
String str = gVar.AFLogger$LogLevel;
if (application == null) {
AFLogger.values("sendWithEvent - got null context. skipping event/launch.");
return;
}
SharedPreferences values2 = values(application);
AppsFlyerProperties.getInstance().saveProperties(values2);
if (!aeVar.isStopped()) {
StringBuilder sb2 = new StringBuilder("sendWithEvent from activity: ");
sb2.append(application.getClass().getName());
AFLogger.AFKeystoreWrapper(sb2.toString());
}
int i10 = 1;
int i11 = 0;
boolean z10 = str == null;
boolean z11 = gVar instanceof bd;
boolean z12 = gVar instanceof bh;
gVar.onAttributionFailureNative = z10;
Map<String, ?> values3 = aeVar.values(gVar);
String str2 = (String) values3.get("appsflyerKey");
if (str2 != null && str2.length() != 0) {
if (!aeVar.isStopped()) {
AFLogger.AFKeystoreWrapper("AppsFlyerLib.sendWithEvent");
}
int valueOf2 = valueOf(values2, "appsFlyerCount", false);
if (z12 || z11) {
format = String.format(onAttributionFailure, AppsFlyerLib.getInstance().getHostPrefix(), onConversionDataSuccess.getHostName());
} else if (!z10) {
format = String.format(onConversionDataFail, AppsFlyerLib.getInstance().getHostPrefix(), onConversionDataSuccess.getHostName());
} else if (valueOf2 < 2) {
format = String.format(onAttributionFailureNative, AppsFlyerLib.getInstance().getHostPrefix(), onConversionDataSuccess.getHostName());
} else {
format = String.format(onAppOpenAttribution, AppsFlyerLib.getInstance().getHostPrefix(), onConversionDataSuccess.getHostName());
}
StringBuilder sb3 = new StringBuilder();
sb3.append(format);
sb3.append(application.getPackageName());
String obj = sb3.toString();
StringBuilder sb4 = new StringBuilder();
sb4.append(obj);
sb4.append("&buildnumber=6.3.2");
String obj2 = sb4.toString();
String valueOf3 = aeVar.valueOf(application);
if (valueOf3 != null) {
StringBuilder sb5 = new StringBuilder();
sb5.append(obj2);
sb5.append("&channel=");
sb5.append(valueOf3);
obj2 = sb5.toString();
}
if (!(AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.COLLECT_ANDROID_ID_FORCE_BY_USER, false) || AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.COLLECT_IMEI_FORCE_BY_USER, false)) && values3.get("advertiserId") != null) {
try {
if (TextUtils.isEmpty(aeVar.AFLogger$LogLevel) && values3.remove("android_id") != null) {
AFLogger.AFKeystoreWrapper("validateGaidAndIMEI :: removing: android_id");
}
if (TextUtils.isEmpty(aeVar.AppsFlyer2dXConversionCallback) && values3.remove("imei") != null) {
AFLogger.AFKeystoreWrapper("validateGaidAndIMEI :: removing: imei");
}
} catch (Exception e10) {
AFLogger.AFInAppEventType("failed to remove IMEI or AndroidID key from params; ", e10);
}
}
g valueOf4 = gVar.AFInAppEventParameterName(obj2).valueOf(values3);
valueOf4.onInstallConversionFailureNative = valueOf2;
d dVar = new d(aeVar, valueOf4, (byte) 0);
if (z10) {
bt[] btVarArr = aeVar.onAppOpenAttributionNative;
if (btVarArr != null) {
int length = btVarArr.length;
int i12 = 0;
while (i11 < length) {
bt btVar = btVarArr[i11];
if (btVar.AFInAppEventParameterName == bt.e.STARTED) {
StringBuilder sb6 = new StringBuilder("Failed to get ");
sb6.append(btVar.valueOf);
sb6.append(" referrer, wait ...");
AFLogger.values(sb6.toString());
i12 = 1;
}
i11++;
}
i11 = i12;
}
if (aeVar.setPhoneNumber && !aeVar.AFInAppEventType()) {
AFLogger.values("fetching Facebook deferred AppLink data, wait ...");
i11 = 1;
}
if (!aeVar.getOutOfStore || aeVar.AFLogger$LogLevel()) {
i10 = i11;
}
} else {
i10 = 0;
}
if (j.valueOf) {
AFLogger.AFInAppEventParameterName("ESP deeplink: execute launch on SerialExecutor");
if (k.valueOf == null) {
k.valueOf = new k();
}
k kVar = k.valueOf;
if (kVar.AFInAppEventParameterName == null) {
kVar.AFInAppEventParameterName = Executors.newSingleThreadScheduledExecutor(kVar.AFInAppEventType);
}
AFInAppEventParameterName2 = kVar.AFInAppEventParameterName;
} else {
if (k.valueOf == null) {
k.valueOf = new k();
}
AFInAppEventParameterName2 = k.valueOf.AFInAppEventParameterName();
}
AFInAppEventType(AFInAppEventParameterName2, dVar, i10 != 0 ? 500L : 0L, TimeUnit.MILLISECONDS);
return;
}
AFLogger.values("Not sending data yet, waiting for dev key");
AppsFlyerRequestListener appsFlyerRequestListener = gVar.AFKeystoreWrapper;
if (appsFlyerRequestListener != null) {
appsFlyerRequestListener.onError(RequestError.NO_DEV_KEY, ax.AFKeystoreWrapper);
}
}
public static SharedPreferences values(Context context) {
ae aeVar = onConversionDataSuccess;
if (aeVar.sendPushNotificationData == null) {
aeVar.sendPushNotificationData = context.getApplicationContext().getSharedPreferences("appsflyer-data", 0);
}
return onConversionDataSuccess.sendPushNotificationData;
}
}