package com.pgl.ssdk;

import android.content.Context;
import android.text.TextUtils;

/* JADX INFO: loaded from: classes.dex */
public class a4 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static int f24645a = 504;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static String f24646b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private static volatile String f24647c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private static Context f24648d;

    public static synchronized String a() {
        try {
            if (TextUtils.isEmpty(f24647c)) {
                f24647c = (String) com.pgl.ssdk.ces.a.meta(303, f24648d, null);
            }
        } catch (Throwable th) {
            throw th;
        }
        return f24647c;
    }

    public static void b() {
        Context context = f24648d;
        if (context != null) {
            ar.b(new ao(context, 301, null));
            f24645a = 102;
            com.pgl.ssdk.ces.b bVarE = com.pgl.ssdk.ces.b.e();
            if (bVarE != null) {
                bVarE.a("");
            }
        }
    }

    public static void a(Context context, String str) {
        if (f24648d == null) {
            f24648d = context;
        }
        int i10 = f24645a;
        if (i10 == 102 || i10 == 202 || i10 == 200) {
            return;
        }
        f24646b = str;
        f24645a = 102;
        ar.b(new ao(context, 301, null));
    }

    public static synchronized void a(byte[] bArr) {
        if (bArr != null) {
            if (bArr.length > 0) {
                Object objMeta = com.pgl.ssdk.ces.a.meta(302, f24648d, bArr);
                if ((objMeta instanceof Integer) && ((Integer) objMeta).intValue() == 0) {
                    f24645a = 200;
                } else if (objMeta instanceof String) {
                    f24647c = (String) objMeta;
                    f24645a = 200;
                }
            }
        }
    }
}
