Confectionery Chaos Quest v2.0.0版本的 MD5 值为:0a215dcdba438eef8c81d54c9027e977

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


package com.appsflyer.internal;

import android.content.Context;
import android.content.Intent;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerInAppPurchaseValidatorListener;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerProperties;
import com.appsflyer.attribution.AppsFlyerRequestListener;
import com.appsflyer.internal.AFd1tSDK;
import com.appsflyer.internal.components.network.http.ResponseNetwork;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONObject;

public final class AFa1kSDK implements Runnable {
    private static String AFKeystoreWrapper = "https://%ssdk-services.%s/validate-android-signature";
    private static String valueOf = new StringBuilder("https://%svalidate.%s/api/v").append(AFa1dSDK.AFKeystoreWrapper).append("/androidevent?buildnumber=6.12.1&app_id=").toString();
    private final String AFInAppEventParameterName;
    private final Intent AFInAppEventType;
    private final String AFLogger;
    private final Map<String, String> AFLogger$LogLevel;
    private final String afDebugLog;
    private final String afErrorLog;
    private final String afInfoLog;
    private final String afRDLog;
    private final WeakReference<Context> values;

    public AFa1kSDK(Context context, String str, String str2, String str3, String str4, String str5, String str6, Map<String, String> map, Intent intent) {
        this.values = new WeakReference<>(context);
        this.AFInAppEventParameterName = str;
        this.afDebugLog = str2;
        this.AFLogger = str4;
        this.afInfoLog = str5;
        this.afRDLog = str6;
        this.AFLogger$LogLevel = map;
        this.afErrorLog = str3;
        this.AFInAppEventType = intent;
    }

    @Override
    public final void run() {
        String str = this.AFInAppEventParameterName;
        if (str == null || str.length() == 0 || AppsFlyerLib.getInstance().isStopped()) {
            return;
        }
        try {
            Context context = this.values.get();
            if (context == null) {
                return;
            }
            HashMap hashMap = new HashMap();
            hashMap.put("public-key", this.afDebugLog);
            hashMap.put("sig-data", this.AFLogger);
            hashMap.put("signature", this.afErrorLog);
            Object hashMap2 = new HashMap(hashMap);
            Object obj = this.AFLogger$LogLevel;
            String obj2 = new StringBuilder().append(String.format(valueOf, AppsFlyerLib.getInstance().getHostPrefix(), AFa1dSDK.valueOf().getHostName())).append(context.getPackageName()).toString();
            String valueOf2 = AFa1dSDK.valueOf().AFInAppEventParameterName().AFKeystoreWrapper().valueOf("referrer", "");
            AFa1qSDK aFf1zSDK = new AFf1zSDK();
            aFf1zSDK.AFLogger = valueOf2;
            AFa1dSDK valueOf3 = AFa1dSDK.valueOf();
            Map<String, Object> values = valueOf3.values(aFf1zSDK);
            values.put("price", this.afInfoLog);
            values.put("currency", this.afRDLog);
            values.put("receipt_data", hashMap2);
            if (obj != null) {
                values.put("extra_prms", obj);
            }
            values.putAll(valueOf3.AFInAppEventParameterName().AFVersionDeclaration().AFKeystoreWrapper());
            AFInAppEventType(context, (AFf1zSDK) aFf1zSDK.AFInAppEventType(values).valueOf(obj2));
            hashMap.put("dev_key", this.AFInAppEventParameterName);
            hashMap.put("app_id", context.getPackageName());
            hashMap.put("uid", AppsFlyerLib.getInstance().getAppsFlyerUID(context));
            String string = AppsFlyerProperties.getInstance().getString("advertiserId");
            if (string != null) {
                hashMap.put("advertiserId", string);
            }
            AFe1dSDK aFe1dSDK = (AFe1dSDK) new AFe1dSDK().AFInAppEventType(hashMap).valueOf(String.format(AFKeystoreWrapper, AppsFlyerLib.getInstance().getHostPrefix(), AFa1dSDK.valueOf().getHostName()));
            final AFd1eSDK AFInAppEventType = AFInAppEventType(context, aFe1dSDK);
            aFe1dSDK.AFInAppEventType = new AppsFlyerRequestListener() {
                @Override
                public final void onSuccess() {
                    try {
                        JSONObject jSONObject = new JSONObject((String) ((AFd1nSDK) AFInAppEventType).AFLogger.getBody());
                        AFLogger.afInfoLog("Validate response ok: ".concat(String.valueOf(jSONObject)));
                        AFa1kSDK.AFInAppEventParameterName(jSONObject.optBoolean("result"), AFa1kSDK.this.AFLogger, AFa1kSDK.this.afInfoLog, AFa1kSDK.this.afRDLog, jSONObject.toString());
                    } catch (Exception e) {
                        AFLogger.afErrorLog("Failed Validate request: ".concat(String.valueOf(e)), e);
                        AFa1kSDK.AFInAppEventParameterName(false, AFa1kSDK.this.AFLogger, AFa1kSDK.this.afInfoLog, AFa1kSDK.this.afRDLog, e.getMessage());
                    }
                }

                @Override
                public final void onError(int i, String str2) {
                    ResponseNetwork responseNetwork;
                    if (i == 50 && (responseNetwork = ((AFd1nSDK) AFInAppEventType).AFLogger) != null) {
                        str2 = responseNetwork.toString();
                    }
                    AFa1kSDK.AFInAppEventParameterName(false, AFa1kSDK.this.AFLogger, AFa1kSDK.this.afInfoLog, AFa1kSDK.this.afRDLog, str2);
                }
            };
        } catch (Throwable th) {
            if (AFa1dSDK.AFInAppEventParameterName != null) {
                AFLogger.afErrorLog("Failed Validate request + ex", th);
                AFInAppEventParameterName(false, this.AFLogger, this.afInfoLog, this.afRDLog, th.getMessage());
            }
            AFLogger.afErrorLog(th.getMessage(), th);
        }
    }

