package or;

import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import or.f;
import rm.n0;
import uq.c0;
import uq.e0;

/* loaded from: classes5.dex */
final class a extends f.a {

    /* renamed from: a, reason: collision with root package name */
    private boolean f31642a = true;

    /* renamed from: or.a$a, reason: collision with other inner class name */
    /* loaded from: classes5.dex */
    static final class C0729a implements or.f {

        /* renamed from: a, reason: collision with root package name */
        static final C0729a f31643a = new C0729a();

        C0729a() {
        }

        @Override // or.f
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public e0 convert(e0 e0Var) {
            try {
                return y.a(e0Var);
            } finally {
                e0Var.close();
            }
        }
    }

    /* loaded from: classes5.dex */
    static final class b implements or.f {

        /* renamed from: a, reason: collision with root package name */
        static final b f31644a = new b();

        b() {
        }

        @Override // or.f
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public c0 convert(c0 c0Var) {
            return c0Var;
        }
    }

    /* loaded from: classes5.dex */
    static final class c implements or.f {

        /* renamed from: a, reason: collision with root package name */
        static final c f31645a = new c();

        c() {
        }

        @Override // or.f
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public e0 convert(e0 e0Var) {
            return e0Var;
        }
    }

    /* loaded from: classes5.dex */
    static final class d implements or.f {

        /* renamed from: a, reason: collision with root package name */
        static final d f31646a = new d();

        d() {
        }

        @Override // or.f
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public String convert(Object obj) {
            return obj.toString();
        }
    }

    /* loaded from: classes5.dex */
    static final class e implements or.f {

        /* renamed from: a, reason: collision with root package name */
        static final e f31647a = new e();

        e() {
        }

        @Override // or.f
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public n0 convert(e0 e0Var) {
            e0Var.close();
            return n0.f34904a;
        }
    }

    /* loaded from: classes5.dex */
    static final class f implements or.f {

        /* renamed from: a, reason: collision with root package name */
        static final f f31648a = new f();

        f() {
        }

        @Override // or.f
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public Void convert(e0 e0Var) {
            e0Var.close();
            return null;
        }
    }

    @Override // or.f.a
    public or.f c(Type type, Annotation[] annotationArr, Annotation[] annotationArr2, u uVar) {
        if (c0.class.isAssignableFrom(y.h(type))) {
            return b.f31644a;
        }
        return null;
    }

    @Override // or.f.a
    public or.f d(Type type, Annotation[] annotationArr, u uVar) {
        if (type == e0.class) {
            return y.l(annotationArr, sr.w.class) ? c.f31645a : C0729a.f31643a;
        }
        if (type == Void.class) {
            return f.f31648a;
        }
        if (!this.f31642a || type != n0.class) {
            return null;
        }
        try {
            return e.f31647a;
        } catch (NoClassDefFoundError unused) {
            this.f31642a = false;
            return null;
        }
    }
}
