四虎影院 v4.1.6版本的 MD5 值为:3c86dc44d368396917a29935d39af88b

以下内容为反编译后的 d.java 源代码,内容仅作参考


package q.f.f;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.StringReader;
import java.io.StringWriter;
import java.net.URI;
import java.net.URL;
import java.util.HashMap;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathFactory;
import okhttp3.n0.http2.Http2ExchangeCodec;
import org.w3c.dom.CDATASection;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.EntityResolver;
import org.xml.sax.ErrorHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import q.f.f.b;

public abstract class d<D extends q.f.f.b> implements ErrorHandler, EntityResolver {

    public static Logger f21005c = Logger.getLogger(d.class.getName());

    public static final URL f21006d = Thread.currentThread().getContextClassLoader().getResource("org/seamless/schemas/xml.xsd");
    public Source[] a;
    public Schema b;

    public class a extends HashMap<URI, URL> {
        public a() {
            put(q.f.f.b.b, d.f21006d);
        }
    }

    public class b extends c {
        public b(short s2) {
            super(s2);
        }

        @Override
        public void a(Node node) {
            CDATASection cDATASection = (CDATASection) node;
            cDATASection.getParentNode().setTextContent(cDATASection.getData());
        }
    }

    public static abstract class c {
        public static final boolean b = false;
        public short a;

        public c(short s2) {
            this.a = s2;
        }

        public abstract void a(Node node);

        public boolean a() {
            return false;
        }
    }

    public d() {
        this(null);
    }

    public static String d(String str) {
        if (str == null) {
            return null;
        }
        return str.replaceAll("<([a-zA-Z]|/).*?>", "");
    }

    public DocumentBuilderFactory a(boolean z) {
        DocumentBuilderFactory newInstance = DocumentBuilderFactory.newInstance();
        try {
            newInstance.setNamespaceAware(true);
            if (z) {
                newInstance.setXIncludeAware(true);
                newInstance.setFeature("http://apache.org/xml/features/xinclude/fixup-base-uris", false);
                newInstance.setFeature("http://apache.org/xml/features/xinclude/fixup-language", false);
                newInstance.setSchema(c());
                newInstance.setFeature("http://apache.org/xml/features/validation/dynamic", true);
            }
            return newInstance;
        } catch (ParserConfigurationException e2) {
            throw new f(e2);
        }
    }

    public abstract D a(Document document);

    public void b(URL url) {
        if (url != null) {
            f21005c.fine("Validating XML of URL: " + url);
            a(new StreamSource(url.toString()));
            return;
        }
        throw new IllegalArgumentException("Can't validate null URL");
    }

    public Schema c() {
        if (this.b == null) {
            try {
                SchemaFactory newInstance = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
                newInstance.setResourceResolver(new q.f.f.a(new a()));
                if (this.a != null) {
                    this.b = newInstance.newSchema(this.a);
                } else {
                    this.b = newInstance.newSchema();
                }
            } catch (Exception e2) {
                throw new RuntimeException(e2);
            }
        }
        return this.b;
    }

    @Override
    public void error(SAXParseException sAXParseException) {
        throw new SAXException(new f(sAXParseException));
    }

    @Override
    public void fatalError(SAXParseException sAXParseException) {
        throw new SAXException(new f(sAXParseException));
    }

    @Override
    public InputSource resolveEntity(String str, String str2) {
        InputSource inputSource;
        if (str2.startsWith("file://")) {
            inputSource = new InputSource(new FileInputStream(new File(URI.create(str2))));
        } else {
            inputSource = new InputSource(new ByteArrayInputStream(new byte[0]));
        }
        inputSource.setPublicId(str);
        inputSource.setSystemId(str2);
        return inputSource;
    }

    @Override
    public void warning(SAXParseException sAXParseException) {
        f21005c.warning(sAXParseException.toString());
    }

    public d(Source[] sourceArr) {
        this.a = sourceArr;
    }

    public void b(String str) {
        if (str != null) {
            f21005c.fine("Validating XML string characters: " + str.length());
            a(new SAXSource(new InputSource(new StringReader(str))));
            return;
        }
        throw new IllegalArgumentException("Can't validate null string");
    }

    public void b(q.f.f.b bVar) {
        a(new DOMSource(bVar.c()));
    }

    public XPathFactory b() {
        return XPathFactory.newInstance();
    }

