/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.common.io.XmlUtil
 *  com.l7tech.policy.bundle.BundleInfo
 *  com.l7tech.util.DomUtils
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.IOUtils
 *  com.l7tech.util.MissingRequiredElementException
 *  com.l7tech.util.Pair
 *  com.l7tech.util.TooManyChildElementsException
 *  org.jetbrains.annotations.NotNull
 *  org.jetbrains.annotations.Nullable
 */
package com.l7tech.server.policy.bundle;

import com.l7tech.common.io.XmlUtil;
import com.l7tech.policy.bundle.BundleInfo;
import com.l7tech.server.policy.bundle.BundleResolver;
import com.l7tech.server.policy.bundle.GatewayManagementDocumentUtilities;
import com.l7tech.server.policy.bundle.PolicyUtils;
import com.l7tech.util.DomUtils;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.IOUtils;
import com.l7tech.util.MissingRequiredElementException;
import com.l7tech.util.Pair;
import com.l7tech.util.TooManyChildElementsException;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.JarURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.logging.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;

/*
 * Exception performing whole class analysis ignored.
 */
public class BundleUtils {
    public static final String NS_BUNDLE;
    public static final String L7_NS_POLICY;
    public static final String L7_NS_GW_MGMT;
    private static final Logger a;
    private static final String[] b;

    @NotNull
    public static List<Pair<BundleInfo, String>> getBundleInfos(@NotNull Class clazz, @NotNull String string) throws BundleResolver.InvalidBundleException {
        ArrayList<Pair<BundleInfo, String>> arrayList;
        try {
            if (clazz == null) {
                BundleUtils.a(0);
            }
        }
        catch (IOException iOException) {
            throw BundleUtils.a(iOException);
        }
        try {
            if (string == null) {
                BundleUtils.a(1);
            }
        }
        catch (IOException iOException) {
            throw BundleUtils.a(iOException);
        }
        ArrayList<Pair<BundleInfo, String>> arrayList2 = new ArrayList<Pair<BundleInfo, String>>();
        try {
            JarFile jarFile = BundleUtils.a(clazz, string);
            arrayList2.addAll(BundleUtils.getBundleInfos(clazz, string, jarFile));
        }
        catch (IOException iOException) {
            throw new BundleResolver.InvalidBundleException(iOException);
        }
        try {
            arrayList = arrayList2;
            if (arrayList == null) {
                BundleUtils.a(2);
            }
        }
        catch (IOException iOException) {
            throw BundleUtils.a(iOException);
        }
        return arrayList;
    }

    @NotNull
    public static List<Pair<BundleInfo, String>> getBundleInfos(@NotNull Class clazz, @NotNull String string, @Nullable JarFile jarFile) throws BundleResolver.InvalidBundleException {
        ArrayList<Pair<BundleInfo, String>> arrayList;
        ArrayList<Pair<BundleInfo, String>> arrayList2;
        block16: {
            try {
                if (clazz == null) {
                    BundleUtils.a(3);
                }
            }
            catch (SAXException sAXException) {
                throw BundleUtils.a(sAXException);
            }
            try {
                if (string == null) {
                    BundleUtils.a(4);
                }
            }
            catch (SAXException sAXException) {
                throw BundleUtils.a(sAXException);
            }
            arrayList2 = new ArrayList<Pair<BundleInfo, String>>();
            try {
                if (jarFile != null) {
                    List<JarEntry> list = BundleUtils.a(jarFile, string);
                    List<Pair<BundleInfo, String>> list2 = BundleUtils.getBundleInfosFromJar(list, clazz);
                    arrayList2.addAll(list2);
                    break block16;
                }
                URL uRL = clazz.getResource(string);
                File file = new File(uRL.getFile());
                if (file.isDirectory()) {
                    File[] fileArray = file.listFiles();
                    if (fileArray == null) break block16;
                    for (File file2 : fileArray) {
                        Document document;
                        if (!file2.isDirectory()) continue;
                        String[] stringArray = b;
                        File file3 = new File(file2, stringArray[38]);
                        byte[] byArray = IOUtils.slurpFile((File)file3);
                        try {
                            document = XmlUtil.parse((InputStream)new ByteArrayInputStream(byArray));
                        }
                        catch (SAXException sAXException) {
                            throw new BundleResolver.InvalidBundleException(sAXException);
                        }
                        BundleInfo bundleInfo = BundleUtils.getBundleInfo(document);
                        arrayList2.add((Pair<BundleInfo, String>)new Pair((Object)bundleInfo, (Object)(string + "/" + file2.getName())));
                    }
                    break block16;
                }
                throw new BundleResolver.InvalidBundleException(b[27]);
            }
            catch (IOException iOException) {
                throw new BundleResolver.InvalidBundleException(iOException);
            }
        }
        try {
            arrayList = arrayList2;
            if (arrayList == null) {
                BundleUtils.a(5);
            }
        }
        catch (SAXException sAXException) {
            throw BundleUtils.a(sAXException);
        }
        return arrayList;
    }

