package androidx.appcompat.widget;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.CheckedTextView;

/* loaded from: classes.dex */
class h {

    /* renamed from: a, reason: collision with root package name */
    private final CheckedTextView f1064a;

    /* renamed from: b, reason: collision with root package name */
    private ColorStateList f1065b = null;

    /* renamed from: c, reason: collision with root package name */
    private PorterDuff.Mode f1066c = null;

    /* renamed from: d, reason: collision with root package name */
    private boolean f1067d = false;

    /* renamed from: e, reason: collision with root package name */
    private boolean f1068e = false;

    /* renamed from: f, reason: collision with root package name */
    private boolean f1069f;

    /* JADX INFO: Access modifiers changed from: package-private */
    public h(CheckedTextView checkedTextView) {
        this.f1064a = checkedTextView;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void a() {
        Drawable a10 = androidx.core.widget.c.a(this.f1064a);
        if (a10 != null) {
            if (this.f1067d || this.f1068e) {
                Drawable mutate = androidx.core.graphics.drawable.a.l(a10).mutate();
                if (this.f1067d) {
                    androidx.core.graphics.drawable.a.i(mutate, this.f1065b);
                }
                if (this.f1068e) {
                    androidx.core.graphics.drawable.a.j(mutate, this.f1066c);
                }
                if (mutate.isStateful()) {
                    mutate.setState(this.f1064a.getDrawableState());
                }
                this.f1064a.setCheckMarkDrawable(mutate);
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public ColorStateList b() {
        return this.f1065b;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public PorterDuff.Mode c() {
        return this.f1066c;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* JADX WARN: Removed duplicated region for block: B:11:0x003d A[Catch: all -> 0x0084, TRY_ENTER, TryCatch #1 {all -> 0x0084, blocks: (B:3:0x001d, B:5:0x0025, B:8:0x002b, B:11:0x003d, B:13:0x0045, B:15:0x004b, B:16:0x0058, B:18:0x0060, B:19:0x0069, B:21:0x0071), top: B:2:0x001d }] */
    /* JADX WARN: Removed duplicated region for block: B:18:0x0060 A[Catch: all -> 0x0084, TryCatch #1 {all -> 0x0084, blocks: (B:3:0x001d, B:5:0x0025, B:8:0x002b, B:11:0x003d, B:13:0x0045, B:15:0x004b, B:16:0x0058, B:18:0x0060, B:19:0x0069, B:21:0x0071), top: B:2:0x001d }] */
    /* JADX WARN: Removed duplicated region for block: B:21:0x0071 A[Catch: all -> 0x0084, TRY_LEAVE, TryCatch #1 {all -> 0x0084, blocks: (B:3:0x001d, B:5:0x0025, B:8:0x002b, B:11:0x003d, B:13:0x0045, B:15:0x004b, B:16:0x0058, B:18:0x0060, B:19:0x0069, B:21:0x0071), top: B:2:0x001d }] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void d(AttributeSet attributeSet, int i10) {
        boolean z10;
        int i11;
        int i12;
        int n10;
        int n11;
        Context context = this.f1064a.getContext();
        int[] iArr = h.j.P0;
        v0 v10 = v0.v(context, attributeSet, iArr, i10, 0);
        CheckedTextView checkedTextView = this.f1064a;
        androidx.core.view.s0.k0(checkedTextView, checkedTextView.getContext(), iArr, attributeSet, v10.r(), i10, 0);
        try {
            int i13 = h.j.R0;
            if (v10.s(i13) && (n11 = v10.n(i13, 0)) != 0) {
                try {
                    CheckedTextView checkedTextView2 = this.f1064a;
                    checkedTextView2.setCheckMarkDrawable(j.a.b(checkedTextView2.getContext(), n11));
                    z10 = true;
                } catch (Resources.NotFoundException unused) {
                }
                if (!z10) {
                    int i14 = h.j.Q0;
                    if (v10.s(i14) && (n10 = v10.n(i14, 0)) != 0) {
                        CheckedTextView checkedTextView3 = this.f1064a;
                        checkedTextView3.setCheckMarkDrawable(j.a.b(checkedTextView3.getContext(), n10));
                    }
                }
                i11 = h.j.S0;
                if (v10.s(i11)) {
                    androidx.core.widget.c.b(this.f1064a, v10.c(i11));
                }
                i12 = h.j.T0;
                if (v10.s(i12)) {
                    androidx.core.widget.c.c(this.f1064a, f0.e(v10.k(i12, -1), null));
                }
            }
            z10 = false;
            if (!z10) {
            }
            i11 = h.j.S0;
            if (v10.s(i11)) {
            }
            i12 = h.j.T0;
            if (v10.s(i12)) {
            }
        } finally {
            v10.w();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void e() {
        if (this.f1069f) {
            this.f1069f = false;
        } else {
            this.f1069f = true;
            a();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void f(ColorStateList colorStateList) {
        this.f1065b = colorStateList;
        this.f1067d = true;
        a();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void g(PorterDuff.Mode mode) {
        this.f1066c = mode;
        this.f1068e = true;
        a();
    }
}
