Fortune Cow 6 v1.0.1版本的 MD5 值为:cc5dbc2a635a6fa7c66a7991d91041f6
以下内容为反编译后的 AFb1jSDK.java 源代码,内容仅作参考
package com.appsflyer.internal;
import android.os.Build;
import com.appsflyer.AFLogger;
import com.appsflyer.deeplink.DeepLink;
import com.appsflyer.deeplink.DeepLinkResult;
import com.appsflyer.internal.AFg1mSDK;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Observable;
import java.util.Observer;
import java.util.TimeZone;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.json.JSONException;
import org.json.JSONObject;
public final class AFb1jSDK extends AFf1pSDK {
private final AFf1tSDK AFLogger$LogLevel;
private final List<AFg1mSDK> AFVersionDeclaration;
private final AFb1kSDK AppsFlyer2dXConversionCallback;
final AFg1nSDK afErrorLogForExcManagerOnly;
int afWarnLog;
private final CountDownLatch getLevel;
private final AFc1tSDK init;
private final AFe1hSDK onAppOpenAttributionNative;
private int onConversionDataSuccess;
private final ExecutorService onInstallConversionDataLoadedNative;
private final AFb1sSDK onInstallConversionFailureNative;
private boolean onResponseErrorNative;
private int onResponseNative;
public AFb1jSDK(AFc1qSDK aFc1qSDK) {
super(null, "https://%sdlsdk.%s/v1.0/android/", Boolean.FALSE, Boolean.TRUE, null);
this.AFVersionDeclaration = new ArrayList();
this.getLevel = new CountDownLatch(1);
this.AFLogger$LogLevel = aFc1qSDK.AFLogger();
this.init = aFc1qSDK.AFInAppEventType();
this.onAppOpenAttributionNative = aFc1qSDK.afWarnLog();
this.afErrorLogForExcManagerOnly = aFc1qSDK.AFLogger$LogLevel();
this.onInstallConversionDataLoadedNative = aFc1qSDK.AFKeystoreWrapper();
this.onInstallConversionFailureNative = aFc1qSDK.getLevel();
this.AppsFlyer2dXConversionCallback = aFc1qSDK.onInstallConversionFailureNative();
}
public final DeepLinkResult AFLogger() {
DeepLinkResult.Error error;
AFLogger.afDebugLog("[DDL] start");
FutureTask futureTask = new FutureTask(new Callable<DeepLinkResult>() {
@Override
public final DeepLinkResult call() throws Exception {
AFg1mSDK[] values;
final AFb1jSDK aFb1jSDK = AFb1jSDK.this;
ArrayList<AFg1mSDK> arrayList = new ArrayList();
for (AFg1mSDK aFg1mSDK : aFb1jSDK.afErrorLogForExcManagerOnly.values()) {
if (aFg1mSDK != null && aFg1mSDK.afDebugLog != AFg1mSDK.AFa1vSDK.NOT_STARTED) {
arrayList.add(aFg1mSDK);
}
}
aFb1jSDK.afWarnLog = arrayList.size();
for (final AFg1mSDK aFg1mSDK2 : arrayList) {
int i = AnonymousClass3.AFKeystoreWrapper[aFg1mSDK2.afDebugLog.ordinal()];
if (i == 1) {
StringBuilder sb = new StringBuilder("[DDL] ");
sb.append(aFg1mSDK2.valueOf.get("source"));
sb.append(" referrer collected earlier");
AFLogger.afDebugLog(sb.toString());
aFb1jSDK.valueOf(aFg1mSDK2);
} else if (i == 2) {
aFg1mSDK2.addObserver(new Observer() {
@Override
public final void update(Observable observable, Object obj) {
StringBuilder sb2 = new StringBuilder("[DDL] ");
sb2.append(aFg1mSDK2.valueOf.get("source"));
sb2.append(" referrer collected via observer");
AFLogger.afDebugLog(sb2.toString());
AFb1jSDK.this.valueOf((AFg1mSDK) observable);
}
});
}
}
AFb1jSDK.this.afWarnLog();
return AFb1jSDK.AFInAppEventType(AFb1jSDK.this);
}
});
this.onInstallConversionDataLoadedNative.execute(futureTask);
try {
DeepLinkResult deepLinkResult = (DeepLinkResult) futureTask.get(this.AppsFlyer2dXConversionCallback.afDebugLog, TimeUnit.MILLISECONDS);
this.AFLogger$LogLevel.valueOf(deepLinkResult, this.AppsFlyer2dXConversionCallback.afDebugLog);
this.AppsFlyer2dXConversionCallback.AFKeystoreWrapper(deepLinkResult);
return deepLinkResult;
} catch (InterruptedException e) {
e = e;
AFLogger.afErrorLog("[DDL] Error occurred", e, true);
if (!(e.getCause() instanceof IOException)) {
error = DeepLinkResult.Error.NETWORK;
} else {
error = DeepLinkResult.Error.UNEXPECTED;
}
DeepLinkResult deepLinkResult2 = new DeepLinkResult(null, error);
this.AFLogger$LogLevel.valueOf(deepLinkResult2, this.AppsFlyer2dXConversionCallback.afDebugLog);
this.AppsFlyer2dXConversionCallback.AFKeystoreWrapper(deepLinkResult2);
return deepLinkResult2;
} catch (ExecutionException e2) {
e = e2;
AFLogger.afErrorLog("[DDL] Error occurred", e, true);
if (!(e.getCause() instanceof IOException)) {
}
DeepLinkResult deepLinkResult22 = new DeepLinkResult(null, error);
this.AFLogger$LogLevel.valueOf(deepLinkResult22, this.AppsFlyer2dXConversionCallback.afDebugLog);
this.AppsFlyer2dXConversionCallback.AFKeystoreWrapper(deepLinkResult22);
return deepLinkResult22;
} catch (TimeoutException e3) {
AFLogger.afErrorLogForExcManagerOnly("[DDL] Timeout", e3);
StringBuilder sb = new StringBuilder("[DDL] Timeout, didn't manage to find deferred deep link after ");
sb.append(this.onResponseNative);
sb.append(" attempt(s) within ");
sb.append(this.AppsFlyer2dXConversionCallback.afDebugLog);
sb.append(" milliseconds");
AFLogger.afDebugLog(sb.toString());
DeepLinkResult deepLinkResult3 = new DeepLinkResult(null, DeepLinkResult.Error.TIMEOUT);
this.AFLogger$LogLevel.valueOf(deepLinkResult3, this.AppsFlyer2dXConversionCallback.afDebugLog);
this.AppsFlyer2dXConversionCallback.AFKeystoreWrapper(deepLinkResult3);
return deepLinkResult3;
}
}
private boolean getLevel() {
List list = (List) this.valueOf.get("referrers");
return (list != null ? list.size() : 0) < this.afWarnLog && !this.valueOf.containsKey("referrers");
}
public void afWarnLog() {
String[] strArr;
this.onResponseNative++;
StringBuilder sb = new StringBuilder("[DDL] Preparing request ");
sb.append(this.onResponseNative);
AFLogger.afDebugLog(sb.toString());
if (this.onResponseNative == 1) {
AFa1cSDK AFInAppEventType = AFa1cSDK.AFInAppEventType();
this.valueOf.put("is_first", Boolean.valueOf(this.init.AFKeystoreWrapper.AFInAppEventParameterName("appsFlyerCount", 0) == 0));
Map<String, Object> map = this.valueOf;
StringBuilder sb2 = new StringBuilder();
sb2.append(Locale.getDefault().getLanguage());
sb2.append("-");
sb2.append(Locale.getDefault().getCountry());
map.put("lang", sb2.toString());
this.valueOf.put("os", Build.VERSION.RELEASE);
this.valueOf.put("type", Build.MODEL);
Map<String, Object> map2 = this.valueOf;
AFc1tSDK aFc1tSDK = this.init;
map2.put("request_id", AFb1uSDK.values(aFc1tSDK.values, aFc1tSDK.AFKeystoreWrapper));
AFb1aSDK aFb1aSDK = AFInAppEventType.afDebugLog;
if (aFb1aSDK != null && (strArr = aFb1aSDK.values) != null) {
this.valueOf.put("sharing_filter", strArr);
}
Map<String, Object> AFInAppEventParameterName = AFInAppEventParameterName(AFa1dSDK.AFKeystoreWrapper(this.init.values.AFInAppEventType, new HashMap()));
Map<String, Object> AFInAppEventParameterName2 = AFInAppEventParameterName(AFa1dSDK.AFInAppEventParameterName(this.init.values.AFInAppEventType));
if (AFInAppEventParameterName != null) {
this.valueOf.put("gaid", AFInAppEventParameterName);
}
if (AFInAppEventParameterName2 != null) {
this.valueOf.put("oaid", AFInAppEventParameterName2);
}
}
Map<String, Object> map3 = this.valueOf;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US);
long currentTimeMillis = System.currentTimeMillis();
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
map3.put("timestamp", simpleDateFormat.format(new Date(currentTimeMillis)));
this.valueOf.put("request_count", Integer.valueOf(this.onResponseNative));
ArrayList arrayList = new ArrayList();
for (AFg1mSDK aFg1mSDK : this.AFVersionDeclaration) {
Map<String, String> values = values(aFg1mSDK);
if (values != null) {
arrayList.add(values);
}
}
if (!arrayList.isEmpty()) {
this.valueOf.put("referrers", arrayList);
}
valueOf(onInstallConversionDataLoadedNative());
}
private String onInstallConversionDataLoadedNative() {
return new AFg1kSDK(this.init).AFInAppEventType(this.onAppOpenAttributionNative.AFLogger, (String) this.valueOf.get("timestamp"));
}
static class AnonymousClass3 {
static final int[] AFKeystoreWrapper;
static {
int[] iArr = new int[AFg1mSDK.AFa1vSDK.values().length];
AFKeystoreWrapper = iArr;
try {
iArr[AFg1mSDK.AFa1vSDK.FINISHED.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
AFKeystoreWrapper[AFg1mSDK.AFa1vSDK.STARTED.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
}
}
final void valueOf(AFg1mSDK aFg1mSDK) {
if (AFKeystoreWrapper(aFg1mSDK)) {
this.AFVersionDeclaration.add(aFg1mSDK);
this.getLevel.countDown();
StringBuilder sb = new StringBuilder("[DDL] Added non-organic ");
sb.append(aFg1mSDK.getClass().getSimpleName());
AFLogger.afDebugLog(sb.toString());
return;
}
int i = this.onConversionDataSuccess + 1;
this.onConversionDataSuccess = i;
if (i == this.afWarnLog) {
this.getLevel.countDown();
}
}
private static boolean AFKeystoreWrapper(AFg1mSDK aFg1mSDK) {
Long l = (Long) aFg1mSDK.valueOf.get("click_ts");
return l != null && System.currentTimeMillis() - TimeUnit.SECONDS.toMillis(l.longValue()) < TimeUnit.DAYS.toMillis(1L);
}
@Override
public final AFd1eSDK valueOf() {
return AFd1eSDK.DLSDK;
}
private Map<String, Object> AFInAppEventParameterName(final AFa1bSDK aFa1bSDK) {
Boolean bool;
boolean z = false;
if (aFa1bSDK != null && aFa1bSDK.AFInAppEventParameterName != null && ((bool = aFa1bSDK.valueOf) == null || !bool.booleanValue())) {
z = true;
}
if (z) {
return new HashMap<String, Object>() {
{
put("type", "unhashed");
put("value", aFa1bSDK.AFInAppEventParameterName);
}
};
}
return null;
}
private static Map<String, String> values(AFg1mSDK aFg1mSDK) {
if (aFg1mSDK.afDebugLog == AFg1mSDK.AFa1vSDK.FINISHED) {
HashMap hashMap = new HashMap();
String str = (String) aFg1mSDK.valueOf.get("referrer");
if (str != null) {
hashMap.put("source", (String) aFg1mSDK.valueOf.get("source"));
hashMap.put("value", str);
return hashMap;
}
return null;
}
return null;
}
static DeepLinkResult AFInAppEventType(AFb1jSDK aFb1jSDK) throws IOException, JSONException, InterruptedException {
DeepLink AFKeystoreWrapper;
while (true) {
AFf1tSDK aFf1tSDK = aFb1jSDK.AFLogger$LogLevel;
int i = aFb1jSDK.onResponseNative;
if (i <= 0 || i > 2) {
AFLogger.afErrorLogForExcManagerOnly("Unexpected ddl requestCount - start", new IllegalStateException("Metrics: Unexpected ddl requestCount = ".concat(String.valueOf(i))));
} else {
int i2 = i - 1;
aFf1tSDK.afInfoLog[i2] = System.currentTimeMillis();
if (i2 == 0) {
if (aFf1tSDK.afErrorLog != 0) {
aFf1tSDK.values.put("from_fg", Long.valueOf(aFf1tSDK.afInfoLog[i2] - aFf1tSDK.afErrorLog));
aFf1tSDK.AFInAppEventParameterName.AFKeystoreWrapper("ddl", new JSONObject(aFf1tSDK.values).toString());
} else {
AFLogger.afInfoLog("Metrics: fg ts is missing");
}
}
}
HttpURLConnection valueOf = new AFa1fSDK(aFb1jSDK, aFb1jSDK.onInstallConversionFailureNative).valueOf(aFb1jSDK.onAppOpenAttributionNative.AFLogger);
AFf1tSDK aFf1tSDK2 = aFb1jSDK.AFLogger$LogLevel;
int i3 = aFb1jSDK.onResponseNative;
if (i3 <= 0 || i3 > 2) {
AFLogger.afErrorLogForExcManagerOnly("Unexpected ddl requestCount - end", new IllegalStateException("Metrics: Unexpected ddl requestCount = ".concat(String.valueOf(i3))));
} else {
int i4 = i3 - 1;
aFf1tSDK2.afDebugLog[i4] = System.currentTimeMillis();
if (aFf1tSDK2.afInfoLog[i4] != 0) {
aFf1tSDK2.afRDLog[i4] = aFf1tSDK2.afDebugLog[i4] - aFf1tSDK2.afInfoLog[i4];
aFf1tSDK2.values.put("net", aFf1tSDK2.afRDLog);
aFf1tSDK2.AFInAppEventParameterName.AFKeystoreWrapper("ddl", new JSONObject(aFf1tSDK2.values).toString());
} else {
StringBuilder sb = new StringBuilder("Metrics: ddlStart[");
sb.append(i4);
sb.append("] ts is missing");
AFLogger.afInfoLog(sb.toString());
}
}
if (valueOf.getResponseCode() != 200) {
StringBuilder sb2 = new StringBuilder("[DDL] Error occurred. Server response code = ");
sb2.append(valueOf.getResponseCode());
AFLogger.afDebugLog(sb2.toString());
return new DeepLinkResult(null, DeepLinkResult.Error.HTTP_STATUS_CODE);
}
JSONObject jSONObject = new JSONObject(AFa1cSDK.AFKeystoreWrapper(valueOf));
aFb1jSDK.onResponseErrorNative = jSONObject.optBoolean("is_second_ping", true);
if (jSONObject.optBoolean("found")) {
AFKeystoreWrapper = DeepLink.AFKeystoreWrapper(jSONObject.optJSONObject("click_event"));
AFKeystoreWrapper.AFKeystoreWrapper.put("is_deferred", true);
} else {
AFKeystoreWrapper = null;
}
if (AFKeystoreWrapper != null) {
return new DeepLinkResult(AFKeystoreWrapper, null);
}
if (aFb1jSDK.onResponseNative > 1 || !aFb1jSDK.getLevel() || !aFb1jSDK.onResponseErrorNative) {
break;
}
AFLogger.afDebugLog("[DDL] Waiting for referrers...");
aFb1jSDK.getLevel.await();
AFf1tSDK aFf1tSDK3 = aFb1jSDK.AFLogger$LogLevel;
long currentTimeMillis = System.currentTimeMillis();
if (aFf1tSDK3.afDebugLog[0] != 0) {
aFf1tSDK3.values.put("rfr_wait", Long.valueOf(currentTimeMillis - aFf1tSDK3.afDebugLog[0]));
aFf1tSDK3.AFInAppEventParameterName.AFKeystoreWrapper("ddl", new JSONObject(aFf1tSDK3.values).toString());
} else {
AFLogger.afInfoLog("Metrics: ddlEnd[0] ts is missing");
}
if (aFb1jSDK.onConversionDataSuccess != aFb1jSDK.afWarnLog) {
aFb1jSDK.afWarnLog();
} else {
return new DeepLinkResult(null, null);
}
}
}
}