    /*
     * Loose catch block
     * Enabled force condition propagation
     * Lifted jumps to return sites
     */
    public static BundleInfo getBundleInfo(Document document) throws BundleResolver.InvalidBundleException {
        String string;
        String string2;
        String string3;
        String string4;
        String[] stringArray;
        block14: {
            block15: {
                Element element;
                Element element2;
                Element element3;
                Element element4;
                String string5 = document.getDocumentElement().getNamespaceURI();
                try {
                    if (!b[4].equals(string5)) {
                        throw new BundleResolver.InvalidBundleException(b[17] + string5);
                    }
                }
                catch (TooManyChildElementsException tooManyChildElementsException) {
                    throw BundleUtils.a((Exception)((Object)tooManyChildElementsException));
                }
                try {
                    stringArray = b;
                    element4 = XmlUtil.findExactlyOneChildElementByName((Element)document.getDocumentElement(), (String)stringArray[5], (String)stringArray[1]);
                    element3 = XmlUtil.findExactlyOneChildElementByName((Element)document.getDocumentElement(), (String)stringArray[5], (String)stringArray[9]);
                    element2 = XmlUtil.findExactlyOneChildElementByName((Element)document.getDocumentElement(), (String)stringArray[5], (String)stringArray[13]);
                    element = XmlUtil.findExactlyOneChildElementByName((Element)document.getDocumentElement(), (String)stringArray[5], (String)stringArray[0]);
                }
                catch (MissingRequiredElementException | TooManyChildElementsException throwable) {
                    throw new BundleResolver.InvalidBundleException(throwable);
                }
                string4 = DomUtils.getTextValue((Element)element4, (boolean)true);
                string3 = DomUtils.getTextValue((Element)element3, (boolean)true);
                string2 = DomUtils.getTextValue((Element)element2, (boolean)true);
                string = DomUtils.getTextValue((Element)element, (boolean)true);
                if (string4.isEmpty()) throw new BundleResolver.InvalidBundleException(b[7]);
                if (string2.isEmpty()) throw new BundleResolver.InvalidBundleException(b[7]);
                break block15;
                catch (TooManyChildElementsException tooManyChildElementsException) {
                    throw BundleUtils.a((Exception)((Object)tooManyChildElementsException));
                }
            }
            try {
                if (!string.isEmpty()) break block14;
                throw new BundleResolver.InvalidBundleException(b[7]);
                catch (TooManyChildElementsException tooManyChildElementsException) {
                    throw BundleUtils.a((Exception)((Object)tooManyChildElementsException));
                }
            }
            catch (TooManyChildElementsException tooManyChildElementsException) {
                throw BundleUtils.a((Exception)((Object)tooManyChildElementsException));
            }
        }
        String string6 = "";
        try {
            stringArray = b;
            Element element = XmlUtil.findExactlyOneChildElementByName((Element)document.getDocumentElement(), (String)stringArray[5], (String)stringArray[2]);
            string6 = DomUtils.getTextValue((Element)element, (boolean)true);
            return new BundleInfo(string4, string3, string2, string, string6);
        }
        catch (MissingRequiredElementException missingRequiredElementException) {
            a.fine(b[8]);
            return new BundleInfo(string4, string3, string2, string, string6);
        }
        catch (TooManyChildElementsException tooManyChildElementsException) {
            throw new BundleResolver.InvalidBundleException(tooManyChildElementsException);
        }
    }

