Fortune Cow 4 v1.0.1版本的 MD5 值为:7ba46af6fc58566545d41cb8b412326c

以下内容为反编译后的 CrossPromotionHelper.java 源代码,内容仅作参考


package com.appsflyer.share;

import android.content.Context;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerProperties;
import com.appsflyer.internal.AFa1cSDK;
import com.appsflyer.internal.AFc1qSDK;
import com.appsflyer.internal.AFd1fSDK;
import com.appsflyer.internal.AFe1zSDK;
import com.appsflyer.internal.AFg1dSDK;
import com.appsflyer.internal.AFg1fSDK;
import java.util.HashMap;
import java.util.Map;
public class CrossPromotionHelper {
    private static String valueOf = "https://%simpression.%s";

    public static void logAndOpenStore(Context context, String str, String str2) {
        logAndOpenStore(context, str, str2, null);
    }

    public static void logAndOpenStore(Context context, String str, String str2, Map<String, String> map) {
        LinkGenerator values = values(context, str, str2, map, String.format(AFg1dSDK.valueOf, AppsFlyerLib.getInstance().getHostPrefix(), AFa1cSDK.AFInAppEventType().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);
            AFKeystoreWrapper(values.generateLink(), context, new AFg1fSDK(context));
        }
    }

    public static void logCrossPromoteImpression(Context context, String str, String str2) {
        logCrossPromoteImpression(context, str, str2, null);
    }

    public static void logCrossPromoteImpression(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 {
            AFKeystoreWrapper(values(context, str, str2, map, String.format(valueOf, AppsFlyerLib.getInstance().getHostPrefix(), AFa1cSDK.AFInAppEventType().getHostName())).generateLink(), context, null);
        }
    }

    private static void AFKeystoreWrapper(String str, Context context, AFg1fSDK aFg1fSDK) {
        AFa1cSDK AFInAppEventType = AFa1cSDK.AFInAppEventType();
        AFInAppEventType.values(context);
        AFc1qSDK valueOf2 = AFInAppEventType.valueOf();
        AFe1zSDK aFe1zSDK = new AFe1zSDK(valueOf2, str, aFg1fSDK);
        AFd1fSDK afErrorLogForExcManagerOnly = valueOf2.afErrorLogForExcManagerOnly();
        afErrorLogForExcManagerOnly.values.execute(new AFd1fSDK.AnonymousClass3(aFe1zSDK));
    }

    private static LinkGenerator values(Context context, String str, String str2, Map<String, String> map, String str3) {
        LinkGenerator linkGenerator = new LinkGenerator("af_cross_promotion");
        linkGenerator.valueOf = str3;
        linkGenerator.AFKeystoreWrapper = 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) {
        for (Map.Entry<String, String> entry : map.entrySet()) {
            String value = entry.getValue();
            String key = entry.getKey();
            char c = 65535;
            int hashCode = key.hashCode();
            if (hashCode != 96801) {
                if (hashCode == 120623625 && key.equals("impression")) {
                    c = 1;
                }
            } else if (key.equals("app")) {
                c = 0;
            }
            if (c == 0) {
                AFg1dSDK.valueOf = value;
            } else if (c == 1) {
                valueOf = value;
            }
        }
    }
}