Craftsman 4 v1.20.43版本的 MD5 值为:44824ed1b4bf939cc4a771f5f317f768

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


package com.appsflyer.internal;

import android.os.Build;
import com.android.billingclient.api.BillingClient;
import com.android.billingclient.api.Purchase;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerProperties;
import com.appsflyer.internal.a;
import com.appsflyer.internal.bf;
import com.ironsource.adapters.ironsource.IronSourceAdapter;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.ExecutorService;
import org.json.JSONObject;
public final class ax implements Runnable {
    public final bg AFInAppEventParameterName;
    public final ExecutorService AFInAppEventType;
    final bp AFKeystoreWrapper;
    private final bh init;
    BillingClient valueOf;
    private az values;

    public ax(bg bgVar, az azVar, bp bpVar, ExecutorService executorService, bh bhVar) {
        this.AFInAppEventParameterName = bgVar;
        this.values = azVar;
        this.AFKeystoreWrapper = bpVar;
        this.AFInAppEventType = executorService;
        this.init = bhVar;
    }

    static void AFInAppEventParameterName(ax axVar, boolean z, List list) {
        ab abVar = new ab(false, z, list, null);
        bh bhVar = axVar.init;
        String format = String.format("https://%sars.%s/api/v1/android/validate_subscription", AppsFlyerLib.getInstance().getHostPrefix(), ah.AFKeystoreWrapper().getHostName());
        HashMap hashMap = new HashMap();
        hashMap.put("app_id", bhVar.valueOf.AFKeystoreWrapper.getPackageName());
        String string = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.APP_USER_ID);
        if (string != null) {
            hashMap.put("cuid", string);
        }
        n nVar = bhVar.valueOf;
        hashMap.put("app_version_name", ab.values(nVar.AFKeystoreWrapper, nVar.AFKeystoreWrapper.getPackageName()));
        HashMap hashMap2 = new HashMap();
        a.d.C0103a valueOf = ac.valueOf(bhVar.valueOf.AFKeystoreWrapper, new HashMap());
        String str = valueOf != null ? valueOf.valueOf : null;
        if (str != null) {
            hashMap2.put("advertising_id", str);
        }
        hashMap2.put("appsflyer_id", al.AFInAppEventType(new WeakReference(bhVar.valueOf.AFKeystoreWrapper)));
        StringBuilder sb = new StringBuilder();
        sb.append(Build.VERSION.SDK_INT);
        hashMap2.put("os_version", sb.toString());
        hashMap2.put("sdk_version", ah.values);
        hashMap.put("device_data", hashMap2);
        hashMap.put("is_cached", Boolean.valueOf(abVar.AFInAppEventType()));
        hashMap.put("environment", abVar.valueOf() ? "SANDBOX" : "PRODUCTION");
        hashMap.put("additional_parameters", abVar.AFKeystoreWrapper);
        ArrayList arrayList = new ArrayList();
        for (Purchase purchase : abVar.AFInAppEventParameterName) {
            HashMap hashMap3 = new HashMap();
            hashMap3.put(IronSourceAdapter.IRONSOURCE_BIDDING_TOKEN_KEY, purchase.getPurchaseToken());
            hashMap3.put("subscription_id", purchase.getSku());
            arrayList.add(hashMap3);
        }
        hashMap.put(BillingClient.FeatureType.SUBSCRIPTIONS, arrayList);
        x xVar = new x(format, new JSONObject(hashMap).toString().getBytes(), "POST", Collections.emptyMap(), false);
        w wVar = bhVar.AFInAppEventType;
        bf bfVar = new bf(xVar, wVar.valueOf, wVar.AFInAppEventType, new bm());
        bi<String> biVar = new bi<String>(z, null) {
            private boolean values;

            @Override
            public final void valueOf(br<String> brVar) {
                if (brVar.valueOf() && this.values) {
                    ax.this.AFKeystoreWrapper.values("ars_history_sent", true);
                }
            }

            @Override
            public final void valueOf(Throwable th) {
                AFLogger.AFInAppEventType(th);
            }
        };
        if (!bfVar.AFInAppEventParameterName.getAndSet(true)) {
            bfVar.AFKeystoreWrapper.submit(new bf.AnonymousClass1(biVar));
            return;
        }
        throw new IllegalStateException("Http call is already executed");
    }

    @Override
    public final void run() {
        try {
            if (this.valueOf == null) {
                az azVar = this.values;
                BillingClient build = BillingClient.newBuilder(azVar.AFInAppEventType).setListener(new at(this)).enablePendingPurchases().build();
                this.valueOf = build;
                build.startConnection(new au(this));
            }
        } catch (Throwable th) {
            if ((th instanceof NoSuchMethodError) || (th instanceof NoClassDefFoundError)) {
                AFLogger.init("It seems your app uses different Play Billing library version than the SDK. Please use v.3.0.3");
            }
            AFLogger.AFInAppEventType("Failed to setup Play billing", th);
        }
    }
}