    public static List<Pair<BundleInfo, String>> getBundleInfosFromJar(@NotNull List<JarEntry> list, @NotNull Class clazz) throws BundleResolver.InvalidBundleException {
        try {
            if (list == null) {
                BundleUtils.a(6);
            }
        }
        catch (IOException iOException) {
            throw BundleUtils.a(iOException);
        }
        try {
            if (clazz == null) {
                BundleUtils.a(7);
            }
        }
        catch (IOException iOException) {
            throw BundleUtils.a(iOException);
        }
        ArrayList<Pair<BundleInfo, String>> arrayList = new ArrayList<Pair<BundleInfo, String>>();
        for (JarEntry jarEntry : list) {
            Document document;
            byte[] byArray;
            String string = "/" + jarEntry.getName();
            String[] stringArray = b;
            String string2 = string + stringArray[36];
            URL uRL = clazz.getResource(string2);
            try {
                byArray = IOUtils.slurpUrl((URL)uRL);
            }
            catch (IOException iOException) {
                stringArray = b;
                throw new BundleResolver.InvalidBundleException(stringArray[30] + string, iOException);
            }
            try {
                document = XmlUtil.parse((InputStream)new ByteArrayInputStream(byArray));
            }
            catch (IOException | SAXException exception) {
                throw new BundleResolver.InvalidBundleException(b[31] + string, exception);
            }
            BundleInfo bundleInfo = BundleUtils.getBundleInfo(document);
            arrayList.add((Pair<BundleInfo, String>)new Pair((Object)bundleInfo, (Object)string));
        }
        return arrayList;
    }

    public static void findReferences(BundleInfo bundleInfo, BundleResolver bundleResolver) throws BundleResolver.BundleResolverException, BundleResolver.UnknownBundleException, BundleResolver.InvalidBundleException {
        Object object;
        Object object2;
        Object object3;
        Element element;
        Object object4;
        Object object5;
        Object object6;
        String[] stringArray;
        String string = bundleInfo.getId();
        Document document = bundleResolver.getBundleItem(string, BundleResolver.BundleItem.POLICY, true);
        if (document != null) {
            stringArray = b;
            object6 = GatewayManagementDocumentUtilities.getEntityElements(document.getDocumentElement(), stringArray[16]);
            object5 = object6.iterator();
            while (object5.hasNext()) {
                object4 = (Element)object5.next();
                element = GatewayManagementDocumentUtilities.getPolicyResourceElement((Element)object4, (stringArray = b)[34], BundleUtils.b((Element)object4));
                if (element == null) continue;
                object3 = BundleUtils.searchForJdbcReferences(element, stringArray[34], BundleUtils.b((Element)object4));
                object2 = object3.iterator();
                while (object2.hasNext()) {
                    object = (String)object2.next();
                    bundleInfo.addJdbcReference((String)object);
                }
            }
        }
        if ((object6 = bundleResolver.getBundleItem(string, BundleResolver.BundleItem.SERVICE, true)) != null) {
            stringArray = b;
            object5 = GatewayManagementDocumentUtilities.getEntityElements(object6.getDocumentElement(), stringArray[15]);
            object4 = object5.iterator();
            while (object4.hasNext()) {
                element = (Element)object4.next();
                object3 = GatewayManagementDocumentUtilities.getPolicyResourceElement(element, (stringArray = b)[20], BundleUtils.a(element));
                if (object3 == null) continue;
                object2 = BundleUtils.searchForJdbcReferences((Element)object3, stringArray[20], BundleUtils.a(element));
                object = object2.iterator();
                while (object.hasNext()) {
                    String string2 = (String)object.next();
                    bundleInfo.addJdbcReference(string2);
                }
            }
        }
    }

