package com.pgl.ssdk.ces.out;

import android.content.Context;
import android.text.TextUtils;
import android.view.MotionEvent;
import com.pgl.ssdk.a4;
import com.pgl.ssdk.ces.b;
import java.util.Map;

/* JADX INFO: loaded from: classes.dex */
public class PglSSManager {
    public static final int INIT_STATUS_FAIL_CONTEXT_NULL = 4;
    public static final int INIT_STATUS_FAIL_SO_LOADFAIL = 3;
    public static final int INIT_STATUS_FAIL_SO_MISSING = 2;
    public static final int INIT_STATUS_OK = 0;
    public static final int INIT_STATUS_UNINITIALIZE = 1;
    public static final String REPORT_SCENE_ADSHOW = "AdShow";

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private static volatile PglSSManager f24755a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final b f24756b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private volatile int f24757c = 0;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private volatile PglSSCallBack f24758d;

    private PglSSManager(Context context, PglSSConfig pglSSConfig) {
        this.f24756b = b.a(context, pglSSConfig.getAppId(), pglSSConfig.getOVRegionType(), pglSSConfig.getCollectMode(), pglSSConfig.getAdSdkVersion());
    }

    public static int getInitStatus() {
        return b.d();
    }

    public static PglSSManager getInstance() {
        return f24755a;
    }

    public static String getLoadError() {
        if (b.f() != null) {
            return b.f().f24722b;
        }
        return null;
    }

    @DungeonFlag
    public static PglSSManager init(Context context, PglSSConfig pglSSConfig, String str, String str2, String str3, String str4) {
        if (context == null && pglSSConfig == null) {
            return null;
        }
        if (f24755a == null) {
            synchronized (PglSSManager.class) {
                try {
                    if (f24755a == null) {
                        f24755a = new PglSSManager(context, pglSSConfig);
                        if (b.d() == 0) {
                            f24755a.f24758d = pglSSConfig.getCallBack();
                            f24755a.f24756b.a(pglSSConfig.getCustomInfo());
                            f24755a.f24756b.a(str, str3, str2, str4);
                        }
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
        }
        return f24755a;
    }

    public void checkEventVirtual(MotionEvent motionEvent) {
        if (b.d() == 0) {
            this.f24756b.a(motionEvent);
        }
    }

    public long getECForBidding() {
        return 0L;
    }

    public Map<String, String> getFeatureHash(String str, byte[] bArr) {
        if (b.d() == 0) {
            return this.f24756b.a(str, bArr);
        }
        return null;
    }

    public PglSSCallBack getPglCallBack() {
        return this.f24758d;
    }

    public String getSofChara() {
        return null;
    }

    public String getToken() {
        if (b.d() == 0) {
            return this.f24756b.g();
        }
        return null;
    }

    public void reportNow(String str, Map<String, Object> map) {
        if (b.d() == 0) {
            this.f24756b.a(str);
            int i10 = this.f24757c;
            b bVar = this.f24756b;
            if (i10 % bVar.f24739l == 0) {
                bVar.a(str, map, !TextUtils.isEmpty(a4.a()) ? 0L : 10000L);
            }
            this.f24757c++;
        }
    }

    public void setCustomInfo(Map<String, Object> map) {
        if (b.d() == 0) {
            this.f24756b.a(map);
        }
    }

    public void setDeviceId(String str) {
        if (b.d() == 0) {
            this.f24756b.c(str);
        }
    }

    public void setGaid(String str) {
        if (b.d() == 0) {
            this.f24756b.d(str);
        }
    }
}
