导航菜单

页面标题

页面副标题

MT Manager v2.13.3 - RunnableC4449.java 源代码

正在查看: MT Manager v2.13.3 应用的 RunnableC4449.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package l;

import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;

public final class RunnableC4449 implements Runnable, InterfaceC11604 {

    public static final InterfaceC8213 f16058 = C11854.m25881(RunnableC4449.class);

    public ArrayList f16059;

    public int f16060;

    public HashMap f16061;

    public InetAddress f16062;

    public C8817 f16063;

    public byte[] f16064;

    public int f16065;

    public C11566 f16066;

    public InetAddress f16067;

    public C11566 f16068;

    public int f16069;

    public byte[] f16070;

    public final Object f16071;

    public Thread f16072;

    public int f16073;

    public C10273 f16074;

    public final HashSet f16075;

    public DatagramPacket f16076;

    public DatagramPacket f16077;

    public final HashMap f16078;

    public InterfaceC12131 f16079;

    public DatagramSocket f16080;

    public RunnableC4449(InterfaceC12131 interfaceC12131) {
        InetAddress byName;
        interfaceC12131.mo3477().getClass();
        interfaceC12131.mo3477().getClass();
        this.f16071 = new Object();
        this.f16065 = 0;
        HashMap hashMap = new HashMap();
        this.f16078 = hashMap;
        this.f16075 = new HashSet();
        this.f16061 = new HashMap();
        this.f16060 = 0;
        this.f16059 = new ArrayList();
        this.f16063 = new C8817();
        this.f16069 = 0;
        this.f16062 = null;
        this.f16079 = interfaceC12131;
        this.f16067 = ((C3594) interfaceC12131.mo3477()).m9040();
        this.f16070 = new byte[((C3594) interfaceC12131.mo3477()).m9032()];
        this.f16064 = new byte[((C3594) interfaceC12131.mo3477()).m9010()];
        this.f16077 = new DatagramPacket(this.f16070, ((C3594) interfaceC12131.mo3477()).m9032(), this.f16067, 137);
        this.f16076 = new DatagramPacket(this.f16064, ((C3594) interfaceC12131.mo3477()).m9010());
        this.f16059 = ((C3594) interfaceC12131.mo3477()).m9013();
        C10273 c10273 = new C10273(interfaceC12131.mo3477(), "0.0.0.0", 0, null);
        this.f16074 = c10273;
        C11566 c11566 = new C11566(c10273, 0);
        this.f16068 = c11566;
        hashMap.put(c10273, new C2992(c11566, -1L));
        interfaceC12131.mo3477().getClass();
        try {
            try {
                byName = InetAddress.getLocalHost();
            } catch (UnknownHostException unused) {
                byName = InetAddress.getByName("127.0.0.1");
            }
            interfaceC12131.mo3477().getClass();
            byte[] address = byName.getAddress();
            String str = "JCIFS" + (address[2] & 255) + "_" + (address[3] & 255) + "_" + C2627.m6869((int) (Math.random() * 255.0d), 2);
            InterfaceC9946 mo3477 = interfaceC12131.mo3477();
            interfaceC12131.mo3477().getClass();
            C10273 c102732 = new C10273(mo3477, str, 0, null);
            C11566 c115662 = new C11566(c102732, byName.hashCode(), 0);
            this.f16066 = c115662;
            m10835(c102732, c115662, -1L);
        } catch (UnknownHostException e) {
            throw new C2138(e);
        }
    }

