package k1;

import java.io.UnsupportedEncodingException;
import java.util.Date;
import l1.C0622e;

/* JADX INFO: loaded from: classes.dex */
class h0 extends AbstractC0575L {

    /* JADX INFO: renamed from: M0, reason: collision with root package name */
    int f4882M0;

    /* JADX INFO: renamed from: N0, reason: collision with root package name */
    boolean f4883N0;

    /* JADX INFO: renamed from: O0, reason: collision with root package name */
    int f4884O0;

    /* JADX INFO: renamed from: P0, reason: collision with root package name */
    int f4885P0;

    /* JADX INFO: renamed from: Q0, reason: collision with root package name */
    int f4886Q0;

    /* JADX INFO: renamed from: R0, reason: collision with root package name */
    String f4887R0;

    /* JADX INFO: renamed from: S0, reason: collision with root package name */
    int f4888S0;

    class a implements InterfaceC0589g {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        int f4889a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        int f4890b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        long f4891c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        long f4892d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        long f4893e;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        long f4894f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        long f4895g;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        long f4896h;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        int f4897i;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        int f4898j;

        /* JADX INFO: renamed from: k, reason: collision with root package name */
        int f4899k;

        /* JADX INFO: renamed from: l, reason: collision with root package name */
        int f4900l;

        /* JADX INFO: renamed from: m, reason: collision with root package name */
        String f4901m;

        /* JADX INFO: renamed from: n, reason: collision with root package name */
        String f4902n;

        a() {
        }

        @Override // k1.InterfaceC0589g
        public int a() {
            return this.f4897i;
        }

        @Override // k1.InterfaceC0589g
        public long b() {
            return this.f4891c;
        }

        @Override // k1.InterfaceC0589g
        public long c() {
            return this.f4893e;
        }

        @Override // k1.InterfaceC0589g
        public String getName() {
            return this.f4902n;
        }

        @Override // k1.InterfaceC0589g
        public int getType() {
            return 1;
        }

        @Override // k1.InterfaceC0589g
        public long length() {
            return this.f4895g;
        }

        public String toString() {
            return new String("SmbFindFileBothDirectoryInfo[nextEntryOffset=" + this.f4889a + ",fileIndex=" + this.f4890b + ",creationTime=" + new Date(this.f4891c) + ",lastAccessTime=" + new Date(this.f4892d) + ",lastWriteTime=" + new Date(this.f4893e) + ",changeTime=" + new Date(this.f4894f) + ",endOfFile=" + this.f4895g + ",allocationSize=" + this.f4896h + ",extFileAttributes=" + this.f4897i + ",fileNameLength=" + this.f4898j + ",eaSize=" + this.f4899k + ",shortNameLength=" + this.f4900l + ",shortName=" + this.f4901m + ",filename=" + this.f4902n + "]");
        }
    }

    h0() {
        this.f5021r = (byte) 50;
        this.f4641F0 = (byte) 1;
    }

    @Override // k1.AbstractC0575L
    int E(byte[] bArr, int i2, int i3) {
        int i4;
        this.f4886Q0 = this.f4885P0 + i2;
        this.f4647L0 = new a[this.f4646K0];
        for (int i5 = 0; i5 < this.f4646K0; i5++) {
            InterfaceC0589g[] interfaceC0589gArr = this.f4647L0;
            a aVar = new a();
            interfaceC0589gArr[i5] = aVar;
            aVar.f4889a = AbstractC0600r.k(bArr, i2);
            aVar.f4890b = AbstractC0600r.k(bArr, i2 + 4);
            aVar.f4891c = AbstractC0600r.r(bArr, i2 + 8);
            aVar.f4893e = AbstractC0600r.r(bArr, i2 + 24);
            aVar.f4895g = AbstractC0600r.l(bArr, i2 + 40);
            aVar.f4897i = AbstractC0600r.k(bArr, i2 + 56);
            int iK = AbstractC0600r.k(bArr, i2 + 60);
            aVar.f4898j = iK;
            String strG = G(bArr, i2 + 94, iK);
            aVar.f4902n = strG;
            int i6 = this.f4886Q0;
            if (i6 >= i2 && ((i4 = aVar.f4889a) == 0 || i6 < i4 + i2)) {
                this.f4887R0 = strG;
                this.f4888S0 = aVar.f4890b;
            }
            i2 += aVar.f4889a;
        }
        return this.f4640E0;
    }

    @Override // k1.AbstractC0575L
    int F(byte[] bArr, int i2, int i3) {
        int i4;
        if (this.f4641F0 == 1) {
            this.f4882M0 = AbstractC0600r.j(bArr, i2);
            i4 = i2 + 2;
        } else {
            i4 = i2;
        }
        this.f4646K0 = AbstractC0600r.j(bArr, i4);
        this.f4883N0 = (bArr[i4 + 2] & 1) == 1;
        this.f4884O0 = AbstractC0600r.j(bArr, i4 + 4);
        this.f4885P0 = AbstractC0600r.j(bArr, i4 + 6);
        return (i4 + 8) - i2;
    }

    String G(byte[] bArr, int i2, int i3) {
        try {
            if (this.f5011e0) {
                return new String(bArr, i2, i3, "UTF-16LE");
            }
            if (i3 > 0 && bArr[(i2 + i3) - 1] == 0) {
                i3--;
            }
            return new String(bArr, i2, i3, U.f4691C);
        } catch (UnsupportedEncodingException e2) {
            if (C0622e.f5384g > 1) {
                e2.printStackTrace(AbstractC0600r.f4999o0);
            }
            return null;
        }
    }

    @Override // k1.AbstractC0575L, k1.AbstractC0600r
    public String toString() {
        return new String((this.f4641F0 == 1 ? "Trans2FindFirst2Response[" : "Trans2FindNext2Response[") + super.toString() + ",sid=" + this.f4882M0 + ",searchCount=" + this.f4646K0 + ",isEndOfSearch=" + this.f4883N0 + ",eaErrorOffset=" + this.f4884O0 + ",lastNameOffset=" + this.f4885P0 + ",lastName=" + this.f4887R0 + "]");
    }
}