    public Transformer a(String str, int i2, boolean z) {
        try {
            TransformerFactory newInstance = TransformerFactory.newInstance();
            if (i2 > 0) {
                try {
                    newInstance.setAttribute("indent-number", Integer.valueOf(i2));
                } catch (IllegalArgumentException unused) {
                }
            }
            Transformer newTransformer = newInstance.newTransformer();
            newTransformer.setOutputProperty("omit-xml-declaration", z ? "no" : "yes");
            if (z) {
                try {
                    newTransformer.setOutputProperty("http://www.oracle.com/xml/is-standalone", "yes");
                } catch (IllegalArgumentException unused2) {
                }
            }
            newTransformer.setOutputProperty("indent", i2 > 0 ? "yes" : "no");
            if (i2 > 0) {
                newTransformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", Integer.toString(i2));
            }
            newTransformer.setOutputProperty("method", str);
            return newTransformer;
        } catch (Exception e2) {
            throw new f(e2);
        }
    }

    public String b(String str, int i2, boolean z) {
        return a(new StreamSource(new StringReader(str)), i2, z);
    }

    public void c(Document document) {
        a(new DOMSource(document));
    }

    public static String c(String str) {
        return a(str, false, false);
    }

    public String b(Document document) {
        return a(document, 4, true, true);
    }

    public D a() {
        try {
            return a(a(false).newDocumentBuilder().newDocument());
        } catch (Exception e2) {
            throw new RuntimeException(e2);
        }
    }

    public D a(URL url) {
        return a(url, true);
    }

    public D a(String str) {
        return a(str, true);
    }

    public D a(File file) {
        return a(file, true);
    }

    public D a(InputStream inputStream) {
        return a(inputStream, true);
    }

    public D a(URL url, boolean z) {
        if (url != null) {
            try {
                return a(url.openStream(), z);
            } catch (Exception e2) {
                throw new f("Parsing URL failed: " + url, e2);
            }
        }
        throw new IllegalArgumentException("Can't parse null URL");
    }

    public D a(String str, boolean z) {
        if (str != null) {
            return a(new InputSource(new StringReader(str)), z);
        }
        throw new IllegalArgumentException("Can't parse null string");
    }

    public D a(File file, boolean z) {
        if (file != null) {
            try {
                return a(file.toURI().toURL(), z);
            } catch (Exception e2) {
                throw new f("Parsing file failed: " + file, e2);
            }
        }
        throw new IllegalArgumentException("Can't parse null file");
    }

    public D a(InputStream inputStream, boolean z) {
        return a(new InputSource(inputStream), z);
    }

    public D a(InputSource inputSource, boolean z) {
        try {
            DocumentBuilder newDocumentBuilder = a(z).newDocumentBuilder();
            newDocumentBuilder.setEntityResolver(this);
            newDocumentBuilder.setErrorHandler(this);
            Document parse = newDocumentBuilder.parse(inputSource);
            parse.normalizeDocument();
            return a(parse);
        } catch (Exception e2) {
            throw a(e2);
        }
    }

    public void a(Source source) {
        try {
            Validator newValidator = c().newValidator();
            newValidator.setErrorHandler(this);
            newValidator.validate(source);
        } catch (Exception e2) {
            throw a(e2);
        }
    }

    public XPath a(NamespaceContext namespaceContext) {
        XPath newXPath = b().newXPath();
        newXPath.setNamespaceContext(namespaceContext);
        return newXPath;
    }

    public XPath a(XPathFactory xPathFactory, NamespaceContext namespaceContext) {
        XPath newXPath = xPathFactory.newXPath();
        newXPath.setNamespaceContext(namespaceContext);
        return newXPath;
    }

    public Object a(q.f.f.b bVar, XPath xPath, String str, QName qName) {
        return a(bVar.c(), xPath, str, qName);
    }

    public Object a(q.f.f.c cVar, XPath xPath, String str, QName qName) {
        return a(cVar.e(), xPath, str, qName);
    }

    public Object a(Node node, XPath xPath, String str, QName qName) {
        try {
            f21005c.fine("Evaluating xpath query: " + str);
            return xPath.evaluate(str, node, qName);
        } catch (Exception e2) {
            throw new RuntimeException(e2);
        }
    }

    public String a(q.f.f.b bVar) {
        return a(bVar, 4, true);
    }

    public String a(q.f.f.b bVar, int i2) {
        return a(bVar, i2, true);
    }

    public String a(q.f.f.b bVar, boolean z) {
        return a(bVar, 4, z);
    }

    public String a(q.f.f.b bVar, int i2, boolean z) {
        return a(bVar.c(), i2, z);
    }

