afun 2020238 v1.0版本的 MD5 值为:0e5438925c609ea263d060e5259b230d
以下内容为反编译后的 CrossPromotionHelper.java 源代码,内容仅作参考
package com.appsflyer.share;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerProperties;
import com.appsflyer.internal.AFb1tSDK;
import com.appsflyer.internal.AFd1pSDK;
import com.appsflyer.internal.AFe1fSDK;
import com.appsflyer.internal.AFe1jSDK;
import com.appsflyer.internal.AFi1uSDK;
import com.appsflyer.internal.AFi1vSDK;
import java.util.HashMap;
import java.util.Map;
public class CrossPromotionHelper {
private static String AFInAppEventType = "https://%simpression.%s";
public static void logAndOpenStore(@NonNull Context context, String str, String str2) {
logAndOpenStore(context, str, str2, null);
}
public static void logAndOpenStore(@NonNull Context context, String str, String str2, Map<String, String> map) {
LinkGenerator valueOf = valueOf(context, str, str2, map, String.format(AFi1uSDK.valueOf, AppsFlyerLib.getInstance().getHostPrefix(), AFb1tSDK.AFKeystoreWrapper().getHostName()));
if (AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.AF_WAITFOR_CUSTOMERID, false)) {
AFLogger.afInfoLog("CustomerUserId not set, track And Open Store is disabled", true);
} else if (AppsFlyerLib.getInstance().isStopped()) {
AFLogger.afInfoLog("SDK is stopped, track And Open Store is disabled", true);
} else {
if (map == null) {
map = new HashMap<>();
}
map.put("af_campaign", str2);
AppsFlyerLib.getInstance().logEvent(context, "af_cross_promotion", map);
AFInAppEventType(valueOf.generateLink(), context, new AFi1vSDK(context));
}
}
public static void logCrossPromoteImpression(@NonNull Context context, String str, String str2) {
logCrossPromoteImpression(context, str, str2, null);
}
public static void logCrossPromoteImpression(@NonNull Context context, String str, String str2, Map<String, String> map) {
if (AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.AF_WAITFOR_CUSTOMERID, false)) {
AFLogger.afInfoLog("CustomerUserId not set, Promote Impression is disabled", true);
} else if (AppsFlyerLib.getInstance().isStopped()) {
AFLogger.afInfoLog("SDK is stopped, Promote Impression is disabled", true);
} else {
AFInAppEventType(valueOf(context, str, str2, map, String.format(AFInAppEventType, AppsFlyerLib.getInstance().getHostPrefix(), AFb1tSDK.AFKeystoreWrapper().getHostName())).generateLink(), context, null);
}
}
private static void AFInAppEventType(@NonNull String str, @NonNull Context context, @Nullable AFi1vSDK aFi1vSDK) {
AFb1tSDK AFKeystoreWrapper = AFb1tSDK.AFKeystoreWrapper();
AFKeystoreWrapper.AFInAppEventType(context);
AFd1pSDK values = AFKeystoreWrapper.values();
AFe1fSDK aFe1fSDK = new AFe1fSDK(values, str, aFi1vSDK);
AFe1jSDK afWarnLog = values.afWarnLog();
afWarnLog.AFInAppEventParameterName.execute(new AFe1jSDK.AnonymousClass4(aFe1fSDK));
}
@NonNull
private static LinkGenerator valueOf(@NonNull Context context, String str, String str2, Map<String, String> map, String str3) {
LinkGenerator linkGenerator = new LinkGenerator("af_cross_promotion");
linkGenerator.AFInAppEventParameterName = str3;
linkGenerator.values = str;
linkGenerator.addParameter("af_siteid", context.getPackageName());
if (str2 != null) {
linkGenerator.setCampaign(str2);
}
if (map != null) {
linkGenerator.addParameters(map);
}
String string = AppsFlyerProperties.getInstance().getString("advertiserId");
if (string != null) {
linkGenerator.addParameter("advertising_id", string);
}
return linkGenerator;
}
public static void setUrl(Map<String, String> map) {
char c;
for (Map.Entry<String, String> entry : map.entrySet()) {
String value = entry.getValue();
String key = entry.getKey();
switch (key.hashCode()) {
case 96801:
if (key.equals("app")) {
c = 0;
break;
}
c = 65535;
break;
case 120623625:
if (key.equals("impression")) {
c = 1;
break;
}
c = 65535;
break;
default:
c = 65535;
break;
}
switch (c) {
case 0:
AFi1uSDK.valueOf = value;
break;
case 1:
AFInAppEventType = value;
break;
}
}
}
}