Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f

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


package com.appsflyer.internal;

import android.content.Context;
import android.content.Intent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.applovin.sdk.AppLovinEventParameters;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerInAppPurchaseValidatorListener;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerProperties;
import com.appsflyer.attribution.AppsFlyerRequestListener;
import com.appsflyer.attribution.RequestError;
import com.appsflyer.internal.AFd1wSDK;
import com.appsflyer.internal.components.network.http.ResponseNetwork;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import com.tapjoy.TapjoyConstants;
import com.unity3d.ads.metadata.InAppPurchaseMetaData;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONObject;

public final class AFa1jSDK implements Runnable {
    private static String AFInAppEventParameterName = null;

    @VisibleForTesting
    private static String AFInAppEventType = "https://%ssdk-services.%s/validate-android-signature";
    private final String AFKeystoreWrapper;
    private final String AFLogger;
    private final String afDebugLog;
    private final String afErrorLog;
    private final Map<String, String> afErrorLogForExcManagerOnly;
    private final String afInfoLog;
    private final String afRDLog;
    private final WeakReference<Context> valueOf;
    private final Intent values;

    static {
        StringBuilder sb2 = new StringBuilder("https://%svalidate.%s/api/v");
        sb2.append(AFa1dSDK.AFKeystoreWrapper);
        sb2.append("/androidevent?buildnumber=6.11.0&app_id=");
        AFInAppEventParameterName = sb2.toString();
    }

    public AFa1jSDK(Context context, String str, String str2, String str3, String str4, String str5, String str6, Map<String, String> map, @Nullable Intent intent) {
        this.valueOf = new WeakReference<>(context);
        this.AFKeystoreWrapper = str;
        this.afRDLog = str2;
        this.afInfoLog = str4;
        this.AFLogger = str5;
        this.afDebugLog = str6;
        this.afErrorLogForExcManagerOnly = map;
        this.afErrorLog = str3;
        this.values = intent;
    }

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

    @Override
    public final void run() {
        String str = this.AFKeystoreWrapper;
        if (str == null || str.length() == 0 || AppsFlyerLib.getInstance().isStopped()) {
            return;
        }
        try {
            Context context = this.valueOf.get();
            if (context == null) {
                return;
            }
            HashMap hashMap = new HashMap();
            hashMap.put("public-key", this.afRDLog);
            hashMap.put("sig-data", this.afInfoLog);
            hashMap.put(InAppPurchaseMetaData.KEY_SIGNATURE, this.afErrorLog);
            Object hashMap2 = new HashMap(hashMap);
            Object obj = this.afErrorLogForExcManagerOnly;
            StringBuilder sb2 = new StringBuilder();
            sb2.append(String.format(AFInAppEventParameterName, AppsFlyerLib.getInstance().getHostPrefix(), AFa1dSDK.valueOf().getHostName()));
            sb2.append(context.getPackageName());
            String obj2 = sb2.toString();
            String string = AFa1dSDK.AFKeystoreWrapper(context).getString(TapjoyConstants.TJC_REFERRER, "");
            AFa1sSDK aFf1wSDK = new AFf1wSDK();
            aFf1wSDK.afDebugLog = string;
            AFa1dSDK valueOf = AFa1dSDK.valueOf();
            Map<String, Object> AFInAppEventType2 = valueOf.AFInAppEventType(aFf1wSDK);
            AFInAppEventType2.put("price", this.AFLogger);
            AFInAppEventType2.put("currency", this.afDebugLog);
            AFInAppEventType2.put(AppLovinEventParameters.IN_APP_PURCHASE_DATA, hashMap2);
            if (obj != null) {
                AFInAppEventType2.put("extra_prms", obj);
            }
            AFInAppEventType2.putAll(valueOf.AFKeystoreWrapper().AppsFlyer2dXConversionCallback().valueOf());
            values(context, (AFf1wSDK) aFf1wSDK.valueOf((Map<String, ?>) AFInAppEventType2).AFKeystoreWrapper(obj2));
            hashMap.put("dev_key", this.AFKeystoreWrapper);
            hashMap.put("app_id", context.getPackageName());
            hashMap.put("uid", AppsFlyerLib.getInstance().getAppsFlyerUID(context));
            String string2 = AppsFlyerProperties.getInstance().getString("advertiserId");
            if (string2 != null) {
                hashMap.put("advertiserId", string2);
            }
            AFf1ySDK aFf1ySDK = (AFf1ySDK) new AFf1ySDK().valueOf(hashMap).AFKeystoreWrapper(String.format(AFInAppEventType, AppsFlyerLib.getInstance().getHostPrefix(), AFa1dSDK.valueOf().getHostName()));
            final AFd1gSDK values = values(context, aFf1ySDK);
            aFf1ySDK.AFInAppEventParameterName = new AppsFlyerRequestListener() {
                @Override
                public final void onError(int i11, @NonNull String str2) {
                    ResponseNetwork responseNetwork;
                    if (i11 == RequestError.RESPONSE_CODE_FAILURE && (responseNetwork = ((AFd1mSDK) values).afDebugLog) != null) {
                        str2 = responseNetwork.toString();
                    }
                    AFa1jSDK.AFInAppEventType(false, AFa1jSDK.this.afInfoLog, AFa1jSDK.this.AFLogger, AFa1jSDK.this.afDebugLog, str2);
                }

                @Override
                public final void onSuccess() {
                    try {
                        JSONObject jSONObject = new JSONObject((String) ((AFd1mSDK) values).afDebugLog.getBody());
                        AFLogger.afInfoLog("Validate response ok: ".concat(String.valueOf(jSONObject)));
                        AFa1jSDK.AFInAppEventType(jSONObject.optBoolean(IronSourceConstants.EVENTS_RESULT), AFa1jSDK.this.afInfoLog, AFa1jSDK.this.AFLogger, AFa1jSDK.this.afDebugLog, jSONObject.toString());
                    } catch (Exception e11) {
                        AFLogger.afErrorLog("Failed Validate request: ".concat(String.valueOf(e11)), e11);
                        AFa1jSDK.AFInAppEventType(false, AFa1jSDK.this.afInfoLog, AFa1jSDK.this.AFLogger, AFa1jSDK.this.afDebugLog, e11.getMessage());
                    }
                }
            };
        } catch (Throwable th2) {
            if (AFa1dSDK.AFInAppEventType != null) {
                AFLogger.afErrorLog("Failed Validate request + ex", th2);
                AFInAppEventType(false, this.afInfoLog, this.AFLogger, this.afDebugLog, th2.getMessage());
            }
            AFLogger.afErrorLog(th2.getMessage(), th2);
        }
    }

    private static AFd1gSDK values(Context context, @NonNull AFe1cSDK aFe1cSDK) {
        AFa1dSDK.valueOf().AFInAppEventParameterName(context);
        AFb1bSDK AFKeystoreWrapper = AFa1dSDK.valueOf().AFKeystoreWrapper();
        aFe1cSDK.values(AFKeystoreWrapper.values().values.AFInAppEventType("appsFlyerCount", 0));
        AFd1gSDK aFd1gSDK = new AFd1gSDK(aFe1cSDK, AFKeystoreWrapper);
        AFd1wSDK afWarnLog = AFKeystoreWrapper.afWarnLog();
        afWarnLog.valueOf.execute(new AFd1wSDK.AnonymousClass3(aFd1gSDK));
        return aFd1gSDK;
    }
}