    public final C11566 m10829(C10273 c10273) {
        C11566 c11566;
        C11566 c115662 = null;
        InetAddress inetAddress = c10273.f31963 == 29 ? this.f16067 : null;
        c10273.f31961 = inetAddress != null ? inetAddress.hashCode() : 0;
        C11566 m10844 = m10844(c10273);
        if (m10844 == null) {
            synchronized (this.f16075) {
                if (!this.f16075.contains(c10273)) {
                    this.f16075.add(c10273);
                } else {
                    while (this.f16075.contains(c10273)) {
                        try {
                            this.f16075.wait();
                        } catch (InterruptedException e) {
                            f16058.mo6428("Interrupted", e);
                        }
                    }
                    c115662 = m10844(c10273);
                    if (c115662 == null) {
                        synchronized (this.f16075) {
                            this.f16075.add(c10273);
                        }
                    }
                }
            }
            try {
                if (c115662 == null) {
                    try {
                        c11566 = m10830(c10273, inetAddress);
                    } catch (UnknownHostException unused) {
                        c11566 = this.f16068;
                    }
                    m10844 = c11566;
                    m10834(c10273, m10844);
                    m10825(c10273);
                } else {
                    m10844 = c115662;
                }
            } catch (Throwable th) {
                m10834(c10273, c115662);
                m10825(c10273);
                throw th;
            }
        }
        if (m10844 != this.f16068) {
            return m10844;
        }
        throw new UnknownHostException(c10273.toString());
    }

    private void m10825(C10273 c10273) {
        synchronized (this.f16075) {
            this.f16075.remove(c10273);
            this.f16075.notifyAll();
        }
    }

    public final void m10834(C10273 c10273, C11566 c11566) {
        if (((C3594) this.f16079.mo3477()).m9003() == 0) {
            return;
        }
        m10835(c10273, c11566, ((C3594) this.f16079.mo3477()).m9003() != -1 ? System.currentTimeMillis() + (((C3594) this.f16079.mo3477()).m9003() * 1000) : -1L);
    }

    public final void m10835(C10273 c10273, C11566 c11566, long j) {
        if (((C3594) this.f16079.mo3477()).m9003() == 0) {
            return;
        }
        synchronized (this.f16078) {
            C2992 c2992 = (C2992) this.f16078.get(c10273);
            if (c2992 == null) {
                this.f16078.put(c10273, new C2992(c11566, j));
            } else {
                c2992.f9655 = c11566;
                c2992.f9656 = j;
            }
        }
    }

    public final void m10836(C11566[] c11566Arr) {
        if (((C3594) this.f16079.mo3477()).m9003() == 0) {
            return;
        }
        long currentTimeMillis = ((C3594) this.f16079.mo3477()).m9003() != -1 ? System.currentTimeMillis() + (((C3594) this.f16079.mo3477()).m9003() * 1000) : -1L;
        synchronized (this.f16078) {
            for (int i = 0; i < c11566Arr.length; i++) {
                C2992 c2992 = (C2992) this.f16078.get(c11566Arr[i].f35231);
                if (c2992 == null) {
                    C11566 c11566 = c11566Arr[i];
                    this.f16078.put(c11566.f35231, new C2992(c11566, currentTimeMillis));
                } else {
                    c2992.f9655 = c11566Arr[i];
                    c2992.f9656 = currentTimeMillis;
                }
            }
        }
    }

    public final C11566 m10844(C10273 c10273) {
        C11566 c11566;
        if (((C3594) this.f16079.mo3477()).m9003() == 0) {
            return null;
        }
        synchronized (this.f16078) {
            C2992 c2992 = (C2992) this.f16078.get(c10273);
            if (c2992 != null && c2992.f9656 < System.currentTimeMillis() && c2992.f9656 >= 0) {
                c2992 = null;
            }
            c11566 = c2992 != null ? c2992.f9655 : null;
        }
        return c11566;
    }

    public final void m10832(int i) {
        this.f16073 = 0;
        if (((C3594) this.f16079.mo3477()).m9044() != 0) {
            this.f16073 = Math.max(((C3594) this.f16079.mo3477()).m9044(), i);
        }
        if (this.f16080 == null) {
            this.f16080 = new DatagramSocket(this.f16069, this.f16062);
            Thread thread = new Thread(this, "JCIFS-NameServiceClient");
            this.f16072 = thread;
            thread.setDaemon(true);
            this.f16072.start();
        }
    }

    public final void m10826() {
        synchronized (this.f16071) {
            DatagramSocket datagramSocket = this.f16080;
            if (datagramSocket != null) {
                datagramSocket.close();
                this.f16080 = null;
            }
            this.f16072 = null;
            this.f16061.clear();
        }
    }

