Play House Simulation v3.0版本的 MD5 值为:4dbd745af43e6bcde3a0dca90b9e5934
以下内容为反编译后的 af.java 源代码,内容仅作参考
package com.appsflyer.internal;
import OooO0OO.OooO0O0.OooO00o.OooO00o.OooO00o;
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.Process;
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.util.TypedValue;
import android.view.ViewConfiguration;
import android.view.WindowManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.browser.trusted.sharing.ShareTarget;
import androidx.core.os.EnvironmentCompat;
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.a;
import com.appsflyer.internal.ah;
import com.appsflyer.internal.aq;
import com.appsflyer.internal.bw;
import com.appsflyer.internal.d;
import com.appsflyer.internal.m;
import com.appsflyer.internal.u;
import com.appsflyer.internal.v;
import com.appsflyer.internal.y;
import com.google.android.gms.common.GoogleApiAvailability;
import com.huawei.agconnect.apms.collect.model.EventType;
import com.huawei.hms.ads.fv;
import com.huawei.hms.framework.common.ContainerUtils;
import com.huawei.hms.support.api.entity.common.CommonConstant;
import com.huawei.hms.support.api.entity.pay.HwPayConstant;
import com.huawei.hms.support.feature.result.CommonConstant;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import com.huawei.openalliance.ad.views.PPSLabelView;
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.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public final class af extends AppsFlyerLib {
public static final String AFInAppEventParameterName = "6.3";
public static final String AFInAppEventType;
public static AppsFlyerConversionListener AFKeystoreWrapper = null;
private static String onAppOpenAttribution = null;
private static String onAppOpenAttributionNative = "https://%sstats.%s/stats";
@VisibleForTesting
private static af onAttributionFailure = null;
@VisibleForTesting
private static String onConversionDataFail = null;
private static String onConversionDataSuccess = null;
private static final String onDeepLinkingNative;
private static String onInstallConversionDataLoadedNative = null;
private static String onInstallConversionFailureNative = null;
public static AppsFlyerInAppPurchaseValidatorListener valueOf = null;
public static final String values = "98";
public aw AFLogger$LogLevel;
public String AFVersionDeclaration;
public String AppsFlyer2dXConversionCallback;
private String getInstance;
@VisibleForTesting
public long getLevel;
private Map<String, Object> getOutOfStore;
public String[] init;
@Nullable
public bw[] onAttributionFailureNative;
private Map<Long, String> onPause;
private long onValidateInAppFailure;
private boolean setAndroidIdData;
private au setAppInviteOneLink;
private String setCustomerIdAndLogSession;
private Application setImeiData;
private SharedPreferences setUserEmails;
private boolean stop;
private long updateServerUninstallToken;
private Map<String, Object> waitForCustomerUserId;
private long onDeepLinking = -1;
private long onValidateInApp = -1;
private long AppsFlyerInAppPurchaseValidatorListener = TimeUnit.SECONDS.toMillis(5);
private boolean AppsFlyerConversionListener = false;
private ScheduledExecutorService AppsFlyerLib = null;
private boolean getSdkVersion = false;
private final aj enableLocationCollection = new aj();
private boolean setOaidData = false;
private boolean setDebugLog = false;
private boolean setCustomerUserId = false;
private boolean setPhoneNumber = false;
private final JSONObject setAdditionalData = new JSONObject();
public static class AnonymousClass7 {
public static final int[] AFInAppEventParameterName;
public static final int[] AFKeystoreWrapper;
static {
bw.d.values();
int[] iArr = new int[3];
AFKeystoreWrapper = iArr;
try {
bw.d dVar = bw.d.FINISHED;
iArr[2] = 1;
} catch (NoSuchFieldError unused) {
}
try {
int[] iArr2 = AFKeystoreWrapper;
bw.d dVar2 = bw.d.STARTED;
iArr2[1] = 2;
} catch (NoSuchFieldError unused2) {
}
AppsFlyerProperties.EmailsCryptType.values();
int[] iArr3 = new int[2];
AFInAppEventParameterName = iArr3;
try {
AppsFlyerProperties.EmailsCryptType emailsCryptType = AppsFlyerProperties.EmailsCryptType.SHA256;
iArr3[1] = 1;
} catch (NoSuchFieldError unused3) {
}
try {
int[] iArr4 = AFInAppEventParameterName;
AppsFlyerProperties.EmailsCryptType emailsCryptType2 = AppsFlyerProperties.EmailsCryptType.NONE;
iArr4[0] = 2;
} catch (NoSuchFieldError unused4) {
}
}
}
public class a implements Runnable {
private final h AFInAppEventType;
public a(af afVar, h hVar, byte b) {
this(hVar);
}
@Override
public final void run() {
af.AFInAppEventParameterName(af.this, this.AFInAppEventType);
}
private a(h hVar) {
this.AFInAppEventType = hVar;
}
}
public class b implements Runnable {
private final Application AFKeystoreWrapper;
public b(Context context) {
this.AFKeystoreWrapper = (Application) context.getApplicationContext();
}
@Override
public final void run() {
if (af.this.AppsFlyerConversionListener) {
return;
}
af.this.getLevel = System.currentTimeMillis();
af.this.AppsFlyerConversionListener = true;
try {
try {
String valueOf = af.valueOf(AppsFlyerProperties.AF_KEY);
ag.AFInAppEventType();
for (i iVar : ag.values(this.AFKeystoreWrapper)) {
StringBuilder sb = new StringBuilder("resending request: ");
sb.append(iVar.AFInAppEventType);
AFLogger.AFInAppEventParameterName(sb.toString());
try {
long currentTimeMillis = System.currentTimeMillis();
long parseLong = Long.parseLong(iVar.valueOf, 10);
af afVar = af.this;
be beVar = new be();
StringBuilder sb2 = new StringBuilder();
sb2.append(iVar.AFInAppEventType);
sb2.append("&isCachedRequest=true&timeincache=");
sb2.append((currentTimeMillis - parseLong) / 1000);
h values = beVar.values(sb2.toString());
values.getLevel = iVar.values();
values.AFLogger$LogLevel = valueOf;
Application application = this.AFKeystoreWrapper;
if (application != null) {
values.valueOf = (Application) application.getApplicationContext();
}
values.init = iVar.valueOf;
values.onInstallConversionDataLoadedNative = false;
af.AFKeystoreWrapper(afVar, values);
} catch (Exception e) {
AFLogger.values("Failed to resend cached request", e);
}
}
} catch (Throwable th) {
af.this.AppsFlyerConversionListener = false;
throw th;
}
} catch (Exception e2) {
AFLogger.values("failed to check cache. ", e2);
}
af.this.AppsFlyerConversionListener = false;
af.this.AppsFlyerLib.shutdown();
af.init(af.this);
}
}
public class c implements Runnable {
private final h values;
public c(af afVar, h hVar, byte b) {
this(hVar);
}
@Override
public final void run() {
IOException iOException;
AppsFlyerRequestListener appsFlyerRequestListener;
Throwable th;
OutputStreamWriter outputStreamWriter;
String str;
Map<String, Object> valueOf = this.values.valueOf();
boolean AFInAppEventType = this.values.AFInAppEventType();
h hVar = this.values;
String str2 = hVar.onInstallConversionFailureNative;
int i = hVar.onDeepLinkingNative;
Application application = hVar.valueOf;
if (af.this.isStopped()) {
AppsFlyerRequestListener appsFlyerRequestListener2 = this.values.values;
if (appsFlyerRequestListener2 != null) {
appsFlyerRequestListener2.onError(RequestError.STOP_TRACKING, at.AFInAppEventType);
return;
}
return;
}
byte[] bArr = new byte[0];
if (AFInAppEventType && i <= 2) {
ArrayList arrayList = new ArrayList();
if (af.this.onAttributionFailureNative != null) {
for (bw bwVar : af.this.onAttributionFailureNative) {
boolean z = bwVar instanceof bq;
int i2 = AnonymousClass7.AFKeystoreWrapper[bwVar.AFInAppEventType.ordinal()];
if (i2 == 1) {
if (z) {
valueOf.put("rfr", ((bq) bwVar).values);
af.AFInAppEventType(application).edit().putBoolean(AppsFlyerProperties.NEW_REFERRER_SENT, true).apply();
}
arrayList.add(bwVar.AFKeystoreWrapper);
} else if (i2 == 2 && i == 2 && !z) {
HashMap hashMap = new HashMap();
hashMap.put(com.huawei.openalliance.ad.constant.ao.ao, bwVar.valueOf);
hashMap.put("response", "TIMEOUT");
hashMap.putAll(new bs());
arrayList.add(hashMap);
}
}
}
if (!arrayList.isEmpty()) {
valueOf.put("referrers", arrayList);
}
if (af.this.waitForCustomerUserId != null) {
valueOf.put("fb_ddl", af.this.waitForCustomerUserId);
}
}
if (!(this.values instanceof bf)) {
valueOf.putAll(new d.a(valueOf, application));
valueOf.putAll(af.this.valueOf());
}
?? r3 = 0;
r3 = 0;
r3 = 0;
r3 = 0;
r3 = 0;
try {
try {
h hVar2 = this.values;
if (hVar2 instanceof bf) {
str = (String) valueOf.get("af_key");
} else {
str = (String) valueOf.get("appsflyerKey");
}
hVar2.AFLogger$LogLevel = str;
synchronized (valueOf) {
try {
try {
byte[] bArr2 = (byte[]) ((Class) com.appsflyer.internal.b.values((TypedValue.complexToFraction(0, 0.0f, 0.0f) > 0.0f ? 1 : (TypedValue.complexToFraction(0, 0.0f, 0.0f) == 0.0f ? 0 : -1)) + 48, (char) (Process.myTid() >> 22), (ViewConfiguration.getScrollBarSize() >> 8) + 24)).getDeclaredMethod("AFInAppEventType", h.class).invoke(null, this.values);
try {
try {
af afVar = af.this;
h hVar3 = this.values;
hVar3.getLevel = bArr2;
af.AFKeystoreWrapper(afVar, hVar3);
return;
} catch (IOException e) {
iOException = e;
bArr = bArr2;
AFLogger.values("Exception while sending request to server. ", iOException);
if (bArr != null && application != null && !str2.contains("&isCachedRequest=true&timeincache=")) {
ag.AFInAppEventType();
i iVar = new i(str2, bArr, "6.3.0");
try {
try {
try {
File valueOf2 = ag.valueOf(application);
if (!valueOf2.exists()) {
valueOf2.mkdir();
} else {
File[] listFiles = valueOf2.listFiles();
if (listFiles != null && listFiles.length > 40) {
AFLogger.AFInAppEventParameterName("reached cache limit, not caching request");
} else {
AFLogger.AFInAppEventParameterName("caching request...");
File file = new File(ag.valueOf(application), Long.toString(System.currentTimeMillis()));
file.createNewFile();
OutputStreamWriter outputStreamWriter2 = new OutputStreamWriter(new FileOutputStream(file.getPath(), true));
try {
outputStreamWriter2.write("version=");
outputStreamWriter2.write(iVar.AFInAppEventParameterName);
outputStreamWriter2.write(10);
outputStreamWriter2.write("url=");
outputStreamWriter2.write(iVar.AFInAppEventType);
outputStreamWriter2.write(10);
r3 = "data=";
outputStreamWriter2.write("data=");
outputStreamWriter2.write(Base64.encodeToString(iVar.values(), 2));
outputStreamWriter2.write(10);
outputStreamWriter2.flush();
outputStreamWriter2.close();
} catch (Exception e2) {
e = e2;
r3 = outputStreamWriter2;
AFLogger.values("Could not cache request", e);
if (r3 != 0) {
r3.close();
}
AFLogger.values(iOException.getMessage(), iOException);
appsFlyerRequestListener = this.values.values;
if (appsFlyerRequestListener != null) {
}
af afVar2 = af.this;
h hVar4 = this.values;
ay.AFKeystoreWrapper(afVar2, hVar4, hVar4.AFLogger$LogLevel, application, af.AFInAppEventType(application), null, iOException);
return;
} catch (Throwable th2) {
th = th2;
outputStreamWriter = outputStreamWriter2;
if (outputStreamWriter != null) {
try {
outputStreamWriter.close();
throw th;
} catch (IOException e3) {
AFLogger.AFInAppEventType(e3);
throw th;
}
}
throw th;
}
}
}
} catch (IOException e4) {
AFLogger.AFInAppEventType(e4);
}
} catch (Exception e5) {
e = e5;
}
AFLogger.values(iOException.getMessage(), iOException);
} catch (Throwable th3) {
th = th3;
outputStreamWriter = r3;
}
}
appsFlyerRequestListener = this.values.values;
if (appsFlyerRequestListener != null) {
appsFlyerRequestListener.onError(RequestError.NETWORK_FAILURE, iOException.getMessage());
}
af afVar22 = af.this;
h hVar42 = this.values;
ay.AFKeystoreWrapper(afVar22, hVar42, hVar42.AFLogger$LogLevel, application, af.AFInAppEventType(application), null, iOException);
return;
}
} catch (Throwable th4) {
th = th4;
bArr = bArr2;
}
} catch (Throwable th5) {
Throwable cause = th5.getCause();
if (cause == null) {
throw th5;
}
throw cause;
}
} catch (Throwable th6) {
th = th6;
}
}
throw th;
} catch (IOException e6) {
iOException = e6;
}
} catch (Throwable th7) {
AFLogger.AFInAppEventParameterName(th7.getMessage(), th7);
AppsFlyerRequestListener appsFlyerRequestListener3 = this.values.values;
if (appsFlyerRequestListener3 != null) {
appsFlyerRequestListener3.onError(RequestError.NETWORK_FAILURE, th7.getMessage());
}
}
}
private c(h hVar) {
this.values = hVar;
}
}
static {
StringBuilder sb = new StringBuilder();
sb.append(AFInAppEventParameterName);
sb.append("/androidevent?buildnumber=6.3.0&app_id=");
AFInAppEventType = sb.toString();
StringBuilder sb2 = new StringBuilder("https://%sadrevenue.%s/api/v");
sb2.append(AFInAppEventParameterName);
sb2.append("/android?buildnumber=6.3.0&app_id=");
onInstallConversionDataLoadedNative = sb2.toString();
StringBuilder sb3 = new StringBuilder();
sb3.append(AFInAppEventParameterName);
sb3.append("/androidevent?app_id=");
String obj = sb3.toString();
onDeepLinkingNative = obj;
StringBuilder sb4 = new StringBuilder("https://%sconversions.%s/api/v");
sb4.append(obj);
onInstallConversionFailureNative = sb4.toString();
StringBuilder sb5 = new StringBuilder("https://%slaunches.%s/api/v");
sb5.append(obj);
onConversionDataSuccess = sb5.toString();
StringBuilder sb6 = new StringBuilder("https://%sinapps.%s/api/v");
sb6.append(obj);
onAppOpenAttribution = sb6.toString();
StringBuilder sb7 = new StringBuilder("https://%sattr.%s/api/v");
sb7.append(obj);
onConversionDataFail = sb7.toString();
valueOf = null;
AFKeystoreWrapper = null;
onAttributionFailure = new af();
}
@VisibleForTesting
public af() {
AFVersionDeclaration.init();
}
public static ScheduledExecutorService init(af afVar) {
afVar.AppsFlyerLib = null;
return null;
}
@Override
public final void addPushNotificationDeepLinkPath(String... strArr) {
List<String> asList = Arrays.asList(strArr);
List<List<String>> list = f.AFInAppEventParameterName().AppsFlyer2dXConversionCallback;
if (list.contains(asList)) {
return;
}
list.add(asList);
}
@Override
public final void anonymizeUser(boolean z) {
am.AFKeystoreWrapper().valueOf("public_api_call", "anonymizeUser", String.valueOf(z));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.DEVICE_TRACKING_DISABLED, z);
}
@Override
public final void appendParametersToDeepLinkingURL(String str, Map<String, String> map) {
f AFInAppEventParameterName2 = f.AFInAppEventParameterName();
AFInAppEventParameterName2.getLevel = str;
AFInAppEventParameterName2.AFVersionDeclaration = map;
}
@Override
public final void enableFacebookDeferredApplinks(boolean z) {
this.setCustomerUserId = z;
}
@Override
public final AppsFlyerLib enableLocationCollection(boolean z) {
this.getSdkVersion = z;
return this;
}
@Override
public final String getAppsFlyerUID(Context context) {
am.AFKeystoreWrapper().valueOf("public_api_call", "getAppsFlyerUID", new String[0]);
return ak.AFKeystoreWrapper(new WeakReference(context));
}
@Override
public final String getAttributionId(Context context) {
try {
return new ae(context).AFKeystoreWrapper();
} catch (Throwable th) {
AFLogger.values("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 : "";
}
@Override
public final String getOutOfStore(Context context) {
String string = AppsFlyerProperties.getInstance().getString("api_store_value");
if (string != null) {
return string;
}
String values2 = context == null ? null : values("AF_STORE", context.getPackageManager(), context.getPackageName());
if (values2 != null) {
return values2;
}
AFLogger.AFInAppEventParameterName("No out-of-store value set");
return null;
}
@Override
public final String getSdkVersion() {
am.AFKeystoreWrapper().valueOf("public_api_call", "getSdkVersion", new String[0]);
StringBuilder sb = new StringBuilder("version: 6.3.0 (build ");
sb.append(values);
sb.append(")");
return sb.toString();
}
@Override
public final boolean isPreInstalledApp(Context context) {
try {
} catch (PackageManager.NameNotFoundException e) {
AFLogger.values("Could not check if app is pre installed", e);
}
return (context.getPackageManager().getApplicationInfo(context.getPackageName(), 0).flags & 1) != 0;
}
@Override
public final boolean isStopped() {
return this.setDebugLog;
}
@Override
public final void logEvent(@NonNull Context context, String str, Map<String, Object> map, AppsFlyerRequestListener appsFlyerRequestListener) {
bl blVar = new bl();
if (context != null) {
blVar.valueOf = (Application) context.getApplicationContext();
}
blVar.AFVersionDeclaration = str;
blVar.AFKeystoreWrapper = map == null ? null : new HashMap(map);
blVar.values = appsFlyerRequestListener;
am AFKeystoreWrapper2 = am.AFKeystoreWrapper();
String[] strArr = new String[2];
strArr[0] = str;
Map map2 = blVar.AFKeystoreWrapper;
if (map2 == null) {
map2 = new HashMap();
}
strArr[1] = new JSONObject(map2).toString();
AFKeystoreWrapper2.valueOf("public_api_call", "logEvent", strArr);
if (str != null) {
z.valueOf(context).valueOf();
}
AFKeystoreWrapper(blVar, context instanceof Activity ? (Activity) context : null);
}
@Override
public final void logLocation(Context context, double d, double d2) {
am.AFKeystoreWrapper().valueOf("public_api_call", "logLocation", String.valueOf(d), String.valueOf(d2));
HashMap hashMap = new HashMap();
hashMap.put(AFInAppEventParameterName.LONGTITUDE, Double.toString(d2));
hashMap.put(AFInAppEventParameterName.LATITUDE, Double.toString(d));
values(context, AFInAppEventType.LOCATION_COORDINATES, hashMap);
}
@Override
public final void logSession(Context context) {
am.AFKeystoreWrapper().valueOf("public_api_call", "logSession", new String[0]);
am.AFKeystoreWrapper().AFInAppEventParameterName = false;
values(context, (String) null, (Map<String, Object>) null);
}
@Override
public final void onPause(Context context) {
ah.e eVar = ah.AFInAppEventType;
if (eVar != null) {
eVar.valueOf(context);
}
}
@Override
public final void performOnAppAttribution(@NonNull Context context, @NonNull URI uri) {
if (uri == null || uri.toString().isEmpty()) {
StringBuilder sb = new StringBuilder("Link is \"");
sb.append(uri);
sb.append("\"");
as.AFInAppEventType(sb.toString());
return;
}
if (context == null) {
StringBuilder sb2 = new StringBuilder("Context is \"");
sb2.append(context);
sb2.append("\"");
as.AFInAppEventType(sb2.toString());
return;
}
f.AFInAppEventParameterName().AFInAppEventType(context, new HashMap(), Uri.parse(uri.toString()));
}
@Override
public final void registerConversionListener(Context context, AppsFlyerConversionListener appsFlyerConversionListener) {
am.AFKeystoreWrapper().valueOf("public_api_call", "registerConversionListener", new String[0]);
if (appsFlyerConversionListener != null) {
AFKeystoreWrapper = appsFlyerConversionListener;
}
}
@Override
public final void registerValidatorListener(Context context, AppsFlyerInAppPurchaseValidatorListener appsFlyerInAppPurchaseValidatorListener) {
am.AFKeystoreWrapper().valueOf("public_api_call", "registerValidatorListener", new String[0]);
AFLogger.AFInAppEventType("registerValidatorListener called");
if (appsFlyerInAppPurchaseValidatorListener == null) {
AFLogger.AFInAppEventType("registerValidatorListener null listener");
} else {
valueOf = appsFlyerInAppPurchaseValidatorListener;
}
}
@Override
public final void sendAdRevenue(Context context, Map<String, Object> map) {
bf bfVar = new bf();
if (context != null) {
bfVar.valueOf = (Application) context.getApplicationContext();
}
bfVar.AFKeystoreWrapper = map;
Application application = bfVar.valueOf;
byte b2 = 0;
StringBuilder OooOOo0 = OooO00o.OooOOo0(String.format(onInstallConversionDataLoadedNative, AppsFlyerLib.getInstance().getHostPrefix(), onAttributionFailure.getHostName()));
OooOOo0.append(application.getPackageName());
String obj = OooOOo0.toString();
SharedPreferences AFInAppEventType2 = AFInAppEventType(application);
int AFInAppEventParameterName2 = AFInAppEventParameterName(AFInAppEventType2, "appsFlyerCount", false);
int AFInAppEventParameterName3 = AFInAppEventParameterName(AFInAppEventType2, "appsFlyerAdRevenueCount", true);
HashMap hashMap = new HashMap();
hashMap.put("ad_network", bfVar.AFKeystoreWrapper);
hashMap.put("adrevenue_counter", Integer.valueOf(AFInAppEventParameterName3));
String string = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
hashMap.put("af_key", string);
hashMap.put("launch_counter", Integer.valueOf(AFInAppEventParameterName2));
hashMap.put("af_timestamp", Long.toString(new Date().getTime()));
hashMap.put(CommonConstant.KEY_UID, ak.AFKeystoreWrapper(new WeakReference(application)));
String string2 = AppsFlyerProperties.getInstance().getString("advertiserId");
hashMap.put("advertiserIdEnabled", AppsFlyerProperties.getInstance().getString("advertiserIdEnabled"));
if (string2 != null) {
hashMap.put("advertiserId", string2);
}
hashMap.put(EventType.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 j = packageInfo.firstInstallTime;
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
hashMap.put("install_date", simpleDateFormat.format(new Date(j)));
String string3 = AFInAppEventType2.getString("appsFlyerFirstInstall", null);
if (string3 == null) {
string3 = values(simpleDateFormat, application);
}
hashMap.put("first_launch_date", string3);
} catch (Throwable th) {
AFLogger.values("AdRevenue - Exception while collecting app version data ", th);
}
h AFKeystoreWrapper2 = bfVar.values(obj).AFKeystoreWrapper(hashMap);
AFKeystoreWrapper2.onDeepLinkingNative = AFInAppEventParameterName2;
AFKeystoreWrapper2.AFLogger$LogLevel = string;
c cVar = new c(this, AFKeystoreWrapper2, b2);
if (n.valueOf == null) {
n.valueOf = new n();
}
AFInAppEventParameterName(n.valueOf.values(), cVar, 1L, TimeUnit.MILLISECONDS);
}
@Override
public final void sendPushNotificationData(@NonNull Activity activity) {
long j;
if (activity != null && activity.getIntent() != null) {
am AFKeystoreWrapper2 = am.AFKeystoreWrapper();
StringBuilder sb = new StringBuilder("activity_intent_");
sb.append(activity.getIntent().toString());
AFKeystoreWrapper2.valueOf("public_api_call", "sendPushNotificationData", activity.getLocalClassName(), sb.toString());
} else if (activity != null) {
am.AFKeystoreWrapper().valueOf("public_api_call", "sendPushNotificationData", activity.getLocalClassName(), "activity_intent_null");
} else {
am.AFKeystoreWrapper().valueOf("public_api_call", "sendPushNotificationData", "activity_null");
}
String AFKeystoreWrapper3 = AFKeystoreWrapper(activity);
this.getInstance = AFKeystoreWrapper3;
if (AFKeystoreWrapper3 != null) {
long currentTimeMillis = System.currentTimeMillis();
if (this.onPause == null) {
AFLogger.AFInAppEventParameterName("pushes: initializing pushes history..");
this.onPause = new ConcurrentHashMap();
j = currentTimeMillis;
} else {
try {
long j2 = AppsFlyerProperties.getInstance().getLong("pushPayloadMaxAging", 1800000L);
j = currentTimeMillis;
for (Long l : this.onPause.keySet()) {
try {
JSONObject jSONObject = new JSONObject(this.getInstance);
JSONObject jSONObject2 = new JSONObject(this.onPause.get(l));
if (jSONObject.opt("pid").equals(jSONObject2.opt("pid")) && jSONObject.opt("c").equals(jSONObject2.opt("c"))) {
StringBuilder sb2 = new StringBuilder("PushNotificationMeasurement: A previous payload with same PID and campaign was already acknowledged! (old: ");
sb2.append(jSONObject2);
sb2.append(", new: ");
sb2.append(jSONObject);
sb2.append(")");
AFLogger.AFInAppEventParameterName(sb2.toString());
this.getInstance = null;
return;
}
if (currentTimeMillis - l.longValue() > j2) {
this.onPause.remove(l);
}
if (l.longValue() <= j) {
j = l.longValue();
}
} catch (Throwable th) {
th = th;
StringBuilder sb3 = new StringBuilder("Error while handling push notification measurement: ");
sb3.append(th.getClass().getSimpleName());
AFLogger.values(sb3.toString(), th);
if (this.onPause.size() == AppsFlyerProperties.getInstance().getInt("pushPayloadHistorySize", 2)) {
}
this.onPause.put(Long.valueOf(currentTimeMillis), this.getInstance);
start(activity);
}
}
} catch (Throwable th2) {
th = th2;
j = currentTimeMillis;
}
}
if (this.onPause.size() == AppsFlyerProperties.getInstance().getInt("pushPayloadHistorySize", 2)) {
StringBuilder sb4 = new StringBuilder("pushes: removing oldest overflowing push (oldest push:");
sb4.append(j);
sb4.append(")");
AFLogger.AFInAppEventParameterName(sb4.toString());
this.onPause.remove(Long.valueOf(j));
}
this.onPause.put(Long.valueOf(currentTimeMillis), this.getInstance);
start(activity);
}
}
@Override
public final void setAdditionalData(Map<String, Object> map) {
if (map != null) {
am.AFKeystoreWrapper().valueOf("public_api_call", "setAdditionalData", map.toString());
AppsFlyerProperties.getInstance().setCustomData(new JSONObject(map).toString());
}
}
@Override
public final void setAndroidIdData(String str) {
am.AFKeystoreWrapper().valueOf("public_api_call", "setAndroidIdData", str);
this.AFVersionDeclaration = str;
}
@Override
public final void setAppId(String str) {
am.AFKeystoreWrapper().valueOf("public_api_call", "setAppId", str);
AppsFlyerProperties.getInstance().set("appid", str);
}
@Override
public final void setAppInviteOneLink(String str) {
am.AFKeystoreWrapper().valueOf("public_api_call", "setAppInviteOneLink", str);
AFLogger.AFInAppEventParameterName("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 z) {
am.AFKeystoreWrapper().valueOf("public_api_call", "setCollectAndroidID", String.valueOf(z));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.COLLECT_ANDROID_ID, Boolean.toString(z));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.COLLECT_ANDROID_ID_FORCE_BY_USER, Boolean.toString(z));
}
@Override
public final void setCollectIMEI(boolean z) {
am.AFKeystoreWrapper().valueOf("public_api_call", "setCollectIMEI", String.valueOf(z));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.COLLECT_IMEI, Boolean.toString(z));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.COLLECT_IMEI_FORCE_BY_USER, Boolean.toString(z));
}
@Override
public final void setCollectOaid(boolean z) {
am.AFKeystoreWrapper().valueOf("public_api_call", "setCollectOaid", String.valueOf(z));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.COLLECT_OAID, Boolean.toString(z));
}
@Override
public final void setCurrencyCode(String str) {
am.AFKeystoreWrapper().valueOf("public_api_call", "setCurrencyCode", str);
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.CURRENCY_CODE, str);
}
@Override
public final void setCustomerIdAndLogSession(String str, @NonNull Context context) {
if (context != null) {
if (AFInAppEventType()) {
setCustomerUserId(str);
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.AF_WAITFOR_CUSTOMERID, false);
StringBuilder sb = new StringBuilder("CustomerUserId set: ");
sb.append(str);
sb.append(" - Initializing AppsFlyer Tacking");
AFLogger.AFInAppEventParameterName(sb.toString(), true);
String referrer = AppsFlyerProperties.getInstance().getReferrer(context);
String string = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
if (referrer == null) {
referrer = "";
}
if (context instanceof Activity) {
((Activity) context).getIntent();
}
bi biVar = new bi();
biVar.valueOf = (Application) context.getApplicationContext();
biVar.AFVersionDeclaration = null;
biVar.AFLogger$LogLevel = string;
biVar.AFKeystoreWrapper = null;
biVar.AppsFlyer2dXConversionCallback = referrer;
biVar.AFInAppEventParameterName = null;
values(biVar);
return;
}
setCustomerUserId(str);
AFLogger.AFInAppEventParameterName("waitForCustomerUserId is false; setting CustomerUserID: ".concat(String.valueOf(str)), true);
}
}
@Override
public final void setCustomerUserId(String str) {
am.AFKeystoreWrapper().valueOf("public_api_call", "setCustomerUserId", str);
AFLogger.AFInAppEventParameterName("setCustomerUserId = ".concat(String.valueOf(str)));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.APP_USER_ID, str);
}
@Override
public final void setDebugLog(boolean z) {
setLogLevel(z ? AFLogger.LogLevel.DEBUG : AFLogger.LogLevel.NONE);
}
@Override
public final void setExtension(String str) {
am.AFKeystoreWrapper().valueOf("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.AFVersionDeclaration("hostName cannot be null or empty");
}
}
@Override
public final void setImeiData(String str) {
am.AFKeystoreWrapper().valueOf("public_api_call", "setImeiData", str);
this.AppsFlyer2dXConversionCallback = str;
}
@Override
public final void setIsUpdate(boolean z) {
am.AFKeystoreWrapper().valueOf("public_api_call", "setIsUpdate", String.valueOf(z));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.IS_UPDATE, z);
}
@Override
public final void setLogLevel(@NonNull AFLogger.LogLevel logLevel) {
am.AFKeystoreWrapper().valueOf("public_api_call", "log", String.valueOf(logLevel.getLevel() > AFLogger.LogLevel.NONE.getLevel()));
AppsFlyerProperties.getInstance().set("logLevel", logLevel.getLevel());
}
@Override
public final void setMinTimeBetweenSessions(int i) {
this.AppsFlyerInAppPurchaseValidatorListener = TimeUnit.SECONDS.toMillis(i);
}
@Override
public final void setOaidData(String str) {
am.AFKeystoreWrapper().valueOf("public_api_call", "setOaidData", str);
ab.AFInAppEventType = str;
}
@Override
public final void setOneLinkCustomDomain(String... strArr) {
AFLogger.AFInAppEventType(String.format("setOneLinkCustomDomain %s", Arrays.toString(strArr)));
f.AFLogger$LogLevel = strArr;
}
@Override
public final void setOutOfStore(String str) {
if (str != null) {
String lowerCase = str.toLowerCase();
AppsFlyerProperties.getInstance().set("api_store_value", lowerCase);
AFLogger.AFInAppEventParameterName("Store API set with value: ".concat(String.valueOf(lowerCase)), true);
return;
}
AFLogger.valueOf("Cannot set setOutOfStore with null");
}
@Override
public final void setPartnerData(@NonNull String str, Map<String, Object> map) {
if (this.setAppInviteOneLink == null) {
this.setAppInviteOneLink = new au();
}
au auVar = this.setAppInviteOneLink;
if (str != null && !str.isEmpty()) {
if (map != null && !map.isEmpty()) {
StringBuilder sb = new StringBuilder("Setting partner data for ");
sb.append(str);
sb.append(": ");
sb.append(map);
AFLogger.AFInAppEventType(sb.toString());
int length = new JSONObject(map).toString().length();
if (length > 1000) {
AFLogger.AFVersionDeclaration("Partner data 1000 characters limit exceeded");
HashMap hashMap = new HashMap();
hashMap.put(com.umeng.analytics.pro.d.O, "limit exceeded: ".concat(String.valueOf(length)));
auVar.AFInAppEventParameterName.put(str, hashMap);
return;
}
auVar.valueOf.put(str, map);
auVar.AFInAppEventParameterName.remove(str);
return;
}
AFLogger.AFVersionDeclaration(auVar.valueOf.remove(str) == null ? "Partner data is missing or `null`" : "Cleared partner data for ".concat(str));
return;
}
AFLogger.AFVersionDeclaration("Partner ID is missing or `null`");
}
@Override
public final void setPhoneNumber(String str) {
this.setCustomerIdAndLogSession = ai.valueOf(str);
}
@Override
public final void setPreinstallAttribution(String str, String str2, String str3) {
AFLogger.AFInAppEventType("setPreinstallAttribution API called");
JSONObject jSONObject = new JSONObject();
if (str != null) {
try {
jSONObject.put("pid", str);
} catch (JSONException e) {
AFLogger.values(e.getMessage(), e);
}
}
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());
} else {
AFLogger.AFVersionDeclaration("Cannot set preinstall attribution data without a media source");
}
}
@Override
public final void setResolveDeepLinkURLs(String... strArr) {
AFLogger.AFInAppEventType(String.format("setResolveDeepLinkURLs %s", Arrays.toString(strArr)));
f.AFKeystoreWrapper = strArr;
}
@Override
public final void setSharingFilter(@NonNull String... strArr) {
if (strArr == null || Arrays.equals(this.init, 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.AFVersionDeclaration("Invalid partner name :".concat(String.valueOf(str)));
} else {
arrayList.add(str);
}
}
if (arrayList.isEmpty()) {
this.init = null;
} else {
this.init = (String[]) arrayList.toArray(new String[0]);
}
}
@Override
public final void setSharingFilterForAllPartners() {
this.init = new String[]{"all"};
}
@Override
public final void setUserEmails(String... strArr) {
am.AFKeystoreWrapper().valueOf("public_api_call", "setUserEmails", strArr);
setUserEmails(AppsFlyerProperties.EmailsCryptType.NONE, strArr);
}
@Override
public final void start(@NonNull Context context) {
start(context, null);
}
@Override
public final void stop(boolean z, Context context) {
this.setDebugLog = z;
ag.AFInAppEventType();
try {
File valueOf2 = ag.valueOf(context);
if (!valueOf2.exists()) {
valueOf2.mkdir();
} else {
for (File file : valueOf2.listFiles()) {
StringBuilder sb = new StringBuilder("Found cached request");
sb.append(file.getName());
AFLogger.AFInAppEventParameterName(sb.toString());
ag.values(ag.AFKeystoreWrapper(file).valueOf, context);
}
}
} catch (Exception e) {
AFLogger.values("Could not cache request", e);
}
if (this.setDebugLog) {
SharedPreferences.Editor edit = AFInAppEventType(context).edit();
edit.putBoolean("is_stop_tracking_used", true);
edit.apply();
}
}
@Override
public final void subscribeForDeepLink(@NonNull DeepLinkListener deepLinkListener) {
f.AFInAppEventParameterName().AFInAppEventType = deepLinkListener;
}
@Override
public final void unregisterConversionListener() {
am.AFKeystoreWrapper().valueOf("public_api_call", "unregisterConversionListener", new String[0]);
AFKeystoreWrapper = null;
}
@Override
public final void updateServerUninstallToken(Context context, String str) {
new az(context).AFKeystoreWrapper(str);
}
@Override
public final void validateAndLogInAppPurchase(Context context, String str, String str2, String str3, String str4, String str5, Map<String, String> map) {
am AFKeystoreWrapper2 = am.AFKeystoreWrapper();
String[] strArr = new String[6];
strArr[0] = str;
strArr[1] = str2;
strArr[2] = str3;
strArr[3] = str4;
strArr[4] = str5;
strArr[5] = map == null ? "" : map.toString();
AFKeystoreWrapper2.valueOf("public_api_call", "validateAndTrackInAppPurchase", strArr);
if (!isStopped()) {
StringBuilder sb = new StringBuilder("Validate in app called with parameters: ");
sb.append(str3);
sb.append(PPSLabelView.Code);
sb.append(str4);
sb.append(PPSLabelView.Code);
sb.append(str5);
AFLogger.AFInAppEventParameterName(sb.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 aa(applicationContext, string, str, str2, str3, str4, str5, map)).start();
return;
}
AppsFlyerInAppPurchaseValidatorListener appsFlyerInAppPurchaseValidatorListener = valueOf;
if (appsFlyerInAppPurchaseValidatorListener != null) {
appsFlyerInAppPurchaseValidatorListener.onValidateInAppFailure("Please provide purchase parameters");
}
}
@Override
public final void waitForCustomerUserId(boolean z) {
AFLogger.AFInAppEventParameterName("initAfterCustomerUserID: ".concat(String.valueOf(z)), true);
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.AF_WAITFOR_CUSTOMERID, z);
}
public static af AFInAppEventParameterName() {
return onAttributionFailure;
}
private static boolean AFVersionDeclaration(Context context) {
try {
if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context) == 0) {
return true;
}
} catch (Throwable th) {
AFLogger.values("WARNING: Google play services is unavailable. ", th);
}
try {
context.getPackageManager().getPackageInfo("com.google.android.gms", 0);
return true;
} catch (PackageManager.NameNotFoundException e) {
AFLogger.values("WARNING: Google Play Services is unavailable. ", e);
return false;
}
}
private boolean AppsFlyer2dXConversionCallback() {
Map<String, Object> map = this.getOutOfStore;
return (map == null || map.isEmpty()) ? false : true;
}
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 e) {
AFLogger.values("Failed collecting ivc data", e);
}
} 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 e2) {
AFLogger.values("Failed collecting ivc data", e2);
}
}
}
return false;
}
private static void valueOf(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 i = 0; i < jSONArray.length(); i++) {
arrayList.add(Long.valueOf(jSONArray.getLong(i)));
}
} 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 i2 = 0;
while (i2 < jSONArray2.length()) {
if (jSONArray2.getLong(i2) != ((Long) arrayList.get(0)).longValue() && jSONArray2.getLong(i2) != ((Long) arrayList.get(1)).longValue() && jSONArray2.getLong(i2) != ((Long) arrayList.get(arrayList.size() - 1)).longValue()) {
i2++;
str = next;
}
}
} catch (JSONException unused2) {
}
}
}
if (str != null) {
jSONObject.remove(str);
}
}
public final void AFInAppEventType(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.AFVersionDeclaration("Cannot set preinstall attribution data without a media source");
}
} catch (JSONException e) {
AFLogger.values("Error parsing JSON for preinstall", e);
}
}
AFLogger.AFInAppEventParameterName("****** onReceive called *******");
AppsFlyerProperties.getInstance();
String stringExtra2 = intent.getStringExtra("referrer");
AFLogger.AFInAppEventParameterName("Play store referrer: ".concat(String.valueOf(stringExtra2)));
if (stringExtra2 != null) {
SharedPreferences.Editor edit = AFInAppEventType(context).edit();
edit.putString("referrer", stringExtra2);
edit.apply();
AppsFlyerProperties appsFlyerProperties = AppsFlyerProperties.getInstance();
appsFlyerProperties.set("AF_REFERRER", stringExtra2);
appsFlyerProperties.AFInAppEventType = stringExtra2;
if (AppsFlyerProperties.getInstance().AFKeystoreWrapper()) {
AFLogger.AFInAppEventParameterName("onReceive: isLaunchCalled");
bd bdVar = new bd();
if (context != null) {
bdVar.valueOf = (Application) context.getApplicationContext();
}
bdVar.AppsFlyer2dXConversionCallback = stringExtra2;
if (stringExtra2.length() <= 5 || !valueOf(bdVar, AFInAppEventType(context))) {
return;
}
if (n.valueOf == null) {
n.valueOf = new n();
}
AFInAppEventParameterName(n.valueOf.values(), new a(this, bdVar, (byte) 0), 5L, TimeUnit.MILLISECONDS);
}
}
}
@Override
public final AppsFlyerLib init(@NonNull String str, AppsFlyerConversionListener appsFlyerConversionListener, @NonNull Context context) {
if (this.setAndroidIdData) {
return this;
}
this.setAndroidIdData = true;
if (context != null) {
if (this.AFLogger$LogLevel == null) {
this.AFLogger$LogLevel = new aw(context);
}
aw awVar = this.AFLogger$LogLevel;
if (awVar.AFKeystoreWrapper()) {
awVar.AFInAppEventType.edit().putLong("init_ts", System.currentTimeMillis()).apply();
}
this.setImeiData = (Application) context.getApplicationContext();
final bq bqVar = new bq(new Runnable() {
@Override
public final void run() {
if (n.valueOf == null) {
n.valueOf = new n();
}
af.AFInAppEventParameterName(n.valueOf.values(), new Runnable() {
@Override
public final void run() {
try {
bg bgVar = new bg();
Application application = af.this.setImeiData;
if (application != null) {
bgVar.valueOf = (Application) application.getApplicationContext();
}
af afVar = af.this;
if (afVar.valueOf(bgVar, af.AFInAppEventType(afVar.setImeiData))) {
af.AFInAppEventParameterName(af.this, bgVar);
}
} catch (Throwable th) {
AFLogger.values(th.getMessage(), th);
}
}
}, 0L, TimeUnit.MILLISECONDS);
}
});
Runnable runnable = new Runnable() {
@Override
public final void run() {
SharedPreferences AFInAppEventType2 = af.AFInAppEventType(af.this.setImeiData);
int AFInAppEventParameterName2 = af.AFInAppEventParameterName(AFInAppEventType2, "appsFlyerCount", false);
boolean z = AFInAppEventType2.getBoolean(AppsFlyerProperties.NEW_REFERRER_SENT, false);
boolean z2 = bqVar.AFInAppEventType == bw.d.NOT_STARTED;
if (AFInAppEventParameterName2 == 1) {
if (z2 || z) {
af afVar = af.this;
bg bgVar = new bg();
Application application = af.this.setImeiData;
if (application != null) {
bgVar.valueOf = (Application) application.getApplicationContext();
}
af.AFInAppEventParameterName(afVar, bgVar);
}
}
}
};
bw[] bwVarArr = {bqVar, new br(runnable), new bu(runnable)};
this.onAttributionFailureNative = bwVarArr;
for (bw bwVar : bwVarArr) {
bwVar.AFInAppEventType(this.setImeiData);
}
this.setPhoneNumber = valueOf(context);
ax.AFInAppEventParameterName = this.setImeiData;
} else {
AFLogger.AFVersionDeclaration("context is null, Google Install Referrer will be not initialized");
}
am AFKeystoreWrapper2 = am.AFKeystoreWrapper();
String[] strArr = new String[2];
strArr[0] = str;
strArr[1] = appsFlyerConversionListener == null ? "null" : "conversionDataListener";
AFKeystoreWrapper2.valueOf("public_api_call", "init", strArr);
AFLogger.values(String.format("Initializing AppsFlyer SDK: (v%s.%s)", "6.3.0", values));
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.AF_KEY, str);
an.valueOf(str);
AFKeystoreWrapper = appsFlyerConversionListener;
return this;
}
@Override
public final void start(@NonNull Context context, String str) {
start(context, str, null);
}
@Override
public final void subscribeForDeepLink(@NonNull DeepLinkListener deepLinkListener, long j) {
ar.onAppOpenAttributionNative = j;
subscribeForDeepLink(deepLinkListener);
}
public static void AFInAppEventParameterName(Context context, String str, String str2) {
SharedPreferences.Editor edit = AFInAppEventType(context).edit();
edit.putString(str, str2);
edit.apply();
}
private static float AppsFlyer2dXConversionCallback(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.values(th.getMessage(), th);
return 1.0f;
}
}
private static boolean values(String str, boolean z) {
return AppsFlyerProperties.getInstance().getBoolean(str, z);
}
@Override
public final void start(@NonNull Context context, final String str, final AppsFlyerRequestListener appsFlyerRequestListener) {
if (ah.AFInAppEventType != null) {
return;
}
if (!this.setAndroidIdData) {
AFLogger.AFVersionDeclaration("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, at.AFInAppEventParameterName);
return;
}
return;
}
}
this.setImeiData = (Application) context.getApplicationContext();
am.AFKeystoreWrapper().valueOf("public_api_call", "start", str);
String str2 = values;
AFLogger.AFInAppEventParameterName(String.format("Starting AppsFlyer: (v%s.%s)", "6.3.0", str2));
StringBuilder sb = new StringBuilder("Build Number: ");
sb.append(str2);
AFLogger.AFInAppEventParameterName(sb.toString());
AppsFlyerProperties.getInstance().loadProperties(this.setImeiData.getApplicationContext());
if (!TextUtils.isEmpty(str)) {
AppsFlyerProperties.getInstance().set(AppsFlyerProperties.AF_KEY, str);
an.valueOf(str);
} else if (TextUtils.isEmpty(AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY))) {
AFLogger.AFVersionDeclaration("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, at.AFInAppEventParameterName);
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.AFInAppEventParameterName("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 e) {
StringBuilder sb2 = new StringBuilder("checkBackupRules Exception: ");
sb2.append(e.toString());
AFLogger.AFKeystoreWrapper(sb2.toString());
}
if (this.setCustomerUserId) {
Context applicationContext = this.setImeiData.getApplicationContext();
this.waitForCustomerUserId = new HashMap();
final long currentTimeMillis = System.currentTimeMillis();
m.d dVar = new m.d() {
@Override
public final void AFInAppEventType(String str3) {
af.this.waitForCustomerUserId.put(com.umeng.analytics.pro.d.O, str3);
}
@Override
public final void values(String str3, String str4, String str5) {
if (str3 != null) {
AFLogger.AFInAppEventParameterName("Facebook Deferred AppLink data received: ".concat(str3));
af.this.waitForCustomerUserId.put("link", str3);
if (str4 != null) {
af.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);
af.this.waitForCustomerUserId.put("extras", hashMap);
}
} else {
af.this.waitForCustomerUserId.put("link", "");
}
af.this.waitForCustomerUserId.put("ttr", String.valueOf(System.currentTimeMillis() - currentTimeMillis));
}
};
try {
Class.forName("com.facebook.FacebookSdk").getMethod("sdkInitialize", Context.class).invoke(null, applicationContext);
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() {
private d AFInAppEventParameterName;
private Class values;
public AnonymousClass4(Class cls3, d dVar2) {
r1 = cls3;
r2 = dVar2;
}
@Override
public final Object invoke(Object obj, Method method2, Object[] objArr) {
String str3;
String str4;
String str5;
Bundle bundle;
if (method2.getName().equals("onDeferredAppLinkDataFetched")) {
if (objArr[0] != null) {
Bundle bundle2 = (Bundle) Bundle.class.cast(r1.getMethod("getArgumentBundle", new Class[0]).invoke(r1.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;
}
d dVar2 = r2;
if (dVar2 != null) {
dVar2.values(str4, str5, str3);
}
} else {
d dVar3 = r2;
if (dVar3 != null) {
dVar3.values(null, null, null);
}
}
return null;
}
d dVar4 = r2;
if (dVar4 != null) {
dVar4.AFInAppEventType("onDeferredAppLinkDataFetched invocation failed");
}
return null;
}
});
String string = applicationContext.getString(applicationContext.getResources().getIdentifier("facebook_app_id", "string", applicationContext.getPackageName()));
if (TextUtils.isEmpty(string)) {
dVar2.AFInAppEventType("Facebook app id not defined in resources");
} else {
method.invoke(null, applicationContext, string, newProxyInstance);
}
} catch (ClassNotFoundException e2) {
dVar2.AFInAppEventType(e2.toString());
} catch (IllegalAccessException e3) {
dVar2.AFInAppEventType(e3.toString());
} catch (NoSuchMethodException e4) {
dVar2.AFInAppEventType(e4.toString());
} catch (InvocationTargetException e5) {
dVar2.AFInAppEventType(e5.toString());
}
}
ah.AFInAppEventType(context, new ah.e() {
@Override
public final void AFInAppEventType(Activity activity) {
af.this.onValidateInAppFailure = System.currentTimeMillis();
af afVar = af.this;
if (afVar.AFLogger$LogLevel == null) {
afVar.AFLogger$LogLevel = new aw(activity);
}
aw awVar = afVar.AFLogger$LogLevel;
if (awVar.AFKeystoreWrapper()) {
awVar.AFInAppEventType.edit().putLong("fg_ts", System.currentTimeMillis()).apply();
}
int AFInAppEventParameterName2 = af.AFInAppEventParameterName(af.AFInAppEventType(activity), "appsFlyerCount", false);
if (AFInAppEventParameterName2 == 0) {
try {
af.this.setAdditionalData.put("init_to_fg", af.this.onValidateInAppFailure - af.this.AFLogger$LogLevel.AFInAppEventType.getLong("init_ts", 0L));
} catch (JSONException unused) {
}
}
AFLogger.AFInAppEventParameterName("onBecameForeground");
if (AFInAppEventParameterName2 < 2) {
z valueOf2 = z.valueOf(activity);
valueOf2.AFInAppEventParameterName.post(valueOf2.getLevel);
valueOf2.AFInAppEventParameterName.post(valueOf2.values);
}
bi biVar = new bi();
f AFInAppEventParameterName3 = f.AFInAppEventParameterName();
Map<String, Object> valueOf3 = biVar.valueOf();
aw awVar2 = af.this.AFLogger$LogLevel;
SharedPreferences AFInAppEventType2 = af.AFInAppEventType(activity);
boolean z = AFInAppEventType2.getBoolean("ddl_sent", false);
af.AFInAppEventParameterName();
int AFInAppEventParameterName4 = af.AFInAppEventParameterName(AFInAppEventType2, "appsFlyerCount", false);
if (!AFInAppEventParameterName3.values(activity.getIntent(), activity, valueOf3) && AFInAppEventParameterName3.AFInAppEventType != null && AFInAppEventParameterName4 == 0 && !z) {
final ar arVar = new ar(activity.getApplicationContext(), awVar2);
AFLogger.AFInAppEventType("[DDL] start");
FutureTask futureTask = new FutureTask(new Callable<DeepLinkResult>() {
public AnonymousClass3() {
}
@Override
public final DeepLinkResult call() {
Application application = ar.this.valueOf;
ar.valueOf(ar.this);
ar.this.valueOf(application);
return ar.valueOf(ar.this, application);
}
});
new Thread(futureTask).start();
try {
arVar.AFInAppEventParameterName((DeepLinkResult) futureTask.get(ar.onAppOpenAttributionNative, TimeUnit.MILLISECONDS));
} catch (InterruptedException e6) {
e = e6;
AFLogger.AFInAppEventParameterName("[DDL] Error occurred", e);
arVar.AFInAppEventParameterName(new DeepLinkResult(null, !(e.getCause() instanceof IOException) ? DeepLinkResult.Error.NETWORK : DeepLinkResult.Error.UNEXPECTED));
} catch (ExecutionException e7) {
e = e7;
AFLogger.AFInAppEventParameterName("[DDL] Error occurred", e);
arVar.AFInAppEventParameterName(new DeepLinkResult(null, !(e.getCause() instanceof IOException) ? DeepLinkResult.Error.NETWORK : DeepLinkResult.Error.UNEXPECTED));
} catch (TimeoutException unused2) {
StringBuilder sb3 = new StringBuilder("[DDL] Timeout, didn't manage to find deferred deep link after ");
sb3.append(arVar.onAttributionFailureNative);
sb3.append(" attempt(s) within ");
sb3.append(ar.onAppOpenAttributionNative);
sb3.append(" milliseconds");
AFLogger.AFInAppEventType(sb3.toString());
arVar.AFInAppEventParameterName(new DeepLinkResult(null, DeepLinkResult.Error.TIMEOUT));
}
}
af afVar2 = af.this;
biVar.valueOf = (Application) activity.getApplicationContext();
biVar.AFLogger$LogLevel = str;
biVar.values = appsFlyerRequestListener;
afVar2.AFKeystoreWrapper(biVar, activity);
}
@Override
public final void valueOf(Context context2) {
AFLogger.AFInAppEventParameterName("onBecameBackground");
af.this.updateServerUninstallToken = System.currentTimeMillis();
long j = af.this.updateServerUninstallToken - af.this.onValidateInAppFailure;
if (j > 0 && j < 1000) {
j = 1000;
}
af afVar = af.this;
if (afVar.AFLogger$LogLevel == null) {
afVar.AFLogger$LogLevel = new aw(context2);
}
afVar.AFLogger$LogLevel.AFInAppEventType.edit().putLong("prev_session_dur", TimeUnit.MILLISECONDS.toSeconds(j)).apply();
AFLogger.AFInAppEventParameterName("callStatsBackground background call");
af.this.valueOf(new WeakReference<>(context2));
am AFKeystoreWrapper2 = am.AFKeystoreWrapper();
if (AFKeystoreWrapper2.AFLogger$LogLevel()) {
AFKeystoreWrapper2.AFInAppEventParameterName();
if (context2 != null) {
am.AFInAppEventParameterName(context2.getPackageName(), context2.getPackageManager());
}
AFKeystoreWrapper2.AFInAppEventType();
} else {
AFLogger.AFInAppEventType("RD status is OFF");
}
if (n.valueOf == null) {
n.valueOf = new n();
}
n nVar = n.valueOf;
try {
n.AFInAppEventParameterName(nVar.AFInAppEventParameterName);
Executor executor = nVar.AFInAppEventType;
if (executor instanceof ThreadPoolExecutor) {
n.AFInAppEventParameterName((ThreadPoolExecutor) executor);
}
} catch (Throwable th) {
AFLogger.values("failed to stop Executors", th);
}
z valueOf2 = z.valueOf(context2);
valueOf2.AFInAppEventParameterName.post(valueOf2.getLevel);
}
});
}
private static void values(Context context) {
int i;
if (ac.AFKeystoreWrapper()) {
i = 23;
AFLogger.AFKeystoreWrapper("OPPO device found");
} else {
i = 18;
}
int i2 = Build.VERSION.SDK_INT;
if (i2 >= i && !values(AppsFlyerProperties.DISABLE_KEYSTORE, true)) {
StringBuilder sb = new StringBuilder("OS SDK is=");
sb.append(i2);
sb.append("; use KeyStore");
AFLogger.AFKeystoreWrapper(sb.toString());
AFKeystoreWrapper aFKeystoreWrapper = new AFKeystoreWrapper(context);
if (!aFKeystoreWrapper.AFInAppEventParameterName()) {
aFKeystoreWrapper.AFKeystoreWrapper = ak.AFKeystoreWrapper(new WeakReference(context));
aFKeystoreWrapper.values = 0;
aFKeystoreWrapper.valueOf(aFKeystoreWrapper.AFKeystoreWrapper());
} else {
String AFKeystoreWrapper2 = aFKeystoreWrapper.AFKeystoreWrapper();
synchronized (aFKeystoreWrapper.AFInAppEventType) {
aFKeystoreWrapper.values++;
AFLogger.AFInAppEventParameterName("Deleting key with alias: ".concat(String.valueOf(AFKeystoreWrapper2)));
try {
synchronized (aFKeystoreWrapper.AFInAppEventType) {
aFKeystoreWrapper.valueOf.deleteEntry(AFKeystoreWrapper2);
}
} catch (KeyStoreException e) {
StringBuilder sb2 = new StringBuilder("Exception ");
sb2.append(e.getMessage());
sb2.append(" occurred");
AFLogger.values(sb2.toString(), e);
}
}
aFKeystoreWrapper.valueOf(aFKeystoreWrapper.AFKeystoreWrapper());
}
AppsFlyerProperties.getInstance().set("KSAppsFlyerId", aFKeystoreWrapper.valueOf());
AppsFlyerProperties.getInstance().set("KSAppsFlyerRICounter", String.valueOf(aFKeystoreWrapper.AFInAppEventType()));
return;
}
StringBuilder sb3 = new StringBuilder("OS SDK is=");
sb3.append(i2);
sb3.append("; no KeyStore usage");
AFLogger.AFKeystoreWrapper(sb3.toString());
}
@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));
am.AFKeystoreWrapper().valueOf("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 (AnonymousClass7.AFInAppEventParameterName[emailsCryptType.ordinal()] != 2) {
arrayList2.add(ai.valueOf(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 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 j = this.onDeepLinking;
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
String format = simpleDateFormat.format(new Date(j));
long j2 = this.onValidateInApp;
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
String format2 = simpleDateFormat.format(new Date(j2));
if (currentTimeMillis < this.AppsFlyerInAppPurchaseValidatorListener && !isStopped()) {
AFLogger.AFInAppEventParameterName(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.AppsFlyerInAppPurchaseValidatorListener)));
return true;
}
if (!isStopped()) {
AFLogger.AFInAppEventParameterName(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.AFInAppEventParameterName("Sending first launch for this session!");
}
return false;
}
private static String AFInAppEventParameterName(String str) {
try {
return (String) Class.forName("android.os.SystemProperties").getMethod("get", String.class).invoke(null, str);
} catch (Throwable th) {
AFLogger.values(th.getMessage(), th);
return null;
}
}
@Nullable
public final String AFInAppEventParameterName(Context context) {
String string = AppsFlyerProperties.getInstance().getString("channel");
if (string == null) {
string = context == null ? null : values("CHANNEL", context.getPackageManager(), context.getPackageName());
}
if (string == null || !string.equals("")) {
return string;
}
return null;
}
@Override
public final void logEvent(Context context, String str, Map<String, Object> map) {
logEvent(context, str, map, null);
}
public final String AFInAppEventParameterName(Context context, String str) {
SharedPreferences AFInAppEventType2 = AFInAppEventType(context);
if (AFInAppEventType2.contains("CACHED_CHANNEL")) {
return AFInAppEventType2.getString("CACHED_CHANNEL", null);
}
SharedPreferences.Editor edit = AFInAppEventType(context).edit();
edit.putString("CACHED_CHANNEL", str);
edit.apply();
return str;
}
public final void valueOf(Context context, String str) {
JSONArray jSONArray;
JSONArray jSONArray2;
JSONObject jSONObject;
AFLogger.AFInAppEventType("received a new (extra) referrer: ".concat(String.valueOf(str)));
try {
long currentTimeMillis = System.currentTimeMillis();
String string = AFInAppEventType(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) {
valueOf(jSONObject);
}
jSONObject.put(str, jSONArray2.toString());
String jSONObject3 = jSONObject.toString();
SharedPreferences.Editor edit = AFInAppEventType(context).edit();
edit.putString("extraReferrers", jSONObject3);
edit.apply();
} catch (JSONException unused) {
} catch (Throwable th) {
StringBuilder sb = new StringBuilder("Couldn't save referrer - ");
sb.append(str);
sb.append(": ");
AFLogger.values(sb.toString(), th);
}
}
public static int AFInAppEventParameterName(SharedPreferences sharedPreferences, String str, boolean z) {
int i = sharedPreferences.getInt(str, 0);
if (z) {
i++;
SharedPreferences.Editor edit = sharedPreferences.edit();
edit.putInt(str, i);
edit.apply();
}
if (am.AFKeystoreWrapper().AFLogger$LogLevel()) {
am.AFKeystoreWrapper().values(String.valueOf(i));
}
return i;
}
public static boolean AFKeystoreWrapper(@NonNull SharedPreferences sharedPreferences) {
return Boolean.parseBoolean(sharedPreferences.getString("sentSuccessfully", null));
}
private static String AFKeystoreWrapper(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.AFInAppEventParameterName("Push Notification received af payload = ".concat(str));
extras.remove("af");
activity.setIntent(intent.putExtras(extras));
}
} catch (Throwable th) {
AFLogger.values(th.getMessage(), th);
}
}
return str;
}
private static boolean init(Context context) {
return (AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.COLLECT_ANDROID_ID_FORCE_BY_USER, false) || AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.COLLECT_IMEI_FORCE_BY_USER, false)) || !AFVersionDeclaration(context);
}
public static void AFInAppEventParameterName(ScheduledExecutorService scheduledExecutorService, Runnable runnable, long j, TimeUnit timeUnit) {
if (scheduledExecutorService != null) {
try {
if (!scheduledExecutorService.isShutdown() && !scheduledExecutorService.isTerminated()) {
scheduledExecutorService.schedule(runnable, j, timeUnit);
return;
}
} catch (RejectedExecutionException e) {
AFLogger.values("scheduleJob failed with RejectedExecutionException Exception", e);
return;
} catch (Throwable th) {
AFLogger.values("scheduleJob failed with Exception", th);
return;
}
}
AFLogger.AFVersionDeclaration("scheduler is null, shut downed or terminated");
}
public static boolean AFKeystoreWrapper(Context context) {
return !AFInAppEventType(context).contains("appsFlyerCount");
}
private void values(Context context, String str, Map<String, Object> map) {
bl blVar = new bl();
if (context != null) {
blVar.valueOf = (Application) context.getApplicationContext();
}
blVar.AFVersionDeclaration = str;
blVar.AFKeystoreWrapper = map;
AFKeystoreWrapper(blVar, context instanceof Activity ? (Activity) context : null);
}
private static File AFKeystoreWrapper(String str) {
if (str == null) {
return null;
}
try {
if (str.trim().length() > 0) {
return new File(str.trim());
}
return null;
} catch (Throwable th) {
AFLogger.values(th.getMessage(), th);
return null;
}
}
public static void AFInAppEventParameterName(af afVar, h hVar) {
String format;
ScheduledExecutorService values2;
Application application = hVar.valueOf;
String str = hVar.AFVersionDeclaration;
if (application == null) {
AFLogger.AFInAppEventType("sendWithEvent - got null context. skipping event/launch.");
return;
}
SharedPreferences AFInAppEventType2 = AFInAppEventType(application);
AppsFlyerProperties.getInstance().saveProperties(AFInAppEventType2);
if (!afVar.isStopped()) {
StringBuilder sb = new StringBuilder("sendWithEvent from activity: ");
sb.append(application.getClass().getName());
AFLogger.AFInAppEventParameterName(sb.toString());
}
boolean z = true;
boolean z2 = false;
boolean z3 = str == null;
boolean z4 = hVar instanceof bd;
boolean z5 = hVar instanceof bg;
hVar.onInstallConversionDataLoadedNative = z3;
Map<String, ?> valueOf2 = afVar.valueOf(hVar);
String str2 = (String) valueOf2.get("appsflyerKey");
if (str2 != null && str2.length() != 0) {
if (!afVar.isStopped()) {
AFLogger.AFInAppEventParameterName("AppsFlyerLib.sendWithEvent");
}
int AFInAppEventParameterName2 = AFInAppEventParameterName(AFInAppEventType2, "appsFlyerCount", false);
if (z5 || z4) {
format = String.format(onConversionDataFail, AppsFlyerLib.getInstance().getHostPrefix(), onAttributionFailure.getHostName());
} else if (!z3) {
format = String.format(onAppOpenAttribution, AppsFlyerLib.getInstance().getHostPrefix(), onAttributionFailure.getHostName());
} else if (AFInAppEventParameterName2 < 2) {
format = String.format(onInstallConversionFailureNative, AppsFlyerLib.getInstance().getHostPrefix(), onAttributionFailure.getHostName());
} else {
format = String.format(onConversionDataSuccess, AppsFlyerLib.getInstance().getHostPrefix(), onAttributionFailure.getHostName());
}
StringBuilder OooOOo0 = OooO00o.OooOOo0(format);
OooOOo0.append(application.getPackageName());
String obj = OooOOo0.toString();
StringBuilder sb2 = new StringBuilder();
sb2.append(obj);
sb2.append("&buildnumber=6.3.0");
String obj2 = sb2.toString();
String AFInAppEventParameterName3 = afVar.AFInAppEventParameterName(application);
if (AFInAppEventParameterName3 != null) {
StringBuilder sb3 = new StringBuilder();
sb3.append(obj2);
sb3.append("&channel=");
sb3.append(AFInAppEventParameterName3);
obj2 = sb3.toString();
}
if (!(AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.COLLECT_ANDROID_ID_FORCE_BY_USER, false) || AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.COLLECT_IMEI_FORCE_BY_USER, false)) && valueOf2.get("advertiserId") != null) {
try {
if (TextUtils.isEmpty(afVar.AFVersionDeclaration) && valueOf2.remove("android_id") != null) {
AFLogger.AFInAppEventParameterName("validateGaidAndIMEI :: removing: android_id");
}
if (TextUtils.isEmpty(afVar.AppsFlyer2dXConversionCallback) && valueOf2.remove("imei") != null) {
AFLogger.AFInAppEventParameterName("validateGaidAndIMEI :: removing: imei");
}
} catch (Exception e) {
AFLogger.values("failed to remove IMEI or AndroidID key from params; ", e);
}
}
h AFKeystoreWrapper2 = hVar.values(obj2).AFKeystoreWrapper(valueOf2);
AFKeystoreWrapper2.onDeepLinkingNative = AFInAppEventParameterName2;
c cVar = new c(afVar, AFKeystoreWrapper2, z2 ? (byte) 1 : (byte) 0);
if (z3) {
bw[] bwVarArr = afVar.onAttributionFailureNative;
if (bwVarArr != null) {
boolean z6 = false;
for (bw bwVar : bwVarArr) {
if (bwVar.AFInAppEventType == bw.d.STARTED) {
StringBuilder sb4 = new StringBuilder("Failed to get ");
sb4.append(bwVar.valueOf);
sb4.append(" referrer, wait ...");
AFLogger.AFInAppEventType(sb4.toString());
z6 = true;
}
}
z2 = z6;
}
if (afVar.setCustomerUserId && !afVar.values()) {
AFLogger.AFInAppEventType("fetching Facebook deferred AppLink data, wait ...");
z2 = true;
}
if (!afVar.setPhoneNumber || afVar.AppsFlyer2dXConversionCallback()) {
z = z2;
}
} else {
z = false;
}
if (f.valueOf) {
AFLogger.AFKeystoreWrapper("ESP deeplink: execute launch on SerialExecutor");
if (n.valueOf == null) {
n.valueOf = new n();
}
n nVar = n.valueOf;
if (nVar.AFKeystoreWrapper == null) {
nVar.AFKeystoreWrapper = Executors.newSingleThreadScheduledExecutor(nVar.values);
}
values2 = nVar.AFKeystoreWrapper;
} else {
if (n.valueOf == null) {
n.valueOf = new n();
}
values2 = n.valueOf.values();
}
AFInAppEventParameterName(values2, cVar, z ? 500L : 0L, TimeUnit.MILLISECONDS);
return;
}
AFLogger.AFInAppEventType("Not sending data yet, waiting for dev key");
AppsFlyerRequestListener appsFlyerRequestListener = hVar.values;
if (appsFlyerRequestListener != null) {
appsFlyerRequestListener.onError(RequestError.NO_DEV_KEY, at.AFInAppEventParameterName);
}
}
public static void AFInAppEventType(Context context, String str) {
SharedPreferences.Editor edit = AFInAppEventType(context).edit();
edit.putBoolean(str, true);
edit.apply();
}
@VisibleForTesting
public final void AFKeystoreWrapper(@NonNull h hVar, @Nullable Activity activity) {
Uri values2;
Application application = hVar.valueOf;
String obj = (activity == null || (values2 = ao.values(activity)) == null) ? "" : values2.toString();
if (AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY) == null) {
AFLogger.AFVersionDeclaration("[LogEvent/Launch] AppsFlyer's SDK cannot send any event without providing DevKey.");
AppsFlyerRequestListener appsFlyerRequestListener = hVar.values;
if (appsFlyerRequestListener != null) {
appsFlyerRequestListener.onError(RequestError.NO_DEV_KEY, at.AFInAppEventParameterName);
return;
}
return;
}
String referrer = AppsFlyerProperties.getInstance().getReferrer(application);
hVar.AppsFlyer2dXConversionCallback = referrer != null ? referrer : "";
hVar.AFInAppEventParameterName = obj;
values(hVar);
}
private boolean values() {
Map<String, Object> map = this.waitForCustomerUserId;
return (map == null || map.isEmpty()) ? false : true;
}
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 ? "" : "lr" : com.umeng.analytics.pro.ak.ay : "l" : com.umeng.analytics.pro.ak.ax);
}
}
public static boolean AFInAppEventType() {
return values(AppsFlyerProperties.AF_WAITFOR_CUSTOMERID, false) && AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.APP_USER_ID) == null;
}
public static String AFInAppEventType(SimpleDateFormat simpleDateFormat, long j) {
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
return simpleDateFormat.format(new Date(j));
}
private static String values(@Nullable String str) {
if (str == null) {
return null;
}
if (!str.matches("fb\\d*?://authorize.*") || !str.contains("access_token")) {
return str;
}
int indexOf = str.indexOf(63);
String substring = indexOf == -1 ? "" : str.substring(indexOf);
if (substring.length() == 0) {
return str;
}
ArrayList arrayList = new ArrayList();
if (substring.contains(ContainerUtils.FIELD_DELIMITER)) {
arrayList = new ArrayList(Arrays.asList(substring.split(ContainerUtils.FIELD_DELIMITER)));
} else {
arrayList.add(substring);
}
StringBuilder sb = new StringBuilder();
Iterator it = arrayList.iterator();
while (it.hasNext()) {
String str2 = (String) it.next();
if (str2.contains("access_token")) {
it.remove();
} else {
if (sb.length() != 0) {
sb.append(ContainerUtils.FIELD_DELIMITER);
} else if (!str2.startsWith("?")) {
sb.append("?");
}
sb.append(str2);
}
}
return str.replace(substring, sb.toString());
}
public final void valueOf(Context context, String str, long j) {
SharedPreferences.Editor edit = AFInAppEventType(context).edit();
edit.putLong(str, j);
edit.apply();
}
public static Map<String, Object> AFInAppEventType(Map<String, Object> map) {
if (map.containsKey("meta")) {
return (Map) map.get("meta");
}
HashMap hashMap = new HashMap();
map.put("meta", hashMap);
return hashMap;
}
@NonNull
public static String AFInAppEventType(HttpURLConnection httpURLConnection) {
String obj;
InputStreamReader inputStreamReader;
StringBuilder sb = 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 z = false;
while (true) {
try {
String readLine = bufferedReader2.readLine();
if (readLine == null) {
break;
}
sb.append(z ? '\n' : "");
sb.append(readLine);
z = true;
} catch (Throwable th) {
th = th;
bufferedReader = bufferedReader2;
try {
StringBuilder sb2 = new StringBuilder("Could not read connection response from: ");
sb2.append(httpURLConnection.getURL().toString());
AFLogger.values(sb2.toString(), th);
if (bufferedReader != null) {
bufferedReader.close();
}
if (inputStreamReader != null) {
inputStreamReader.close();
}
obj = sb.toString();
new JSONObject(obj);
return obj;
} catch (Throwable th2) {
if (bufferedReader != null) {
try {
bufferedReader.close();
} catch (Throwable th3) {
AFLogger.AFInAppEventType(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.AFInAppEventType(th6);
}
obj = sb.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();
}
}
}
public static String valueOf(String str) {
return AppsFlyerProperties.getInstance().getString(str);
}
public static void AFKeystoreWrapper(Context context, Map<String, ? super String> map) {
u uVar = u.e.values;
u.a values2 = u.values(context);
map.put("network", values2.AFInAppEventType);
String str = values2.AFInAppEventParameterName;
if (str != null) {
map.put("operator", str);
}
String str2 = values2.valueOf;
if (str2 != null) {
map.put(com.umeng.analytics.pro.ak.P, str2);
}
}
private boolean valueOf(Context context) {
try {
Class.forName("com.appsflyer.lvl.AppsFlyerLVL");
final long currentTimeMillis = System.currentTimeMillis();
this.getOutOfStore = new ConcurrentHashMap();
final y.e eVar = new y.e() {
@Override
public final void AFInAppEventParameterName(@NonNull String str, @NonNull String str2) {
af.this.getOutOfStore.put("signedData", str);
af.this.getOutOfStore.put("signature", str2);
af.this.getOutOfStore.put("ttr", Long.valueOf(System.currentTimeMillis() - currentTimeMillis));
AFLogger.AFInAppEventParameterName("Successfully retrieved Google LVL data.");
}
@Override
public final void AFInAppEventType(String str, Exception exc) {
String message = exc.getMessage();
if (message == null) {
message = EnvironmentCompat.MEDIA_UNKNOWN;
}
af.this.getOutOfStore.put(com.umeng.analytics.pro.d.O, 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() {
public AnonymousClass5() {
}
@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;
e eVar2 = e.this;
if (eVar2 == null) {
AFLogger.AFInAppEventType("onLvlResult invocation succeeded, but listener is null");
} else if (str != null && str2 != null) {
eVar2.AFInAppEventParameterName(str, str2);
} else if (str2 == null) {
eVar2.AFInAppEventType("onLvlResult with error", new Exception("AFLVL Invalid signature"));
} else {
eVar2.AFInAppEventType("onLvlResult with error", new Exception("AFLVL Invalid signedData"));
}
} else if (method.getName().equals("onLvlFailure")) {
e eVar3 = e.this;
if (eVar3 != null) {
if (objArr[0] != null) {
eVar3.AFInAppEventType("onLvlFailure with exception", (Exception) objArr[0]);
} else {
eVar3.AFInAppEventType("onLvlFailure", new Exception(EnvironmentCompat.MEDIA_UNKNOWN));
}
} else {
AFLogger.AFInAppEventType("onLvlFailure: listener is null");
}
} else {
e eVar4 = e.this;
if (eVar4 != null) {
eVar4.AFInAppEventType("lvlInvocation failed", new Exception("com.appsflyer.lvl.AppsFlyerLVL$resultListener invocation failed"));
}
}
return null;
}
}));
} catch (ClassNotFoundException e) {
eVar.AFInAppEventType(e.getClass().getSimpleName(), e);
} catch (IllegalAccessException e2) {
eVar.AFInAppEventType(e2.getClass().getSimpleName(), e2);
}
} catch (NoSuchMethodException e3) {
eVar.AFInAppEventType(e3.getClass().getSimpleName(), e3);
} catch (InvocationTargetException e4) {
eVar.AFInAppEventType(e4.getClass().getSimpleName(), e4);
}
return true;
} catch (ClassNotFoundException unused) {
return false;
}
}
public static void AFKeystoreWrapper(af afVar, h hVar) {
String jSONObject;
StringBuilder sb = new StringBuilder("url: ");
sb.append(hVar.onInstallConversionFailureNative);
AFLogger.AFInAppEventParameterName(sb.toString());
if (hVar.init != null) {
jSONObject = Base64.encodeToString(hVar.values(), 2);
AFLogger.AFInAppEventParameterName("cached data: ".concat(String.valueOf(jSONObject)));
} else {
jSONObject = new JSONObject(hVar.valueOf()).toString();
String replaceAll = jSONObject.replaceAll("\\p{C}", "*Non-printing character*");
if (!replaceAll.equals(jSONObject)) {
AFLogger.AFVersionDeclaration("Payload contains non-printing characters");
jSONObject = replaceAll;
}
an.AFKeystoreWrapper("data: ".concat(jSONObject));
}
am.AFKeystoreWrapper().valueOf("server_request", hVar.onInstallConversionFailureNative, jSONObject);
try {
afVar.AFInAppEventType(hVar);
} catch (IOException e) {
AFLogger.values("Exception in sendRequestToServer. ", e);
if (AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.USE_HTTP_FALLBACK, false)) {
afVar.AFInAppEventType(hVar.values(hVar.onInstallConversionFailureNative.replace("https:", "http:")));
return;
}
StringBuilder sb2 = new StringBuilder("failed to send request to server. ");
sb2.append(e.getLocalizedMessage());
AFLogger.AFInAppEventParameterName(sb2.toString());
throw e;
}
}
public final void valueOf(WeakReference<Context> weakReference) {
if (weakReference.get() == null) {
return;
}
AFLogger.AFInAppEventParameterName("app went to background");
SharedPreferences AFInAppEventType2 = AFInAppEventType(weakReference.get());
AppsFlyerProperties.getInstance().saveProperties(AFInAppEventType2);
long j = this.updateServerUninstallToken - this.onValidateInAppFailure;
HashMap hashMap = new HashMap();
String string = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
if (string == null) {
AFLogger.AFVersionDeclaration("[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, fv.Code);
}
d.a.C0055d AFKeystoreWrapper2 = ab.AFKeystoreWrapper(weakReference.get().getContentResolver());
if (AFKeystoreWrapper2 != null) {
hashMap.put("amazon_aid", AFKeystoreWrapper2.valueOf);
hashMap.put("amazon_aid_limit", String.valueOf(AFKeystoreWrapper2.AFInAppEventType));
}
String string3 = AppsFlyerProperties.getInstance().getString("advertiserId");
if (string3 != null) {
hashMap.put("advertiserId", string3);
}
hashMap.put(HiAnalyticsConstant.BI_KEY_APP_ID, weakReference.get().getPackageName());
hashMap.put("devkey", string);
hashMap.put(CommonConstant.KEY_UID, ak.AFKeystoreWrapper(weakReference));
hashMap.put("time_in_app", String.valueOf(j / 1000));
hashMap.put("statType", "user_closed_app");
hashMap.put(EventType.PLATFORM, "Android");
hashMap.put("launch_counter", Integer.toString(AFInAppEventParameterName(AFInAppEventType2, "appsFlyerCount", false)));
hashMap.put("channel", AFInAppEventParameterName(weakReference.get()));
if (string2 == null) {
string2 = "";
}
hashMap.put("originalAppsflyerId", string2);
if (this.setOaidData) {
try {
AFLogger.AFInAppEventType("Running callStats task");
bn bnVar = new bn();
bnVar.onConversionDataSuccess = isStopped();
new Thread(new k((bh) bnVar.AFKeystoreWrapper(hashMap).values(String.format(onAppOpenAttributionNative, AppsFlyerLib.getInstance().getHostPrefix(), onAttributionFailure.getHostName())))).start();
return;
} catch (Throwable th) {
AFLogger.values("Could not send callStats request", th);
return;
}
}
AFLogger.AFInAppEventType("Stats call is disabled, ignore ...");
}
@Nullable
private static String values(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 sb = new StringBuilder("Could not find ");
sb.append(str);
sb.append(" value in the manifest");
AFLogger.values(sb.toString(), th);
return null;
}
}
private static String values(File file, String str) {
FileReader fileReader;
Properties properties;
try {
try {
try {
properties = new Properties();
fileReader = new FileReader(file);
} catch (Throwable th) {
AFLogger.values(th.getMessage(), th);
return null;
}
} catch (FileNotFoundException unused) {
fileReader = null;
} catch (Throwable th2) {
th = th2;
fileReader = null;
}
try {
properties.load(fileReader);
AFLogger.AFInAppEventParameterName("Found PreInstall property!");
String property = properties.getProperty(str);
try {
fileReader.close();
} catch (Throwable th3) {
AFLogger.values(th3.getMessage(), th3);
}
return property;
} catch (FileNotFoundException unused2) {
StringBuilder sb = new StringBuilder("PreInstall file wasn't found: ");
sb.append(file.getAbsolutePath());
AFLogger.AFInAppEventType(sb.toString());
if (fileReader != null) {
fileReader.close();
}
return null;
} catch (Throwable th4) {
th = th4;
AFLogger.values(th.getMessage(), th);
if (fileReader != null) {
fileReader.close();
}
return null;
}
} catch (Throwable th5) {
if (fileReader != null) {
try {
fileReader.close();
} catch (Throwable th6) {
AFLogger.values(th6.getMessage(), th6);
}
}
throw th5;
}
}
public static SharedPreferences AFInAppEventType(Context context) {
af afVar = onAttributionFailure;
if (afVar.setUserEmails == null) {
afVar.setUserEmails = context.getApplicationContext().getSharedPreferences("appsflyer-data", 0);
}
return onAttributionFailure.setUserEmails;
}
private void AFInAppEventType(h hVar) {
long currentTimeMillis;
HttpURLConnection httpURLConnection;
HttpURLConnection httpURLConnection2;
DataOutputStream dataOutputStream;
URL url = new URL(hVar.onInstallConversionFailureNative);
byte[] values2 = hVar.values();
String str = hVar.AFLogger$LogLevel;
String str2 = hVar.init;
boolean AFInAppEventType2 = hVar.AFInAppEventType();
Application application = hVar.valueOf;
AppsFlyerRequestListener appsFlyerRequestListener = hVar.values;
boolean z = AFInAppEventType2 && hVar.onDeepLinkingNative == 1;
if (z) {
try {
this.setAdditionalData.put("from_fg", System.currentTimeMillis() - this.onValidateInAppFailure);
} catch (JSONException unused) {
}
currentTimeMillis = System.currentTimeMillis();
} else {
currentTimeMillis = 0;
}
try {
httpURLConnection2 = (HttpURLConnection) url.openConnection();
} catch (Throwable th) {
th = th;
httpURLConnection = null;
}
try {
httpURLConnection2.setRequestMethod(ShareTarget.METHOD_POST);
httpURLConnection2.setRequestProperty("Content-Length", String.valueOf(values2.length));
httpURLConnection2.setRequestProperty("Content-Type", hVar.AFKeystoreWrapper() ? "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(values2);
dataOutputStream.close();
int responseCode = httpURLConnection2.getResponseCode();
if (z) {
try {
this.setAdditionalData.put("net", System.currentTimeMillis() - currentTimeMillis);
} catch (JSONException unused2) {
}
}
if (this.AFLogger$LogLevel == null) {
this.AFLogger$LogLevel = new aw(application);
}
this.AFLogger$LogLevel.AFInAppEventType.edit().putString("first_launch", this.setAdditionalData.toString()).apply();
String AFInAppEventType3 = AFInAppEventType(httpURLConnection2);
am.AFKeystoreWrapper().valueOf("server_response", url.toString(), String.valueOf(responseCode), AFInAppEventType3);
AFLogger.AFInAppEventParameterName("response code: ".concat(String.valueOf(responseCode)));
SharedPreferences AFInAppEventType4 = AFInAppEventType(application);
if (responseCode == 200) {
if (application != null && AFInAppEventType2) {
this.onValidateInApp = System.currentTimeMillis();
}
if (appsFlyerRequestListener != null) {
appsFlyerRequestListener.onSuccess();
}
if (str2 != null) {
ag.AFInAppEventType();
ag.values(str2, application);
} else {
SharedPreferences.Editor edit = AFInAppEventType(application).edit();
edit.putString("sentSuccessfully", fv.Code);
edit.apply();
if (!this.AppsFlyerConversionListener && System.currentTimeMillis() - this.getLevel >= 15000 && this.AppsFlyerLib == null) {
if (n.valueOf == null) {
n.valueOf = new n();
}
this.AppsFlyerLib = n.valueOf.values();
AFInAppEventParameterName(this.AppsFlyerLib, new b(application), 1L, TimeUnit.SECONDS);
}
}
az azVar = new az(application);
m AFInAppEventParameterName2 = azVar.AFInAppEventParameterName();
if (AFInAppEventParameterName2 != null && AFInAppEventParameterName2.AFKeystoreWrapper()) {
String str3 = AFInAppEventParameterName2.AFKeystoreWrapper;
AFLogger.AFInAppEventType("Resending Uninstall token to AF servers: ".concat(String.valueOf(str3)));
azVar.valueOf(str3);
}
this.setOaidData = ap.values(AFInAppEventType3).optBoolean("send_background", false);
} else if (appsFlyerRequestListener != null) {
int i = RequestError.RESPONSE_CODE_FAILURE;
StringBuilder sb = new StringBuilder();
sb.append(at.AFKeystoreWrapper);
sb.append(PPSLabelView.Code);
sb.append(responseCode);
appsFlyerRequestListener.onError(i, sb.toString());
}
ay.AFKeystoreWrapper(this, hVar, str, application, AFInAppEventType4, 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;
}
}
private String values(SimpleDateFormat simpleDateFormat, Context context) {
String str;
String string = AFInAppEventType(context).getString("appsFlyerFirstInstall", null);
if (string == null) {
if (AFKeystoreWrapper(context)) {
AFLogger.AFInAppEventType("AppsFlyer: first launch detected");
str = simpleDateFormat.format(new Date());
} else {
str = "";
}
string = str;
SharedPreferences.Editor edit = AFInAppEventType(context).edit();
edit.putString("appsFlyerFirstInstall", string);
edit.apply();
}
AFLogger.AFInAppEventParameterName("AppsFlyer: first launch date: ".concat(String.valueOf(string)));
return string;
}
private void values(h hVar) {
byte b2 = 0;
boolean z = hVar.AFVersionDeclaration == null;
if (AFInAppEventType()) {
AFLogger.AFInAppEventParameterName("CustomerUserId not set, reporting is disabled", true);
return;
}
if (z) {
if (AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.LAUNCH_PROTECT_ENABLED, true)) {
if (AFKeystoreWrapper()) {
AppsFlyerRequestListener appsFlyerRequestListener = hVar.values;
if (appsFlyerRequestListener != null) {
appsFlyerRequestListener.onError(RequestError.EVENT_TIMEOUT, at.valueOf);
return;
}
return;
}
} else {
AFLogger.AFInAppEventParameterName("Allowing multiple launches within a 5 second time window.");
}
this.onDeepLinking = System.currentTimeMillis();
}
if (n.valueOf == null) {
n.valueOf = new n();
}
AFInAppEventParameterName(n.valueOf.values(), new a(this, hVar, b2), 0L, TimeUnit.MILLISECONDS);
}
public final void valueOf(Context context, Map<String, Object> map, Uri uri) {
if (!map.containsKey("af_deeplink")) {
String values2 = values(uri.toString());
f AFInAppEventParameterName2 = f.AFInAppEventParameterName();
String str = AFInAppEventParameterName2.getLevel;
if (str != null && AFInAppEventParameterName2.AFVersionDeclaration != null && values2.contains(str)) {
Uri.Builder buildUpon = Uri.parse(values2).buildUpon();
Uri.Builder buildUpon2 = Uri.EMPTY.buildUpon();
for (Map.Entry<String, String> entry : AFInAppEventParameterName2.AFVersionDeclaration.entrySet()) {
buildUpon.appendQueryParameter(entry.getKey(), entry.getValue());
buildUpon2.appendQueryParameter(entry.getKey(), entry.getValue());
}
values2 = buildUpon.build().toString();
map.put("appended_query_params", buildUpon2.build().getEncodedQuery());
}
map.put("af_deeplink", values2);
}
final HashMap hashMap = new HashMap();
hashMap.put("link", uri.toString());
aq aqVar = new aq(uri, this, context);
if (aqVar.AFInAppEventType) {
map.put("isBrandedDomain", Boolean.TRUE);
}
ac.AFInAppEventType(context, hashMap, uri);
if (aqVar.AFKeystoreWrapper()) {
aqVar.AFInAppEventParameterName = new aq.d() {
@Override
public final void AFKeystoreWrapper(Map<String, String> map2) {
for (String str2 : map2.keySet()) {
hashMap.put(str2, map2.get(str2));
}
as.AFInAppEventType((Map<String, String>) hashMap);
}
@Override
public final void valueOf(String str2) {
as.AFInAppEventType(str2);
}
};
if (n.valueOf == null) {
n.valueOf = new n();
}
n.valueOf.AFInAppEventParameterName().execute(aqVar);
return;
}
as.AFInAppEventType(hashMap);
}
private static boolean valueOf(File file) {
return file == null || !file.exists();
}
public final Map<String, Object> valueOf() {
HashMap hashMap = new HashMap();
if (AppsFlyer2dXConversionCallback()) {
hashMap.put("lvl", this.getOutOfStore);
} else if (this.setPhoneNumber) {
HashMap hashMap2 = new HashMap();
this.getOutOfStore = hashMap2;
hashMap2.put(com.umeng.analytics.pro.d.O, "operation timed out.");
hashMap.put("lvl", this.getOutOfStore);
}
return hashMap;
}
public boolean valueOf(h hVar, SharedPreferences sharedPreferences) {
int AFInAppEventParameterName2 = AFInAppEventParameterName(sharedPreferences, "appsFlyerCount", false);
return (!sharedPreferences.getBoolean(AppsFlyerProperties.NEW_REFERRER_SENT, false) && AFInAppEventParameterName2 == 1) || (AFInAppEventParameterName2 == 1 && !(hVar instanceof bg));
}
public final Map<String, Object> valueOf(h hVar) {
AppsFlyerProperties appsFlyerProperties;
boolean z;
aw awVar;
String str;
Application application;
String str2;
Exception exc;
JSONObject jSONObject;
StringBuilder sb;
String string;
String string2;
String string3;
String string4;
Application application2;
String AFInAppEventParameterName2;
String AFInAppEventParameterName3;
SharedPreferences AFInAppEventType2;
String str3;
String string5;
String string6;
String string7;
String str4;
AppsFlyerProperties appsFlyerProperties2;
Object obj;
String str5;
boolean z2;
String str6;
d.a.C0055d AFInAppEventType3;
String str7;
TelephonyManager telephonyManager;
String str8;
String str9;
AppsFlyerProperties appsFlyerProperties3;
String str10;
d.a.C0055d AFKeystoreWrapper2;
boolean z3;
int AFInAppEventParameterName4;
aw awVar2;
String[] strArr;
int i;
int i2;
String AFKeystoreWrapper3;
String installerPackageName;
UiModeManager uiModeManager;
Application application3 = hVar.valueOf;
String str11 = hVar.AFLogger$LogLevel;
String str12 = hVar.AFVersionDeclaration;
Map map = hVar.AFKeystoreWrapper;
if (map == null) {
map = new HashMap();
}
String jSONObject2 = new JSONObject(map).toString();
String str13 = hVar.AppsFlyer2dXConversionCallback;
SharedPreferences AFInAppEventType4 = AFInAppEventType(application3);
boolean AFInAppEventType5 = hVar.AFInAppEventType();
String str14 = hVar.AFInAppEventParameterName;
Map<String, Object> map2 = hVar.AFInAppEventType;
ab.AFKeystoreWrapper(application3, map2);
long time = new Date().getTime();
map2.put("af_timestamp", Long.toString(time));
String AFInAppEventType6 = d.AFInAppEventType(application3, time);
if (AFInAppEventType6 != null) {
map2.put("cksm_v1", AFInAppEventType6);
}
try {
if (!isStopped()) {
StringBuilder sb2 = new StringBuilder("******* sendTrackingWithEvent: ");
sb2.append(AFInAppEventType5 ? "Launch" : str12);
AFLogger.AFInAppEventParameterName(sb2.toString());
} else {
AFLogger.AFInAppEventParameterName("Reporting has been stopped");
}
ag.AFInAppEventType();
try {
if (!ag.valueOf(application3).exists()) {
ag.valueOf(application3).mkdir();
}
} catch (Exception e) {
AFLogger.values("Could not create cache directory", e);
}
try {
List asList = Arrays.asList(application3.getPackageManager().getPackageInfo(application3.getPackageName(), 4096).requestedPermissions);
if (!asList.contains("android.permission.INTERNET")) {
AFLogger.AFVersionDeclaration("Permission android.permission.INTERNET is missing in the AndroidManifest.xml");
}
if (!asList.contains("android.permission.ACCESS_NETWORK_STATE")) {
AFLogger.AFVersionDeclaration("Permission android.permission.ACCESS_NETWORK_STATE is missing in the AndroidManifest.xml");
}
if (!asList.contains("android.permission.ACCESS_WIFI_STATE")) {
AFLogger.AFVersionDeclaration("Permission android.permission.ACCESS_WIFI_STATE is missing in the AndroidManifest.xml");
}
} catch (Exception e2) {
AFLogger.values("Exception while validation permissions. ", e2);
}
map2.put("af_events_api", "1");
map2.put(com.huawei.openalliance.ad.constant.ao.r, Build.BRAND);
map2.put(EventType.DEVICE, Build.DEVICE);
map2.put("product", Build.PRODUCT);
int i3 = Build.VERSION.SDK_INT;
map2.put("sdk", Integer.toString(i3));
map2.put("model", Build.MODEL);
map2.put(com.huawei.openalliance.ad.constant.ao.e, Build.TYPE);
values(application3, map2);
AppsFlyerProperties appsFlyerProperties4 = AppsFlyerProperties.getInstance();
if (this.AFLogger$LogLevel == null) {
this.AFLogger$LogLevel = new aw(application3);
}
aw awVar3 = this.AFLogger$LogLevel;
if (AFInAppEventType5) {
if (AFKeystoreWrapper(application3)) {
if (!appsFlyerProperties4.isOtherSdkStringDisabled()) {
map2.put("batteryLevel", String.valueOf(AppsFlyer2dXConversionCallback(application3)));
}
values(application3);
if (i3 >= 23) {
uiModeManager = (UiModeManager) application3.getSystemService(UiModeManager.class);
} else {
uiModeManager = (UiModeManager) application3.getSystemService("uimode");
}
if (uiModeManager != null && uiModeManager.getCurrentModeType() == 4) {
map2.put("tv", Boolean.TRUE);
}
if (bc.AFKeystoreWrapper(application3)) {
map2.put("inst_app", Boolean.TRUE);
}
}
z = AFInAppEventType5;
long j = AFInAppEventType(application3).getLong("AppsFlyerTimePassedSincePrevLaunch", 0L);
long currentTimeMillis = System.currentTimeMillis();
valueOf(application3, "AppsFlyerTimePassedSincePrevLaunch", currentTimeMillis);
map2.put("timepassedsincelastlaunch", Long.toString(j > 0 ? (currentTimeMillis - j) / 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.AFLogger$LogLevel.AFInAppEventType.getString("gcd", null);
if (string10 != null) {
try {
Map<String, Object> AFInAppEventParameterName5 = k.AFInAppEventParameterName(new JSONObject(string10));
if (!AFInAppEventParameterName5.isEmpty()) {
AFInAppEventType(map2).put("gcd", AFInAppEventParameterName5);
this.AFLogger$LogLevel.AFInAppEventType.edit().putString("gcd", null).apply();
}
} catch (JSONException unused) {
}
}
String str15 = this.setCustomerIdAndLogSession;
if (str15 != null) {
map2.put("phone", str15);
}
if (!TextUtils.isEmpty(str13)) {
map2.put("referrer", str13);
}
String string11 = AFInAppEventType4.getString("extraReferrers", null);
if (string11 != null) {
map2.put("extraReferrers", string11);
}
appsFlyerProperties = appsFlyerProperties4;
String referrer = appsFlyerProperties.getReferrer(application3);
if (!TextUtils.isEmpty(referrer) && map2.get("referrer") == null) {
map2.put("referrer", referrer);
}
long j2 = awVar3.AFInAppEventType.getLong("prev_session_dur", 0L);
if (j2 != 0) {
map2.put("prev_session_dur", Long.valueOf(j2));
}
Application application4 = ax.AFInAppEventParameterName;
map2.put("exception_number", Long.valueOf(application4 == null ? -1L : AFInAppEventType(application4).getLong("exception_number", 0L)));
au auVar = this.setAppInviteOneLink;
if (auVar != null) {
if (!auVar.valueOf.isEmpty()) {
map2.put("partner_data", auVar.valueOf);
}
if (!auVar.AFInAppEventParameterName.isEmpty()) {
AFInAppEventType(map2).put("partner_data", auVar.AFInAppEventParameterName);
auVar.AFInAppEventParameterName = new HashMap();
}
}
awVar = awVar3;
str = "preInstallName";
application = application3;
str2 = str12;
} else {
appsFlyerProperties = appsFlyerProperties4;
z = AFInAppEventType5;
SharedPreferences AFInAppEventType7 = AFInAppEventType(application3);
SharedPreferences.Editor edit = AFInAppEventType7.edit();
try {
String string12 = AFInAppEventType7.getString("prev_event_name", null);
if (string12 != null) {
try {
jSONObject = new JSONObject();
awVar = awVar3;
} catch (Exception e3) {
e = e3;
awVar = awVar3;
}
try {
sb = new StringBuilder();
str = "preInstallName";
application = application3;
} catch (Exception e4) {
e = e4;
str = "preInstallName";
application = application3;
exc = e;
str2 = str12;
AFLogger.values("Error while processing previous event.", exc);
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) {
}
string4 = appsFlyerProperties.getString(AppsFlyerProperties.EXTENSION);
if (string4 != null) {
map2.put(AppsFlyerProperties.EXTENSION, string4);
}
application2 = application;
AFInAppEventParameterName2 = AFInAppEventParameterName(application2);
AFInAppEventParameterName3 = AFInAppEventParameterName(application2, AFInAppEventParameterName2);
if (AFInAppEventParameterName3 != null) {
map2.put("af_latestchannel", AFInAppEventParameterName2);
AFInAppEventType2 = AFInAppEventType(application2);
if (AFInAppEventType2.contains("INSTALL_STORE")) {
}
if (str3 != null) {
}
SharedPreferences AFInAppEventType8 = AFInAppEventType(application2);
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 (str11 == null) {
}
string7 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
if (string7 == null) {
}
AFLogger.AFInAppEventParameterName("AppsFlyer dev key is missing!!! Please use AppsFlyerLib.getInstance().setAppsFlyerKey(...) to set it. ");
AFLogger.AFInAppEventParameterName("AppsFlyer will not track this event.");
return null;
}
map2.put("af_latestchannel", AFInAppEventParameterName2);
AFInAppEventType2 = AFInAppEventType(application2);
if (AFInAppEventType2.contains("INSTALL_STORE")) {
}
if (str3 != null) {
}
SharedPreferences AFInAppEventType82 = AFInAppEventType(application2);
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 (str11 == null) {
}
string7 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
if (string7 == null) {
}
AFLogger.AFInAppEventParameterName("AppsFlyer dev key is missing!!! Please use AppsFlyerLib.getInstance().setAppsFlyerKey(...) to set it. ");
AFLogger.AFInAppEventParameterName("AppsFlyer will not track this event.");
return null;
}
try {
sb.append(AFInAppEventType7.getLong("prev_event_timestamp", -1L));
jSONObject.put("prev_event_timestamp", sb.toString());
jSONObject.put("prev_event_value", AFInAppEventType7.getString("prev_event_value", null));
jSONObject.put("prev_event_name", string12);
map2.put("prev_event", jSONObject.toString());
} catch (Exception e5) {
e = e5;
exc = e;
str2 = str12;
AFLogger.values("Error while processing previous event.", exc);
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) {
}
string4 = appsFlyerProperties.getString(AppsFlyerProperties.EXTENSION);
if (string4 != null) {
}
application2 = application;
AFInAppEventParameterName2 = AFInAppEventParameterName(application2);
AFInAppEventParameterName3 = AFInAppEventParameterName(application2, AFInAppEventParameterName2);
if (AFInAppEventParameterName3 != null) {
}
map2.put("af_latestchannel", AFInAppEventParameterName2);
AFInAppEventType2 = AFInAppEventType(application2);
if (AFInAppEventType2.contains("INSTALL_STORE")) {
}
if (str3 != null) {
}
SharedPreferences AFInAppEventType822 = AFInAppEventType(application2);
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 (str11 == null) {
}
string7 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
if (string7 == null) {
}
AFLogger.AFInAppEventParameterName("AppsFlyer dev key is missing!!! Please use AppsFlyerLib.getInstance().setAppsFlyerKey(...) to set it. ");
AFLogger.AFInAppEventParameterName("AppsFlyer will not track this event.");
return null;
}
} else {
awVar = awVar3;
str = "preInstallName";
application = application3;
}
str2 = str12;
} catch (Exception e6) {
e = e6;
awVar = awVar3;
str = "preInstallName";
application = application3;
str2 = str12;
}
try {
edit.putString("prev_event_name", str2);
edit.putString("prev_event_value", jSONObject2);
edit.putLong("prev_event_timestamp", System.currentTimeMillis());
edit.apply();
} catch (Exception e7) {
e = e7;
exc = e;
AFLogger.values("Error while processing previous event.", exc);
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) {
}
string4 = appsFlyerProperties.getString(AppsFlyerProperties.EXTENSION);
if (string4 != null) {
}
application2 = application;
AFInAppEventParameterName2 = AFInAppEventParameterName(application2);
AFInAppEventParameterName3 = AFInAppEventParameterName(application2, AFInAppEventParameterName2);
if (AFInAppEventParameterName3 != null) {
}
map2.put("af_latestchannel", AFInAppEventParameterName2);
AFInAppEventType2 = AFInAppEventType(application2);
if (AFInAppEventType2.contains("INSTALL_STORE")) {
}
if (str3 != null) {
}
SharedPreferences AFInAppEventType8222 = AFInAppEventType(application2);
String str16222 = str;
string5 = AppsFlyerProperties.getInstance().getString(str16222);
if (string5 == null) {
}
if (string5 != null) {
}
string6 = AppsFlyerProperties.getInstance().getString("api_store_value");
if (string6 == null) {
}
if (string6 != null) {
}
if (str11 == null) {
}
string7 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
if (string7 == null) {
}
AFLogger.AFInAppEventParameterName("AppsFlyer dev key is missing!!! Please use AppsFlyerLib.getInstance().setAppsFlyerKey(...) to set it. ");
AFLogger.AFInAppEventParameterName("AppsFlyer will not track this event.");
return null;
}
}
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(com.huawei.openalliance.ad.constant.ao.t, string3);
}
try {
installerPackageName = application.getPackageManager().getInstallerPackageName(application.getPackageName());
if (installerPackageName != null) {
map2.put("installer_package", installerPackageName);
}
} catch (Exception e8) {
AFLogger.values("Exception while getting the app's installer package. ", e8);
}
string4 = appsFlyerProperties.getString(AppsFlyerProperties.EXTENSION);
if (string4 != null && string4.length() > 0) {
map2.put(AppsFlyerProperties.EXTENSION, string4);
}
application2 = application;
AFInAppEventParameterName2 = AFInAppEventParameterName(application2);
AFInAppEventParameterName3 = AFInAppEventParameterName(application2, AFInAppEventParameterName2);
if ((AFInAppEventParameterName3 != null && !AFInAppEventParameterName3.equals(AFInAppEventParameterName2)) || (AFInAppEventParameterName3 == null && AFInAppEventParameterName2 != null)) {
map2.put("af_latestchannel", AFInAppEventParameterName2);
}
AFInAppEventType2 = AFInAppEventType(application2);
if (AFInAppEventType2.contains("INSTALL_STORE")) {
str3 = AFInAppEventType2.getString("INSTALL_STORE", null);
} else {
if (AFKeystoreWrapper(application2)) {
str3 = AppsFlyerProperties.getInstance().getString("api_store_value");
if (str3 == null) {
if (application2 != null) {
str3 = values("AF_STORE", application2.getPackageManager(), application2.getPackageName());
}
}
SharedPreferences.Editor edit2 = AFInAppEventType(application2).edit();
edit2.putString("INSTALL_STORE", str3);
edit2.apply();
}
str3 = null;
SharedPreferences.Editor edit22 = AFInAppEventType(application2).edit();
edit22.putString("INSTALL_STORE", str3);
edit22.apply();
}
if (str3 != null) {
map2.put("af_installstore", str3.toLowerCase());
}
SharedPreferences AFInAppEventType82222 = AFInAppEventType(application2);
String str162222 = str;
string5 = AppsFlyerProperties.getInstance().getString(str162222);
if (string5 == null) {
if (AFInAppEventType82222.contains(str162222)) {
string5 = AFInAppEventType82222.getString(str162222, null);
} else {
if (AFKeystoreWrapper(application2)) {
File AFKeystoreWrapper4 = AFKeystoreWrapper(AFInAppEventParameterName("ro.appsflyer.preinstall.path"));
if (valueOf(AFKeystoreWrapper4)) {
AFKeystoreWrapper4 = AFKeystoreWrapper(values("AF_PRE_INSTALL_PATH", application2.getPackageManager(), application2.getPackageName()));
}
if (valueOf(AFKeystoreWrapper4)) {
AFKeystoreWrapper4 = AFKeystoreWrapper("/data/local/tmp/pre_install.appsflyer");
}
if (valueOf(AFKeystoreWrapper4)) {
AFKeystoreWrapper4 = AFKeystoreWrapper("/etc/pre_install.appsflyer");
}
String values2 = valueOf(AFKeystoreWrapper4) ? null : values(AFKeystoreWrapper4, application2.getPackageName());
if (values2 == null) {
values2 = application2 == null ? null : values("AF_PRE_INSTALL_NAME", application2.getPackageManager(), application2.getPackageName());
}
string5 = values2;
}
if (string5 != null) {
SharedPreferences.Editor edit3 = AFInAppEventType(application2).edit();
edit3.putString(str162222, string5);
edit3.apply();
}
}
if (string5 != null) {
AppsFlyerProperties.getInstance().set(str162222, string5);
}
}
if (string5 != null) {
map2.put("af_preinstall_name", string5.toLowerCase());
}
string6 = AppsFlyerProperties.getInstance().getString("api_store_value");
if (string6 == null) {
string6 = application2 == null ? null : values("AF_STORE", application2.getPackageManager(), application2.getPackageName());
}
if (string6 != null) {
map2.put("af_currentstore", string6.toLowerCase());
}
if (str11 == null && str11.length() > 0) {
map2.put("appsflyerKey", str11);
} else {
string7 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
if (string7 == null && string7.length() > 0) {
map2.put("appsflyerKey", string7);
} else {
AFLogger.AFInAppEventParameterName("AppsFlyer dev key is missing!!! Please use AppsFlyerLib.getInstance().setAppsFlyerKey(...) to set it. ");
AFLogger.AFInAppEventParameterName("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 = appsFlyerProperties.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", ai.AFKeystoreWrapper(string15));
}
}
if (str2 != null) {
map2.put("eventName", str2);
if (jSONObject2 != null) {
map2.put("eventValue", jSONObject2);
}
}
if (AppsFlyerProperties.getInstance().getString("appid") != null) {
map2.put("appid", AppsFlyerProperties.getInstance().getString("appid"));
}
String string16 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.CURRENCY_CODE);
if (string16 != null) {
if (string16.length() != 3) {
StringBuilder sb3 = new StringBuilder("WARNING: currency code should be 3 characters!!! '");
sb3.append(string16);
sb3.append("' is not a legal value.");
AFLogger.AFVersionDeclaration(sb3.toString());
}
map2.put(HwPayConstant.KEY_CURRENCY, string16);
}
String string17 = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.IS_UPDATE);
if (string17 != null) {
map2.put("isUpdate", string17);
}
map2.put("af_preinstalled", Boolean.toString(isPreInstalledApp(application2)));
if (appsFlyerProperties.getBoolean(AppsFlyerProperties.COLLECT_FACEBOOK_ATTR_ID, true)) {
try {
try {
application2.getPackageManager().getApplicationInfo("com.facebook.katana", 0);
str4 = getAttributionId(application2);
} catch (Throwable th) {
AFLogger.values("Exception while collecting facebook's attribution ID. ", th);
str4 = null;
if (str4 != null) {
}
appsFlyerProperties2 = AppsFlyerProperties.getInstance();
if (appsFlyerProperties2.getBoolean(AppsFlyerProperties.DEVICE_TRACKING_DISABLED, false)) {
}
AFKeystoreWrapper3 = ak.AFKeystoreWrapper(new WeakReference(application2));
str8 = CommonConstant.KEY_UID;
if (AFKeystoreWrapper3 != null) {
}
map2.put(CommonConstant.ReqAccessTokenParam.LANGUAGE_LABEL, Locale.getDefault().getDisplayLanguage());
map2.put("lang_code", Locale.getDefault().getLanguage());
map2.put("country", Locale.getDefault().getCountry());
map2.put("platformextension", this.enableLocationCollection.values());
AFKeystoreWrapper(application2, (Map<String, ? super String>) map2);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", Locale.US);
long j3 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0).firstInstallTime;
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
map2.put("installDate", simpleDateFormat.format(new Date(j3)));
PackageInfo packageInfo = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0);
i = AFInAppEventType4.getInt("versionCode", 0);
i2 = packageInfo.versionCode;
if (i2 > i) {
}
map2.put("app_version_code", Integer.toString(packageInfo.versionCode));
map2.put("app_version_name", packageInfo.versionName);
long j4 = packageInfo.firstInstallTime;
long j5 = packageInfo.lastUpdateTime;
str10 = str8;
try {
Locale locale = Locale.US;
appsFlyerProperties3 = appsFlyerProperties;
try {
str9 = str2;
try {
map2.put("date1", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale).format(new Date(j4)));
map2.put("date2", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale).format(new Date(j5)));
map2.put("firstLaunchDate", values(simpleDateFormat, application2));
} catch (Throwable th2) {
th = th2;
AFLogger.values("Exception while collecting app version data ", th);
this.stop = az.values(application2);
StringBuilder sb4 = new StringBuilder("didConfigureTokenRefreshService=");
sb4.append(this.stop);
AFLogger.AFInAppEventType(sb4.toString());
if (!this.stop) {
}
if (z) {
}
if (!z) {
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
}
AFKeystoreWrapper2 = ab.AFKeystoreWrapper(application2.getContentResolver());
if (AFKeystoreWrapper2 != null) {
}
map2.put("registeredUninstall", Boolean.valueOf(az.values(AFInAppEventType4)));
z3 = z;
AFInAppEventParameterName4 = AFInAppEventParameterName(AFInAppEventType4, "appsFlyerCount", z3);
map2.put("counter", Integer.toString(AFInAppEventParameterName4));
map2.put("iaecounter", Integer.toString(AFInAppEventParameterName(AFInAppEventType4, "appsFlyerInAppEventCount", str9 != null)));
if (z3) {
}
awVar2 = awVar;
map2.put("isFirstCall", Boolean.toString(!AFKeystoreWrapper(AFInAppEventType4)));
HashMap hashMap = new HashMap();
hashMap.put("cpu_abi", AFInAppEventParameterName("ro.product.cpu.abi"));
hashMap.put("cpu_abi2", AFInAppEventParameterName("ro.product.cpu.abi2"));
hashMap.put("arch", AFInAppEventParameterName("os.arch"));
hashMap.put("build_display_id", AFInAppEventParameterName("ro.build.display.id"));
if (z3) {
}
hashMap.put("dim", w.values(application2));
map2.put("deviceData", hashMap);
Object obj2 = obj;
String str17 = (String) map2.get(obj2);
String str18 = (String) map2.get("af_timestamp");
String str19 = str10;
String str20 = (String) map2.get(str19);
StringBuilder sb5 = new StringBuilder();
sb5.append(str17.substring(0, 7));
sb5.append(str20.substring(0, 7));
sb5.append(str18.substring(str18.length() - 7));
map2.put("af_v", ai.AFKeystoreWrapper(sb5.toString()));
String str21 = (String) map2.get(obj2);
StringBuilder sb6 = new StringBuilder();
sb6.append(str21);
sb6.append(map2.get("af_timestamp"));
String obj3 = sb6.toString();
StringBuilder sb7 = new StringBuilder();
sb7.append(obj3);
sb7.append(map2.get(str19));
String obj4 = sb7.toString();
StringBuilder sb8 = new StringBuilder();
sb8.append(obj4);
sb8.append(map2.get("installDate"));
String obj5 = sb8.toString();
StringBuilder sb9 = new StringBuilder();
sb9.append(obj5);
sb9.append(map2.get("counter"));
String obj6 = sb9.toString();
StringBuilder sb10 = new StringBuilder();
sb10.append(obj6);
sb10.append(map2.get("iaecounter"));
map2.put("af_v2", ai.AFKeystoreWrapper(ai.AFInAppEventType(sb10.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application2)));
if (AFInAppEventType4.contains("is_stop_tracking_used")) {
}
HashMap hashMap2 = new HashMap();
hashMap2.put("mcc", Integer.valueOf(application2.getResources().getConfiguration().mcc));
hashMap2.put("mnc", Integer.valueOf(application2.getResources().getConfiguration().mnc));
map2.put("cell", hashMap2);
map2.put("sig", ac.valueOf(awVar2.values.getPackageManager(), awVar2.values.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong = statFs.getBlockSizeLong();
long availableBlocksLong = statFs.getAvailableBlocksLong() * blockSizeLong;
long blockCountLong = statFs.getBlockCountLong() * blockSizeLong;
double pow = Math.pow(2.0d, 20.0d);
double d = availableBlocksLong;
Double.isNaN(d);
long j6 = (long) (d / pow);
double d2 = blockCountLong;
Double.isNaN(d2);
long j7 = (long) (d2 / pow);
StringBuilder sb11 = new StringBuilder();
sb11.append(j6);
sb11.append("/");
sb11.append(j7);
map2.put("disk", sb11.toString());
strArr = this.init;
if (strArr != null) {
}
return map2;
}
} catch (Throwable th3) {
th = th3;
str9 = str2;
}
} catch (Throwable th4) {
th = th4;
str9 = str2;
appsFlyerProperties3 = appsFlyerProperties;
}
this.stop = az.values(application2);
StringBuilder sb42 = new StringBuilder("didConfigureTokenRefreshService=");
sb42.append(this.stop);
AFLogger.AFInAppEventType(sb42.toString());
if (!this.stop) {
}
if (z) {
}
if (!z) {
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
}
AFKeystoreWrapper2 = ab.AFKeystoreWrapper(application2.getContentResolver());
if (AFKeystoreWrapper2 != null) {
}
map2.put("registeredUninstall", Boolean.valueOf(az.values(AFInAppEventType4)));
z3 = z;
AFInAppEventParameterName4 = AFInAppEventParameterName(AFInAppEventType4, "appsFlyerCount", z3);
map2.put("counter", Integer.toString(AFInAppEventParameterName4));
map2.put("iaecounter", Integer.toString(AFInAppEventParameterName(AFInAppEventType4, "appsFlyerInAppEventCount", str9 != null)));
if (z3) {
}
awVar2 = awVar;
map2.put("isFirstCall", Boolean.toString(!AFKeystoreWrapper(AFInAppEventType4)));
HashMap hashMap3 = new HashMap();
hashMap3.put("cpu_abi", AFInAppEventParameterName("ro.product.cpu.abi"));
hashMap3.put("cpu_abi2", AFInAppEventParameterName("ro.product.cpu.abi2"));
hashMap3.put("arch", AFInAppEventParameterName("os.arch"));
hashMap3.put("build_display_id", AFInAppEventParameterName("ro.build.display.id"));
if (z3) {
}
hashMap3.put("dim", w.values(application2));
map2.put("deviceData", hashMap3);
Object obj22 = obj;
String str172 = (String) map2.get(obj22);
String str182 = (String) map2.get("af_timestamp");
String str192 = str10;
String str202 = (String) map2.get(str192);
StringBuilder sb52 = new StringBuilder();
sb52.append(str172.substring(0, 7));
sb52.append(str202.substring(0, 7));
sb52.append(str182.substring(str182.length() - 7));
map2.put("af_v", ai.AFKeystoreWrapper(sb52.toString()));
String str212 = (String) map2.get(obj22);
StringBuilder sb62 = new StringBuilder();
sb62.append(str212);
sb62.append(map2.get("af_timestamp"));
String obj32 = sb62.toString();
StringBuilder sb72 = new StringBuilder();
sb72.append(obj32);
sb72.append(map2.get(str192));
String obj42 = sb72.toString();
StringBuilder sb82 = new StringBuilder();
sb82.append(obj42);
sb82.append(map2.get("installDate"));
String obj52 = sb82.toString();
StringBuilder sb92 = new StringBuilder();
sb92.append(obj52);
sb92.append(map2.get("counter"));
String obj62 = sb92.toString();
StringBuilder sb102 = new StringBuilder();
sb102.append(obj62);
sb102.append(map2.get("iaecounter"));
map2.put("af_v2", ai.AFKeystoreWrapper(ai.AFInAppEventType(sb102.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application2)));
if (AFInAppEventType4.contains("is_stop_tracking_used")) {
}
HashMap hashMap22 = new HashMap();
hashMap22.put("mcc", Integer.valueOf(application2.getResources().getConfiguration().mcc));
hashMap22.put("mnc", Integer.valueOf(application2.getResources().getConfiguration().mnc));
map2.put("cell", hashMap22);
map2.put("sig", ac.valueOf(awVar2.values.getPackageManager(), awVar2.values.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs2 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong2 = statFs2.getBlockSizeLong();
long availableBlocksLong2 = statFs2.getAvailableBlocksLong() * blockSizeLong2;
long blockCountLong2 = statFs2.getBlockCountLong() * blockSizeLong2;
double pow2 = Math.pow(2.0d, 20.0d);
double d3 = availableBlocksLong2;
Double.isNaN(d3);
long j62 = (long) (d3 / pow2);
double d22 = blockCountLong2;
Double.isNaN(d22);
long j72 = (long) (d22 / pow2);
StringBuilder sb112 = new StringBuilder();
sb112.append(j62);
sb112.append("/");
sb112.append(j72);
map2.put("disk", sb112.toString());
strArr = this.init;
if (strArr != null) {
}
return map2;
}
} catch (PackageManager.NameNotFoundException unused2) {
AFLogger.AFVersionDeclaration("Exception while collecting facebook's attribution ID. ");
str4 = null;
if (str4 != null) {
}
appsFlyerProperties2 = AppsFlyerProperties.getInstance();
if (appsFlyerProperties2.getBoolean(AppsFlyerProperties.DEVICE_TRACKING_DISABLED, false)) {
}
AFKeystoreWrapper3 = ak.AFKeystoreWrapper(new WeakReference(application2));
str8 = com.huawei.hms.support.feature.result.CommonConstant.KEY_UID;
if (AFKeystoreWrapper3 != null) {
}
map2.put(CommonConstant.ReqAccessTokenParam.LANGUAGE_LABEL, Locale.getDefault().getDisplayLanguage());
map2.put("lang_code", Locale.getDefault().getLanguage());
map2.put("country", Locale.getDefault().getCountry());
map2.put("platformextension", this.enableLocationCollection.values());
AFKeystoreWrapper(application2, (Map<String, ? super String>) map2);
SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", Locale.US);
long j32 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0).firstInstallTime;
simpleDateFormat2.setTimeZone(TimeZone.getTimeZone("UTC"));
map2.put("installDate", simpleDateFormat2.format(new Date(j32)));
PackageInfo packageInfo2 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0);
i = AFInAppEventType4.getInt("versionCode", 0);
i2 = packageInfo2.versionCode;
if (i2 > i) {
}
map2.put("app_version_code", Integer.toString(packageInfo2.versionCode));
map2.put("app_version_name", packageInfo2.versionName);
long j42 = packageInfo2.firstInstallTime;
long j52 = packageInfo2.lastUpdateTime;
str10 = str8;
Locale locale2 = Locale.US;
appsFlyerProperties3 = appsFlyerProperties;
str9 = str2;
map2.put("date1", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale2).format(new Date(j42)));
map2.put("date2", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale2).format(new Date(j52)));
map2.put("firstLaunchDate", values(simpleDateFormat2, application2));
this.stop = az.values(application2);
StringBuilder sb422 = new StringBuilder("didConfigureTokenRefreshService=");
sb422.append(this.stop);
AFLogger.AFInAppEventType(sb422.toString());
if (!this.stop) {
}
if (z) {
}
if (!z) {
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
}
AFKeystoreWrapper2 = ab.AFKeystoreWrapper(application2.getContentResolver());
if (AFKeystoreWrapper2 != null) {
}
map2.put("registeredUninstall", Boolean.valueOf(az.values(AFInAppEventType4)));
z3 = z;
AFInAppEventParameterName4 = AFInAppEventParameterName(AFInAppEventType4, "appsFlyerCount", z3);
map2.put("counter", Integer.toString(AFInAppEventParameterName4));
map2.put("iaecounter", Integer.toString(AFInAppEventParameterName(AFInAppEventType4, "appsFlyerInAppEventCount", str9 != null)));
if (z3) {
}
awVar2 = awVar;
map2.put("isFirstCall", Boolean.toString(!AFKeystoreWrapper(AFInAppEventType4)));
HashMap hashMap32 = new HashMap();
hashMap32.put("cpu_abi", AFInAppEventParameterName("ro.product.cpu.abi"));
hashMap32.put("cpu_abi2", AFInAppEventParameterName("ro.product.cpu.abi2"));
hashMap32.put("arch", AFInAppEventParameterName("os.arch"));
hashMap32.put("build_display_id", AFInAppEventParameterName("ro.build.display.id"));
if (z3) {
}
hashMap32.put("dim", w.values(application2));
map2.put("deviceData", hashMap32);
Object obj222 = obj;
String str1722 = (String) map2.get(obj222);
String str1822 = (String) map2.get("af_timestamp");
String str1922 = str10;
String str2022 = (String) map2.get(str1922);
StringBuilder sb522 = new StringBuilder();
sb522.append(str1722.substring(0, 7));
sb522.append(str2022.substring(0, 7));
sb522.append(str1822.substring(str1822.length() - 7));
map2.put("af_v", ai.AFKeystoreWrapper(sb522.toString()));
String str2122 = (String) map2.get(obj222);
StringBuilder sb622 = new StringBuilder();
sb622.append(str2122);
sb622.append(map2.get("af_timestamp"));
String obj322 = sb622.toString();
StringBuilder sb722 = new StringBuilder();
sb722.append(obj322);
sb722.append(map2.get(str1922));
String obj422 = sb722.toString();
StringBuilder sb822 = new StringBuilder();
sb822.append(obj422);
sb822.append(map2.get("installDate"));
String obj522 = sb822.toString();
StringBuilder sb922 = new StringBuilder();
sb922.append(obj522);
sb922.append(map2.get("counter"));
String obj622 = sb922.toString();
StringBuilder sb1022 = new StringBuilder();
sb1022.append(obj622);
sb1022.append(map2.get("iaecounter"));
map2.put("af_v2", ai.AFKeystoreWrapper(ai.AFInAppEventType(sb1022.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application2)));
if (AFInAppEventType4.contains("is_stop_tracking_used")) {
}
HashMap hashMap222 = new HashMap();
hashMap222.put("mcc", Integer.valueOf(application2.getResources().getConfiguration().mcc));
hashMap222.put("mnc", Integer.valueOf(application2.getResources().getConfiguration().mnc));
map2.put("cell", hashMap222);
map2.put("sig", ac.valueOf(awVar2.values.getPackageManager(), awVar2.values.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs22 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong22 = statFs22.getBlockSizeLong();
long availableBlocksLong22 = statFs22.getAvailableBlocksLong() * blockSizeLong22;
long blockCountLong22 = statFs22.getBlockCountLong() * blockSizeLong22;
double pow22 = Math.pow(2.0d, 20.0d);
double d32 = availableBlocksLong22;
Double.isNaN(d32);
long j622 = (long) (d32 / pow22);
double d222 = blockCountLong22;
Double.isNaN(d222);
long j722 = (long) (d222 / pow22);
StringBuilder sb1122 = new StringBuilder();
sb1122.append(j622);
sb1122.append("/");
sb1122.append(j722);
map2.put("disk", sb1122.toString());
strArr = this.init;
if (strArr != null) {
}
return map2;
}
if (str4 != null) {
map2.put("fb", str4);
}
}
appsFlyerProperties2 = AppsFlyerProperties.getInstance();
if (appsFlyerProperties2.getBoolean(AppsFlyerProperties.DEVICE_TRACKING_DISABLED, false)) {
map2.put(AppsFlyerProperties.DEVICE_TRACKING_DISABLED, fv.Code);
obj = "appsflyerKey";
} else {
SharedPreferences AFInAppEventType9 = AFInAppEventType(application2);
boolean z4 = appsFlyerProperties2.getBoolean(AppsFlyerProperties.COLLECT_IMEI, true);
String string18 = AFInAppEventType9.getString("imeiCached", null);
if (z4 && TextUtils.isEmpty(this.AppsFlyer2dXConversionCallback)) {
if (init(application2)) {
try {
telephonyManager = (TelephonyManager) application2.getSystemService("phone");
obj = "appsflyerKey";
} catch (InvocationTargetException unused3) {
obj = "appsflyerKey";
} catch (Exception e9) {
e = e9;
obj = "appsflyerKey";
}
try {
str5 = (String) telephonyManager.getClass().getMethod("getDeviceId", new Class[0]).invoke(telephonyManager, new Object[0]);
if (str5 == null) {
if (string18 != null) {
str7 = "use cached IMEI: ";
try {
AFLogger.AFInAppEventType(str7.concat(string18));
} catch (InvocationTargetException unused4) {
if (string18 == null) {
AFLogger.AFInAppEventType(str7.concat(string18));
} else {
string18 = null;
}
AFLogger.AFVersionDeclaration("WARNING: READ_PHONE_STATE is missing.");
if (string18 != null) {
}
z2 = appsFlyerProperties2.getBoolean(AppsFlyerProperties.COLLECT_ANDROID_ID, true);
String string19 = AFInAppEventType9.getString("androidIdCached", null);
if (!z2) {
}
str6 = this.AFVersionDeclaration;
if (str6 != null) {
}
str6 = null;
if (str6 != null) {
}
AFInAppEventType3 = ab.AFInAppEventType(application2);
if (AFInAppEventType3 != null) {
}
AFKeystoreWrapper3 = ak.AFKeystoreWrapper(new WeakReference(application2));
str8 = com.huawei.hms.support.feature.result.CommonConstant.KEY_UID;
if (AFKeystoreWrapper3 != null) {
}
map2.put(CommonConstant.ReqAccessTokenParam.LANGUAGE_LABEL, Locale.getDefault().getDisplayLanguage());
map2.put("lang_code", Locale.getDefault().getLanguage());
map2.put("country", Locale.getDefault().getCountry());
map2.put("platformextension", this.enableLocationCollection.values());
AFKeystoreWrapper(application2, (Map<String, ? super String>) map2);
SimpleDateFormat simpleDateFormat22 = new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", Locale.US);
long j322 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0).firstInstallTime;
simpleDateFormat22.setTimeZone(TimeZone.getTimeZone("UTC"));
map2.put("installDate", simpleDateFormat22.format(new Date(j322)));
PackageInfo packageInfo22 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0);
i = AFInAppEventType4.getInt("versionCode", 0);
i2 = packageInfo22.versionCode;
if (i2 > i) {
}
map2.put("app_version_code", Integer.toString(packageInfo22.versionCode));
map2.put("app_version_name", packageInfo22.versionName);
long j422 = packageInfo22.firstInstallTime;
long j522 = packageInfo22.lastUpdateTime;
str10 = str8;
Locale locale22 = Locale.US;
appsFlyerProperties3 = appsFlyerProperties;
str9 = str2;
map2.put("date1", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale22).format(new Date(j422)));
map2.put("date2", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale22).format(new Date(j522)));
map2.put("firstLaunchDate", values(simpleDateFormat22, application2));
this.stop = az.values(application2);
StringBuilder sb4222 = new StringBuilder("didConfigureTokenRefreshService=");
sb4222.append(this.stop);
AFLogger.AFInAppEventType(sb4222.toString());
if (!this.stop) {
}
if (z) {
}
if (!z) {
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
}
AFKeystoreWrapper2 = ab.AFKeystoreWrapper(application2.getContentResolver());
if (AFKeystoreWrapper2 != null) {
}
map2.put("registeredUninstall", Boolean.valueOf(az.values(AFInAppEventType4)));
z3 = z;
AFInAppEventParameterName4 = AFInAppEventParameterName(AFInAppEventType4, "appsFlyerCount", z3);
map2.put("counter", Integer.toString(AFInAppEventParameterName4));
map2.put("iaecounter", Integer.toString(AFInAppEventParameterName(AFInAppEventType4, "appsFlyerInAppEventCount", str9 != null)));
if (z3) {
}
awVar2 = awVar;
map2.put("isFirstCall", Boolean.toString(!AFKeystoreWrapper(AFInAppEventType4)));
HashMap hashMap322 = new HashMap();
hashMap322.put("cpu_abi", AFInAppEventParameterName("ro.product.cpu.abi"));
hashMap322.put("cpu_abi2", AFInAppEventParameterName("ro.product.cpu.abi2"));
hashMap322.put("arch", AFInAppEventParameterName("os.arch"));
hashMap322.put("build_display_id", AFInAppEventParameterName("ro.build.display.id"));
if (z3) {
}
hashMap322.put("dim", w.values(application2));
map2.put("deviceData", hashMap322);
Object obj2222 = obj;
String str17222 = (String) map2.get(obj2222);
String str18222 = (String) map2.get("af_timestamp");
String str19222 = str10;
String str20222 = (String) map2.get(str19222);
StringBuilder sb5222 = new StringBuilder();
sb5222.append(str17222.substring(0, 7));
sb5222.append(str20222.substring(0, 7));
sb5222.append(str18222.substring(str18222.length() - 7));
map2.put("af_v", ai.AFKeystoreWrapper(sb5222.toString()));
String str21222 = (String) map2.get(obj2222);
StringBuilder sb6222 = new StringBuilder();
sb6222.append(str21222);
sb6222.append(map2.get("af_timestamp"));
String obj3222 = sb6222.toString();
StringBuilder sb7222 = new StringBuilder();
sb7222.append(obj3222);
sb7222.append(map2.get(str19222));
String obj4222 = sb7222.toString();
StringBuilder sb8222 = new StringBuilder();
sb8222.append(obj4222);
sb8222.append(map2.get("installDate"));
String obj5222 = sb8222.toString();
StringBuilder sb9222 = new StringBuilder();
sb9222.append(obj5222);
sb9222.append(map2.get("counter"));
String obj6222 = sb9222.toString();
StringBuilder sb10222 = new StringBuilder();
sb10222.append(obj6222);
sb10222.append(map2.get("iaecounter"));
map2.put("af_v2", ai.AFKeystoreWrapper(ai.AFInAppEventType(sb10222.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application2)));
if (AFInAppEventType4.contains("is_stop_tracking_used")) {
}
HashMap hashMap2222 = new HashMap();
hashMap2222.put("mcc", Integer.valueOf(application2.getResources().getConfiguration().mcc));
hashMap2222.put("mnc", Integer.valueOf(application2.getResources().getConfiguration().mnc));
map2.put("cell", hashMap2222);
map2.put("sig", ac.valueOf(awVar2.values.getPackageManager(), awVar2.values.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs222 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong222 = statFs222.getBlockSizeLong();
long availableBlocksLong222 = statFs222.getAvailableBlocksLong() * blockSizeLong222;
long blockCountLong222 = statFs222.getBlockCountLong() * blockSizeLong222;
double pow222 = Math.pow(2.0d, 20.0d);
double d322 = availableBlocksLong222;
Double.isNaN(d322);
long j6222 = (long) (d322 / pow222);
double d2222 = blockCountLong222;
Double.isNaN(d2222);
long j7222 = (long) (d2222 / pow222);
StringBuilder sb11222 = new StringBuilder();
sb11222.append(j6222);
sb11222.append("/");
sb11222.append(j7222);
map2.put("disk", sb11222.toString());
strArr = this.init;
if (strArr != null) {
}
return map2;
} catch (Exception e10) {
e = e10;
Exception exc2 = e;
if (string18 == null) {
AFLogger.AFInAppEventType(str7.concat(string18));
} else {
string18 = null;
}
AFLogger.values("WARNING: other reason: ", exc2);
if (string18 != null) {
}
z2 = appsFlyerProperties2.getBoolean(AppsFlyerProperties.COLLECT_ANDROID_ID, true);
String string192 = AFInAppEventType9.getString("androidIdCached", null);
if (!z2) {
}
str6 = this.AFVersionDeclaration;
if (str6 != null) {
}
str6 = null;
if (str6 != null) {
}
AFInAppEventType3 = ab.AFInAppEventType(application2);
if (AFInAppEventType3 != null) {
}
AFKeystoreWrapper3 = ak.AFKeystoreWrapper(new WeakReference(application2));
str8 = com.huawei.hms.support.feature.result.CommonConstant.KEY_UID;
if (AFKeystoreWrapper3 != null) {
}
map2.put(CommonConstant.ReqAccessTokenParam.LANGUAGE_LABEL, Locale.getDefault().getDisplayLanguage());
map2.put("lang_code", Locale.getDefault().getLanguage());
map2.put("country", Locale.getDefault().getCountry());
map2.put("platformextension", this.enableLocationCollection.values());
AFKeystoreWrapper(application2, (Map<String, ? super String>) map2);
SimpleDateFormat simpleDateFormat222 = new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", Locale.US);
long j3222 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0).firstInstallTime;
simpleDateFormat222.setTimeZone(TimeZone.getTimeZone("UTC"));
map2.put("installDate", simpleDateFormat222.format(new Date(j3222)));
PackageInfo packageInfo222 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0);
i = AFInAppEventType4.getInt("versionCode", 0);
i2 = packageInfo222.versionCode;
if (i2 > i) {
}
map2.put("app_version_code", Integer.toString(packageInfo222.versionCode));
map2.put("app_version_name", packageInfo222.versionName);
long j4222 = packageInfo222.firstInstallTime;
long j5222 = packageInfo222.lastUpdateTime;
str10 = str8;
Locale locale222 = Locale.US;
appsFlyerProperties3 = appsFlyerProperties;
str9 = str2;
map2.put("date1", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale222).format(new Date(j4222)));
map2.put("date2", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale222).format(new Date(j5222)));
map2.put("firstLaunchDate", values(simpleDateFormat222, application2));
this.stop = az.values(application2);
StringBuilder sb42222 = new StringBuilder("didConfigureTokenRefreshService=");
sb42222.append(this.stop);
AFLogger.AFInAppEventType(sb42222.toString());
if (!this.stop) {
}
if (z) {
}
if (!z) {
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
}
AFKeystoreWrapper2 = ab.AFKeystoreWrapper(application2.getContentResolver());
if (AFKeystoreWrapper2 != null) {
}
map2.put("registeredUninstall", Boolean.valueOf(az.values(AFInAppEventType4)));
z3 = z;
AFInAppEventParameterName4 = AFInAppEventParameterName(AFInAppEventType4, "appsFlyerCount", z3);
map2.put("counter", Integer.toString(AFInAppEventParameterName4));
map2.put("iaecounter", Integer.toString(AFInAppEventParameterName(AFInAppEventType4, "appsFlyerInAppEventCount", str9 != null)));
if (z3) {
}
awVar2 = awVar;
map2.put("isFirstCall", Boolean.toString(!AFKeystoreWrapper(AFInAppEventType4)));
HashMap hashMap3222 = new HashMap();
hashMap3222.put("cpu_abi", AFInAppEventParameterName("ro.product.cpu.abi"));
hashMap3222.put("cpu_abi2", AFInAppEventParameterName("ro.product.cpu.abi2"));
hashMap3222.put("arch", AFInAppEventParameterName("os.arch"));
hashMap3222.put("build_display_id", AFInAppEventParameterName("ro.build.display.id"));
if (z3) {
}
hashMap3222.put("dim", w.values(application2));
map2.put("deviceData", hashMap3222);
Object obj22222 = obj;
String str172222 = (String) map2.get(obj22222);
String str182222 = (String) map2.get("af_timestamp");
String str192222 = str10;
String str202222 = (String) map2.get(str192222);
StringBuilder sb52222 = new StringBuilder();
sb52222.append(str172222.substring(0, 7));
sb52222.append(str202222.substring(0, 7));
sb52222.append(str182222.substring(str182222.length() - 7));
map2.put("af_v", ai.AFKeystoreWrapper(sb52222.toString()));
String str212222 = (String) map2.get(obj22222);
StringBuilder sb62222 = new StringBuilder();
sb62222.append(str212222);
sb62222.append(map2.get("af_timestamp"));
String obj32222 = sb62222.toString();
StringBuilder sb72222 = new StringBuilder();
sb72222.append(obj32222);
sb72222.append(map2.get(str192222));
String obj42222 = sb72222.toString();
StringBuilder sb82222 = new StringBuilder();
sb82222.append(obj42222);
sb82222.append(map2.get("installDate"));
String obj52222 = sb82222.toString();
StringBuilder sb92222 = new StringBuilder();
sb92222.append(obj52222);
sb92222.append(map2.get("counter"));
String obj62222 = sb92222.toString();
StringBuilder sb102222 = new StringBuilder();
sb102222.append(obj62222);
sb102222.append(map2.get("iaecounter"));
map2.put("af_v2", ai.AFKeystoreWrapper(ai.AFInAppEventType(sb102222.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application2)));
if (AFInAppEventType4.contains("is_stop_tracking_used")) {
}
HashMap hashMap22222 = new HashMap();
hashMap22222.put("mcc", Integer.valueOf(application2.getResources().getConfiguration().mcc));
hashMap22222.put("mnc", Integer.valueOf(application2.getResources().getConfiguration().mnc));
map2.put("cell", hashMap22222);
map2.put("sig", ac.valueOf(awVar2.values.getPackageManager(), awVar2.values.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs2222 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong2222 = statFs2222.getBlockSizeLong();
long availableBlocksLong2222 = statFs2222.getAvailableBlocksLong() * blockSizeLong2222;
long blockCountLong2222 = statFs2222.getBlockCountLong() * blockSizeLong2222;
double pow2222 = Math.pow(2.0d, 20.0d);
double d3222 = availableBlocksLong2222;
Double.isNaN(d3222);
long j62222 = (long) (d3222 / pow2222);
double d22222 = blockCountLong2222;
Double.isNaN(d22222);
long j72222 = (long) (d22222 / pow2222);
StringBuilder sb112222 = new StringBuilder();
sb112222.append(j62222);
sb112222.append("/");
sb112222.append(j72222);
map2.put("disk", sb112222.toString());
strArr = this.init;
if (strArr != null) {
}
return map2;
}
}
}
string18 = str5;
} catch (InvocationTargetException unused5) {
str7 = "use cached IMEI: ";
if (string18 == null) {
}
AFLogger.AFVersionDeclaration("WARNING: READ_PHONE_STATE is missing.");
if (string18 != null) {
}
z2 = appsFlyerProperties2.getBoolean(AppsFlyerProperties.COLLECT_ANDROID_ID, true);
String string1922 = AFInAppEventType9.getString("androidIdCached", null);
if (!z2) {
}
str6 = this.AFVersionDeclaration;
if (str6 != null) {
}
str6 = null;
if (str6 != null) {
}
AFInAppEventType3 = ab.AFInAppEventType(application2);
if (AFInAppEventType3 != null) {
}
AFKeystoreWrapper3 = ak.AFKeystoreWrapper(new WeakReference(application2));
str8 = com.huawei.hms.support.feature.result.CommonConstant.KEY_UID;
if (AFKeystoreWrapper3 != null) {
}
map2.put(CommonConstant.ReqAccessTokenParam.LANGUAGE_LABEL, Locale.getDefault().getDisplayLanguage());
map2.put("lang_code", Locale.getDefault().getLanguage());
map2.put("country", Locale.getDefault().getCountry());
map2.put("platformextension", this.enableLocationCollection.values());
AFKeystoreWrapper(application2, (Map<String, ? super String>) map2);
SimpleDateFormat simpleDateFormat2222 = new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", Locale.US);
long j32222 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0).firstInstallTime;
simpleDateFormat2222.setTimeZone(TimeZone.getTimeZone("UTC"));
map2.put("installDate", simpleDateFormat2222.format(new Date(j32222)));
PackageInfo packageInfo2222 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0);
i = AFInAppEventType4.getInt("versionCode", 0);
i2 = packageInfo2222.versionCode;
if (i2 > i) {
}
map2.put("app_version_code", Integer.toString(packageInfo2222.versionCode));
map2.put("app_version_name", packageInfo2222.versionName);
long j42222 = packageInfo2222.firstInstallTime;
long j52222 = packageInfo2222.lastUpdateTime;
str10 = str8;
Locale locale2222 = Locale.US;
appsFlyerProperties3 = appsFlyerProperties;
str9 = str2;
map2.put("date1", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale2222).format(new Date(j42222)));
map2.put("date2", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale2222).format(new Date(j52222)));
map2.put("firstLaunchDate", values(simpleDateFormat2222, application2));
this.stop = az.values(application2);
StringBuilder sb422222 = new StringBuilder("didConfigureTokenRefreshService=");
sb422222.append(this.stop);
AFLogger.AFInAppEventType(sb422222.toString());
if (!this.stop) {
}
if (z) {
}
if (!z) {
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
}
AFKeystoreWrapper2 = ab.AFKeystoreWrapper(application2.getContentResolver());
if (AFKeystoreWrapper2 != null) {
}
map2.put("registeredUninstall", Boolean.valueOf(az.values(AFInAppEventType4)));
z3 = z;
AFInAppEventParameterName4 = AFInAppEventParameterName(AFInAppEventType4, "appsFlyerCount", z3);
map2.put("counter", Integer.toString(AFInAppEventParameterName4));
map2.put("iaecounter", Integer.toString(AFInAppEventParameterName(AFInAppEventType4, "appsFlyerInAppEventCount", str9 != null)));
if (z3) {
}
awVar2 = awVar;
map2.put("isFirstCall", Boolean.toString(!AFKeystoreWrapper(AFInAppEventType4)));
HashMap hashMap32222 = new HashMap();
hashMap32222.put("cpu_abi", AFInAppEventParameterName("ro.product.cpu.abi"));
hashMap32222.put("cpu_abi2", AFInAppEventParameterName("ro.product.cpu.abi2"));
hashMap32222.put("arch", AFInAppEventParameterName("os.arch"));
hashMap32222.put("build_display_id", AFInAppEventParameterName("ro.build.display.id"));
if (z3) {
}
hashMap32222.put("dim", w.values(application2));
map2.put("deviceData", hashMap32222);
Object obj222222 = obj;
String str1722222 = (String) map2.get(obj222222);
String str1822222 = (String) map2.get("af_timestamp");
String str1922222 = str10;
String str2022222 = (String) map2.get(str1922222);
StringBuilder sb522222 = new StringBuilder();
sb522222.append(str1722222.substring(0, 7));
sb522222.append(str2022222.substring(0, 7));
sb522222.append(str1822222.substring(str1822222.length() - 7));
map2.put("af_v", ai.AFKeystoreWrapper(sb522222.toString()));
String str2122222 = (String) map2.get(obj222222);
StringBuilder sb622222 = new StringBuilder();
sb622222.append(str2122222);
sb622222.append(map2.get("af_timestamp"));
String obj322222 = sb622222.toString();
StringBuilder sb722222 = new StringBuilder();
sb722222.append(obj322222);
sb722222.append(map2.get(str1922222));
String obj422222 = sb722222.toString();
StringBuilder sb822222 = new StringBuilder();
sb822222.append(obj422222);
sb822222.append(map2.get("installDate"));
String obj522222 = sb822222.toString();
StringBuilder sb922222 = new StringBuilder();
sb922222.append(obj522222);
sb922222.append(map2.get("counter"));
String obj622222 = sb922222.toString();
StringBuilder sb1022222 = new StringBuilder();
sb1022222.append(obj622222);
sb1022222.append(map2.get("iaecounter"));
map2.put("af_v2", ai.AFKeystoreWrapper(ai.AFInAppEventType(sb1022222.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application2)));
if (AFInAppEventType4.contains("is_stop_tracking_used")) {
}
HashMap hashMap222222 = new HashMap();
hashMap222222.put("mcc", Integer.valueOf(application2.getResources().getConfiguration().mcc));
hashMap222222.put("mnc", Integer.valueOf(application2.getResources().getConfiguration().mnc));
map2.put("cell", hashMap222222);
map2.put("sig", ac.valueOf(awVar2.values.getPackageManager(), awVar2.values.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs22222 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong22222 = statFs22222.getBlockSizeLong();
long availableBlocksLong22222 = statFs22222.getAvailableBlocksLong() * blockSizeLong22222;
long blockCountLong22222 = statFs22222.getBlockCountLong() * blockSizeLong22222;
double pow22222 = Math.pow(2.0d, 20.0d);
double d32222 = availableBlocksLong22222;
Double.isNaN(d32222);
long j622222 = (long) (d32222 / pow22222);
double d222222 = blockCountLong22222;
Double.isNaN(d222222);
long j722222 = (long) (d222222 / pow22222);
StringBuilder sb1122222 = new StringBuilder();
sb1122222.append(j622222);
sb1122222.append("/");
sb1122222.append(j722222);
map2.put("disk", sb1122222.toString());
strArr = this.init;
if (strArr != null) {
}
return map2;
} catch (Exception e11) {
e = e11;
str7 = "use cached IMEI: ";
Exception exc22 = e;
if (string18 == null) {
}
AFLogger.values("WARNING: other reason: ", exc22);
if (string18 != null) {
}
z2 = appsFlyerProperties2.getBoolean(AppsFlyerProperties.COLLECT_ANDROID_ID, true);
String string19222 = AFInAppEventType9.getString("androidIdCached", null);
if (!z2) {
}
str6 = this.AFVersionDeclaration;
if (str6 != null) {
}
str6 = null;
if (str6 != null) {
}
AFInAppEventType3 = ab.AFInAppEventType(application2);
if (AFInAppEventType3 != null) {
}
AFKeystoreWrapper3 = ak.AFKeystoreWrapper(new WeakReference(application2));
str8 = com.huawei.hms.support.feature.result.CommonConstant.KEY_UID;
if (AFKeystoreWrapper3 != null) {
}
map2.put(CommonConstant.ReqAccessTokenParam.LANGUAGE_LABEL, Locale.getDefault().getDisplayLanguage());
map2.put("lang_code", Locale.getDefault().getLanguage());
map2.put("country", Locale.getDefault().getCountry());
map2.put("platformextension", this.enableLocationCollection.values());
AFKeystoreWrapper(application2, (Map<String, ? super String>) map2);
SimpleDateFormat simpleDateFormat22222 = new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", Locale.US);
long j322222 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0).firstInstallTime;
simpleDateFormat22222.setTimeZone(TimeZone.getTimeZone("UTC"));
map2.put("installDate", simpleDateFormat22222.format(new Date(j322222)));
PackageInfo packageInfo22222 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0);
i = AFInAppEventType4.getInt("versionCode", 0);
i2 = packageInfo22222.versionCode;
if (i2 > i) {
}
map2.put("app_version_code", Integer.toString(packageInfo22222.versionCode));
map2.put("app_version_name", packageInfo22222.versionName);
long j422222 = packageInfo22222.firstInstallTime;
long j522222 = packageInfo22222.lastUpdateTime;
str10 = str8;
Locale locale22222 = Locale.US;
appsFlyerProperties3 = appsFlyerProperties;
str9 = str2;
map2.put("date1", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale22222).format(new Date(j422222)));
map2.put("date2", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale22222).format(new Date(j522222)));
map2.put("firstLaunchDate", values(simpleDateFormat22222, application2));
this.stop = az.values(application2);
StringBuilder sb4222222 = new StringBuilder("didConfigureTokenRefreshService=");
sb4222222.append(this.stop);
AFLogger.AFInAppEventType(sb4222222.toString());
if (!this.stop) {
}
if (z) {
}
if (!z) {
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
}
AFKeystoreWrapper2 = ab.AFKeystoreWrapper(application2.getContentResolver());
if (AFKeystoreWrapper2 != null) {
}
map2.put("registeredUninstall", Boolean.valueOf(az.values(AFInAppEventType4)));
z3 = z;
AFInAppEventParameterName4 = AFInAppEventParameterName(AFInAppEventType4, "appsFlyerCount", z3);
map2.put("counter", Integer.toString(AFInAppEventParameterName4));
map2.put("iaecounter", Integer.toString(AFInAppEventParameterName(AFInAppEventType4, "appsFlyerInAppEventCount", str9 != null)));
if (z3) {
}
awVar2 = awVar;
map2.put("isFirstCall", Boolean.toString(!AFKeystoreWrapper(AFInAppEventType4)));
HashMap hashMap322222 = new HashMap();
hashMap322222.put("cpu_abi", AFInAppEventParameterName("ro.product.cpu.abi"));
hashMap322222.put("cpu_abi2", AFInAppEventParameterName("ro.product.cpu.abi2"));
hashMap322222.put("arch", AFInAppEventParameterName("os.arch"));
hashMap322222.put("build_display_id", AFInAppEventParameterName("ro.build.display.id"));
if (z3) {
}
hashMap322222.put("dim", w.values(application2));
map2.put("deviceData", hashMap322222);
Object obj2222222 = obj;
String str17222222 = (String) map2.get(obj2222222);
String str18222222 = (String) map2.get("af_timestamp");
String str19222222 = str10;
String str20222222 = (String) map2.get(str19222222);
StringBuilder sb5222222 = new StringBuilder();
sb5222222.append(str17222222.substring(0, 7));
sb5222222.append(str20222222.substring(0, 7));
sb5222222.append(str18222222.substring(str18222222.length() - 7));
map2.put("af_v", ai.AFKeystoreWrapper(sb5222222.toString()));
String str21222222 = (String) map2.get(obj2222222);
StringBuilder sb6222222 = new StringBuilder();
sb6222222.append(str21222222);
sb6222222.append(map2.get("af_timestamp"));
String obj3222222 = sb6222222.toString();
StringBuilder sb7222222 = new StringBuilder();
sb7222222.append(obj3222222);
sb7222222.append(map2.get(str19222222));
String obj4222222 = sb7222222.toString();
StringBuilder sb8222222 = new StringBuilder();
sb8222222.append(obj4222222);
sb8222222.append(map2.get("installDate"));
String obj5222222 = sb8222222.toString();
StringBuilder sb9222222 = new StringBuilder();
sb9222222.append(obj5222222);
sb9222222.append(map2.get("counter"));
String obj6222222 = sb9222222.toString();
StringBuilder sb10222222 = new StringBuilder();
sb10222222.append(obj6222222);
sb10222222.append(map2.get("iaecounter"));
map2.put("af_v2", ai.AFKeystoreWrapper(ai.AFInAppEventType(sb10222222.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application2)));
if (AFInAppEventType4.contains("is_stop_tracking_used")) {
}
HashMap hashMap2222222 = new HashMap();
hashMap2222222.put("mcc", Integer.valueOf(application2.getResources().getConfiguration().mcc));
hashMap2222222.put("mnc", Integer.valueOf(application2.getResources().getConfiguration().mnc));
map2.put("cell", hashMap2222222);
map2.put("sig", ac.valueOf(awVar2.values.getPackageManager(), awVar2.values.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs222222 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong222222 = statFs222222.getBlockSizeLong();
long availableBlocksLong222222 = statFs222222.getAvailableBlocksLong() * blockSizeLong222222;
long blockCountLong222222 = statFs222222.getBlockCountLong() * blockSizeLong222222;
double pow222222 = Math.pow(2.0d, 20.0d);
double d322222 = availableBlocksLong222222;
Double.isNaN(d322222);
long j6222222 = (long) (d322222 / pow222222);
double d2222222 = blockCountLong222222;
Double.isNaN(d2222222);
long j7222222 = (long) (d2222222 / pow222222);
StringBuilder sb11222222 = new StringBuilder();
sb11222222.append(j6222222);
sb11222222.append("/");
sb11222222.append(j7222222);
map2.put("disk", sb11222222.toString());
strArr = this.init;
if (strArr != null) {
}
return map2;
}
} else {
obj = "appsflyerKey";
}
string18 = null;
} else {
obj = "appsflyerKey";
str5 = this.AppsFlyer2dXConversionCallback;
}
if (string18 != null) {
SharedPreferences.Editor edit4 = AFInAppEventType(application2).edit();
edit4.putString("imeiCached", string18);
edit4.apply();
map2.put("imei", string18);
} else {
AFLogger.AFInAppEventParameterName("IMEI was not collected.");
}
z2 = appsFlyerProperties2.getBoolean(AppsFlyerProperties.COLLECT_ANDROID_ID, true);
String string192222 = AFInAppEventType9.getString("androidIdCached", null);
if (!z2 && TextUtils.isEmpty(this.AFVersionDeclaration)) {
if (init(application2)) {
try {
str6 = Settings.Secure.getString(application2.getContentResolver(), "android_id");
} catch (Exception e12) {
if (string192222 != null) {
AFLogger.AFInAppEventType("use cached AndroidId: ".concat(string192222));
} else {
string192222 = null;
}
AFLogger.values(e12.getMessage(), e12);
}
if (str6 == null) {
if (string192222 != null) {
AFLogger.AFInAppEventType("use cached AndroidId: ".concat(string192222));
} else {
string192222 = null;
}
str6 = string192222;
if (str6 != null) {
}
AFInAppEventType3 = ab.AFInAppEventType(application2);
if (AFInAppEventType3 != null) {
}
} else {
if (str6 != null) {
}
AFInAppEventType3 = ab.AFInAppEventType(application2);
if (AFInAppEventType3 != null) {
}
}
}
str6 = null;
if (str6 != null) {
}
AFInAppEventType3 = ab.AFInAppEventType(application2);
if (AFInAppEventType3 != null) {
}
} else {
str6 = this.AFVersionDeclaration;
if (str6 != null) {
if (str6 != null) {
SharedPreferences.Editor edit5 = AFInAppEventType(application2).edit();
edit5.putString("androidIdCached", str6);
edit5.apply();
map2.put("android_id", str6);
} else {
AFLogger.AFInAppEventParameterName("Android ID was not collected.");
}
AFInAppEventType3 = ab.AFInAppEventType(application2);
if (AFInAppEventType3 != null) {
HashMap hashMap4 = new HashMap();
hashMap4.put("isManual", AFInAppEventType3.values);
hashMap4.put("val", AFInAppEventType3.valueOf);
Boolean bool = AFInAppEventType3.AFInAppEventType;
if (bool != null) {
hashMap4.put("isLat", bool);
}
map2.put("oaid", hashMap4);
}
}
str6 = null;
if (str6 != null) {
}
AFInAppEventType3 = ab.AFInAppEventType(application2);
if (AFInAppEventType3 != null) {
}
}
}
try {
AFKeystoreWrapper3 = ak.AFKeystoreWrapper(new WeakReference(application2));
str8 = com.huawei.hms.support.feature.result.CommonConstant.KEY_UID;
if (AFKeystoreWrapper3 != null) {
try {
map2.put(str8, AFKeystoreWrapper3);
} catch (Exception e13) {
e = e13;
Exception exc3 = e;
StringBuilder sb12 = new StringBuilder("ERROR: could not get uid ");
sb12.append(exc3.getMessage());
AFLogger.values(sb12.toString(), exc3);
map2.put(CommonConstant.ReqAccessTokenParam.LANGUAGE_LABEL, Locale.getDefault().getDisplayLanguage());
map2.put("lang_code", Locale.getDefault().getLanguage());
map2.put("country", Locale.getDefault().getCountry());
map2.put("platformextension", this.enableLocationCollection.values());
AFKeystoreWrapper(application2, (Map<String, ? super String>) map2);
SimpleDateFormat simpleDateFormat222222 = new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", Locale.US);
long j3222222 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0).firstInstallTime;
simpleDateFormat222222.setTimeZone(TimeZone.getTimeZone("UTC"));
map2.put("installDate", simpleDateFormat222222.format(new Date(j3222222)));
PackageInfo packageInfo222222 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0);
i = AFInAppEventType4.getInt("versionCode", 0);
i2 = packageInfo222222.versionCode;
if (i2 > i) {
}
map2.put("app_version_code", Integer.toString(packageInfo222222.versionCode));
map2.put("app_version_name", packageInfo222222.versionName);
long j4222222 = packageInfo222222.firstInstallTime;
long j5222222 = packageInfo222222.lastUpdateTime;
str10 = str8;
Locale locale222222 = Locale.US;
appsFlyerProperties3 = appsFlyerProperties;
str9 = str2;
map2.put("date1", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale222222).format(new Date(j4222222)));
map2.put("date2", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale222222).format(new Date(j5222222)));
map2.put("firstLaunchDate", values(simpleDateFormat222222, application2));
this.stop = az.values(application2);
StringBuilder sb42222222 = new StringBuilder("didConfigureTokenRefreshService=");
sb42222222.append(this.stop);
AFLogger.AFInAppEventType(sb42222222.toString());
if (!this.stop) {
}
if (z) {
}
if (!z) {
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
}
AFKeystoreWrapper2 = ab.AFKeystoreWrapper(application2.getContentResolver());
if (AFKeystoreWrapper2 != null) {
}
map2.put("registeredUninstall", Boolean.valueOf(az.values(AFInAppEventType4)));
z3 = z;
AFInAppEventParameterName4 = AFInAppEventParameterName(AFInAppEventType4, "appsFlyerCount", z3);
map2.put("counter", Integer.toString(AFInAppEventParameterName4));
map2.put("iaecounter", Integer.toString(AFInAppEventParameterName(AFInAppEventType4, "appsFlyerInAppEventCount", str9 != null)));
if (z3) {
}
awVar2 = awVar;
map2.put("isFirstCall", Boolean.toString(!AFKeystoreWrapper(AFInAppEventType4)));
HashMap hashMap3222222 = new HashMap();
hashMap3222222.put("cpu_abi", AFInAppEventParameterName("ro.product.cpu.abi"));
hashMap3222222.put("cpu_abi2", AFInAppEventParameterName("ro.product.cpu.abi2"));
hashMap3222222.put("arch", AFInAppEventParameterName("os.arch"));
hashMap3222222.put("build_display_id", AFInAppEventParameterName("ro.build.display.id"));
if (z3) {
}
hashMap3222222.put("dim", w.values(application2));
map2.put("deviceData", hashMap3222222);
Object obj22222222 = obj;
String str172222222 = (String) map2.get(obj22222222);
String str182222222 = (String) map2.get("af_timestamp");
String str192222222 = str10;
String str202222222 = (String) map2.get(str192222222);
StringBuilder sb52222222 = new StringBuilder();
sb52222222.append(str172222222.substring(0, 7));
sb52222222.append(str202222222.substring(0, 7));
sb52222222.append(str182222222.substring(str182222222.length() - 7));
map2.put("af_v", ai.AFKeystoreWrapper(sb52222222.toString()));
String str212222222 = (String) map2.get(obj22222222);
StringBuilder sb62222222 = new StringBuilder();
sb62222222.append(str212222222);
sb62222222.append(map2.get("af_timestamp"));
String obj32222222 = sb62222222.toString();
StringBuilder sb72222222 = new StringBuilder();
sb72222222.append(obj32222222);
sb72222222.append(map2.get(str192222222));
String obj42222222 = sb72222222.toString();
StringBuilder sb82222222 = new StringBuilder();
sb82222222.append(obj42222222);
sb82222222.append(map2.get("installDate"));
String obj52222222 = sb82222222.toString();
StringBuilder sb92222222 = new StringBuilder();
sb92222222.append(obj52222222);
sb92222222.append(map2.get("counter"));
String obj62222222 = sb92222222.toString();
StringBuilder sb102222222 = new StringBuilder();
sb102222222.append(obj62222222);
sb102222222.append(map2.get("iaecounter"));
map2.put("af_v2", ai.AFKeystoreWrapper(ai.AFInAppEventType(sb102222222.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application2)));
if (AFInAppEventType4.contains("is_stop_tracking_used")) {
}
HashMap hashMap22222222 = new HashMap();
hashMap22222222.put("mcc", Integer.valueOf(application2.getResources().getConfiguration().mcc));
hashMap22222222.put("mnc", Integer.valueOf(application2.getResources().getConfiguration().mnc));
map2.put("cell", hashMap22222222);
map2.put("sig", ac.valueOf(awVar2.values.getPackageManager(), awVar2.values.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs2222222 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong2222222 = statFs2222222.getBlockSizeLong();
long availableBlocksLong2222222 = statFs2222222.getAvailableBlocksLong() * blockSizeLong2222222;
long blockCountLong2222222 = statFs2222222.getBlockCountLong() * blockSizeLong2222222;
double pow2222222 = Math.pow(2.0d, 20.0d);
double d3222222 = availableBlocksLong2222222;
Double.isNaN(d3222222);
long j62222222 = (long) (d3222222 / pow2222222);
double d22222222 = blockCountLong2222222;
Double.isNaN(d22222222);
long j72222222 = (long) (d22222222 / pow2222222);
StringBuilder sb112222222 = new StringBuilder();
sb112222222.append(j62222222);
sb112222222.append("/");
sb112222222.append(j72222222);
map2.put("disk", sb112222222.toString());
strArr = this.init;
if (strArr != null) {
}
return map2;
}
}
} catch (Exception e14) {
e = e14;
str8 = com.huawei.hms.support.feature.result.CommonConstant.KEY_UID;
}
try {
map2.put(CommonConstant.ReqAccessTokenParam.LANGUAGE_LABEL, Locale.getDefault().getDisplayLanguage());
} catch (Exception e15) {
AFLogger.values("Exception while collecting display language name. ", e15);
}
try {
map2.put("lang_code", Locale.getDefault().getLanguage());
} catch (Exception e16) {
AFLogger.values("Exception while collecting display language code. ", e16);
}
try {
map2.put("country", Locale.getDefault().getCountry());
} catch (Exception e17) {
AFLogger.values("Exception while collecting country name. ", e17);
}
map2.put("platformextension", this.enableLocationCollection.values());
AFKeystoreWrapper(application2, (Map<String, ? super String>) map2);
SimpleDateFormat simpleDateFormat2222222 = new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", Locale.US);
try {
long j32222222 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0).firstInstallTime;
simpleDateFormat2222222.setTimeZone(TimeZone.getTimeZone("UTC"));
map2.put("installDate", simpleDateFormat2222222.format(new Date(j32222222)));
} catch (Exception e18) {
AFLogger.values("Exception while collecting install date. ", e18);
}
try {
PackageInfo packageInfo2222222 = application2.getPackageManager().getPackageInfo(application2.getPackageName(), 0);
i = AFInAppEventType4.getInt("versionCode", 0);
i2 = packageInfo2222222.versionCode;
if (i2 > i) {
SharedPreferences.Editor edit6 = AFInAppEventType(application2).edit();
edit6.putInt("versionCode", i2);
edit6.apply();
}
map2.put("app_version_code", Integer.toString(packageInfo2222222.versionCode));
map2.put("app_version_name", packageInfo2222222.versionName);
long j42222222 = packageInfo2222222.firstInstallTime;
long j52222222 = packageInfo2222222.lastUpdateTime;
str10 = str8;
Locale locale2222222 = Locale.US;
appsFlyerProperties3 = appsFlyerProperties;
str9 = str2;
map2.put("date1", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale2222222).format(new Date(j42222222)));
map2.put("date2", new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", locale2222222).format(new Date(j52222222)));
map2.put("firstLaunchDate", values(simpleDateFormat2222222, application2));
} catch (Throwable th5) {
th = th5;
str9 = str2;
appsFlyerProperties3 = appsFlyerProperties;
str10 = str8;
}
this.stop = az.values(application2);
StringBuilder sb422222222 = new StringBuilder("didConfigureTokenRefreshService=");
sb422222222.append(this.stop);
AFLogger.AFInAppEventType(sb422222222.toString());
if (!this.stop) {
map2.put("tokenRefreshConfigured", Boolean.FALSE);
}
if (z) {
if (this.getInstance != null) {
if (map2.get("af_deeplink") != null) {
AFLogger.AFInAppEventType("Skip 'af' payload as deeplink was found by path");
} else {
JSONObject jSONObject3 = new JSONObject(this.getInstance);
jSONObject3.put("isPush", fv.Code);
map2.put("af_deeplink", jSONObject3.toString());
}
}
this.getInstance = null;
map2.put("open_referrer", str14);
}
if (!z) {
try {
z valueOf2 = z.valueOf(application2);
ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap();
List<Map<String, Object>> AFInAppEventParameterName6 = valueOf2.AFInAppEventParameterName();
if (!AFInAppEventParameterName6.isEmpty()) {
concurrentHashMap.put("sensors", new g().AFInAppEventType(AFInAppEventParameterName6));
} else {
concurrentHashMap.put("sensors", "na");
}
map2.putAll(concurrentHashMap);
} catch (Exception e19) {
StringBuilder sb13 = new StringBuilder("Unexpected exception from AFSensorManager: ");
sb13.append(e19.getMessage());
AFLogger.AFKeystoreWrapper(sb13.toString());
}
}
if (AppsFlyerProperties.getInstance().getString("advertiserId") == null) {
ab.AFKeystoreWrapper(application2, map2);
if (AppsFlyerProperties.getInstance().getString("advertiserId") != null) {
map2.put("GAID_retry", fv.Code);
} else {
map2.put("GAID_retry", fv.V);
}
}
AFKeystoreWrapper2 = ab.AFKeystoreWrapper(application2.getContentResolver());
if (AFKeystoreWrapper2 != null) {
map2.put("amazon_aid", AFKeystoreWrapper2.valueOf);
map2.put("amazon_aid_limit", String.valueOf(AFKeystoreWrapper2.AFInAppEventType));
}
map2.put("registeredUninstall", Boolean.valueOf(az.values(AFInAppEventType4)));
z3 = z;
AFInAppEventParameterName4 = AFInAppEventParameterName(AFInAppEventType4, "appsFlyerCount", z3);
map2.put("counter", Integer.toString(AFInAppEventParameterName4));
map2.put("iaecounter", Integer.toString(AFInAppEventParameterName(AFInAppEventType4, "appsFlyerInAppEventCount", str9 != null)));
} catch (Throwable th6) {
AFLogger.AFInAppEventParameterName(th6.getLocalizedMessage(), th6);
}
if (z3) {
if (AFInAppEventParameterName4 == 1) {
awVar2 = awVar;
appsFlyerProperties3.values = true;
if (values(AppsFlyerProperties.AF_WAITFOR_CUSTOMERID, false)) {
map2.put("wait_cid", Boolean.toString(true));
}
Map<String, Object> AFInAppEventType10 = AFInAppEventType(map2);
String string20 = awVar2.AFInAppEventType.getString("ddl", null);
if (string20 != null) {
Map<String, Object> AFInAppEventParameterName7 = k.AFInAppEventParameterName(new JSONObject(string20));
if (!AFInAppEventParameterName7.isEmpty()) {
AFInAppEventType10.put("ddl", AFInAppEventParameterName7);
}
}
Map<String, Object> AFInAppEventParameterName8 = k.AFInAppEventParameterName(this.setAdditionalData);
if (!AFInAppEventParameterName8.isEmpty()) {
AFInAppEventType10.put("first_launch", AFInAppEventParameterName8);
}
map2.put("isFirstCall", Boolean.toString(!AFKeystoreWrapper(AFInAppEventType4)));
HashMap hashMap32222222 = new HashMap();
hashMap32222222.put("cpu_abi", AFInAppEventParameterName("ro.product.cpu.abi"));
hashMap32222222.put("cpu_abi2", AFInAppEventParameterName("ro.product.cpu.abi2"));
hashMap32222222.put("arch", AFInAppEventParameterName("os.arch"));
hashMap32222222.put("build_display_id", AFInAppEventParameterName("ro.build.display.id"));
if (z3) {
}
hashMap32222222.put("dim", w.values(application2));
map2.put("deviceData", hashMap32222222);
Object obj222222222 = obj;
String str1722222222 = (String) map2.get(obj222222222);
String str1822222222 = (String) map2.get("af_timestamp");
String str1922222222 = str10;
String str2022222222 = (String) map2.get(str1922222222);
StringBuilder sb522222222 = new StringBuilder();
sb522222222.append(str1722222222.substring(0, 7));
sb522222222.append(str2022222222.substring(0, 7));
sb522222222.append(str1822222222.substring(str1822222222.length() - 7));
map2.put("af_v", ai.AFKeystoreWrapper(sb522222222.toString()));
String str2122222222 = (String) map2.get(obj222222222);
StringBuilder sb622222222 = new StringBuilder();
sb622222222.append(str2122222222);
sb622222222.append(map2.get("af_timestamp"));
String obj322222222 = sb622222222.toString();
StringBuilder sb722222222 = new StringBuilder();
sb722222222.append(obj322222222);
sb722222222.append(map2.get(str1922222222));
String obj422222222 = sb722222222.toString();
StringBuilder sb822222222 = new StringBuilder();
sb822222222.append(obj422222222);
sb822222222.append(map2.get("installDate"));
String obj522222222 = sb822222222.toString();
StringBuilder sb922222222 = new StringBuilder();
sb922222222.append(obj522222222);
sb922222222.append(map2.get("counter"));
String obj622222222 = sb922222222.toString();
StringBuilder sb1022222222 = new StringBuilder();
sb1022222222.append(obj622222222);
sb1022222222.append(map2.get("iaecounter"));
map2.put("af_v2", ai.AFKeystoreWrapper(ai.AFInAppEventType(sb1022222222.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application2)));
if (AFInAppEventType4.contains("is_stop_tracking_used")) {
}
HashMap hashMap222222222 = new HashMap();
hashMap222222222.put("mcc", Integer.valueOf(application2.getResources().getConfiguration().mcc));
hashMap222222222.put("mnc", Integer.valueOf(application2.getResources().getConfiguration().mnc));
map2.put("cell", hashMap222222222);
map2.put("sig", ac.valueOf(awVar2.values.getPackageManager(), awVar2.values.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs22222222 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong22222222 = statFs22222222.getBlockSizeLong();
long availableBlocksLong22222222 = statFs22222222.getAvailableBlocksLong() * blockSizeLong22222222;
long blockCountLong22222222 = statFs22222222.getBlockCountLong() * blockSizeLong22222222;
double pow22222222 = Math.pow(2.0d, 20.0d);
double d32222222 = availableBlocksLong22222222;
Double.isNaN(d32222222);
long j622222222 = (long) (d32222222 / pow22222222);
double d222222222 = blockCountLong22222222;
Double.isNaN(d222222222);
long j722222222 = (long) (d222222222 / pow22222222);
StringBuilder sb1122222222 = new StringBuilder();
sb1122222222.append(j622222222);
sb1122222222.append("/");
sb1122222222.append(j722222222);
map2.put("disk", sb1122222222.toString());
strArr = this.init;
if (strArr != null) {
}
return map2;
}
if (AFInAppEventParameterName4 == 2) {
Map<String, Object> AFInAppEventType11 = AFInAppEventType(map2);
awVar2 = awVar;
String string21 = awVar2.AFInAppEventType.getString("first_launch", null);
if (string21 != null) {
Map<String, Object> AFInAppEventParameterName9 = k.AFInAppEventParameterName(new JSONObject(string21));
if (!AFInAppEventParameterName9.isEmpty()) {
AFInAppEventType11.put("first_launch", AFInAppEventParameterName9);
}
}
map2.put("isFirstCall", Boolean.toString(!AFKeystoreWrapper(AFInAppEventType4)));
HashMap hashMap322222222 = new HashMap();
hashMap322222222.put("cpu_abi", AFInAppEventParameterName("ro.product.cpu.abi"));
hashMap322222222.put("cpu_abi2", AFInAppEventParameterName("ro.product.cpu.abi2"));
hashMap322222222.put("arch", AFInAppEventParameterName("os.arch"));
hashMap322222222.put("build_display_id", AFInAppEventParameterName("ro.build.display.id"));
if (z3) {
if (this.getSdkVersion) {
Location AFInAppEventType12 = v.b.values.AFInAppEventType(application2);
HashMap hashMap5 = new HashMap(3);
if (AFInAppEventType12 != null) {
hashMap5.put(com.umeng.analytics.pro.d.C, String.valueOf(AFInAppEventType12.getLatitude()));
hashMap5.put("lon", String.valueOf(AFInAppEventType12.getLongitude()));
hashMap5.put("ts", String.valueOf(AFInAppEventType12.getTime()));
}
if (!hashMap5.isEmpty()) {
hashMap322222222.put("loc", hashMap5);
}
}
a.d AFInAppEventType13 = a.c.values.AFInAppEventType(application2);
hashMap322222222.put("btl", Float.toString(AFInAppEventType13.AFInAppEventParameterName));
String str22 = AFInAppEventType13.AFInAppEventType;
if (str22 != null) {
hashMap322222222.put("btch", str22);
}
if (AFInAppEventParameterName4 <= 2) {
z valueOf3 = z.valueOf(application2);
ConcurrentHashMap concurrentHashMap2 = new ConcurrentHashMap();
List<Map<String, Object>> AFKeystoreWrapper5 = valueOf3.AFKeystoreWrapper();
if (!AFKeystoreWrapper5.isEmpty()) {
concurrentHashMap2.put("sensors", AFKeystoreWrapper5);
} else {
List<Map<String, Object>> AFInAppEventParameterName10 = valueOf3.AFInAppEventParameterName();
if (!AFInAppEventParameterName10.isEmpty()) {
concurrentHashMap2.put("sensors", AFInAppEventParameterName10);
}
}
hashMap322222222.putAll(concurrentHashMap2);
}
}
hashMap322222222.put("dim", w.values(application2));
map2.put("deviceData", hashMap322222222);
Object obj2222222222 = obj;
String str17222222222 = (String) map2.get(obj2222222222);
String str18222222222 = (String) map2.get("af_timestamp");
String str19222222222 = str10;
String str20222222222 = (String) map2.get(str19222222222);
StringBuilder sb5222222222 = new StringBuilder();
sb5222222222.append(str17222222222.substring(0, 7));
sb5222222222.append(str20222222222.substring(0, 7));
sb5222222222.append(str18222222222.substring(str18222222222.length() - 7));
map2.put("af_v", ai.AFKeystoreWrapper(sb5222222222.toString()));
String str21222222222 = (String) map2.get(obj2222222222);
StringBuilder sb6222222222 = new StringBuilder();
sb6222222222.append(str21222222222);
sb6222222222.append(map2.get("af_timestamp"));
String obj3222222222 = sb6222222222.toString();
StringBuilder sb7222222222 = new StringBuilder();
sb7222222222.append(obj3222222222);
sb7222222222.append(map2.get(str19222222222));
String obj4222222222 = sb7222222222.toString();
StringBuilder sb8222222222 = new StringBuilder();
sb8222222222.append(obj4222222222);
sb8222222222.append(map2.get("installDate"));
String obj5222222222 = sb8222222222.toString();
StringBuilder sb9222222222 = new StringBuilder();
sb9222222222.append(obj5222222222);
sb9222222222.append(map2.get("counter"));
String obj6222222222 = sb9222222222.toString();
StringBuilder sb10222222222 = new StringBuilder();
sb10222222222.append(obj6222222222);
sb10222222222.append(map2.get("iaecounter"));
map2.put("af_v2", ai.AFKeystoreWrapper(ai.AFInAppEventType(sb10222222222.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application2)));
if (AFInAppEventType4.contains("is_stop_tracking_used")) {
map2.put("istu", String.valueOf(AFInAppEventType4.getBoolean("is_stop_tracking_used", false)));
}
HashMap hashMap2222222222 = new HashMap();
hashMap2222222222.put("mcc", Integer.valueOf(application2.getResources().getConfiguration().mcc));
hashMap2222222222.put("mnc", Integer.valueOf(application2.getResources().getConfiguration().mnc));
map2.put("cell", hashMap2222222222);
map2.put("sig", ac.valueOf(awVar2.values.getPackageManager(), awVar2.values.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs222222222 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong222222222 = statFs222222222.getBlockSizeLong();
long availableBlocksLong222222222 = statFs222222222.getAvailableBlocksLong() * blockSizeLong222222222;
long blockCountLong222222222 = statFs222222222.getBlockCountLong() * blockSizeLong222222222;
double pow222222222 = Math.pow(2.0d, 20.0d);
double d322222222 = availableBlocksLong222222222;
Double.isNaN(d322222222);
long j6222222222 = (long) (d322222222 / pow222222222);
double d2222222222 = blockCountLong222222222;
Double.isNaN(d2222222222);
long j7222222222 = (long) (d2222222222 / pow222222222);
StringBuilder sb11222222222 = new StringBuilder();
sb11222222222.append(j6222222222);
sb11222222222.append("/");
sb11222222222.append(j7222222222);
map2.put("disk", sb11222222222.toString());
strArr = this.init;
if (strArr != null) {
map2.put("sharing_filter", strArr);
}
return map2;
}
}
awVar2 = awVar;
map2.put("isFirstCall", Boolean.toString(!AFKeystoreWrapper(AFInAppEventType4)));
HashMap hashMap3222222222 = new HashMap();
hashMap3222222222.put("cpu_abi", AFInAppEventParameterName("ro.product.cpu.abi"));
hashMap3222222222.put("cpu_abi2", AFInAppEventParameterName("ro.product.cpu.abi2"));
hashMap3222222222.put("arch", AFInAppEventParameterName("os.arch"));
hashMap3222222222.put("build_display_id", AFInAppEventParameterName("ro.build.display.id"));
if (z3) {
}
hashMap3222222222.put("dim", w.values(application2));
map2.put("deviceData", hashMap3222222222);
Object obj22222222222 = obj;
String str172222222222 = (String) map2.get(obj22222222222);
String str182222222222 = (String) map2.get("af_timestamp");
String str192222222222 = str10;
String str202222222222 = (String) map2.get(str192222222222);
StringBuilder sb52222222222 = new StringBuilder();
sb52222222222.append(str172222222222.substring(0, 7));
sb52222222222.append(str202222222222.substring(0, 7));
sb52222222222.append(str182222222222.substring(str182222222222.length() - 7));
map2.put("af_v", ai.AFKeystoreWrapper(sb52222222222.toString()));
String str212222222222 = (String) map2.get(obj22222222222);
StringBuilder sb62222222222 = new StringBuilder();
sb62222222222.append(str212222222222);
sb62222222222.append(map2.get("af_timestamp"));
String obj32222222222 = sb62222222222.toString();
StringBuilder sb72222222222 = new StringBuilder();
sb72222222222.append(obj32222222222);
sb72222222222.append(map2.get(str192222222222));
String obj42222222222 = sb72222222222.toString();
StringBuilder sb82222222222 = new StringBuilder();
sb82222222222.append(obj42222222222);
sb82222222222.append(map2.get("installDate"));
String obj52222222222 = sb82222222222.toString();
StringBuilder sb92222222222 = new StringBuilder();
sb92222222222.append(obj52222222222);
sb92222222222.append(map2.get("counter"));
String obj62222222222 = sb92222222222.toString();
StringBuilder sb102222222222 = new StringBuilder();
sb102222222222.append(obj62222222222);
sb102222222222.append(map2.get("iaecounter"));
map2.put("af_v2", ai.AFKeystoreWrapper(ai.AFInAppEventType(sb102222222222.toString())));
map2.put("ivc", Boolean.valueOf(getLevel(application2)));
if (AFInAppEventType4.contains("is_stop_tracking_used")) {
}
HashMap hashMap22222222222 = new HashMap();
hashMap22222222222.put("mcc", Integer.valueOf(application2.getResources().getConfiguration().mcc));
hashMap22222222222.put("mnc", Integer.valueOf(application2.getResources().getConfiguration().mnc));
map2.put("cell", hashMap22222222222);
map2.put("sig", ac.valueOf(awVar2.values.getPackageManager(), awVar2.values.getPackageName()));
map2.put("last_boot_time", Long.valueOf(System.currentTimeMillis() - SystemClock.elapsedRealtime()));
StatFs statFs2222222222 = new StatFs(Environment.getDataDirectory().getAbsolutePath());
long blockSizeLong2222222222 = statFs2222222222.getBlockSizeLong();
long availableBlocksLong2222222222 = statFs2222222222.getAvailableBlocksLong() * blockSizeLong2222222222;
long blockCountLong2222222222 = statFs2222222222.getBlockCountLong() * blockSizeLong2222222222;
double pow2222222222 = Math.pow(2.0d, 20.0d);
double d3222222222 = availableBlocksLong2222222222;
Double.isNaN(d3222222222);
long j62222222222 = (long) (d3222222222 / pow2222222222);
double d22222222222 = blockCountLong2222222222;
Double.isNaN(d22222222222);
long j72222222222 = (long) (d22222222222 / pow2222222222);
StringBuilder sb112222222222 = new StringBuilder();
sb112222222222.append(j62222222222);
sb112222222222.append("/");
sb112222222222.append(j72222222222);
map2.put("disk", sb112222222222.toString());
strArr = this.init;
if (strArr != null) {
}
return map2;
}
}