package com.google.gson.internal;

import a.e.a.a;
import a.e.a.t;
import a.e.a.u;
import a.e.a.v.d;
import a.e.a.v.e;
import a.e.a.y.c;
import com.cvte.tv.api.aidl.ITvApiManager;
import com.google.gson.Gson;
import java.io.IOException;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final Excluder f5427b = new Excluder();

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public boolean f5431f;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public double f5428c = -1.0d;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f5429d = ITvApiManager.Stub.TRANSACTION_getTVApiTvIsdbGinga;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f5430e = true;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public List<a> f5432g = Collections.emptyList();

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public List<a> f5433h = Collections.emptyList();

    @Override // a.e.a.u
    public <T> t<T> b(final Gson gson, final a.e.a.x.a<T> aVar) {
        Class<? super T> rawType = aVar.getRawType();
        boolean zC = c(rawType);
        final boolean z = zC || d(rawType, true);
        final boolean z2 = zC || d(rawType, false);
        if (z || z2) {
            return new t<T>() { // from class: com.google.gson.internal.Excluder.1

                /* JADX INFO: renamed from: a, reason: collision with root package name */
                public t<T> f5434a;

                @Override // a.e.a.t
                public T a(a.e.a.y.a aVar2) throws IOException {
                    if (z2) {
                        aVar2.e0();
                        return null;
                    }
                    t<T> tVarG = this.f5434a;
                    if (tVarG == null) {
                        tVarG = gson.g(Excluder.this, aVar);
                        this.f5434a = tVarG;
                    }
                    return tVarG.a(aVar2);
                }

                @Override // a.e.a.t
                public void b(c cVar, T t) throws IOException {
                    if (z) {
                        cVar.M();
                        return;
                    }
                    t<T> tVarG = this.f5434a;
                    if (tVarG == null) {
                        tVarG = gson.g(Excluder.this, aVar);
                        this.f5434a = tVarG;
                    }
                    tVarG.b(cVar, t);
                }
            };
        }
        return null;
    }

    public final boolean c(Class<?> cls) {
        if (this.f5428c == -1.0d || h((d) cls.getAnnotation(d.class), (e) cls.getAnnotation(e.class))) {
            return (!this.f5430e && g(cls)) || f(cls);
        }
        return true;
    }

    public Object clone() {
        try {
            return (Excluder) super.clone();
        } catch (CloneNotSupportedException e2) {
            throw new AssertionError(e2);
        }
    }

    public final boolean d(Class<?> cls, boolean z) {
        Iterator<a> it = (z ? this.f5432g : this.f5433h).iterator();
        while (it.hasNext()) {
            if (it.next().shouldSkipClass(cls)) {
                return true;
            }
        }
        return false;
    }

    public Excluder e() {
        try {
            Excluder excluder = (Excluder) super.clone();
            excluder.f5431f = true;
            return excluder;
        } catch (CloneNotSupportedException e2) {
            throw new AssertionError(e2);
        }
    }

    public final boolean f(Class<?> cls) {
        return !Enum.class.isAssignableFrom(cls) && (cls.isAnonymousClass() || cls.isLocalClass());
    }

    public final boolean g(Class<?> cls) {
        if (cls.isMemberClass()) {
            if (!((cls.getModifiers() & 8) != 0)) {
                return true;
            }
        }
        return false;
    }

    public final boolean h(d dVar, e eVar) {
        if (dVar == null || dVar.value() <= this.f5428c) {
            return eVar == null || (eVar.value() > this.f5428c ? 1 : (eVar.value() == this.f5428c ? 0 : -1)) > 0;
        }
        return false;
    }
}