    @Override
    public final void run() {
        while (this.f16072 == Thread.currentThread()) {
            try {
                try {
                    try {
                        this.f16076.setLength(((C3594) this.f16079.mo3477()).m9010());
                        this.f16080.setSoTimeout(this.f16073);
                        this.f16080.receive(this.f16076);
                        InterfaceC8213 interfaceC8213 = f16058;
                        interfaceC8213.mo6437("NetBIOS: new data read from socket");
                        AbstractC1372 abstractC1372 = (AbstractC1372) this.f16061.get(new Integer(AbstractC1372.m4153(0, this.f16064)));
                        if (abstractC1372 != null && !abstractC1372.f4009) {
                            synchronized (abstractC1372) {
                                abstractC1372.m4155(this.f16064);
                                abstractC1372.f4009 = true;
                                if (interfaceC8213.mo6442()) {
                                    interfaceC8213.mo6437(abstractC1372.toString());
                                    interfaceC8213.mo6437(C2627.m6871(this.f16064, 0, this.f16076.getLength()));
                                }
                                abstractC1372.notify();
                            }
                        }
                    } catch (SocketTimeoutException e) {
                        f16058.mo6428("Socket timeout", e);
                    }
                } catch (Exception e2) {
                    f16058.mo6433("Uncaught exception in NameServiceClient", (Throwable) e2);
                }
            } finally {
                m10826();
            }
        }
    }

    public final void m10833(l.AbstractC1372 r13, l.AbstractC1372 r14, int r15) {
        throw new UnsupportedOperationException("Method not decompiled: l.RunnableC4449.m10833(l.ۗۨۚۗ, l.ۗۨۚۗ, int):void");
    }

    public final C11566 m10830(C10273 c10273, InetAddress inetAddress) {
        C9545 c9545 = new C9545(this.f16079.mo3477(), c10273);
        C2264 c2264 = new C2264(this.f16079.mo3477());
        InterfaceC8213 interfaceC8213 = f16058;
        if (inetAddress != null) {
            c9545.f4021 = inetAddress;
            c9545.f4023 = inetAddress.equals(this.f16067) || inetAddress.getAddress()[3] == -1;
            int m9029 = ((C3594) this.f16079.mo3477()).m9029();
            do {
                try {
                    m10833(c9545, c2264, ((C3594) this.f16079.mo3477()).m9047());
                    if (!c2264.f4009 || c2264.f4025 != 0) {
                        m9029--;
                        if (m9029 <= 0) {
                            break;
                        }
                    } else {
                        C11566[] c11566Arr = c2264.f4008;
                        int length = c11566Arr.length - 1;
                        c11566Arr[length].f35231.f31961 = inetAddress.hashCode();
                        return c2264.f4008[length];
                    }
                } catch (InterruptedIOException e) {
                    if (interfaceC8213.mo6442()) {
                        interfaceC8213.mo6428("Timeout waiting for response " + c10273.f31962, e);
                    }
                    throw new UnknownHostException(c10273.f31962);
                } catch (IOException e2) {
                    interfaceC8213.mo6445("Failed to send nameservice request for " + c10273.f31962, e2);
                    throw new UnknownHostException(c10273.f31962);
                }
            } while (c9545.f4023);
            throw new UnknownHostException(c10273.f31962);
        }
        Iterator it = this.f16059.iterator();
        while (it.hasNext()) {
            EnumC0681 enumC0681 = (EnumC0681) it.next();
            try {
                int ordinal = enumC0681.ordinal();
                if (ordinal == 0 || ordinal == 1) {
                    EnumC0681 enumC06812 = EnumC0681.RESOLVER_WINS;
                    if (enumC0681 == enumC06812 && c10273.f31962 != "\u0001\u0002__MSBROWSE__\u0002" && c10273.f31963 != 29) {
                        c9545.f4021 = m10843();
                        c9545.f4023 = false;
                    } else {
                        c9545.f4021 = this.f16067;
                        c9545.f4023 = true;
                    }
                    int m90292 = ((C3594) this.f16079.mo3477()).m9029();
                    while (true) {
                        int i = m90292 - 1;
                        if (m90292 > 0) {
                            try {
                                m10833(c9545, c2264, ((C3594) this.f16079.mo3477()).m9047());
                                if (c2264.f4009 && c2264.f4025 == 0) {
                                    c2264.f4008[0].f35231.f31961 = c9545.f4021.hashCode();
                                    return c2264.f4008[0];
                                }
                                if (enumC0681 == enumC06812) {
                                    break;
                                }
                                m90292 = i;
                            } catch (IOException e3) {
                                interfaceC8213.mo6445("Failed to send nameservice request for " + c10273.f31962, e3);
                                throw new UnknownHostException(c10273.f31962);
                            }
                        }
                    }
                } else if (ordinal == 3) {
                    this.f16063.m20059(this.f16079);
                }
            } catch (IOException e4) {
                interfaceC8213.mo6431("Failed to lookup name", (Exception) e4);
            }
        }
        throw new UnknownHostException(c10273.f31962);
    }

