package hb;

import android.text.TextUtils;
import androidx.annotation.Nullable;
import com.google.android.gms.measurement.internal.c0;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;

/* JADX INFO: loaded from: classes2.dex */
public final class i {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final long f26462b = TimeUnit.HOURS.toSeconds(1);

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final Pattern f26463c = Pattern.compile("\\AA[\\w-]{38}\\z");

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static i f26464d;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final c0 f26465a;

    public i(c0 c0Var) {
        this.f26465a = c0Var;
    }

    public static i a() {
        if (c0.f21496b == null) {
            c0.f21496b = new c0(12);
        }
        c0 c0Var = c0.f21496b;
        if (f26464d == null) {
            f26464d = new i(c0Var);
        }
        return f26464d;
    }

    public static boolean isValidApiKeyFormat(@Nullable String str) {
        return f26463c.matcher(str).matches();
    }

    public static boolean isValidAppIdFormat(@Nullable String str) {
        return str.contains(":");
    }

    public final boolean b(ib.e eVar) {
        if (TextUtils.isEmpty(eVar.getAuthToken())) {
            return true;
        }
        ib.b bVar = (ib.b) eVar;
        long j10 = bVar.f26604g + bVar.f26603f;
        TimeUnit timeUnit = TimeUnit.MILLISECONDS;
        this.f26465a.getClass();
        return j10 < timeUnit.toSeconds(System.currentTimeMillis()) + f26462b;
    }
}
