McAfee Security v6.7.1.27版本的 MD5 值为:f931794df50c0876bab25b112d85d702

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


package com.appsflyer.internal;

import android.content.Context;
import androidx.annotation.NonNull;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerInAppPurchaseValidatorListener;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerProperties;
import com.appsflyer.internal.aj;
import java.lang.ref.WeakReference;
import java.net.HttpURLConnection;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONObject;
public final class ad implements Runnable {
    private static String AFInAppEventParameterName = "https://%ssdk-services.%s/validate-android-signature";
    private static String valueOf;
    private String AFInAppEventType;
    private String AFKeystoreWrapper;
    private String AFLogger$LogLevel;
    private String AFVersionDeclaration;
    private String AppsFlyer2dXConversionCallback;
    private Map<String, String> getLevel;
    private String init;
    private WeakReference<Context> values;

    static {
        StringBuilder sb = new StringBuilder("https://%svalidate.%s/api/v");
        sb.append(ah.values);
        sb.append("/androidevent?buildnumber=6.5.2&app_id=");
        valueOf = sb.toString();
    }

    public ad(Context context, String str, String str2, String str3, String str4, String str5, String str6, Map<String, String> map) {
        this.values = new WeakReference<>(context);
        this.AFInAppEventType = str;
        this.AFKeystoreWrapper = str2;
        this.AFLogger$LogLevel = str4;
        this.init = str5;
        this.AppsFlyer2dXConversionCallback = str6;
        this.getLevel = map;
        this.AFVersionDeclaration = str3;
    }

    private static HttpURLConnection AFInAppEventParameterName(@NonNull ci ciVar) {
        StringBuilder sb = new StringBuilder("Calling ");
        sb.append(ciVar.onDeepLinkingNative);
        AFLogger.values(sb.toString());
        ciVar.onConversionDataSuccess = AppsFlyerLib.getInstance().isStopped();
        return new aj.a(ciVar).AFInAppEventParameterName();
    }

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

    static void AFInAppEventType(ad adVar, Map map, Map map2, WeakReference weakReference) {
        if (weakReference.get() != null) {
            ac.AFInAppEventType((Context) weakReference.get()).values();
            StringBuilder sb = new StringBuilder();
            sb.append(String.format(valueOf, AppsFlyerLib.getInstance().getHostPrefix(), ah.valueOf().getHostName()));
            sb.append(((Context) weakReference.get()).getPackageName());
            String obj = sb.toString();
            String string = ah.valueOf((Context) weakReference.get()).getString("referrer", "");
            g coVar = new co((Context) weakReference.get());
            coVar.AFLogger$LogLevel = adVar.AFInAppEventType;
            coVar.init = string;
            ah valueOf2 = ah.valueOf();
            Map<String, Object> AFInAppEventType = valueOf2.AFInAppEventType(coVar);
            AFInAppEventType.put("price", adVar.init);
            AFInAppEventType.put("currency", adVar.AppsFlyer2dXConversionCallback);
            AFInAppEventType.put("receipt_data", map);
            if (map2 != null) {
                AFInAppEventType.put("extra_prms", map2);
            }
            AFInAppEventType.putAll(valueOf2.init());
            am.AFKeystoreWrapper().AFInAppEventParameterName(obj, new JSONObject(AFInAppEventType).toString());
            HttpURLConnection httpURLConnection = null;
            try {
                httpURLConnection = AFInAppEventParameterName((ci) coVar.valueOf(AFInAppEventType).AFKeystoreWrapper(obj));
                int responseCode = httpURLConnection != null ? httpURLConnection.getResponseCode() : -1;
                String AFKeystoreWrapper = ah.AFKeystoreWrapper(httpURLConnection);
                am.AFKeystoreWrapper().AFKeystoreWrapper(obj, responseCode, AFKeystoreWrapper);
                StringBuilder sb2 = new StringBuilder("Validate-WH response - ");
                sb2.append(responseCode);
                sb2.append(": ");
                sb2.append(new JSONObject(AFKeystoreWrapper).toString());
                AFLogger.AFKeystoreWrapper(sb2.toString());
            } catch (Throwable th) {
                try {
                    AFLogger.AFKeystoreWrapper(th.getMessage(), th);
                    if (httpURLConnection != null) {
                        httpURLConnection.disconnect();
                    }
                } finally {
                    if (httpURLConnection != null) {
                        httpURLConnection.disconnect();
                    }
                }
            }
        }
    }

    @Override
    public final void run() {
        String str = this.AFInAppEventType;
        if (str == null || str.length() == 0 || AppsFlyerLib.getInstance().isStopped()) {
            return;
        }
        HttpURLConnection httpURLConnection = null;
        try {
            Context context = this.values.get();
            if (context == null) {
                return;
            }
            HashMap hashMap = new HashMap();
            hashMap.put("public-key", this.AFKeystoreWrapper);
            hashMap.put("sig-data", this.AFLogger$LogLevel);
            hashMap.put("signature", this.AFVersionDeclaration);
            final HashMap hashMap2 = new HashMap(hashMap);
            new Thread(new Runnable() {
                @Override
                public final void run() {
                    ad adVar = ad.this;
                    ad.AFInAppEventType(adVar, hashMap2, adVar.getLevel, ad.this.values);
                }
            }).start();
            hashMap.put("dev_key", this.AFInAppEventType);
            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);
            }
            String jSONObject = new JSONObject(hashMap).toString();
            String format = String.format(AFInAppEventParameterName, AppsFlyerLib.getInstance().getHostPrefix(), ah.valueOf().getHostName());
            am.AFKeystoreWrapper().AFInAppEventParameterName(format, jSONObject);
            HttpURLConnection AFInAppEventParameterName2 = AFInAppEventParameterName((ci) new ck().valueOf(hashMap).AFKeystoreWrapper(format));
            int responseCode = AFInAppEventParameterName2 != null ? AFInAppEventParameterName2.getResponseCode() : -1;
            ah.valueOf();
            String AFKeystoreWrapper = ah.AFKeystoreWrapper(AFInAppEventParameterName2);
            am.AFKeystoreWrapper().AFKeystoreWrapper(format, responseCode, AFKeystoreWrapper);
            JSONObject jSONObject2 = new JSONObject(AFKeystoreWrapper);
            jSONObject2.put("code", responseCode);
            if (responseCode == 200) {
                StringBuilder sb = new StringBuilder("Validate response 200 ok: ");
                sb.append(jSONObject2.toString());
                AFLogger.AFKeystoreWrapper(sb.toString());
                AFInAppEventParameterName(jSONObject2.optBoolean("result"), this.AFLogger$LogLevel, this.init, this.AppsFlyer2dXConversionCallback, jSONObject2.toString());
            } else {
                AFLogger.AFKeystoreWrapper("Failed Validate request");
                AFInAppEventParameterName(false, this.AFLogger$LogLevel, this.init, this.AppsFlyer2dXConversionCallback, jSONObject2.toString());
            }
            if (AFInAppEventParameterName2 != null) {
                AFInAppEventParameterName2.disconnect();
            }
        } catch (Throwable th) {
            try {
                if (ah.AFInAppEventType != null) {
                    AFLogger.AFKeystoreWrapper("Failed Validate request + ex", th);
                    AFInAppEventParameterName(false, this.AFLogger$LogLevel, this.init, this.AppsFlyer2dXConversionCallback, th.getMessage());
                }
                AFLogger.AFKeystoreWrapper(th.getMessage(), th);
            } finally {
                if (0 != 0) {
                    httpURLConnection.disconnect();
                }
            }
        }
    }
}