package z3;

import a4.k0;
import android.content.Context;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

/* JADX INFO: loaded from: classes.dex */
public abstract class c0 {
    public static boolean a(String str) {
        a4.b bVar = k0.f318a;
        Set<a4.p> setUnmodifiableSet = Collections.unmodifiableSet(a4.c.f300c);
        HashSet hashSet = new HashSet();
        for (a4.p pVar : setUnmodifiableSet) {
            if (((a4.c) pVar).f301a.equals(str)) {
                hashSet.add(pVar);
            }
        }
        if (hashSet.isEmpty()) {
            throw new RuntimeException(defpackage.e.i("Unknown feature ", str));
        }
        Iterator it = hashSet.iterator();
        while (it.hasNext()) {
            a4.c cVar = (a4.c) ((a4.p) it.next());
            if (cVar.a() || cVar.b()) {
                return true;
            }
        }
        return false;
    }

    public static boolean b(Context context, String str) {
        a4.b bVar = k0.f318a;
        Set<a4.c0> setUnmodifiableSet = Collections.unmodifiableSet(a4.c0.f303c);
        HashSet hashSet = new HashSet();
        for (a4.c0 c0Var : setUnmodifiableSet) {
            if (c0Var.f304a.equals(str)) {
                hashSet.add(c0Var);
            }
        }
        if (hashSet.isEmpty()) {
            throw new RuntimeException(defpackage.e.i("Unknown feature ", str));
        }
        Iterator it = hashSet.iterator();
        while (it.hasNext()) {
            if (((a4.c0) it.next()).a(context)) {
                return true;
            }
        }
        return false;
    }
}
