afun 2020238 v1.0版本的 MD5 值为:0e5438925c609ea263d060e5259b230d
以下内容为反编译后的 AFe1sSDK.java 源代码,内容仅作参考
package com.appsflyer.internal;
import android.util.Base64;
import com.appsflyer.AFLogger;
import java.security.MessageDigest;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.Metadata;
import kotlin.NoWhenBranchMatchedException;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.JvmName;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
import kotlin.text.Charsets;
import kotlin.text.Regex;
import kotlin.text.StringsKt__StringsJVMKt;
import kotlin.text.StringsKt__StringsKt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\b\b\u0016\u0018\u0000 \u00172\u00020\u0001:\u0001\u0017B\u0017\u0012\u0006\u0010\u0013\u001a\u00020\n\u0012\u0006\u0010\u0014\u001a\u00020\u000f¢\u0006\u0004\b\u0015\u0010\u0016R\u0013\u0010\u0005\u001a\u00020\u0002X\u0083\u0080\u0002¢\u0006\u0006\n\u0004\b\u0003\u0010\u0004R\u0013\u0010\u0007\u001a\u00020\u0002X\u0083\u0080\u0002¢\u0006\u0006\n\u0004\b\u0006\u0010\u0004R\u0011\u0010\t\u001a\u00020\u00028G¢\u0006\u0006\u001a\u0004\b\u0006\u0010\bR\u0014\u0010\f\u001a\u00020\n8\u0002X\u0083\u0004¢\u0006\u0006\n\u0004\b\u0005\u0010\u000bR\u0014\u0010\u0006\u001a\u00020\r8CX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\f\u0010\u000eR\u0014\u0010\u0011\u001a\u00020\u000f8\u0002X\u0083\u0004¢\u0006\u0006\n\u0004\b\f\u0010\u0010R\u0011\u0010\u0012\u001a\u00020\u00028G¢\u0006\u0006\u001a\u0004\b\t\u0010\b"}, d2 = {"Lcom/appsflyer/internal/AFe1sSDK;", "", "", "AFLogger", "Lkotlin/Lazy;", "AFInAppEventType", "values", "AFInAppEventParameterName", "()Ljava/lang/String;", "valueOf", "Lcom/appsflyer/internal/AFd1vSDK;", "Lcom/appsflyer/internal/AFd1vSDK;", "AFKeystoreWrapper", "", "()Z", "Lcom/appsflyer/internal/AFd1xSDK;", "Lcom/appsflyer/internal/AFd1xSDK;", "afErrorLog", "afInfoLog", "p0", "p1", "<init>", "(Lcom/appsflyer/internal/AFd1vSDK;Lcom/appsflyer/internal/AFd1xSDK;)V", "AFa1uSDK"}, k = 1, mv = {1, 6, 0}, xi = 48)
public class AFe1sSDK {
@Nullable
private static AFe1tSDK afDebugLog;
@NotNull
private final AFd1vSDK AFInAppEventType;
@NotNull
private final AFd1xSDK AFKeystoreWrapper;
@NotNull
private final Lazy AFLogger;
@NotNull
public final Lazy values;
@NotNull
public static final AFa1uSDK AFa1uSDK = new AFa1uSDK(null);
@NotNull
public static String valueOf = "https://%scdn-%ssettings.%s/android/v1/%s/settings";
@NotNull
public static String AFInAppEventParameterName = "https://%scdn-%stestsettings.%s/android/v1/%s/settings";
@NotNull
private static final List<String> afRDLog = CollectionsKt__CollectionsKt.listOf((Object[]) new String[]{"googleplay", "playstore", "googleplaystore"});
public class AFa1zSDK {
public static final int[] AFInAppEventParameterName;
static {
int[] iArr = new int[AFe1mSDK.values().length];
iArr[AFe1mSDK.DEFAULT.ordinal()] = 1;
iArr[AFe1mSDK.API.ordinal()] = 2;
iArr[AFe1mSDK.RC.ordinal()] = 3;
AFInAppEventParameterName = iArr;
}
}
public static final void AFInAppEventParameterName(@Nullable AFe1tSDK aFe1tSDK) {
AFa1uSDK.values(aFe1tSDK);
}
public AFe1sSDK(@NotNull AFd1vSDK aFd1vSDK, @NotNull AFd1xSDK aFd1xSDK) {
Intrinsics.checkNotNullParameter(aFd1vSDK, "");
Intrinsics.checkNotNullParameter(aFd1xSDK, "");
this.AFInAppEventType = aFd1vSDK;
this.AFKeystoreWrapper = aFd1xSDK;
this.AFLogger = LazyKt__LazyJVMKt.lazy(new Function0<String>() {
{
super(0);
}
@Override
@NotNull
public final String invoke() {
String values = AFb1tSDK.values(AFe1sSDK.this.AFKeystoreWrapper, AFe1sSDK.this.AFInAppEventType.AFKeystoreWrapper());
if (!(values == null || StringsKt__StringsJVMKt.isBlank(values))) {
String obj = StringsKt__StringsKt.trim((CharSequence) values).toString();
AFa1uSDK aFa1uSDK = AFe1sSDK.AFa1uSDK;
List<String> values2 = AFa1uSDK.values();
Locale locale = Locale.getDefault();
Intrinsics.checkNotNullExpressionValue(locale, "");
String lowerCase = obj.toLowerCase(locale);
Intrinsics.checkNotNullExpressionValue(lowerCase, "");
if (!values2.contains(lowerCase)) {
values = "-".concat(String.valueOf(obj));
} else {
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
String format = String.format("AF detected using redundant Google-Play channel for attribution - %s. Using without channel postfix.", Arrays.copyOf(new Object[]{obj}, 1));
Intrinsics.checkNotNullExpressionValue(format, "");
AFLogger.afWarnLog(format);
values = "";
}
}
return StringsKt__StringsKt.trim((CharSequence) (values != null ? values : "")).toString();
}
});
this.values = LazyKt__LazyJVMKt.lazy(new Function0<String>() {
{
super(0);
}
@Override
@NotNull
public final String invoke() {
String packageName = AFe1sSDK.this.AFInAppEventType.AFKeystoreWrapper.AFInAppEventType.getPackageName();
Intrinsics.checkNotNullExpressionValue(packageName, "");
return AFe1sSDK.AFKeystoreWrapper(packageName, AFe1sSDK.valueOf(AFe1sSDK.this));
}
});
}
public static final String AFKeystoreWrapper(String str, String str2) {
StringBuilder sb = new StringBuilder();
StringBuilder sb2 = new StringBuilder();
sb2.append(str);
sb2.append(str2);
String obj = sb2.toString();
Intrinsics.checkNotNullParameter(obj, "");
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
byte[] bytes = obj.getBytes(Charsets.UTF_8);
Intrinsics.checkNotNullExpressionValue(bytes, "");
byte[] digest = messageDigest.digest(bytes);
Intrinsics.checkNotNullExpressionValue(digest, "");
String encodeToString = Base64.encodeToString(digest, 2);
Intrinsics.checkNotNullExpressionValue(encodeToString, "");
String lowerCase = encodeToString.toLowerCase(Locale.ROOT);
Intrinsics.checkNotNullExpressionValue(lowerCase, "");
String substring = new Regex("[^\\w]+").replace(lowerCase, "").substring(0, 6);
Intrinsics.checkNotNullExpressionValue(substring, "");
sb.append(substring);
sb.append('-');
return sb.toString();
}
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010 \n\u0002\u0010\u000e\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0011\u0010\u0012R \u0010\b\u001a\b\u0012\u0004\u0012\u00020\u00030\u00028\u0007X\u0087\u0004¢\u0006\f\n\u0004\b\u0004\u0010\u0005\u001a\u0004\b\u0006\u0010\u0007R\u0012\u0010\u000b\u001a\u00020\u0003X\u0087\u0002¢\u0006\u0006\n\u0004\b\t\u0010\nR\u0012\u0010\t\u001a\u00020\u0003X\u0087\u0002¢\u0006\u0006\n\u0004\b\f\u0010\nR\u001c\u0010\f\u001a\u0004\u0018\u00010\r@\u0007X\u0087\n¢\u0006\f\n\u0004\b\u000e\u0010\u000f\"\u0004\b\u0006\u0010\u0010"}, d2 = {"Lcom/appsflyer/internal/AFe1sSDK$AFa1uSDK;", "", "", "", "afRDLog", "Ljava/util/List;", "values", "()Ljava/util/List;", "AFKeystoreWrapper", "valueOf", "Ljava/lang/String;", "AFInAppEventType", "AFInAppEventParameterName", "Lcom/appsflyer/internal/AFe1tSDK;", "afDebugLog", "Lcom/appsflyer/internal/AFe1tSDK;", "(Lcom/appsflyer/internal/AFe1tSDK;)V", "<init>", "()V"}, k = 1, mv = {1, 6, 0}, xi = 48)
public static final class AFa1uSDK {
public AFa1uSDK(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private AFa1uSDK() {
}
@JvmName(name = "values")
@NotNull
public static List<String> values() {
return AFe1sSDK.afRDLog;
}
@JvmName(name = "values")
public static void values(@Nullable AFe1tSDK aFe1tSDK) {
AFe1sSDK.afDebugLog = aFe1tSDK;
}
}
@JvmName(name = "AFKeystoreWrapper")
public static boolean AFKeystoreWrapper() {
return afDebugLog == null;
}
@JvmName(name = "valueOf")
@NotNull
public final String valueOf() {
AFe1mSDK aFe1mSDK;
if (AFKeystoreWrapper()) {
aFe1mSDK = AFe1mSDK.DEFAULT;
} else {
aFe1mSDK = AFe1mSDK.API;
}
switch (AFa1zSDK.AFInAppEventParameterName[aFe1mSDK.ordinal()]) {
case 1:
return (String) this.values.getValue();
case 2:
AFe1tSDK aFe1tSDK = afDebugLog;
String str = aFe1tSDK != null ? aFe1tSDK.valueOf : null;
return str == null ? "" : str;
case 3:
return "";
default:
throw new NoWhenBranchMatchedException();
}
}
@JvmName(name = "values")
@NotNull
public final String values() {
AFe1mSDK aFe1mSDK;
if (AFKeystoreWrapper()) {
aFe1mSDK = AFe1mSDK.DEFAULT;
} else {
aFe1mSDK = AFe1mSDK.API;
}
switch (AFa1zSDK.AFInAppEventParameterName[aFe1mSDK.ordinal()]) {
case 1:
return "appsflyersdk.com";
case 2:
AFe1tSDK aFe1tSDK = afDebugLog;
String str = aFe1tSDK != null ? aFe1tSDK.AFInAppEventType : null;
return str == null ? "" : str;
case 3:
return "";
default:
throw new NoWhenBranchMatchedException();
}
}
public static final String valueOf(AFe1sSDK aFe1sSDK) {
return (String) aFe1sSDK.AFLogger.getValue();
}
}