WJBET v2.4.39版本的 MD5 值为:a1cc3f24c34b916fdf36d9b31dec8203
以下内容为反编译后的 aq.java 源代码,内容仅作参考
package com.appsflyer.internal;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerProperties;
import com.appsflyer.deeplink.DeepLink;
import com.appsflyer.deeplink.DeepLinkResult;
import com.appsflyer.internal.bt;
import com.appsflyer.internal.d;
import com.facebook.share.internal.ShareConstants;
import com.zoloz.stack.lite.aplog.core.Constant;
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.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public final class aq extends bf {
private static String onAttributionFailure = "https://%sdlsdk.%s/v1.0/android/";
public static long onInstallConversionDataLoadedNative;
private boolean AppsFlyerConversionListener;
private int AppsFlyerInAppPurchaseValidatorListener;
private int AppsFlyerLib;
private final List<bt> onAppOpenAttribution;
private final CountDownLatch onConversionDataSuccess;
private final au onDeepLinking;
public int onDeepLinkingNative;
private final JSONObject onValidateInAppFailure;
public aq(Context context, au auVar) {
super(null, onAttributionFailure, Boolean.FALSE, Boolean.TRUE, null, context);
this.onAppOpenAttribution = new ArrayList();
this.onConversionDataSuccess = new CountDownLatch(1);
this.onValidateInAppFailure = new JSONObject();
this.onDeepLinking = auVar;
}
public final void values(DeepLinkResult deepLinkResult) {
try {
this.onValidateInAppFailure.put("status", deepLinkResult.getStatus().toString());
this.onValidateInAppFailure.put("timeout_value", onInstallConversionDataLoadedNative);
} catch (JSONException unused) {
}
au auVar = this.onDeepLinking;
auVar.valueOf.edit().putString("ddl", this.onValidateInAppFailure.toString()).apply();
ap.AFInAppEventParameterName(deepLinkResult);
}
private boolean valueOf() {
List list = (List) this.AFInAppEventType.get("referrers");
return (list != null ? list.size() : 0) < this.AppsFlyerLib && !this.AFInAppEventType.containsKey("referrers");
}
public void AFKeystoreWrapper(Context context) {
HashMap hashMap;
this.onDeepLinkingNative++;
StringBuilder sb = new StringBuilder("[DDL] Preparing request ");
sb.append(this.onDeepLinkingNative);
AFLogger.values(sb.toString());
if (this.onDeepLinkingNative == 1) {
ae values = ae.values();
this.AFInAppEventType.put("is_first", Boolean.valueOf(ae.AFInAppEventParameterName(context)));
Map<String, Object> map = this.AFInAppEventType;
StringBuilder sb2 = new StringBuilder();
sb2.append(Locale.getDefault().getLanguage());
sb2.append(Constant.EMPTY_FIELD);
sb2.append(Locale.getDefault().getCountry());
map.put("lang", sb2.toString());
this.AFInAppEventType.put("os", Build.VERSION.RELEASE);
this.AFInAppEventType.put(ShareConstants.MEDIA_TYPE, Build.MODEL);
this.AFInAppEventType.put("request_id", values.getAppsFlyerUID(context));
String[] strArr = values.getLevel;
if (strArr != null) {
this.AFInAppEventType.put("sharing_filter", strArr);
}
Map<String, Object> AFInAppEventParameterName = AFInAppEventParameterName(ab.valueOf(context, new HashMap()));
Map<String, Object> AFInAppEventParameterName2 = AFInAppEventParameterName(ab.values(context));
if (AFInAppEventParameterName != null) {
this.AFInAppEventType.put("gaid", AFInAppEventParameterName);
}
if (AFInAppEventParameterName2 != null) {
this.AFInAppEventType.put("oaid", AFInAppEventParameterName2);
}
}
Map<String, Object> map2 = this.AFInAppEventType;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US);
long currentTimeMillis = System.currentTimeMillis();
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
map2.put("timestamp", simpleDateFormat.format(new Date(currentTimeMillis)));
this.AFInAppEventType.put("request_count", Integer.valueOf(this.onDeepLinkingNative));
ArrayList arrayList = new ArrayList();
for (bt btVar : this.onAppOpenAttribution) {
if (btVar.AFInAppEventParameterName == bt.e.FINISHED) {
hashMap = new HashMap();
String str = (String) btVar.AFKeystoreWrapper.get("referrer");
if (str != null) {
hashMap.put("source", (String) btVar.AFKeystoreWrapper.get("source"));
hashMap.put("value", str);
if (hashMap == null) {
arrayList.add(hashMap);
}
}
}
hashMap = null;
if (hashMap == null) {
}
}
if (!arrayList.isEmpty()) {
this.AFInAppEventType.put("referrers", arrayList);
}
String string = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
Uri.Builder appendPath = Uri.parse(String.format(this.onAppOpenAttributionNative, AppsFlyerLib.getInstance().getHostPrefix(), ae.values().getHostName())).buildUpon().appendPath(context.getPackageName());
StringBuilder sb3 = new StringBuilder();
sb3.append(this.AFInAppEventType.get("timestamp"));
sb3.append(string);
AFInAppEventParameterName(appendPath.appendQueryParameter("af_sig", af.values(sb3.toString(), string)).appendQueryParameter("sdk_version", ae.AFInAppEventType).build().toString());
}
public static class AnonymousClass1 {
static final int[] valueOf;
static {
int[] iArr = new int[bt.e.values().length];
valueOf = iArr;
try {
iArr[bt.e.FINISHED.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
valueOf[bt.e.STARTED.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
}
}
public void valueOf(bt btVar) {
if (AFKeystoreWrapper(btVar)) {
this.onAppOpenAttribution.add(btVar);
this.onConversionDataSuccess.countDown();
StringBuilder sb = new StringBuilder("[DDL] Added non-organic ");
sb.append(btVar.getClass().getSimpleName());
AFLogger.values(sb.toString());
return;
}
int i = this.AppsFlyerInAppPurchaseValidatorListener + 1;
this.AppsFlyerInAppPurchaseValidatorListener = i;
if (i == this.AppsFlyerLib) {
this.onConversionDataSuccess.countDown();
}
}
private static boolean AFKeystoreWrapper(bt btVar) {
Long l = (Long) btVar.AFKeystoreWrapper.get("click_ts");
return l != null && System.currentTimeMillis() - TimeUnit.SECONDS.toMillis(l.longValue()) < TimeUnit.DAYS.toMillis(1L);
}
private Map<String, Object> AFInAppEventParameterName(final d.e.C0033d c0033d) {
Boolean bool;
boolean z = false;
if (c0033d != null && c0033d.values != null && ((bool = c0033d.valueOf) == null || !bool.booleanValue())) {
z = true;
}
if (z) {
return new HashMap<String, Object>() {
{
put(ShareConstants.MEDIA_TYPE, "unhashed");
put("value", d.e.C0033d.this.values);
}
};
}
return null;
}
static void AFInAppEventParameterName(aq aqVar) {
bt[] btVarArr;
ArrayList<bt> arrayList = new ArrayList();
for (bt btVar : ae.values().onAppOpenAttributionNative) {
if (btVar != null && btVar.AFInAppEventParameterName != bt.e.NOT_STARTED) {
arrayList.add(btVar);
}
}
aqVar.AppsFlyerLib = arrayList.size();
for (final bt btVar2 : arrayList) {
int i = AnonymousClass1.valueOf[btVar2.AFInAppEventParameterName.ordinal()];
if (i == 1) {
StringBuilder sb = new StringBuilder("[DDL] ");
sb.append(btVar2.AFKeystoreWrapper.get("source"));
sb.append(" referrer collected earlier");
AFLogger.values(sb.toString());
aqVar.valueOf(btVar2);
} else if (i == 2) {
btVar2.addObserver(new Observer() {
@Override
public final void update(Observable observable, Object obj) {
StringBuilder sb2 = new StringBuilder("[DDL] ");
sb2.append(btVar2.AFKeystoreWrapper.get("source"));
sb2.append(" referrer collected via observer");
AFLogger.values(sb2.toString());
aq.this.valueOf((bt) observable);
}
});
}
}
}
static DeepLinkResult valueOf(aq aqVar, Context context) throws IOException, JSONException, InterruptedException {
DeepLink AFInAppEventParameterName;
while (true) {
long currentTimeMillis = System.currentTimeMillis();
if (aqVar.onDeepLinkingNative == 1) {
aqVar.onValidateInAppFailure.put("from_fg", currentTimeMillis - aqVar.onDeepLinking.valueOf.getLong("fg_ts", 0L));
}
HttpURLConnection AFInAppEventType = new m(aqVar).AFInAppEventType();
JSONArray optJSONArray = aqVar.onValidateInAppFailure.optJSONArray("net");
if (optJSONArray == null) {
optJSONArray = new JSONArray();
}
long currentTimeMillis2 = System.currentTimeMillis();
optJSONArray.put(aqVar.onDeepLinkingNative - 1, currentTimeMillis2 - currentTimeMillis);
aqVar.onValidateInAppFailure.put("net", optJSONArray);
if (AFInAppEventType.getResponseCode() != 200) {
StringBuilder sb = new StringBuilder("[DDL] Error occurred. Server response code = ");
sb.append(AFInAppEventType.getResponseCode());
AFLogger.values(sb.toString());
return new DeepLinkResult(null, DeepLinkResult.Error.HTTP_STATUS_CODE);
}
ae.values();
JSONObject jSONObject = new JSONObject(ae.AFKeystoreWrapper(AFInAppEventType));
aqVar.AppsFlyerConversionListener = jSONObject.optBoolean("is_second_ping", true);
if (jSONObject.optBoolean("found")) {
AFInAppEventParameterName = DeepLink.AFInAppEventParameterName(jSONObject.optJSONObject("click_event"));
AFInAppEventParameterName.AFInAppEventParameterName.put("is_deferred", true);
} else {
AFInAppEventParameterName = null;
}
if (AFInAppEventParameterName != null) {
return new DeepLinkResult(AFInAppEventParameterName, null);
}
if (aqVar.onDeepLinkingNative > 1 || !aqVar.valueOf() || !aqVar.AppsFlyerConversionListener) {
break;
}
AFLogger.values("[DDL] Waiting for referrers...");
aqVar.onConversionDataSuccess.await();
aqVar.onValidateInAppFailure.put("rfr_wait", System.currentTimeMillis() - currentTimeMillis2);
if (aqVar.AppsFlyerInAppPurchaseValidatorListener != aqVar.AppsFlyerLib) {
aqVar.AFKeystoreWrapper(context);
} else {
return new DeepLinkResult(null, null);
}
}
}
}