    public static Set<String> searchForJdbcReferences(Element element, String string, String string2) throws BundleResolver.InvalidBundleException {
        HashSet<String> hashSet = new HashSet<String>();
        if (element != null) {
            Document document = GatewayManagementDocumentUtilities.getPolicyDocumentFromResource(element, string, string2);
            List<Element> list = PolicyUtils.findJdbcReferences(document.getDocumentElement());
            for (Element element2 : list) {
                try {
                    String[] stringArray = b;
                    Element element3 = XmlUtil.findExactlyOneChildElementByName((Element)element2, (String)stringArray[19], (String)stringArray[12]);
                    String string3 = element3.getAttribute(stringArray[25]).trim();
                    hashSet.add(string3);
                }
                catch (MissingRequiredElementException | TooManyChildElementsException throwable) {
                    throw new BundleResolver.InvalidBundleException(b[6] + ExceptionUtils.getMessage((Throwable)throwable));
                }
            }
        }
        return hashSet;
    }

    public static Boolean hasActiveVersionMigrationBundleFile(BundleInfo bundleInfo, BundleResolver bundleResolver) throws BundleResolver.BundleResolverException, BundleResolver.UnknownBundleException, BundleResolver.InvalidBundleException {
        boolean bl2;
        bundleInfo.getPrerequisiteFolders();
        BundleResolver.BundleItem bundleItem = BundleResolver.BundleItem.MIGRATION_BUNDLE;
        bundleItem.setVersion(bundleInfo.getVersion());
        for (String string : bundleInfo.getPrerequisiteFolders()) {
            try {
                if (bundleResolver.getBundleItem(bundleInfo.getId(), string, bundleItem, true) == null) continue;
                return true;
            }
            catch (BundleResolver.BundleResolverException bundleResolverException) {
                throw BundleUtils.a(bundleResolverException);
            }
        }
        try {
            bl2 = bundleResolver.getBundleItem(bundleInfo.getId(), bundleItem, true) != null;
        }
        catch (BundleResolver.BundleResolverException bundleResolverException) {
            throw BundleUtils.a(bundleResolverException);
        }
        return bl2;
    }