    public final C11566[] m10840(InterfaceC4323 interfaceC4323) {
        C2100 c2100 = new C2100(this.f16079.mo3477(), (C11566) interfaceC4323.mo19420(C11566.class));
        int i = 0;
        AbstractC1372 c0643 = new C0643(this.f16079.mo3477(), new C10273(this.f16079.mo3477(), "*\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000", 0, null));
        c0643.f4021 = interfaceC4323.mo19422();
        int m9029 = ((C3594) this.f16079.mo3477()).m9029();
        while (true) {
            int i2 = m9029 - 1;
            if (m9029 > 0) {
                try {
                    m10833(c0643, c2100, ((C3594) this.f16079.mo3477()).m9047());
                    if (c2100.f4009 && c2100.f4025 == 0) {
                        int hashCode = c0643.f4021.hashCode();
                        while (true) {
                            C11566[] c11566Arr = c2100.f6630;
                            if (i >= c11566Arr.length) {
                                return c11566Arr;
                            }
                            c11566Arr[i].f35231.f31961 = hashCode;
                            i++;
                        }
                    } else {
                        m9029 = i2;
                    }
                } catch (IOException e) {
                    f16058.mo6445("Failed to send node status request for " + interfaceC4323, e);
                    throw new UnknownHostException(interfaceC4323.toString());
                }
            } else {
                throw new UnknownHostException(interfaceC4323.mo19421());
            }
        }
    }

    public final C11566 m10828(int i, String str) {
        if (str != null && str.length() != 0) {
            C10273 c10273 = new C10273(this.f16079.mo3477(), str, i, null);
            if (!Character.isDigit(str.charAt(0))) {
                return m10829(c10273);
            }
            char[] charArray = str.toCharArray();
            int i2 = 0;
            int i3 = 0;
            int i4 = 0;
            while (i2 < charArray.length) {
                char c = charArray[i2];
                if (c < '0' || c > '9') {
                    return m10829(c10273);
                }
                int i5 = 0;
                while (c != '.') {
                    if (c < '0' || c > '9') {
                        return m10829(c10273);
                    }
                    i5 = ((i5 * 10) + c) - 48;
                    i2++;
                    if (i2 >= charArray.length) {
                        break;
                    }
                    c = charArray[i2];
                }
                if (i5 > 255) {
                    return m10829(c10273);
                }
                i4 = (i4 << 8) + i5;
                i3++;
                i2++;
            }
            if (i3 != 4 || str.endsWith(".")) {
                return m10829(c10273);
            }
            return new C11566(this.f16074, i4);
        }
        return this.f16066;
    }

