导航菜单

页面标题

页面副标题

⁣逼‌多​多⁣ v3.6.2 - b.java 源代码

正在查看: ⁣逼‌多​多⁣ v3.6.2 应用的 b.java JAVA 源代码文件

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


package org.minidns;

import g2.a;
import java.io.IOException;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.logging.Level;
import java.util.logging.Logger;
import k2.c;
import k2.d;
import k2.e;
import org.minidns.MiniDnsException;
import org.minidns.a;
import org.minidns.util.MultipleIoException;

public abstract class b extends org.minidns.a {
    static final List n = new CopyOnWriteArrayList();
    static final Set o;
    static final Set p;
    private static final Set q;
    private final Set j;
    private boolean k;
    private boolean l;
    private boolean m;

    static class a {
        static final int[] a;
        static final int[] b;

        static {
            int[] iArr = new int[a.d.values().length];
            b = iArr;
            try {
                iArr[a.d.b.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                b[a.d.e.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            int[] iArr2 = new int[a.c.values().length];
            a = iArr2;
            try {
                iArr2[a.c.v4v6.ordinal()] = 1;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                a[a.c.v6v4.ordinal()] = 2;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                a[a.c.v4only.ordinal()] = 3;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                a[a.c.v6only.ordinal()] = 4;
            } catch (NoSuchFieldError unused6) {
            }
        }
    }

    static {
        CopyOnWriteArraySet copyOnWriteArraySet = new CopyOnWriteArraySet();
        o = copyOnWriteArraySet;
        p = new CopyOnWriteArraySet();
        p(k2.b.d);
        p(c.d);
        p(e.d);
        try {
            copyOnWriteArraySet.add(q2.e.a("8.8.8.8"));
        } catch (IllegalArgumentException e) {
            org.minidns.a.h.log(Level.WARNING, "Could not add static IPv4 DNS Server", (Throwable) e);
        }
        try {
            p.add(q2.e.b("[2001:4860:4860::8888]"));
        } catch (IllegalArgumentException e2) {
            org.minidns.a.h.log(Level.WARNING, "Could not add static IPv6 DNS Server", (Throwable) e2);
        }
        q = Collections.newSetFromMap(new ConcurrentHashMap(4));
    }

    public b(d2.a aVar) {
        super(aVar);
        this.j = Collections.newSetFromMap(new ConcurrentHashMap(4));
        this.k = false;
        this.l = false;
        this.m = true;
    }

    public static void p(d dVar) {
        if (!dVar.h()) {
            org.minidns.a.h.fine("Not adding " + dVar.getName() + " as it is not available.");
            return;
        }
        List list = n;
        synchronized (list) {
            ArrayList arrayList = new ArrayList(list.size() + 1);
            arrayList.addAll(list);
            arrayList.add(dVar);
            Collections.sort(arrayList);
            list.clear();
            list.addAll(arrayList);
        }
    }

    public static java.util.List q() {
        throw new UnsupportedOperationException("Method not decompiled: org.minidns.b.q():java.util.List");
    }

    public static List r() {
        InetAddress byName;
        List<String> q3 = q();
        if (q3 == null) {
            return new ArrayList();
        }
        a.c cVar = org.minidns.a.i;
        ArrayList arrayList = cVar.a ? new ArrayList(q3.size()) : null;
        ArrayList arrayList2 = cVar.b ? new ArrayList(q3.size()) : null;
        int i = 0;
        for (String str : q3) {
            try {
                byName = InetAddress.getByName(str);
            } catch (UnknownHostException e) {
                org.minidns.a.h.log(Level.SEVERE, "Could not transform '" + str + "' to InetAddress", (Throwable) e);
            }
            if (!(byName instanceof Inet4Address)) {
                if (!(byName instanceof Inet6Address)) {
                    throw new AssertionError("The address '" + byName + "' is neither of type Inet(4|6)Address");
                }
                if (cVar.b) {
                    arrayList2.add((Inet6Address) byName);
                }
            } else if (cVar.a) {
                arrayList.add((Inet4Address) byName);
            }
            i++;
        }
        ArrayList arrayList3 = new ArrayList(i);
        int i2 = a.a[cVar.ordinal()];
        if (i2 == 1) {
            arrayList3.addAll(arrayList);
            arrayList3.addAll(arrayList2);
        } else if (i2 == 2) {
            arrayList3.addAll(arrayList2);
            arrayList3.addAll(arrayList);
        } else if (i2 == 3) {
            arrayList3.addAll(arrayList);
        } else if (i2 == 4) {
            arrayList3.addAll(arrayList2);
        }
        return arrayList3;
    }

    private List u() {
        InetAddress t;
        InetAddress s;
        List r = r();
        if (this.m) {
            int i = a.a[this.f.ordinal()];
            if (i == 1) {
                t = t();
                s = s();
            } else if (i != 2) {
                s = null;
                if (i == 3) {
                    t = t();
                } else {
                    if (i != 4) {
                        throw new AssertionError("Unknown ipVersionSetting: " + this.f);
                    }
                    t = s();
                }
            } else {
                t = s();
                s = t();
            }
            r.add(t);
            if (s != null) {
                r.add(s);
            }
        }
        return r;
    }

    @Override
    protected a.b k(a.b bVar) {
        bVar.A(true);
        bVar.s().i(this.e.b()).h(this.k);
        return bVar;
    }

    @Override
    public h2.c l(a.b bVar) {
        g2.a r = k(bVar).r();
        d2.a aVar = this.d;
        h2.a a2 = aVar == null ? null : aVar.a(r);
        if (a2 != null) {
            return a2;
        }
        List<InetAddress> u = u();
        ArrayList arrayList = new ArrayList(u.size());
        for (InetAddress inetAddress : u) {
            if (this.j.contains(inetAddress)) {
                org.minidns.a.h.finer("Skipping " + inetAddress + " because it was marked as \"recursion not available\"");
            } else {
                try {
                    h2.c m = m(r, inetAddress);
                    g2.a aVar2 = m.c;
                    if (aVar2.h) {
                        if (this.l) {
                            return m;
                        }
                        int i = a.b[aVar2.c.ordinal()];
                        if (i == 1 || i == 2) {
                            return m;
                        }
                        String str = "Response from " + inetAddress + " asked for " + r.p() + " with error code: " + aVar2.c + '.';
                        Logger logger = org.minidns.a.h;
                        if (!logger.isLoggable(Level.FINE)) {
                            str = str + "\n" + aVar2;
                        }
                        logger.warning(str);
                        arrayList.add(new MiniDnsException.ErrorResponseException(r, m));
                    } else if (this.j.add(inetAddress)) {
                        org.minidns.a.h.warning("The DNS server " + inetAddress + " returned a response without the \"recursion available\" (RA) flag set. This likely indicates a misconfiguration because the server is not suitable for DNS resolution");
                    }
                } catch (IOException e) {
                    arrayList.add(e);
                }
            }
        }
        MultipleIoException.b(arrayList);
        throw new MiniDnsException.NoQueryPossibleException(r);
    }

    public InetAddress s() {
        return (InetAddress) q2.c.a(p, this.c);
    }

    public InetAddress t() {
        return (InetAddress) q2.c.a(o, this.c);
    }
}