package a4;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.webkit.ProfileStore;
import java.lang.reflect.InvocationHandler;
import java.util.List;
import org.chromium.support_lib_boundary.ProfileBoundaryInterface;
import org.chromium.support_lib_boundary.ProfileStoreBoundaryInterface;

/* JADX INFO: loaded from: classes.dex */
public final class u implements ProfileStore {

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

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

    public u(ProfileStoreBoundaryInterface profileStoreBoundaryInterface) {
        this.f365a = profileStoreBoundaryInterface;
    }

    public static ProfileStore getInstance() {
        if (f364b == null) {
            f364b = new u(m0.f345a.getProfileStore());
        }
        return f364b;
    }

    @Override // androidx.webkit.ProfileStore
    public final boolean deleteProfile(String str) {
        if (k0.S.b()) {
            return this.f365a.deleteProfile(str);
        }
        throw k0.a();
    }

    @Override // androidx.webkit.ProfileStore
    public final List getAllProfileNames() {
        if (k0.S.b()) {
            return this.f365a.getAllProfileNames();
        }
        throw k0.a();
    }

    @Override // androidx.webkit.ProfileStore
    public final z3.b getOrCreateProfile(String str) {
        if (k0.S.b()) {
            return new nb.c((ProfileBoundaryInterface) ee.b.castToSuppLibClass(ProfileBoundaryInterface.class, this.f365a.getOrCreateProfile(str)), 8);
        }
        throw k0.a();
    }

    @Override // androidx.webkit.ProfileStore
    @Nullable
    public z3.b getProfile(@NonNull String str) {
        if (!k0.S.b()) {
            throw k0.a();
        }
        InvocationHandler profile = this.f365a.getProfile(str);
        if (profile != null) {
            return new nb.c((ProfileBoundaryInterface) ee.b.castToSuppLibClass(ProfileBoundaryInterface.class, profile), 8);
        }
        return null;
    }
}
