package androidx.core.graphics.drawable;

import android.content.res.ColorStateList;
import android.os.Parcelable;
import ῲ.ᑓ.AbstractC1617;
import ῲ.ᑓ.C1616;

public class IconCompatParcelizer {
    public static IconCompat read(AbstractC1617 k) {
        IconCompat iconCompat = new IconCompat();
        iconCompat.f1160 = k.m4197(iconCompat.f1160, 1);
        byte[] bArr = iconCompat.f1155;
        if (k.m4205(2)) {
            C1616 r1 = (C1616) k;
            int readInt = r1.f5804.readInt();
            if (readInt < 0) {
                bArr = null;
            } else {
                byte[] bArr2 = new byte[readInt];
                r1.f5804.readByteArray(bArr2);
                bArr = bArr2;
            }
        }
        iconCompat.f1155 = bArr;
        iconCompat.f1163 = k.m4198(iconCompat.f1163, 3);
        iconCompat.f1156 = k.m4197(iconCompat.f1156, 4);
        iconCompat.f1162 = k.m4197(iconCompat.f1162, 5);
        iconCompat.f1159 = (ColorStateList) k.m4198(iconCompat.f1159, 6);
        iconCompat.f1157 = k.m4201(iconCompat.f1157, 7);
        iconCompat.f1161 = k.m4201(iconCompat.f1161, 8);
        iconCompat.m606();
        return iconCompat;
    }

    public static void write(IconCompat iconCompat, AbstractC1617 k) {
        k.m4207();
        iconCompat.m608(false);
        int i = iconCompat.f1160;
        if (-1 != i) {
            k.m4195(i, 1);
        }
        byte[] bArr = iconCompat.f1155;
        if (bArr != null) {
            k.m4194(2);
            C1616 r2 = (C1616) k;
            r2.f5804.writeInt(bArr.length);
            r2.f5804.writeByteArray(bArr);
        }
        Parcelable parcelable = iconCompat.f1163;
        if (parcelable != null) {
            k.m4194(3);
            ((C1616) k).f5804.writeParcelable(parcelable, 0);
        }
        int i2 = iconCompat.f1156;
        if (i2 != 0) {
            k.m4195(i2, 4);
        }
        int i3 = iconCompat.f1162;
        if (i3 != 0) {
            k.m4195(i3, 5);
        }
        ColorStateList colorStateList = iconCompat.f1159;
        if (colorStateList != null) {
            k.m4194(6);
            ((C1616) k).f5804.writeParcelable(colorStateList, 0);
        }
        String str = iconCompat.f1157;
        if (str != null) {
            k.m4194(7);
            ((C1616) k).f5804.writeString(str);
        }
        String str2 = iconCompat.f1161;
        if (str2 != null) {
            k.m4194(8);
            ((C1616) k).f5804.writeString(str2);
        }
    }
}