    private static AFd1eSDK AFInAppEventType(Context context, AFe1cSDK aFe1cSDK) {
        AFa1dSDK.valueOf().AFInAppEventType(context);
        AFc1zSDK AFInAppEventParameterName = AFa1dSDK.valueOf().AFInAppEventParameterName();
        aFe1cSDK.valueOf(AFInAppEventParameterName.AFInAppEventParameterName().AFInAppEventType.AFInAppEventType("appsFlyerCount", 0));
        AFd1eSDK aFd1eSDK = new AFd1eSDK(aFe1cSDK, AFInAppEventParameterName);
        AFd1tSDK level = AFInAppEventParameterName.getLevel();
        level.AFKeystoreWrapper.execute(new AFd1tSDK.AnonymousClass5(aFd1eSDK));
        return aFd1eSDK;
    }

    public static void AFInAppEventParameterName(boolean z, String str, String str2, String str3, String str4) {
        if (AFa1dSDK.AFInAppEventParameterName != null) {
            AFLogger.afDebugLog(new StringBuilder("Validate callback parameters: ").append(str).append(" ").append(str2).append(" ").append(str3).toString());
            if (z) {
                AFLogger.afDebugLog("Validate in app purchase success: ".concat(String.valueOf(str4)));
                AFa1dSDK.AFInAppEventParameterName.onValidateInApp();
                return;
            }
            AFLogger.afDebugLog("Validate in app purchase failed: ".concat(String.valueOf(str4)));
            AppsFlyerInAppPurchaseValidatorListener appsFlyerInAppPurchaseValidatorListener = AFa1dSDK.AFInAppEventParameterName;
            if (str4 == null) {
                str4 = "Failed validating";
            }
            appsFlyerInAppPurchaseValidatorListener.onValidateInAppFailure(str4);
        }
    }
}