    public String a(Document document, int i2, boolean z) {
        a(document.getDocumentElement());
        return a(new DOMSource(document.getDocumentElement()), i2, z);
    }

    public String a(Source source, int i2, boolean z) {
        try {
            Transformer a2 = a("xml", i2, z);
            a2.setOutputProperty(Http2ExchangeCodec.f17826o, "utf-8");
            StringWriter stringWriter = new StringWriter();
            a2.transform(source, new StreamResult(stringWriter));
            stringWriter.flush();
            return stringWriter.toString();
        } catch (Exception e2) {
            throw new f(e2);
        }
    }

    public String a(Document document, int i2, boolean z, boolean z2) {
        Document document2 = (Document) document.cloneNode(true);
        a(document2.getDocumentElement(), new b((short) 4));
        a(document2.getDocumentElement());
        try {
            Transformer a2 = a("html", i2, z);
            if (z2) {
                a2.setOutputProperty("doctype-public", "-//W3C//DTD HTML 4.01 Transitional//EN");
                a2.setOutputProperty("doctype-system", "http://www.w3.org/TR/html4/loose.dtd");
            }
            StringWriter stringWriter = new StringWriter();
            a2.transform(new DOMSource(document2), new StreamResult(stringWriter));
            stringWriter.flush();
            return stringWriter.toString().replaceFirst("\\s*<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">", "").replaceFirst("<html xmlns=\"http://www.w3.org/1999/xhtml\">", "<html>");
        } catch (Exception e2) {
            throw new f(e2);
        }
    }

    public void a(Element element) {
        Node firstChild = element.getFirstChild();
        while (firstChild != null) {
            Node nextSibling = firstChild.getNextSibling();
            if (a(firstChild)) {
                element.removeChild(firstChild);
            } else if (firstChild.getNodeType() == 1) {
                a((Element) firstChild);
            }
            firstChild = nextSibling;
        }
    }

    public boolean a(Node node) {
        return node.getNodeType() == 3 && node.getTextContent().matches("[\\t\\n\\x0B\\f\\r\\s]+");
    }

    public f a(Exception exc) {
        if (exc.getCause() != null && (exc.getCause() instanceof f)) {
            return (f) exc.getCause();
        }
        return new f(exc);
    }

    public static String a(String str, boolean z, boolean z2) {
        if (str == null) {
            return null;
        }
        StringBuilder sb = new StringBuilder();
        for (int i2 = 0; i2 < str.length(); i2++) {
            char charAt = str.charAt(i2);
            String str2 = charAt != '\"' ? charAt != '&' ? charAt != '<' ? charAt != '>' ? null : "&#62;" : "&#60;" : "&#38;" : "&#34;";
            if (str2 != null) {
                sb.append(str2);
            } else {
                sb.append(charAt);
            }
        }
        String sb2 = sb.toString();
        if (z2) {
            Matcher matcher = Pattern.compile("(\\n+)(\\s*)(.*)").matcher(sb2);
            StringBuffer stringBuffer = new StringBuffer();
            while (matcher.find()) {
                String group = matcher.group(2);
                StringBuilder sb3 = new StringBuilder();
                for (int i3 = 0; i3 < group.length(); i3++) {
                    sb3.append("&#160;");
                }
                matcher.appendReplacement(stringBuffer, "$1" + sb3.toString() + "$3");
            }
            matcher.appendTail(stringBuffer);
            sb2 = stringBuffer.toString();
        }
        return z ? sb2.replaceAll("\n", "<br/>") : sb2;
    }

    public static void a(Node node, c cVar) {
        if (node == null || cVar.a()) {
            return;
        }
        NodeList childNodes = node.getChildNodes();
        for (int i2 = 0; i2 < childNodes.getLength(); i2++) {
            Node item = childNodes.item(i2);
            if (item.getNodeType() == cVar.a) {
                cVar.a(item);
                if (cVar.a()) {
                    return;
                }
            }
            a(item, cVar);
        }
    }

    public static String a(String str, String str2) {
        return a(str, (String) null, str2);
    }

    public static String a(String str, String str2, String str3) {
        StringBuilder sb = new StringBuilder();
        sb.append("<");
        sb.append(str);
        if (str2 != null) {
            sb.append(" xmlns=\"");
            sb.append(str2);
            sb.append("\"");
        }
        sb.append(">");
        sb.append(str3);
        sb.append("</");
        sb.append(str);
        sb.append(">");
        return sb.toString();
    }
}