afun 2020238 v1.0版本的 MD5 值为:0e5438925c609ea263d060e5259b230d
以下内容为反编译后的 AFd1cSDK.java 源代码,内容仅作参考
package com.appsflyer.internal;
import android.content.Context;
import android.graphics.Color;
import android.media.AudioTrack;
import android.os.Build;
import android.os.Process;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewConfiguration;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerProperties;
import java.lang.reflect.Method;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
import kotlin.text.Regex;
import kotlin.text.Typography;
import org.json.JSONObject;
public final class AFd1cSDK {
@VisibleForTesting
private static String AFInAppEventParameterName;
@VisibleForTesting
private static String AFInAppEventType;
public static String AFKeystoreWrapper;
private static long AFLogger;
private static int afErrorLog;
private static char[] afRDLog;
private final AFe1sSDK afDebugLog;
private final AppsFlyerProperties afInfoLog;
private final AFd1dSDK valueOf;
private final AFd1vSDK values;
private static int $10 = 0;
private static int $11 = 1;
private static int afWarnLog = 1;
public static void valueOf() {
afRDLog = new char[]{31616, 54856, Typography.prime, 29279, 52244, 7693, 26677, 47657, 5325, 26323, 45285, 737, 30954, 54549, 9015, 28971, 53072};
AFLogger = 7083915614722970983L;
}
static {
afErrorLog = 0;
valueOf();
AFInAppEventParameterName = "https://%smonitorsdk.%s/remote-debug?app_id=";
AFKeystoreWrapper = "https://%sgcdsdk.%s/install_data/v5.0/";
AFInAppEventType = "https://%sonelink.%s/shortlink-sdk/v2";
int i = afWarnLog + 115;
afErrorLog = i % 128;
switch (i % 2 == 0) {
case false:
int i2 = 92 / 0;
return;
default:
return;
}
}
public AFd1cSDK(AFd1dSDK aFd1dSDK, AFd1vSDK aFd1vSDK, AppsFlyerProperties appsFlyerProperties, AFe1sSDK aFe1sSDK) {
this.valueOf = aFd1dSDK;
this.values = aFd1vSDK;
this.afInfoLog = appsFlyerProperties;
this.afDebugLog = aFe1sSDK;
}
@Nullable
public final AFd1bSDK<String> AFInAppEventParameterName(Map<String, Object> map, String str, @Nullable String str2) {
boolean z;
boolean z2;
String AFInAppEventParameterName2;
int i = afWarnLog + 25;
afErrorLog = i % 128;
int i2 = i % 2;
try {
Object[] objArr = {map, str};
Map<Integer, Object> map2 = AFa1zSDK.init;
Object obj = map2.get(1638884274);
if (obj == null) {
obj = ((Class) AFa1zSDK.AFKeystoreWrapper((char) (KeyEvent.getMaxKeyCode() >> 16), (ViewConfiguration.getPressedStateDuration() >> 16) + 74, Color.green(0) + 37)).getMethod("AFKeystoreWrapper", Map.class, String.class);
map2.put(1638884274, obj);
}
byte[] bArr = (byte[]) ((Method) obj).invoke(null, objArr);
AFi1zSDK aFi1zSDK = new AFi1zSDK(this.values);
switch (str2 == null) {
default:
if (str2.length() != 0) {
z = false;
break;
}
case true:
z = true;
break;
}
if (!z && !new Regex("4.?(\\d+)?.?(\\d+)").matches(str2)) {
switch (!new Regex("3.?(\\d+)?.?(\\d+)").matches(str2)) {
case true:
z2 = false;
break;
}
switch (z2 ? false : true) {
case false:
int i3 = afErrorLog + 79;
afWarnLog = i3 % 128;
switch (i3 % 2 == 0 ? 'I' : (char) 28) {
case 28:
AFInAppEventParameterName2 = aFi1zSDK.AFInAppEventType.AFInAppEventParameterName("https://%sars.%s/api/v2/android/validate_subscription?app_id=");
break;
default:
int i4 = 59 / 0;
AFInAppEventParameterName2 = aFi1zSDK.AFInAppEventType.AFInAppEventParameterName("https://%sars.%s/api/v2/android/validate_subscription?app_id=");
break;
}
default:
AFInAppEventParameterName2 = aFi1zSDK.AFInAppEventType.AFInAppEventParameterName("https://%sars.%s/api/v2/android/validate_subscription_v2?app_id=");
break;
}
StringBuilder sb = new StringBuilder();
sb.append(AFInAppEventParameterName2);
sb.append(aFi1zSDK.AFKeystoreWrapper.AFKeystoreWrapper.AFInAppEventType.getPackageName());
return values(new AFe1zSDK(aFi1zSDK.AFInAppEventParameterName(sb.toString()), bArr, "POST", Collections.emptyMap(), true), new AFe1xSDK());
}
z2 = true;
switch (z2 ? false : true) {
}
StringBuilder sb2 = new StringBuilder();
sb2.append(AFInAppEventParameterName2);
sb2.append(aFi1zSDK.AFKeystoreWrapper.AFKeystoreWrapper.AFInAppEventType.getPackageName());
return values(new AFe1zSDK(aFi1zSDK.AFInAppEventParameterName(sb2.toString()), bArr, "POST", Collections.emptyMap(), true), new AFe1xSDK());
} catch (Throwable th) {
try {
Throwable cause = th.getCause();
if (cause != null) {
throw cause;
}
throw th;
} catch (Exception e) {
AFLogger.afErrorLogForExcManagerOnly("AFFinalizer: reflection init failed", e);
return null;
}
}
}
@Nullable
public final AFd1bSDK<String> AFInAppEventType(Map<String, Object> map, String str, @Nullable String str2) {
boolean z;
int i = afErrorLog + 49;
afWarnLog = i % 128;
int i2 = i % 2;
try {
boolean z2 = true;
Object[] objArr = {map, str};
Map<Integer, Object> map2 = AFa1zSDK.init;
Object obj = map2.get(1638884274);
if (obj == null) {
obj = ((Class) AFa1zSDK.AFKeystoreWrapper((char) TextUtils.indexOf("", "", 0), (ViewConfiguration.getKeyRepeatTimeout() >> 16) + 74, 37 - Gravity.getAbsoluteGravity(0, 0))).getMethod("AFKeystoreWrapper", Map.class, String.class);
map2.put(1638884274, obj);
}
byte[] bArr = (byte[]) ((Method) obj).invoke(null, objArr);
AFi1zSDK aFi1zSDK = new AFi1zSDK(this.values);
switch (str2 != null ? 'O' : 'Y') {
default:
int i3 = afErrorLog + 5;
afWarnLog = i3 % 128;
if (i3 % 2 == 0) {
str2.length();
throw null;
} else if (str2.length() != 0) {
z = false;
break;
}
case 'Y':
z = true;
break;
}
if (!z && !new Regex("4.?(\\d+)?.?(\\d+)").matches(str2)) {
switch (!new Regex("3.?(\\d+)?.?(\\d+)").matches(str2)) {
case true:
z2 = false;
break;
}
}
String AFInAppEventParameterName2 = z2 ? aFi1zSDK.AFInAppEventType.AFInAppEventParameterName("https://%sviap.%s/api/v1/android/validate_purchase?app_id=") : aFi1zSDK.AFInAppEventType.AFInAppEventParameterName("https://%sviap.%s/api/v1/android/validate_purchase_v2?app_id=");
StringBuilder sb = new StringBuilder();
sb.append(AFInAppEventParameterName2);
sb.append(aFi1zSDK.AFKeystoreWrapper.AFKeystoreWrapper.AFInAppEventType.getPackageName());
return values(new AFe1zSDK(aFi1zSDK.AFInAppEventParameterName(sb.toString()), bArr, "POST", Collections.emptyMap(), true), new AFe1xSDK());
} catch (Throwable th) {
try {
Throwable cause = th.getCause();
if (cause != null) {
throw cause;
}
throw th;
} catch (Exception e) {
AFLogger.afErrorLogForExcManagerOnly("AFFinalizer: reflection init failed", e);
return null;
}
}
}
@NonNull
public final AFd1bSDK<String> AFInAppEventType(Map<String, Object> map) {
StringBuilder sb = new StringBuilder();
sb.append(String.format(AFInAppEventParameterName, AppsFlyerLib.getInstance().getHostPrefix(), AFb1tSDK.AFKeystoreWrapper().getHostName()));
sb.append(this.values.AFKeystoreWrapper.AFInAppEventType.getPackageName());
AFd1bSDK<String> values = values(new AFe1zSDK(sb.toString(), new JSONObject(map).toString().getBytes(Charset.defaultCharset()), "POST", Collections.emptyMap(), false, false), new AFe1xSDK());
int i = afErrorLog + 5;
afWarnLog = i % 128;
switch (i % 2 != 0) {
case true:
return values;
default:
Object obj = null;
obj.hashCode();
throw null;
}
}
@NonNull
public final AFd1bSDK<AFg1fSDK> valueOf(boolean z, boolean z2, @NonNull String str, int i) {
String str2;
String str3;
String str4;
AFe1sSDK aFe1sSDK = this.afDebugLog;
Intrinsics.checkNotNullParameter(str, "");
switch (z ? (char) 4 : (char) 21) {
case 21:
str2 = AFe1sSDK.valueOf;
break;
default:
str2 = AFe1sSDK.AFInAppEventParameterName;
break;
}
switch (z2 ? (char) 25 : '\f') {
case 25:
int i2 = afErrorLog + 25;
int i3 = i2 % 128;
afWarnLog = i3;
int i4 = i2 % 2;
char c = Typography.greater;
switch (i4 == 0 ? '2' : '>') {
case '2':
int i5 = 64 / 0;
break;
}
int i6 = i3 + 103;
afErrorLog = i6 % 128;
if (i6 % 2 == 0) {
c = ';';
}
switch (c) {
case '>':
default:
str3 = "stg";
break;
}
default:
int i7 = afErrorLog + 79;
afWarnLog = i7 % 128;
int i8 = i7 % 2;
str3 = "";
break;
}
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
Object[] objArr = new Object[4];
if (AFe1sSDK.AFKeystoreWrapper()) {
int i9 = afErrorLog + 5;
afWarnLog = i9 % 128;
int i10 = i9 % 2;
str4 = (String) aFe1sSDK.values.getValue();
} else {
str4 = "";
}
objArr[0] = str4;
objArr[1] = str3;
objArr[2] = aFe1sSDK.values();
objArr[3] = str;
String format = String.format(str2, Arrays.copyOf(objArr, 4));
Intrinsics.checkNotNullExpressionValue(format, "");
AFe1zSDK aFe1zSDK = new AFe1zSDK(format, "GET");
aFe1zSDK.afErrorLog = 1500;
return values(aFe1zSDK, new AFe1wSDK());
}
@Nullable
public final AFd1bSDK<String> valueOf(AFa1oSDK aFa1oSDK, String str, AFd1tSDK aFd1tSDK) {
int i = afErrorLog + 105;
afWarnLog = i % 128;
int i2 = i % 2;
try {
Object[] objArr = {aFa1oSDK, str, aFd1tSDK};
Map<Integer, Object> map = AFa1zSDK.init;
Object obj = map.get(918794414);
if (obj == null) {
obj = ((Class) AFa1zSDK.AFKeystoreWrapper((char) (Process.myPid() >> 22), 74 - (ViewConfiguration.getDoubleTapTimeout() >> 16), (Process.myPid() >> 22) + 37)).getMethod("AFInAppEventParameterName", AFa1oSDK.class, String.class, AFd1tSDK.class);
map.put(918794414, obj);
}
byte[] bArr = (byte[]) ((Method) obj).invoke(null, objArr);
int i3 = afWarnLog + 63;
afErrorLog = i3 % 128;
int i4 = i3 % 2;
return values(new AFe1zSDK(aFa1oSDK.afErrorLog, bArr, "POST", Collections.emptyMap(), aFa1oSDK.values()), new AFe1xSDK());
} catch (Throwable th) {
try {
Throwable cause = th.getCause();
if (cause != null) {
throw cause;
}
throw th;
} catch (Throwable th2) {
AFLogger.afErrorLogForExcManagerOnly("AFFinalizer: reflection init failed", th2);
return null;
}
}
}
public final AFd1bSDK<Map<String, Object>> values(String str, String str2) {
String packageName = this.values.AFKeystoreWrapper.AFInAppEventType.getPackageName();
AFd1vSDK aFd1vSDK = this.values;
AFd1bSDK<Map<String, Object>> values = values(AFd1eSDK.values(packageName, AFb1iSDK.AFKeystoreWrapper(aFd1vSDK.AFKeystoreWrapper, aFd1vSDK.valueOf), str, str2), new AFd1aSDK());
int i = afWarnLog + 51;
afErrorLog = i % 128;
switch (i % 2 != 0 ? '\n' : '-') {
case '\n':
int i2 = 54 / 0;
return values;
default:
return values;
}
}
public final AFd1bSDK<String> AFInAppEventType(AFg1rSDK aFg1rSDK) {
AFd1bSDK<String> values = values(new AFe1zSDK(aFg1rSDK.afErrorLog, aFg1rSDK.valueOf(), "POST", Collections.emptyMap(), true), new AFe1xSDK());
int i = afErrorLog + 119;
afWarnLog = i % 128;
switch (i % 2 != 0) {
case true:
return values;
default:
Object obj = null;
obj.hashCode();
throw null;
}
}
public final AFd1bSDK<String> values(@NonNull String str, @NonNull Map<String, String> map, @Nullable String str2, @NonNull UUID uuid, @NonNull String str3) {
boolean z;
String obj = uuid.toString();
HashMap hashMap = new HashMap();
hashMap.put("ttl", "-1");
hashMap.put("uuid", obj);
hashMap.put("data", map);
hashMap.put("meta", values());
if (str2 == null) {
z = true;
} else {
z = false;
}
switch (z) {
case false:
int i = afErrorLog + 43;
afWarnLog = i % 128;
int i2 = i % 2;
hashMap.put("brand_domain", str2);
int i3 = afWarnLog + 11;
afErrorLog = i3 % 128;
int i4 = i3 % 2;
break;
}
String jSONObject = AFa1qSDK.AFInAppEventType(hashMap).toString();
HashMap hashMap2 = new HashMap();
Object[] objArr = new Object[1];
a(12 - KeyEvent.keyCodeFromString(""), (char) (View.combineMeasuredStates(0, 0) + 841), (AudioTrack.getMinVolume() > 0.0f ? 1 : (AudioTrack.getMinVolume() == 0.0f ? 0 : -1)), objArr);
hashMap2.put(((String) objArr[0]).intern(), AFInAppEventType(str3, obj, "POST", jSONObject));
StringBuilder sb = new StringBuilder();
sb.append(String.format(AFInAppEventType, AppsFlyerLib.getInstance().getHostPrefix(), AFb1tSDK.AFKeystoreWrapper().getHostName()));
sb.append("/");
sb.append(str);
return values(new AFe1zSDK(sb.toString(), jSONObject.getBytes(Charset.defaultCharset()), "POST", hashMap2, false), new AFe1xSDK(), true);
}
public final AFd1bSDK<Map<String, String>> AFKeystoreWrapper(@NonNull String str, @NonNull String str2, @NonNull UUID uuid, @NonNull String str3) {
String obj = uuid.toString();
StringBuilder sb = new StringBuilder();
sb.append(String.format(AFInAppEventType, AppsFlyerLib.getInstance().getHostPrefix(), AFb1tSDK.AFKeystoreWrapper().getHostName()));
sb.append("/");
sb.append(str);
sb.append("?id=");
sb.append(str2);
String obj2 = sb.toString();
Map<String, Object> values = values();
String valueOf = String.valueOf(values.get("build_number"));
HashMap hashMap = new HashMap();
hashMap.put("Af-UUID", uuid.toString());
hashMap.put("Af-Meta-Sdk-Ver", valueOf);
hashMap.put("Af-Meta-Counter", String.valueOf(values.get("counter")));
hashMap.put("Af-Meta-Model", String.valueOf(values.get("model")));
hashMap.put("Af-Meta-Platform", String.valueOf(values.get("platformextension")));
hashMap.put("Af-Meta-System-Version", String.valueOf(values.get("sdk")));
Object[] objArr = new Object[1];
a(12 - KeyEvent.keyCodeFromString(""), (char) (841 - View.combineMeasuredStates(0, 0)), Color.green(0), objArr);
hashMap.put(((String) objArr[0]).intern(), AFInAppEventType(str3, obj, "GET", obj, str, str2, valueOf));
AFd1bSDK<Map<String, String>> values2 = values(new AFe1zSDK(obj2, null, "GET", hashMap, false), new AFe1uSDK());
int i = afWarnLog + 69;
afErrorLog = i % 128;
int i2 = i % 2;
return values2;
}
public final AFd1bSDK<String> AFInAppEventParameterName(@NonNull String str) {
AFe1zSDK aFe1zSDK = new AFe1zSDK(str, null, "GET", Collections.emptyMap(), false);
aFe1zSDK.afErrorLog = 10000;
aFe1zSDK.AFInAppEventParameterName = false;
AFd1bSDK<String> values = values(aFe1zSDK, new AFe1xSDK());
int i = afErrorLog + 39;
afWarnLog = i % 128;
int i2 = i % 2;
return values;
}
private <T> AFd1bSDK<T> values(AFe1zSDK aFe1zSDK, AFe1rSDK<T> aFe1rSDK) {
int i = afErrorLog + 5;
afWarnLog = i % 128;
int i2 = i % 2;
AFd1bSDK<T> values = values(aFe1zSDK, aFe1rSDK, AFInAppEventParameterName());
int i3 = afErrorLog + 45;
afWarnLog = i3 % 128;
switch (i3 % 2 == 0) {
case true:
Object obj = null;
obj.hashCode();
throw null;
default:
return values;
}
}
@VisibleForTesting
private Map<String, Object> values() {
HashMap hashMap = new HashMap();
hashMap.put("build_number", "6.12.5");
hashMap.put("counter", Integer.valueOf(this.values.valueOf.AFKeystoreWrapper("appsFlyerCount", 0)));
hashMap.put("model", Build.MODEL);
Object[] objArr = new Object[1];
a(5 - (ViewConfiguration.getWindowTouchSlop() >> 8), (char) TextUtils.indexOf("", "", 0, 0), (ViewConfiguration.getTapTimeout() >> 16) + 12, objArr);
hashMap.put(((String) objArr[0]).intern(), Build.BRAND);
hashMap.put("sdk", Integer.toString(Build.VERSION.SDK_INT));
Context context = this.values.AFKeystoreWrapper.AFInAppEventType;
hashMap.put("app_version_name", AFb1rSDK.values(context, context.getPackageName()));
hashMap.put("app_id", this.values.AFKeystoreWrapper.AFInAppEventType.getPackageName());
hashMap.put("platformextension", new AFb1gSDK().AFInAppEventParameterName());
int i = afErrorLog + 93;
afWarnLog = i % 128;
int i2 = i % 2;
return hashMap;
}
private static String AFInAppEventType(String str, String str2, String... strArr) {
ArrayList arrayList = new ArrayList(Arrays.asList(strArr));
arrayList.add(1, "v2");
String join = TextUtils.join("\u2063", (String[]) arrayList.toArray(new String[0]));
StringBuilder sb = new StringBuilder();
sb.append(str);
sb.append(str2);
sb.append("v2");
String valueOf = AFb1jSDK.valueOf(join, sb.toString());
int i = afWarnLog + 3;
afErrorLog = i % 128;
int i2 = i % 2;
return valueOf;
}
private boolean AFInAppEventParameterName() {
int i = afWarnLog + 35;
afErrorLog = i % 128;
switch (i % 2 != 0 ? '8' : (char) 19) {
case '8':
break;
default:
switch (!this.afInfoLog.getBoolean(AppsFlyerProperties.HTTP_CACHE, true)) {
case true:
int i2 = afErrorLog + 83;
afWarnLog = i2 % 128;
switch (i2 % 2 == 0) {
case true:
default:
return true;
}
default:
return false;
}
}
}
private <T> AFd1bSDK<T> values(AFe1zSDK aFe1zSDK, AFe1rSDK<T> aFe1rSDK, boolean z) {
aFe1zSDK.values = z;
AFd1dSDK aFd1dSDK = this.valueOf;
AFd1bSDK<T> aFd1bSDK = new AFd1bSDK<>(aFe1zSDK, aFd1dSDK.values, aFd1dSDK.valueOf, aFe1rSDK);
int i = afErrorLog + 43;
afWarnLog = i % 128;
int i2 = i % 2;
return aFd1bSDK;
}
private static void a(int i, char c, int i2, Object[] objArr) {
AFi1pSDK aFi1pSDK = new AFi1pSDK();
long[] jArr = new long[i];
aFi1pSDK.AFInAppEventType = 0;
while (true) {
int i3 = aFi1pSDK.AFInAppEventType;
switch (i3 < i ? '(' : Typography.less) {
case '<':
char[] cArr = new char[i];
aFi1pSDK.AFInAppEventType = 0;
int i4 = $11 + 117;
$10 = i4 % 128;
int i5 = i4 % 2;
while (true) {
int i6 = aFi1pSDK.AFInAppEventType;
if (i6 >= i) {
String str = new String(cArr);
int i7 = $11 + 117;
$10 = i7 % 128;
switch (i7 % 2 != 0) {
case false:
objArr[0] = str;
return;
default:
Object obj = null;
obj.hashCode();
throw null;
}
}
int i8 = $10 + 119;
$11 = i8 % 128;
int i9 = i8 % 2;
cArr[i6] = (char) jArr[i6];
aFi1pSDK.AFInAppEventType = i6 + 1;
}
default:
jArr[i3] = (((char) (afRDLog[i2 + i3] ^ (-7621715414171420536L))) ^ (i3 * ((-7621715414171420536L) ^ AFLogger))) ^ c;
aFi1pSDK.AFInAppEventType = i3 + 1;
}
}
}
}