package com.google.android.gms.internal.ads;

import androidx.annotation.Nullable;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;

/* JADX INFO: loaded from: classes2.dex */
public final class kf1 implements z9 {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final byte[] f13246b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final int f13247c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final int f13248d;

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
    /* JADX WARN: Removed duplicated region for block: B:20:0x0042  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public kf1(String str, byte[] bArr, int i10, int i11) {
        byte b10;
        byte b11;
        switch (str.hashCode()) {
            case -1949883051:
                b10 = !str.equals("com.android.capture.fps") ? (byte) -1 : (byte) 0;
                break;
            case -269399509:
                if (str.equals("auxiliary.tracks.interleaved")) {
                    b10 = 4;
                    break;
                }
                break;
            case 1011693540:
                if (str.equals("auxiliary.tracks.length")) {
                    b10 = 2;
                    break;
                }
                break;
            case 1098277265:
                if (str.equals("auxiliary.tracks.offset")) {
                    b10 = 1;
                    break;
                }
                break;
            case 2002123038:
                if (str.equals("auxiliary.tracks.map")) {
                    b10 = 3;
                    break;
                }
                break;
        }
        if (b10 != 0) {
            if (b10 == 1 || b10 == 2) {
                if (i11 != 78) {
                    z = false;
                    ih1.x(z);
                } else if (bArr.length == 8) {
                    i11 = 78;
                    ih1.x(z);
                } else {
                    i11 = 78;
                    z = false;
                    ih1.x(z);
                }
            } else if (b10 == 3) {
                ih1.x(i11 == 0);
            } else if (b10 == 4) {
                if (i11 != 75) {
                    z = false;
                    ih1.x(z);
                } else if (bArr.length == 1 && ((b11 = bArr[0]) == 0 || b11 == 1)) {
                    i11 = 75;
                    ih1.x(z);
                } else {
                    i11 = 75;
                    z = false;
                    ih1.x(z);
                }
            }
        } else if (i11 != 23) {
            z = false;
            ih1.x(z);
        } else if (bArr.length == 4) {
            i11 = 23;
            ih1.x(z);
        } else {
            i11 = 23;
            z = false;
            ih1.x(z);
        }
        this.f13245a = str;
        this.f13246b = bArr;
        this.f13247c = i10;
        this.f13248d = i11;
    }

    public final boolean equals(@Nullable Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && kf1.class == obj.getClass()) {
            kf1 kf1Var = (kf1) obj;
            if (this.f13245a.equals(kf1Var.f13245a) && Arrays.equals(this.f13246b, kf1Var.f13246b) && this.f13247c == kf1Var.f13247c && this.f13248d == kf1Var.f13248d) {
                return true;
            }
        }
        return false;
    }

    public final int hashCode() {
        return ((((Arrays.hashCode(this.f13246b) + ((this.f13245a.hashCode() + 527) * 31)) * 31) + this.f13247c) * 31) + this.f13248d;
    }

    /* JADX WARN: Removed duplicated region for block: B:33:0x00dc  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final String toString() {
        String string;
        int i10 = 0;
        String str = this.f13245a;
        byte[] bArr = this.f13246b;
        int i11 = this.f13248d;
        if (i11 != 0) {
            if (i11 == 1) {
                String str2 = bb1.f9474a;
                string = new String(bArr, StandardCharsets.UTF_8);
            } else if (i11 == 23) {
                int length = bArr.length;
                if (length < 4) {
                    throw new IllegalArgumentException(ih1.B0("array too small: %s < %s", Integer.valueOf(length), 4));
                }
                string = String.valueOf(Float.intBitsToFloat(za2.G(bArr[0], bArr[1], bArr[2], bArr[3])));
            } else if (i11 == 67) {
                int length2 = bArr.length;
                if (length2 < 4) {
                    throw new IllegalArgumentException(ih1.B0("array too small: %s < %s", Integer.valueOf(length2), 4));
                }
                string = String.valueOf(za2.G(bArr[0], bArr[1], bArr[2], bArr[3]));
            } else if (i11 == 75) {
                string = String.valueOf(bArr[0] & 255);
            } else if (i11 != 78) {
                String str3 = bb1.f9474a;
                int length3 = bArr.length;
                StringBuilder sb = new StringBuilder(length3 + length3);
                while (i10 < bArr.length) {
                    sb.append(Character.forDigit((bArr[i10] >> 4) & 15, 16));
                    sb.append(Character.forDigit(bArr[i10] & 15, 16));
                    i10++;
                }
                string = sb.toString();
            } else {
                string = String.valueOf(new p01(bArr).j());
            }
        } else if (str.equals("auxiliary.tracks.map")) {
            ih1.f1("Metadata is not an auxiliary tracks map", str.equals("auxiliary.tracks.map"));
            byte b10 = bArr[1];
            ArrayList arrayList = new ArrayList();
            while (i10 < b10) {
                arrayList.add(Integer.valueOf(bArr[i10 + 2]));
                i10++;
            }
            StringBuilder sbC = u.a.c("track types = ");
            ih1.v0(sbC, arrayList.iterator(), ",");
            string = sbC.toString();
        }
        return com.bytedance.sdk.component.adexpress.dynamic.dynamicview.b.h(new StringBuilder(String.valueOf(str).length() + 18 + String.valueOf(string).length()), "mdta: key=", str, ", value=", string);
    }
}
