package j1;

import e1.AbstractC0453a;
import i1.g;
import java.io.IOException;
import java.net.UnknownHostException;
import l1.AbstractC0621d;

/* JADX INFO: renamed from: j1.b, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public class C0556b extends AbstractC0555a {

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private static final int f4524f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private static final String f4525g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private static final String f4526h;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private String f4527d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private String f4528e;

    static {
        f4524f = (AbstractC0453a.a("jcifs.smb.client.useUnicode", true) ? 1 : 2) | 512;
        String strO = null;
        f4525g = AbstractC0453a.h("jcifs.smb.client.domain", null);
        try {
            strO = g.q().o();
        } catch (UnknownHostException unused) {
        }
        f4526h = strO;
    }

    public C0556b(int i2, String str, String str2) {
        f(i2 | j());
        n(str);
        o(str2 == null ? k() : str2);
    }

    public static int j() {
        return f4524f;
    }

    public static String k() {
        return f4526h;
    }

    public String l() {
        return this.f4527d;
    }

    public String m() {
        return this.f4528e;
    }

    public void n(String str) {
        this.f4527d = str;
    }

    public void o(String str) {
        this.f4528e = str;
    }

    public byte[] p() {
        int i2;
        boolean z2;
        int i3;
        try {
            String strL = l();
            String strM = m();
            int iA = a();
            byte[] bytes = new byte[0];
            if (strL == null || strL.length() == 0) {
                i2 = iA & (-4097);
                z2 = false;
            } else {
                i2 = iA | 4096;
                bytes = strL.toUpperCase().getBytes(AbstractC0555a.b());
                z2 = true;
            }
            byte[] bytes2 = new byte[0];
            if (strM == null || strM.length() == 0) {
                i3 = i2 & (-8193);
            } else {
                bytes2 = strM.toUpperCase().getBytes(AbstractC0555a.b());
                i3 = i2 | 8192;
                z2 = true;
            }
            byte[] bArr = new byte[z2 ? bytes.length + 32 + bytes2.length : 16];
            System.arraycopy(AbstractC0555a.f4521b, 0, bArr, 0, 8);
            AbstractC0555a.h(bArr, 8, 1);
            AbstractC0555a.h(bArr, 12, i3);
            if (z2) {
                AbstractC0555a.g(bArr, 16, 32, bytes);
                AbstractC0555a.g(bArr, 24, bytes.length + 32, bytes2);
            }
            return bArr;
        } catch (IOException e2) {
            throw new IllegalStateException(e2.getMessage());
        }
    }

    public String toString() {
        String strL = l();
        String strM = m();
        StringBuilder sb = new StringBuilder();
        sb.append("Type1Message[suppliedDomain=");
        if (strL == null) {
            strL = "null";
        }
        sb.append(strL);
        sb.append(",suppliedWorkstation=");
        if (strM == null) {
            strM = "null";
        }
        sb.append(strM);
        sb.append(",flags=0x");
        sb.append(AbstractC0621d.c(a(), 8));
        sb.append("]");
        return sb.toString();
    }
}
