ChatOn v1.35.366360版本的 MD5 值为:cde28447b38d5467efa95e48e7076155
以下内容为反编译后的 AFc1qSDK.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.AFi1nSDK;
import com.itextpdf.text.xml.xmp.DublinCoreProperties;
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.Iterator;
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.JSONObject;
public final class AFc1qSDK extends AFh1vSDK {
private int AFLogger$LogLevel;
private final ExecutorService afDebugLog;
private final AFb1cSDK afErrorLog;
private boolean afErrorLogForExcManagerOnly;
private final AFg1zSDK afInfoLog;
private int afLogForce;
private final AFd1sSDK afRDLog;
private final AFc1jSDK afVerboseLog;
private final AFi1kSDK afWarnLog;
private final List<AFi1nSDK> force;
private int getLevel;
private final AFd1rSDK f5630i;
private final AFg1bSDK f5631v;
private final CountDownLatch f5632w;
public static class AnonymousClass1 {
static final int[] valueOf;
static {
int[] iArr = new int[AFi1nSDK.AFa1uSDK.values().length];
valueOf = iArr;
try {
iArr[AFi1nSDK.AFa1uSDK.FINISHED.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
valueOf[AFi1nSDK.AFa1uSDK.STARTED.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
}
}
public AFc1qSDK(AFd1nSDK aFd1nSDK) {
super(null, "https://%sdlsdk.%s/v1.0/android/", Boolean.FALSE, Boolean.TRUE, null);
this.force = new ArrayList();
this.f5632w = new CountDownLatch(1);
this.f5631v = aFd1nSDK.unregisterClient();
this.f5630i = aFd1nSDK.AFInAppEventType();
this.afInfoLog = aFd1nSDK.i();
this.afWarnLog = aFd1nSDK.force();
this.afDebugLog = aFd1nSDK.values();
this.afErrorLog = aFd1nSDK.afInfoLog();
this.afVerboseLog = aFd1nSDK.afErrorLog();
this.afRDLog = aFd1nSDK.getLevel();
}
public static DeepLinkResult AFInAppEventParameterName(AFc1qSDK aFc1qSDK) {
DeepLink AFInAppEventType;
while (true) {
AFg1bSDK aFg1bSDK = aFc1qSDK.f5631v;
int i10 = aFc1qSDK.afLogForce;
if (i10 <= 0 || i10 > 2) {
AFLogger.afErrorLogForExcManagerOnly("Unexpected ddl requestCount - start", new IllegalStateException("Metrics: Unexpected ddl requestCount = ".concat(String.valueOf(i10))));
} else {
int i11 = i10 - 1;
aFg1bSDK.AFLogger[i11] = System.currentTimeMillis();
if (i11 == 0) {
long j10 = aFg1bSDK.unregisterClient;
if (j10 != 0) {
aFg1bSDK.values.put("from_fg", Long.valueOf(aFg1bSDK.AFLogger[i11] - j10));
aFg1bSDK.AFKeystoreWrapper.values("ddl", new JSONObject(aFg1bSDK.values).toString());
} else {
AFLogger.afInfoLog("Metrics: fg ts is missing");
}
}
}
HttpURLConnection AFKeystoreWrapper = new AFb1uSDK(aFc1qSDK, aFc1qSDK.afErrorLog).AFKeystoreWrapper(aFc1qSDK.afInfoLog.registerClient);
AFg1bSDK aFg1bSDK2 = aFc1qSDK.f5631v;
int i12 = aFc1qSDK.afLogForce;
if (i12 <= 0 || i12 > 2) {
AFLogger.afErrorLogForExcManagerOnly("Unexpected ddl requestCount - end", new IllegalStateException("Metrics: Unexpected ddl requestCount = ".concat(String.valueOf(i12))));
} else {
int i13 = i12 - 1;
aFg1bSDK2.registerClient[i13] = System.currentTimeMillis();
long j11 = aFg1bSDK2.AFLogger[i13];
if (j11 != 0) {
long[] jArr = aFg1bSDK2.f5693e;
jArr[i13] = aFg1bSDK2.registerClient[i13] - j11;
aFg1bSDK2.values.put("net", jArr);
aFg1bSDK2.AFKeystoreWrapper.values("ddl", new JSONObject(aFg1bSDK2.values).toString());
} else {
StringBuilder sb2 = new StringBuilder("Metrics: ddlStart[");
sb2.append(i13);
sb2.append("] ts is missing");
AFLogger.afInfoLog(sb2.toString());
}
}
if (AFKeystoreWrapper.getResponseCode() != 200) {
AFLogger aFLogger = AFLogger.INSTANCE;
AFg1hSDK aFg1hSDK = AFg1hSDK.DDL;
StringBuilder sb3 = new StringBuilder("Error occurred. Server response code = ");
sb3.append(AFKeystoreWrapper.getResponseCode());
aFLogger.d(aFg1hSDK, sb3.toString());
return new DeepLinkResult(null, DeepLinkResult.Error.HTTP_STATUS_CODE);
}
JSONObject jSONObject = new JSONObject(AFb1vSDK.AFInAppEventType(AFKeystoreWrapper));
aFc1qSDK.afErrorLogForExcManagerOnly = jSONObject.optBoolean("is_second_ping", true);
if (jSONObject.optBoolean("found")) {
AFInAppEventType = DeepLink.AFInAppEventType(jSONObject.optJSONObject("click_event"));
AFInAppEventType.valueOf.put("is_deferred", true);
} else {
AFInAppEventType = null;
}
if (AFInAppEventType != null) {
return new DeepLinkResult(AFInAppEventType, null);
}
if (aFc1qSDK.afLogForce > 1 || !aFc1qSDK.afInfoLog() || !aFc1qSDK.afErrorLogForExcManagerOnly) {
break;
}
AFLogger.INSTANCE.d(AFg1hSDK.DDL, "Waiting for referrers...");
aFc1qSDK.f5632w.await();
AFg1bSDK aFg1bSDK3 = aFc1qSDK.f5631v;
long currentTimeMillis = System.currentTimeMillis();
long j12 = aFg1bSDK3.registerClient[0];
if (j12 != 0) {
aFg1bSDK3.values.put("rfr_wait", Long.valueOf(currentTimeMillis - j12));
aFg1bSDK3.AFKeystoreWrapper.values("ddl", new JSONObject(aFg1bSDK3.values).toString());
} else {
AFLogger.afInfoLog("Metrics: ddlEnd[0] ts is missing");
}
if (aFc1qSDK.getLevel == aFc1qSDK.AFLogger$LogLevel) {
return new DeepLinkResult(null, null);
}
aFc1qSDK.force();
}
}
public void AFInAppEventParameterName(AFi1nSDK aFi1nSDK) {
if (values(aFi1nSDK)) {
this.force.add(aFi1nSDK);
this.f5632w.countDown();
AFLogger.INSTANCE.d(AFg1hSDK.DDL, "Added non-organic ".concat(aFi1nSDK.getClass().getSimpleName()));
return;
}
int i10 = this.getLevel + 1;
this.getLevel = i10;
if (i10 == this.AFLogger$LogLevel) {
this.f5632w.countDown();
}
}
private Map<String, Object> AFKeystoreWrapper(final AFa1aSDK aFa1aSDK) {
if (aFa1aSDK == null || aFa1aSDK.valueOf == null) {
return null;
}
Boolean bool = aFa1aSDK.AFInAppEventType;
if (bool == null || !bool.booleanValue()) {
return new HashMap<String, Object>() {
{
put(DublinCoreProperties.TYPE, "unhashed");
put("value", aFa1aSDK.valueOf);
}
};
}
return null;
}
public static void AFKeystoreWrapper(AFc1qSDK aFc1qSDK) {
AFi1nSDK[] AFInAppEventType;
ArrayList arrayList = new ArrayList();
for (AFi1nSDK aFi1nSDK : aFc1qSDK.afWarnLog.AFInAppEventType()) {
if (aFi1nSDK != null && aFi1nSDK.unregisterClient != AFi1nSDK.AFa1uSDK.NOT_STARTED) {
arrayList.add(aFi1nSDK);
}
}
aFc1qSDK.AFLogger$LogLevel = arrayList.size();
Iterator it = arrayList.iterator();
while (it.hasNext()) {
final AFi1nSDK aFi1nSDK2 = (AFi1nSDK) it.next();
int i10 = AnonymousClass1.valueOf[aFi1nSDK2.unregisterClient.ordinal()];
if (i10 == 1) {
AFLogger aFLogger = AFLogger.INSTANCE;
AFg1hSDK aFg1hSDK = AFg1hSDK.DDL;
StringBuilder sb2 = new StringBuilder();
sb2.append(aFi1nSDK2.values.get(DublinCoreProperties.SOURCE));
sb2.append(" referrer collected earlier");
aFLogger.d(aFg1hSDK, sb2.toString());
aFc1qSDK.AFInAppEventParameterName(aFi1nSDK2);
} else if (i10 == 2) {
aFi1nSDK2.addObserver(new Observer() {
@Override
public final void update(Observable observable, Object obj) {
AFLogger aFLogger2 = AFLogger.INSTANCE;
AFg1hSDK aFg1hSDK2 = AFg1hSDK.DDL;
StringBuilder sb3 = new StringBuilder();
sb3.append(aFi1nSDK2.values.get(DublinCoreProperties.SOURCE));
sb3.append(" referrer collected via observer");
aFLogger2.d(aFg1hSDK2, sb3.toString());
AFc1qSDK.this.AFInAppEventParameterName((AFi1nSDK) observable);
}
});
}
}
}
private boolean afInfoLog() {
List list = (List) this.AFKeystoreWrapper.get("referrers");
return (list != null ? list.size() : 0) < this.AFLogger$LogLevel && !this.AFKeystoreWrapper.containsKey("referrers");
}
private String afWarnLog() {
return new AFi1cSDK(this.f5630i).AFInAppEventParameterName(this.afInfoLog.registerClient, (String) this.AFKeystoreWrapper.get("timestamp"));
}
public void force() {
String[] strArr;
this.afLogForce++;
AFLogger aFLogger = AFLogger.INSTANCE;
AFg1hSDK aFg1hSDK = AFg1hSDK.DDL;
StringBuilder sb2 = new StringBuilder("Preparing request ");
sb2.append(this.afLogForce);
aFLogger.d(aFg1hSDK, sb2.toString());
if (this.afLogForce == 1) {
this.AFKeystoreWrapper.put("is_first", Boolean.valueOf(this.f5630i.AFInAppEventParameterName.valueOf("appsFlyerCount", 0) == 0));
Map<String, Object> map = this.AFKeystoreWrapper;
StringBuilder sb3 = new StringBuilder();
sb3.append(Locale.getDefault().getLanguage());
sb3.append("-");
sb3.append(Locale.getDefault().getCountry());
map.put("lang", sb3.toString());
this.AFKeystoreWrapper.put("os", Build.VERSION.RELEASE);
this.AFKeystoreWrapper.put(DublinCoreProperties.TYPE, Build.MODEL);
Map<String, Object> map2 = this.AFKeystoreWrapper;
AFd1rSDK aFd1rSDK = this.f5630i;
map2.put("request_id", AFb1lSDK.values(aFd1rSDK.AFKeystoreWrapper, aFd1rSDK.AFInAppEventParameterName));
AFc1aSDK aFc1aSDK = this.afRDLog.AFKeystoreWrapper;
if (aFc1aSDK != null && (strArr = aFc1aSDK.AFKeystoreWrapper) != null) {
this.AFKeystoreWrapper.put("sharing_filter", strArr);
}
Map<String, Object> AFKeystoreWrapper = AFKeystoreWrapper(AFb1tSDK.valueOf(this.f5630i.AFKeystoreWrapper.AFInAppEventParameterName, new HashMap()));
Map<String, Object> AFKeystoreWrapper2 = AFKeystoreWrapper(AFb1tSDK.AFInAppEventParameterName(this.f5630i.AFKeystoreWrapper.AFInAppEventParameterName));
if (AFKeystoreWrapper != null) {
this.AFKeystoreWrapper.put("gaid", AFKeystoreWrapper);
}
if (AFKeystoreWrapper2 != null) {
this.AFKeystoreWrapper.put("oaid", AFKeystoreWrapper2);
}
}
Map<String, Object> map3 = this.AFKeystoreWrapper;
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.AFKeystoreWrapper.put("request_count", Integer.valueOf(this.afLogForce));
ArrayList arrayList = new ArrayList();
for (AFi1nSDK aFi1nSDK : this.force) {
Map<String, String> valueOf = valueOf(aFi1nSDK);
if (valueOf != null) {
arrayList.add(valueOf);
}
}
if (!arrayList.isEmpty()) {
this.AFKeystoreWrapper.put("referrers", arrayList);
}
AFKeystoreWrapper(afWarnLog());
}
private static Map<String, String> valueOf(AFi1nSDK aFi1nSDK) {
if (aFi1nSDK.unregisterClient == AFi1nSDK.AFa1uSDK.FINISHED) {
HashMap hashMap = new HashMap();
String str = (String) aFi1nSDK.values.get("referrer");
if (str != null) {
hashMap.put(DublinCoreProperties.SOURCE, (String) aFi1nSDK.values.get(DublinCoreProperties.SOURCE));
hashMap.put("value", str);
return hashMap;
}
return null;
}
return null;
}
private static boolean values(AFi1nSDK aFi1nSDK) {
Long l10 = (Long) aFi1nSDK.values.get("click_ts");
return l10 != null && System.currentTimeMillis() - TimeUnit.SECONDS.toMillis(l10.longValue()) < TimeUnit.DAYS.toMillis(1L);
}
@Override
public final AFe1bSDK AFInAppEventParameterName() {
return AFe1bSDK.DLSDK;
}
public final DeepLinkResult unregisterClient() {
AFLogger.INSTANCE.d(AFg1hSDK.DDL, "start");
FutureTask futureTask = new FutureTask(new Callable<DeepLinkResult>() {
@Override
public final DeepLinkResult call() {
AFc1qSDK.AFKeystoreWrapper(AFc1qSDK.this);
AFc1qSDK.this.force();
return AFc1qSDK.AFInAppEventParameterName(AFc1qSDK.this);
}
});
this.afDebugLog.execute(futureTask);
try {
DeepLinkResult deepLinkResult = (DeepLinkResult) futureTask.get(this.afVerboseLog.AFLogger, TimeUnit.MILLISECONDS);
this.f5631v.valueOf(deepLinkResult, this.afVerboseLog.AFLogger);
this.afVerboseLog.AFInAppEventType(deepLinkResult);
return deepLinkResult;
} catch (InterruptedException e10) {
e = e10;
AFLogger.INSTANCE.e(AFg1hSDK.DDL, "AppsFlyer SDK is stopped: the request was not sent to the server", e, true, true, false, true);
DeepLinkResult deepLinkResult2 = new DeepLinkResult(null, !(e.getCause() instanceof IOException) ? DeepLinkResult.Error.NETWORK : DeepLinkResult.Error.UNEXPECTED);
this.f5631v.valueOf(deepLinkResult2, this.afVerboseLog.AFLogger);
this.afVerboseLog.AFInAppEventType(deepLinkResult2);
return deepLinkResult2;
} catch (ExecutionException e11) {
e = e11;
AFLogger.INSTANCE.e(AFg1hSDK.DDL, "AppsFlyer SDK is stopped: the request was not sent to the server", e, true, true, false, true);
DeepLinkResult deepLinkResult22 = new DeepLinkResult(null, !(e.getCause() instanceof IOException) ? DeepLinkResult.Error.NETWORK : DeepLinkResult.Error.UNEXPECTED);
this.f5631v.valueOf(deepLinkResult22, this.afVerboseLog.AFLogger);
this.afVerboseLog.AFInAppEventType(deepLinkResult22);
return deepLinkResult22;
} catch (TimeoutException e12) {
AFLogger.afErrorLogForExcManagerOnly("[DDL] Timeout", e12);
AFLogger aFLogger = AFLogger.INSTANCE;
AFg1hSDK aFg1hSDK = AFg1hSDK.DDL;
StringBuilder sb2 = new StringBuilder("Timeout, didn't manage to find deferred deep link after ");
sb2.append(this.afLogForce);
sb2.append(" attempt(s) within ");
sb2.append(this.afVerboseLog.AFLogger);
sb2.append(" milliseconds");
aFLogger.d(aFg1hSDK, sb2.toString());
DeepLinkResult deepLinkResult3 = new DeepLinkResult(null, DeepLinkResult.Error.TIMEOUT);
this.f5631v.valueOf(deepLinkResult3, this.afVerboseLog.AFLogger);
this.afVerboseLog.AFInAppEventType(deepLinkResult3);
return deepLinkResult3;
}
}
}