    public final C11566[] m10839(String str, int i, String str2, InetAddress inetAddress) {
        boolean z;
        C10273 c10273 = new C10273(this.f16079.mo3477(), str, i, str2);
        InterfaceC8213 interfaceC8213 = f16058;
        InterfaceC9946 mo3477 = this.f16079.mo3477();
        C9545 c9545 = new C9545(mo3477, c10273);
        C2264 c2264 = new C2264(mo3477);
        if (inetAddress == null) {
            inetAddress = m10843();
        }
        c9545.f4021 = inetAddress;
        int i2 = 1;
        if (inetAddress != null) {
            z = false;
        }
        z = true;
        c9545.f4023 = z;
        if (z) {
            if (c9545.f4021 == null) {
                c9545.f4021 = this.f16067;
            }
            i2 = ((C3594) mo3477).m9029();
        }
        do {
            try {
                m10833(c9545, c2264, ((C3594) mo3477).m9047());
                if (!c2264.f4009 || c2264.f4025 != 0) {
                    i2--;
                    if (i2 <= 0) {
                        break;
                    }
                } else {
                    return c2264.f4008;
                }
            } catch (InterruptedIOException e) {
                if (interfaceC8213.mo6442()) {
                    interfaceC8213.mo6428("Failed to send nameservice request for " + c10273.f31962, e);
                }
                throw new UnknownHostException(c10273.f31962);
            } catch (IOException e2) {
                interfaceC8213.mo6445("Failed to send nameservice request for " + c10273.f31962, e2);
                throw new UnknownHostException(c10273.f31962);
            }
        } while (c9545.f4023);
        throw new UnknownHostException(c10273.f31962);
    }

    public final InterfaceC4323[] m10845(String str) {
        String str2;
        C11566 m10828 = m10828(0, str);
        try {
            C11566[] m10840 = m10840(m10828);
            m10836(m10840);
            return m10840;
        } catch (UnknownHostException unused) {
            StringBuilder sb = new StringBuilder("no name with type 0x");
            sb.append(C2627.m6869(m10828.f35231.f31963, 2));
            String str3 = m10828.f35231.f31959;
            if (str3 == null || str3.isEmpty()) {
                str2 = " with no scope";
            } else {
                str2 = " with scope " + m10828.f35231.f31959;
            }
            sb.append(str2);
            sb.append(" for host ");
            sb.append(m10828.mo19418());
            throw new UnknownHostException(sb.toString());
        }
    }

    public final InetAddress m10843() {
        if (((C3594) this.f16079.mo3477()).m9004().length == 0) {
            return null;
        }
        return ((C3594) this.f16079.mo3477()).m9004()[this.f16065];
    }

    public final boolean m10837(InetAddress inetAddress) {
        for (int i = 0; inetAddress != null && i < ((C3594) this.f16079.mo3477()).m9004().length; i++) {
            if (inetAddress.hashCode() == ((C3594) this.f16079.mo3477()).m9004()[i].hashCode()) {
                return true;
            }
        }
        return false;
    }

    public final void m10842() {
        this.f16065 = this.f16065 + 1 < ((C3594) this.f16079.mo3477()).m9004().length ? this.f16065 + 1 : 0;
        if (((C3594) this.f16079.mo3477()).m9004().length == 0) {
            return;
        }
        InetAddress inetAddress = ((C3594) this.f16079.mo3477()).m9004()[this.f16065];
    }

    public final InterfaceC4323[] m10838(String str, InetAddress inetAddress) {
        C6633 c6633 = new C6633();
        C5177 c5177 = new C5177(c6633, str, m10837(inetAddress) ? 27 : 29, inetAddress, this.f16079);
        C5177 c51772 = new C5177(c6633, str, 32, inetAddress, this.f16079);
        c5177.setDaemon(true);
        c51772.setDaemon(true);
        try {
            synchronized (c6633) {
                c5177.start();
                c51772.start();
                while (c6633.f22052 > 0 && c5177.m12596() == null && c51772.m12596() == null) {
                    c6633.wait();
                }
            }
            try {
                c5177.interrupt();
            } catch (SecurityException unused) {
            }
            try {
                c5177.join();
            } catch (InterruptedException unused2) {
            }
            try {
                c51772.interrupt();
            } catch (SecurityException unused3) {
            }
            try {
                c51772.join();
            } catch (InterruptedException unused4) {
            }
            if (c5177.m12596() != null) {
                return c5177.m12596();
            }
            if (c51772.m12596() != null) {
                return c51772.m12596();
            }
            throw c5177.m12597();
        } catch (InterruptedException unused5) {
            throw new UnknownHostException(str);
        }
    }

