package defpackage;

import com.hierynomus.mssmb2.SMBApiException;
import com.hierynomus.protocol.transport.TransportException;
import com.hierynomus.smbj.session.SMB2GuestSigningRequiredException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.concurrent.locks.ReentrantReadWriteLock;

/* renamed from: ˁˏᵡ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C0683 implements AutoCloseable {

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public static final InterfaceC0567 f3339 = AbstractC1385.m4255(C0683.class);

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public final C2809 f3340;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public boolean f3341;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public final ʽᵡ f3342;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public final ArrayList f3343;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public final ˑᵽʾʦ f3344;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final C2354 f3345;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final C3174 f3346;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public long f3347;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public boolean f3348;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final C3500 f3349;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public boolean f3350;

    public C0683(C3500 c3500, ʽᵡ r4, C3174 c3174, ˑᵽʾʦ r6, InterfaceC2894 interfaceC2894) {
        C2809 c2809 = new C2809();
        c2809.f10825 = new ReentrantReadWriteLock();
        c2809.f10826 = new HashMap();
        c2809.f10824 = new HashMap();
        this.f3340 = c2809;
        this.f3343 = new ArrayList();
        this.f3349 = c3500;
        this.f3342 = r4;
        this.f3346 = c3174;
        this.f3344 = r6;
        EnumC2857 enumC2857 = (EnumC2857) ((C1326) c3500.f13111.f18820).f5442;
        C2354 c2354 = new C2354();
        c2354.f9205 = enumC2857;
        c2354.f9206 = interfaceC2894;
        this.f3345 = c2354;
        if (c3174 != null) {
            c3174.m7528(this);
        }
    }

    @Override // java.lang.AutoCloseable
    public final void close() throws TransportException {
        m2659();
    }

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public final void m2657(C5375 c5375) {
        this.f3341 = c5375.f20156.contains(EnumC3793.f14160);
        boolean zContains = c5375.f20156.contains(EnumC3793.f14163);
        this.f3348 = zContains;
        C3500 c3500 = this.f3349;
        c3500.f13106.getClass();
        C5036 c5036 = c3500.f13111;
        if ((c5036.f18824 & 2) > 0) {
            this.f3350 = true;
        } else {
            this.f3350 = false;
        }
        if (zContains) {
            this.f3350 = false;
        }
        boolean z = this.f3341;
        if (z && this.f3350) {
            throw new SMB2GuestSigningRequiredException("Cannot require message signing when authenticating with a guest account");
        }
        if (z) {
            this.f3350 = false;
        }
        if (((EnumC2857) ((C1326) c5036.f18820).f5442).m6987() && c5375.f20156.contains(EnumC3793.f14162)) {
            this.f3350 = false;
        }
        if (this.f3341 || this.f3348) {
            C2354 c2354 = this.f3345;
            if (c2354.f9205.m6987()) {
                ᵹˉᵞ.ᵳٴᵶ("Cannot set a signing key (yet) for SMB3.x");
            } else {
                c2354.f9204 = "HmacSHA256";
                c2354.f9207 = null;
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:57:0x013e A[Catch: TransportException -> 0x0156, TryCatch #2 {TransportException -> 0x0156, blocks: (B:11:0x004a, B:12:0x007b, B:13:0x0081, B:15:0x0086, B:18:0x0096, B:20:0x00a1, B:22:0x00a7, B:27:0x00b2, B:29:0x00b7, B:33:0x00cc, B:35:0x00d6, B:37:0x00eb, B:44:0x0102, B:40:0x00f4, B:43:0x00fd, B:46:0x0106, B:47:0x010d, B:48:0x010e, B:49:0x0115, B:50:0x0116, B:51:0x0136, B:55:0x013a, B:57:0x013e, B:59:0x0147, B:58:0x0141, B:61:0x0149, B:62:0x0155), top: B:72:0x004a, inners: #5, #5 }] */
    /* JADX WARN: Removed duplicated region for block: B:58:0x0141 A[Catch: TransportException -> 0x0156, TryCatch #2 {TransportException -> 0x0156, blocks: (B:11:0x004a, B:12:0x007b, B:13:0x0081, B:15:0x0086, B:18:0x0096, B:20:0x00a1, B:22:0x00a7, B:27:0x00b2, B:29:0x00b7, B:33:0x00cc, B:35:0x00d6, B:37:0x00eb, B:44:0x0102, B:40:0x00f4, B:43:0x00fd, B:46:0x0106, B:47:0x010d, B:48:0x010e, B:49:0x0115, B:50:0x0116, B:51:0x0136, B:55:0x013a, B:57:0x013e, B:59:0x0147, B:58:0x0141, B:61:0x0149, B:62:0x0155), top: B:72:0x004a, inners: #5, #5 }] */
    /* renamed from: ˏᵙ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final defpackage.AbstractC4311 m2658(java.lang.String r21) throws com.hierynomus.protocol.transport.TransportException {
        /*
            Method dump skipped, instructions count: 370
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C0683.m2658(java.lang.String):ᵯᵺ");
    }

    /* JADX WARN: Removed duplicated region for block: B:37:0x00fa A[Catch: all -> 0x0044, TryCatch #4 {all -> 0x0044, blocks: (B:3:0x0006, B:5:0x0029, B:7:0x0038, B:8:0x0040, B:13:0x0048, B:15:0x0057, B:17:0x005f, B:18:0x0078, B:20:0x007c, B:21:0x0088, B:22:0x00a9, B:23:0x00af, B:27:0x00cc, B:28:0x00ef, B:35:0x00f6, B:37:0x00fa, B:39:0x0103, B:38:0x00fd, B:40:0x0104, B:41:0x0110, B:43:0x0112, B:44:0x0119, B:4:0x001e), top: B:53:0x0006, inners: #0, #2, #3, #7, #6 }] */
    /* JADX WARN: Removed duplicated region for block: B:38:0x00fd A[Catch: all -> 0x0044, TryCatch #4 {all -> 0x0044, blocks: (B:3:0x0006, B:5:0x0029, B:7:0x0038, B:8:0x0040, B:13:0x0048, B:15:0x0057, B:17:0x005f, B:18:0x0078, B:20:0x007c, B:21:0x0088, B:22:0x00a9, B:23:0x00af, B:27:0x00cc, B:28:0x00ef, B:35:0x00f6, B:37:0x00fa, B:39:0x0103, B:38:0x00fd, B:40:0x0104, B:41:0x0110, B:43:0x0112, B:44:0x0119, B:4:0x001e), top: B:53:0x0006, inners: #0, #2, #3, #7, #6 }] */
    /* renamed from: ᵞʡ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void m2659() throws com.hierynomus.protocol.transport.TransportException {
        /*
            Method dump skipped, instructions count: 295
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C0683.m2659():void");
    }

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final C4017 m2660(AbstractC0681 abstractC0681) throws TransportException {
        boolean z = this.f3350;
        C2354 c2354 = this.f3345;
        if (z && c2354.f9207 == null) {
            throw new TransportException("Message signing is required, but no signing key is negotiated");
        }
        if (c2354.f9207 != null) {
            abstractC0681 = new C1172(c2354, abstractC0681);
        } else {
            C2354.f9203.mo2409(((C0663) abstractC0681.ˌᵜᵹᵩ()).f3283, "Not wrapping {} as signed, as no key is set.");
        }
        return this.f3349.m7982(abstractC0681);
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C0683 m2661(C0862 c0862) {
        try {
            C0683 c0683M7984 = this.f3349.f13107.m10350(c0862.f3919).m7984(this.f3342);
            this.f3343.add(c0683M7984);
            return c0683M7984;
        } catch (IOException e) {
            EnumC2703 enumC2703 = EnumC2703.f10480;
            throw new SMBApiException(4294967295L, "Could not connect to DFS root " + c0862, e);
        }
    }
}