    public static Boolean hasWsmanFile(BundleInfo bundleInfo, BundleResolver bundleResolver) throws BundleResolver.BundleResolverException, BundleResolver.UnknownBundleException, BundleResolver.InvalidBundleException {
        boolean bl2;
        block17: {
            block16: {
                for (String string : bundleInfo.getPrerequisiteFolders()) {
                    try {
                        try {
                            if (bundleResolver.getBundleItem(bundleInfo.getId(), string, BundleResolver.BundleItem.POLICY, true) == null && bundleResolver.getBundleItem(bundleInfo.getId(), string, BundleResolver.BundleItem.ENCAPSULATED_ASSERTION, true) == null) continue;
                        }
                        catch (BundleResolver.BundleResolverException bundleResolverException) {
                            throw BundleUtils.a(bundleResolverException);
                        }
                        return true;
                    }
                    catch (BundleResolver.BundleResolverException bundleResolverException) {
                        throw BundleUtils.a(bundleResolverException);
                    }
                }
                try {
                    block15: {
                        try {
                            try {
                                try {
                                    try {
                                        if (bundleResolver.getBundleItem(bundleInfo.getId(), BundleResolver.BundleItem.FOLDER, true) != null || bundleResolver.getBundleItem(bundleInfo.getId(), BundleResolver.BundleItem.POLICY, true) != null) break block15;
                                    }
                                    catch (BundleResolver.BundleResolverException bundleResolverException) {
                                        throw BundleUtils.a(bundleResolverException);
                                    }
                                    if (bundleResolver.getBundleItem(bundleInfo.getId(), BundleResolver.BundleItem.ENCAPSULATED_ASSERTION, true) != null) break block15;
                                }
                                catch (BundleResolver.BundleResolverException bundleResolverException) {
                                    throw BundleUtils.a(bundleResolverException);
                                }
                                if (bundleResolver.getBundleItem(bundleInfo.getId(), BundleResolver.BundleItem.SERVICE, true) != null) break block15;
                            }
                            catch (BundleResolver.BundleResolverException bundleResolverException) {
                                throw BundleUtils.a(bundleResolverException);
                            }
                            if (bundleResolver.getBundleItem(bundleInfo.getId(), BundleResolver.BundleItem.ASSERTION, true) == null) break block16;
                        }
                        catch (BundleResolver.BundleResolverException bundleResolverException) {
                            throw BundleUtils.a(bundleResolverException);
                        }
                    }
                    bl2 = true;
                    break block17;
                }
                catch (BundleResolver.BundleResolverException bundleResolverException) {
                    throw BundleUtils.a(bundleResolverException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    private static String a(Element element) {
        return element.getAttribute(b[37]);
    }

    @NotNull
    private static String b(Element element) {
        String string;
        try {
            string = element.getAttribute(b[14]);
            if (string == null) {
                BundleUtils.a(8);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw BundleUtils.a(illegalArgumentException);
        }
        return string;
    }

    @Nullable
    private static JarFile a(Class clazz, String string) throws IOException {
        URLConnection uRLConnection;
        JarFile jarFile = null;
        URL uRL = clazz.getResource(string);
        if (uRL != null && (uRLConnection = uRL.openConnection()) instanceof JarURLConnection) {
            JarURLConnection jarURLConnection = (JarURLConnection)uRL.openConnection();
            jarFile = jarURLConnection.getJarFile();
        }
        return jarFile;
    }

    @NotNull
    private static List<JarEntry> a(@NotNull JarFile jarFile, @NotNull String string) throws BundleResolver.InvalidBundleException {
        ArrayList<JarEntry> arrayList;
        try {
            if (jarFile == null) {
                BundleUtils.a(9);
            }
        }
        catch (BundleResolver.InvalidBundleException invalidBundleException) {
            throw BundleUtils.a(invalidBundleException);
        }
        try {
            if (string == null) {
                BundleUtils.a(10);
            }
        }
        catch (BundleResolver.InvalidBundleException invalidBundleException) {
            throw BundleUtils.a(invalidBundleException);
        }
        ArrayList<JarEntry> arrayList2 = new ArrayList<JarEntry>();
        Enumeration<JarEntry> enumeration = jarFile.entries();
        while (enumeration.hasMoreElements()) {
            JarEntry jarEntry = enumeration.nextElement();
            String string2 = jarEntry.getName();
            String string3 = string.substring(1);
            try {
                try {
                    try {
                        if (!string2.startsWith(string3) || !jarEntry.isDirectory()) continue;
                    }
                    catch (BundleResolver.InvalidBundleException invalidBundleException) {
                        throw BundleUtils.a(invalidBundleException);
                    }
                    if (string2.indexOf("/", string3.length() + 1) != string2.length() - 1) continue;
                }
                catch (BundleResolver.InvalidBundleException invalidBundleException) {
                    throw BundleUtils.a(invalidBundleException);
                }
                a.fine(b[29] + string2);
                arrayList2.add(jarEntry);
            }
            catch (BundleResolver.InvalidBundleException invalidBundleException) {
                throw BundleUtils.a(invalidBundleException);
            }
        }
        try {
            arrayList = arrayList2;
            if (arrayList == null) {
                BundleUtils.a(11);
            }
        }
        catch (BundleResolver.InvalidBundleException invalidBundleException) {
            throw BundleUtils.a(invalidBundleException);
        }
        return arrayList;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[42];
                var3_1 = 0;
                var2_2 = "\u0015\u001e\u001fR\u001f }%\u0012\u0003_\u0002\u0018\u001f\u0014\u0001\t\tC\b8x8\b\u0005E\b\u0016K>\u0017\bT\u001f:*\u00115\u0003E#<a=[\u0001T\u0019!b5[IBCl~q\u0016\u0019B\u0019ic>\u000fLC\b=x#\u0015L_\u0018%a*9\u000f\u0018AWf\"?\bB]Z=h2\u0013BR\u0002$\"cK]\u0003By4~\u000b\u0003]\u0004*t|\u0019\u0019_\t%h*9\u000f\u0018AWf\"?\bB]Z=h2\u0013BR\u0002$\"cK]\u0003By4~\u000b\u0003]\u0004*t|\u0019\u0019_\t%h \u0012\u0014\u0019]\tic>\u000fLW\u0004'iq\u0011\bS\u000ei\u007f4\u001d\tC\b'n4\bV\u0011J\u0018\u0015\u001aP\u0001 iq\u0019\u0019_\t%hq\u001f\tR\u0001(\u007f0\u000f\u0005^\u0003g-\u0018\u001f@\u0011#(`4[\r_\tiI4\b\u000fC\u00049y8\u0014\u0002\u0011\u0000<~%[\r]\u0001io4[\u0002^\u0003ih<\u000b\u0018H-\u0013\u000e\u0002U\u0001,D?\u001d\u0003\u0011=;h#\u001e\u001dD\u0004:d%\u001e3w\u0002%i4\t\u001f\u0011\u0019(jq\u0012\u001f\u0011\b$}%\u0002B\u0007\u0007\u001e\u001eB\u0004&c\u00156\u001e\u0018s\u0018'i=\u001e%_\u000b&~\u0017\t\u0003\\'(\u007f>\u0010\t\u000bD\u0000,c%[\n^\u001fiM\u001f\u0014\u0018\u007f\u0018%aq\u000b\rC\f$h%\u001e\u001e\u0011Jl~v[\u0003WMl~\u007f^\u001f\u0011\u0000<~%[\u0002^\u0019io4[\u0002D\u0001%\u000e\u0012\u0014\u0002_\b*y8\u0014\u0002\u007f\f$h\u0004\u001f\u001a\u0001T\u00046\u000e\u0005U\u0007\u0002\u001e\u001eG\u0004*h\u0006\u0001\u0014\u0000X\u000e0$\u0004\u0015\u001fD\u001d9b#\u000f\tUM\u000bx?\u001f\u0000T$'k>U\u0014\\\u0001i{4\t\u001fX\u0002'7q\f2\u001a\u0000]\u0004'j\u0012\u0017\rB\u001e#9\u000f\u0018AWf\"&\f\u001b\u001f\u0001(t4\t[E\b*e\u007f\u0018\u0003\\B>~~\u000b\u0003]\u0004*t\u0007\u0002\u001e\u001eG\u0004*h#9\u000f\u0018AWf\"&\f\u001b\u001f\u0001(t4\t[E\b*e\u007f\u0018\u0003\\B>~~\u000b\u0003]\u0004*t\u00143\u000e\u0002U\u0001,G0\t(X\u001f,n%\u0014\u001eX\b:/9\u000f\u0018AWf\"?\bB]Z=h2\u0013BR\u0002$\"cK]\u0001By9~\u001c\rE\b>l(V\u0001P\u0003(j4\u0016\t_\u0019+2\u0014\u0001\u001e\u0001~y4\u0018\u0004\u001e\u001e,\u007f'\u001e\u001e\u001e\u001d&a8\u0018\u0015\u001e\u000f<c5\u0017\t\u001e/<c5\u0017\td\u0019 a\"\u000b\"\u000f\u001eX\u0003.[0\u0017\u0019T\u00147\u0012\u0002U,%a\u0013\u000e\u0002U\u0001,H?\u000f\u001eX\b:*\u0012\u0014\u0019]\tic>\u000fLP\u000e*h\"\bLW\u0004%hq\t\tB\u0002<\u007f2\u001e\u001f\u0011\u000b&\u007fq\u0019\u0019_\t%h\u00163\u000e\u0002U\u0001,_4\b\u0003D\u001f*h\u0013\u001a\u001fT#(`4\u0015\u0017\u0014\u0019_\tio$\u0015\b]\bik>\u0017\bT\u001fs-*\u0004\u0015\rS\u0001,-%\u0014LC\b(iq9\u0019_\t%h\u0018\u0015\n^C1`=[\nC\u0002$-3\u000e\u0002U\u0001,-+\u0004\u0015\rS\u0001,-%\u0014LA\f;~4[.D\u0003-a42\u0002W\u0002gu<\u0017LW\u001f&`q\u0019\u0019_\t%hq+2\u0014\u0001\u001e\u0001~y4\u0018\u0004\u001e\u001e,\u007f'\u001e\u001e\u001e\u001d&a8\u0018\u0015\u001e\u000f<c5\u0017\t\u001e/<c5\u0017\td\u0019 a\"\u000e6\u001e\u0018s\u0018'i=\u001e%_\u000b&~\u0006\u0001\u0014\u0000X\u000e0\u00147\u0012\u0002U,%a\u0013\u000e\u0002U\u0001,H?\u000f\u001eX\b:\u000e\u0013\u000e\u0002U\u0001,D?\u001d\u0003\u001f\u0015$a\u00028\u001f\u000e\u0013\u000e\u0002U\u0001,D?\u001d\u0003\u001f\u0015$a\r6\u001e\u0018a\u0002%d2\u0002+D\u0004-";
                var4_3 = "\u0015\u001e\u001fR\u001f }%\u0012\u0003_\u0002\u0018\u001f\u0014\u0001\t\tC\b8x8\b\u0005E\b\u0016K>\u0017\bT\u001f:*\u00115\u0003E#<a=[\u0001T\u0019!b5[IBCl~q\u0016\u0019B\u0019ic>\u000fLC\b=x#\u0015L_\u0018%a*9\u000f\u0018AWf\"?\bB]Z=h2\u0013BR\u0002$\"cK]\u0003By4~\u000b\u0003]\u0004*t|\u0019\u0019_\t%h*9\u000f\u0018AWf\"?\bB]Z=h2\u0013BR\u0002$\"cK]\u0003By4~\u000b\u0003]\u0004*t|\u0019\u0019_\t%h \u0012\u0014\u0019]\tic>\u000fLW\u0004'iq\u0011\bS\u000ei\u007f4\u001d\tC\b'n4\bV\u0011J\u0018\u0015\u001aP\u0001 iq\u0019\u0019_\t%hq\u001f\tR\u0001(\u007f0\u000f\u0005^\u0003g-\u0018\u001f@\u0011#(`4[\r_\tiI4\b\u000fC\u00049y8\u0014\u0002\u0011\u0000<~%[\r]\u0001io4[\u0002^\u0003ih<\u000b\u0018H-\u0013\u000e\u0002U\u0001,D?\u001d\u0003\u0011=;h#\u001e\u001dD\u0004:d%\u001e3w\u0002%i4\t\u001f\u0011\u0019(jq\u0012\u001f\u0011\b$}%\u0002B\u0007\u0007\u001e\u001eB\u0004&c\u00156\u001e\u0018s\u0018'i=\u001e%_\u000b&~\u0017\t\u0003\\'(\u007f>\u0010\t\u000bD\u0000,c%[\n^\u001fiM\u001f\u0014\u0018\u007f\u0018%aq\u000b\rC\f$h%\u001e\u001e\u0011Jl~v[\u0003WMl~\u007f^\u001f\u0011\u0000<~%[\u0002^\u0019io4[\u0002D\u0001%\u000e\u0012\u0014\u0002_\b*y8\u0014\u0002\u007f\f$h\u0004\u001f\u001a\u0001T\u00046\u000e\u0005U\u0007\u0002\u001e\u001eG\u0004*h\u0006\u0001\u0014\u0000X\u000e0$\u0004\u0015\u001fD\u001d9b#\u000f\tUM\u000bx?\u001f\u0000T$'k>U\u0014\\\u0001i{4\t\u001fX\u0002'7q\f2\u001a\u0000]\u0004'j\u0012\u0017\rB\u001e#9\u000f\u0018AWf\"&\f\u001b\u001f\u0001(t4\t[E\b*e\u007f\u0018\u0003\\B>~~\u000b\u0003]\u0004*t\u0007\u0002\u001e\u001eG\u0004*h#9\u000f\u0018AWf\"&\f\u001b\u001f\u0001(t4\t[E\b*e\u007f\u0018\u0003\\B>~~\u000b\u0003]\u0004*t\u00143\u000e\u0002U\u0001,G0\t(X\u001f,n%\u0014\u001eX\b:/9\u000f\u0018AWf\"?\bB]Z=h2\u0013BR\u0002$\"cK]\u0001By9~\u001c\rE\b>l(V\u0001P\u0003(j4\u0016\t_\u0019+2\u0014\u0001\u001e\u0001~y4\u0018\u0004\u001e\u001e,\u007f'\u001e\u001e\u001e\u001d&a8\u0018\u0015\u001e\u000f<c5\u0017\t\u001e/<c5\u0017\td\u0019 a\"\u000b\"\u000f\u001eX\u0003.[0\u0017\u0019T\u00147\u0012\u0002U,%a\u0013\u000e\u0002U\u0001,H?\u000f\u001eX\b:*\u0012\u0014\u0019]\tic>\u000fLP\u000e*h\"\bLW\u0004%hq\t\tB\u0002<\u007f2\u001e\u001f\u0011\u000b&\u007fq\u0019\u0019_\t%h\u00163\u000e\u0002U\u0001,_4\b\u0003D\u001f*h\u0013\u001a\u001fT#(`4\u0015\u0017\u0014\u0019_\tio$\u0015\b]\bik>\u0017\bT\u001fs-*\u0004\u0015\rS\u0001,-%\u0014LC\b(iq9\u0019_\t%h\u0018\u0015\n^C1`=[\nC\u0002$-3\u000e\u0002U\u0001,-+\u0004\u0015\rS\u0001,-%\u0014LA\f;~4[.D\u0003-a42\u0002W\u0002gu<\u0017LW\u001f&`q\u0019\u0019_\t%hq+2\u0014\u0001\u001e\u0001~y4\u0018\u0004\u001e\u001e,\u007f'\u001e\u001e\u001e\u001d&a8\u0018\u0015\u001e\u000f<c5\u0017\t\u001e/<c5\u0017\td\u0019 a\"\u000e6\u001e\u0018s\u0018'i=\u001e%_\u000b&~\u0006\u0001\u0014\u0000X\u000e0\u00147\u0012\u0002U,%a\u0013\u000e\u0002U\u0001,H?\u000f\u001eX\b:\u000e\u0013\u000e\u0002U\u0001,D?\u001d\u0003\u001f\u0015$a\u00028\u001f\u000e\u0013\u000e\u0002U\u0001,D?\u001d\u0003\u001f\u0015$a\r6\u001e\u0018a\u0002%d2\u0002+D\u0004-".length();
                var1_4 = 11;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 18;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block9;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = BundleUtils.a(v0, BundleUtils.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "(\t\rd\u00176{\u000e%\r\u000b`\u000b4z.\r6L\u00185m";
                    var4_3 = "(\t\rd\u00176{\u000e%\r\u000b`\u000b4z.\r6L\u00185m".length();
                    var1_4 = 7;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 1;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block9;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = BundleUtils.a(v0, BundleUtils.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block10;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        BundleUtils.b = var5;
        BundleUtils.L7_NS_GW_MGMT = BundleUtils.b[23];
        BundleUtils.L7_NS_POLICY = BundleUtils.b[21];
        BundleUtils.NS_BUNDLE = BundleUtils.b[5];
        BundleUtils.a = Logger.getLogger(BundleUtils.class.getName());
    }

    /*
     * Exception decompiling
     */
    private static /* synthetic */ void a(int var0) {
        /*
         * This method has failed to decompile.  When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
         * 
         * org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [0[TRYBLOCK]], but top level block is 6[SWITCH]
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:435)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:484)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
         *     at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
         *     at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1050)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
         *     at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
         *     at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
         *     at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
         *     at org.benf.cfr.reader.Main.main(Main.java:54)
         */
        throw new IllegalStateException("Decompilation failed");
    }

    private static Exception a(Exception exception) {
        return exception;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x1F);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 67;
                    case 1 -> 105;
                    case 2 -> 126;
                    case 3 -> 35;
                    case 4 -> 127;
                    case 5 -> 91;
                    default -> 31;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