    public final C13022 m10831(String str) {
        return m10841(str, false)[0];
    }

    public final C13022[] m10841(String str, boolean z) {
        int ordinal;
        boolean z2;
        InterfaceC4323[] m10838;
        if (str == null || str.length() == 0) {
            throw new UnknownHostException();
        }
        if (C13022.m27960(str)) {
            return new C13022[]{new C13022(m10828(0, str))};
        }
        InterfaceC8213 interfaceC8213 = f16058;
        if (interfaceC8213.mo6442()) {
            interfaceC8213.mo6437("Resolver order is " + ((C3594) this.f16079.mo3477()).m9013());
        }
        Iterator it = ((C3594) this.f16079.mo3477()).m9013().iterator();
        while (it.hasNext()) {
            EnumC0681 enumC0681 = (EnumC0681) it.next();
            try {
                ordinal = enumC0681.ordinal();
            } catch (IOException e) {
                InterfaceC8213 interfaceC82132 = f16058;
                interfaceC82132.mo6446("Resolving {} via {} failed:", str, enumC0681);
                interfaceC82132.mo6428("Exception is", e);
            }
            if (ordinal != 0) {
                if (ordinal != 1) {
                    if (ordinal == 2) {
                        int i = 0;
                        while (true) {
                            if (i >= str.length()) {
                                z2 = true;
                                break;
                            }
                            if (!Character.isDigit(str.charAt(i))) {
                                z2 = false;
                                break;
                            }
                            i++;
                        }
                        if (z2) {
                            throw new UnknownHostException(str);
                        }
                        InetAddress[] allByName = InetAddress.getAllByName(str);
                        C13022[] c13022Arr = new C13022[allByName.length];
                        for (int i2 = 0; i2 < allByName.length; i2++) {
                            c13022Arr[i2] = new C13022(allByName[i2]);
                        }
                        InterfaceC8213 interfaceC82133 = f16058;
                        if (interfaceC82133.mo6436()) {
                            interfaceC82133.mo6432("Resolved '{}' to {} using DNS", str, Arrays.toString(c13022Arr));
                        }
                        return c13022Arr;
                    }
                    if (ordinal != 3) {
                        throw new UnknownHostException(str);
                    }
                    C8817 c8817 = this.f16063;
                    InterfaceC12131 interfaceC12131 = this.f16079;
                    synchronized (c8817) {
                        new C10273(interfaceC12131.mo3477(), str, 32, null);
                        c8817.m20059(interfaceC12131);
                    }
                } else if (str.length() <= 15) {
                    m10838 = z ? m10838(str, ((C3594) this.f16079.mo3477()).m9040()) : m10839(str, 32, null, ((C3594) this.f16079.mo3477()).m9040());
                }
            } else if (!str.equals("\u0001\u0002__MSBROWSE__\u0002") && str.length() <= 15) {
                m10838 = z ? m10838(str, m10843()) : m10839(str, 32, null, m10843());
            }
            if (m10838 != null) {
                InterfaceC8213 interfaceC82134 = f16058;
                if (interfaceC82134.mo6436()) {
                    interfaceC82134.mo6434("Resolved '{}' to addrs {} via {}", str, Arrays.toString(m10838), enumC0681);
                }
                C13022[] c13022Arr2 = new C13022[m10838.length];
                for (int i3 = 0; i3 < m10838.length; i3++) {
                    c13022Arr2[i3] = new C13022(m10838[i3]);
                }
                return c13022Arr2;
            }
        }
        throw new UnknownHostException(str);
    }

    public final C10273 m10827() {
        C11566 c11566 = this.f16066;
        if (c11566 != null) {
            return c11566.f35231;
        }
        return null;
    }
}