/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.util.ClassFilter
 *  com.l7tech.util.ClassFilterBuilder
 *  com.l7tech.util.ClassFilterObjectInputStream
 *  com.l7tech.util.ClassNotPermittedException
 *  com.l7tech.util.ConfigFactory
 *  com.l7tech.util.FileUtils
 *  com.l7tech.util.FileUtils$ByteSaver
 *  com.l7tech.util.FileUtils$Saver
 *  com.l7tech.util.IOUtils
 *  com.l7tech.util.PoolByteArrayOutputStream
 *  com.l7tech.util.ResourceUtils
 *  org.jetbrains.annotations.NotNull
 */
package com.l7tech.server.security.keystore.ncipher;

import com.l7tech.server.security.keystore.ncipher.a;
import com.l7tech.server.security.keystore.ncipher.b;
import com.l7tech.util.ClassFilter;
import com.l7tech.util.ClassFilterBuilder;
import com.l7tech.util.ClassFilterObjectInputStream;
import com.l7tech.util.ClassNotPermittedException;
import com.l7tech.util.ConfigFactory;
import com.l7tech.util.FileUtils;
import com.l7tech.util.IOUtils;
import com.l7tech.util.PoolByteArrayOutputStream;
import com.l7tech.util.ResourceUtils;
import java.io.ByteArrayInputStream;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.security.KeyStoreException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import org.jetbrains.annotations.NotNull;

class NcipherKeyStoreData
implements Serializable {
    private static final Logger logger;
    private static final long serialVersionUID = -1890805696377529829L;
    private static final int MAX_DELETED_FILENAMES_TO_TRACK;
    private static final Pattern PAT_ALPHANUM;
    private static final Pattern PAT_ALPHANUM_WITH_DASH_AND_UNDERSCORE;
    private static final String APP_PREFIX_KEY_JCECSP;
    String keystoreMetadata;
    Map<String, byte[]> fileset = new HashMap<String, byte[]>();
    Set<String> deletedFilenames;
    @NotNull
    private static final ClassFilter CLASS_FILTER;
    private static final String[] a;

    private NcipherKeyStoreData(String string, Set<String> set) {
        this.keystoreMetadata = string;
        this.deletedFilenames = new LinkedHashSet<String>(set);
    }

    byte[] toBytes() throws KeyStoreException {
        this.validate();
        PoolByteArrayOutputStream poolByteArrayOutputStream = new PoolByteArrayOutputStream(8192);
        try {
            ObjectOutputStream objectOutputStream = new ObjectOutputStream((OutputStream)poolByteArrayOutputStream);
            objectOutputStream.writeObject(this);
            objectOutputStream.flush();
            byte[] byArray = poolByteArrayOutputStream.toByteArray();
            return byArray;
        }
        catch (IOException iOException) {
            throw new RuntimeException(iOException);
        }
        finally {
            ResourceUtils.closeQuietly((Closeable)poolByteArrayOutputStream);
        }
    }

    static List<String> readKeystoreIdentifiersFromLocalDisk(File file, Set<String> set) {
        if (set == null) {
            set = Collections.emptySet();
        }
        String[] stringArray = a;
        String string = stringArray[10];
        int n2 = stringArray[10].length();
        Pattern pattern = Pattern.compile(stringArray[3]);
        File[] fileArray = file.listFiles(new a());
        ArrayList<String> arrayList = new ArrayList<String>();
        for (File file2 : fileArray) {
            String string2 = file2.getName();
            try {
                if (!string2.startsWith(a[10])) {
                    continue;
                }
            }
            catch (RuntimeException runtimeException) {
                throw NcipherKeyStoreData.a(runtimeException);
            }
            try {
                if (string2.length() < n2 + 40) {
                    continue;
                }
            }
            catch (RuntimeException runtimeException) {
                throw NcipherKeyStoreData.a(runtimeException);
            }
            String string3 = string2.substring(n2);
            try {
                if (!pattern.matcher(string3).matches()) {
                    continue;
                }
            }
            catch (RuntimeException runtimeException) {
                throw NcipherKeyStoreData.a(runtimeException);
            }
            try {
                if (set.contains(string3)) {
                    continue;
                }
            }
            catch (RuntimeException runtimeException) {
                throw NcipherKeyStoreData.a(runtimeException);
            }
            arrayList.add(string3);
        }
        return arrayList;
    }

    static NcipherKeyStoreData createFromLocalDisk(String string, File file) throws IOException, KeyStoreException {
        NcipherKeyStoreData ncipherKeyStoreData = new NcipherKeyStoreData(string, Collections.emptySet());
        ncipherKeyStoreData.loadFilesetFromLocalDisk(file);
        return ncipherKeyStoreData;
    }

    static NcipherKeyStoreData createFromBytes(byte[] byArray) throws IOException {
        NcipherKeyStoreData ncipherKeyStoreData;
        try {
            if (byArray == null) {
                throw new NullPointerException(a[34]);
            }
        }
        catch (Throwable throwable) {
            throw NcipherKeyStoreData.a(throwable);
        }
        try {
            if (byArray.length < 1) {
                throw new IOException(a[42]);
            }
        }
        catch (Throwable throwable) {
            throw NcipherKeyStoreData.a(throwable);
        }
        ClassFilterObjectInputStream classFilterObjectInputStream = new ClassFilterObjectInputStream((InputStream)new ByteArrayInputStream(byArray), CLASS_FILTER);
        try {
            Object object = classFilterObjectInputStream.readObject();
            try {
                if (object == null) {
                    throw new IOException(a[23]);
                }
            }
            catch (Throwable throwable) {
                throw NcipherKeyStoreData.a(throwable);
            }
            try {
                if (!(object instanceof NcipherKeyStoreData)) {
                    throw new IOException(a[28] + String.valueOf(object.getClass()));
                }
            }
            catch (Throwable throwable) {
                throw NcipherKeyStoreData.a(throwable);
            }
            ncipherKeyStoreData = (NcipherKeyStoreData)object;
        }
        catch (Throwable throwable) {
            try {
                try {
                    classFilterObjectInputStream.close();
                }
                catch (Throwable throwable2) {
                    throwable.addSuppressed(throwable2);
                }
                throw throwable;
            }
            catch (ClassNotPermittedException | ClassNotFoundException throwable3) {
                throw new IOException(throwable3);
            }
        }
        classFilterObjectInputStream.close();
        return ncipherKeyStoreData;
    }

    void validate() throws KeyStoreException {
        block17: {
            try {
                if (this.keystoreMetadata == null) {
                    throw new KeyStoreException(a[39]);
                }
            }
            catch (KeyStoreException keyStoreException) {
                throw NcipherKeyStoreData.a(keyStoreException);
            }
            try {
                if (this.keystoreMetadata.length() < 40) {
                    throw new KeyStoreException(a[16]);
                }
            }
            catch (KeyStoreException keyStoreException) {
                throw NcipherKeyStoreData.a(keyStoreException);
            }
            try {
                if (!PAT_ALPHANUM.matcher(this.keystoreMetadata).matches()) {
                    throw new KeyStoreException(a[33]);
                }
            }
            catch (KeyStoreException keyStoreException) {
                throw NcipherKeyStoreData.a(keyStoreException);
            }
            try {
                try {
                    if (this.fileset != null && !this.fileset.isEmpty()) break block17;
                }
                catch (KeyStoreException keyStoreException) {
                    throw NcipherKeyStoreData.a(keyStoreException);
                }
                return;
            }
            catch (KeyStoreException keyStoreException) {
                throw NcipherKeyStoreData.a(keyStoreException);
            }
        }
        for (Map.Entry<String, byte[]> entry : this.fileset.entrySet()) {
            String string = entry.getKey();
            byte[] byArray = entry.getValue();
            try {
                if (byArray == null) {
                    throw new KeyStoreException(a[17]);
                }
            }
            catch (KeyStoreException keyStoreException) {
                throw NcipherKeyStoreData.a(keyStoreException);
            }
            NcipherKeyStoreData.validateName(string, a[13]);
        }
    }

    private static void validateName(String string, String string2) throws KeyStoreException {
        try {
            if (string == null) {
                throw new KeyStoreException(string2 + a[25]);
            }
        }
        catch (KeyStoreException keyStoreException) {
            throw NcipherKeyStoreData.a(keyStoreException);
        }
        try {
            if (string.length() < 1) {
                throw new KeyStoreException(string2 + a[30]);
            }
        }
        catch (KeyStoreException keyStoreException) {
            throw NcipherKeyStoreData.a(keyStoreException);
        }
        try {
            if (!PAT_ALPHANUM_WITH_DASH_AND_UNDERSCORE.matcher(string).matches()) {
                throw new KeyStoreException(string2 + a[7] + string);
            }
        }
        catch (KeyStoreException keyStoreException) {
            throw NcipherKeyStoreData.a(keyStoreException);
        }
        try {
            if (a[11].equalsIgnoreCase(string)) {
                throw new KeyStoreException(string2 + a[9] + string);
            }
        }
        catch (KeyStoreException keyStoreException) {
            throw NcipherKeyStoreData.a(keyStoreException);
        }
        try {
            if (string.toLowerCase().startsWith(a[5])) {
                throw new KeyStoreException(string2 + a[6] + string);
            }
        }
        catch (KeyStoreException keyStoreException) {
            throw NcipherKeyStoreData.a(keyStoreException);
        }
        try {
            if (string.toLowerCase().startsWith(a[21])) {
                throw new KeyStoreException(string2 + a[36] + string);
            }
        }
        catch (KeyStoreException keyStoreException) {
            throw NcipherKeyStoreData.a(keyStoreException);
        }
        try {
            if (!string.startsWith(a[15])) {
                throw new KeyStoreException(string2 + a[20] + string);
            }
        }
        catch (KeyStoreException keyStoreException) {
            throw NcipherKeyStoreData.a(keyStoreException);
        }
    }

    void loadFilesetFromLocalDisk(File file) throws IOException, KeyStoreException {
        String[] stringArray = a;
        String string = stringArray[10] + this.keystoreMetadata;
        File[] fileArray = file.listFiles(new b(this, string));
        this.fileset = new HashMap<String, byte[]>();
        for (File file2 : fileArray) {
            String string2 = file2.getName();
            try {
                try {
                    NcipherKeyStoreData.validateName(string2, a[0]);
                    if (this.deletedFilenames != null && this.deletedFilenames.contains(string2)) {
                        continue;
                    }
                }
                catch (IOException iOException) {
                    throw NcipherKeyStoreData.a(iOException);
                }
            }
            catch (IOException iOException) {
                throw NcipherKeyStoreData.a(iOException);
            }
            byte[] byArray = IOUtils.slurpFile((File)file2);
            try {
                if (this.fileset.containsKey(string2)) {
                    throw new KeyStoreException(a[40] + string2);
                }
            }
            catch (IOException iOException) {
                throw NcipherKeyStoreData.a(iOException);
            }
            this.fileset.put(string2, byArray);
        }
    }

    void addDeletedFiles(Set<String> set) {
        try {
            if (set == null) {
                throw new NullPointerException(a[38]);
            }
        }
        catch (RuntimeException runtimeException) {
            throw NcipherKeyStoreData.a(runtimeException);
        }
        try {
            if (this.deletedFilenames == null) {
                this.deletedFilenames = new LinkedHashSet<String>();
            }
        }
        catch (RuntimeException runtimeException) {
            throw NcipherKeyStoreData.a(runtimeException);
        }
        this.deletedFilenames.addAll(set);
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     * Loose catch block
     */
    Set<String> saveFilesetToLocalDisk(File file) throws IOException, KeyStoreException {
        HashSet<String> hashSet;
        try {
            this.validate();
            if (!file.isDirectory()) {
                throw new IOException(a[41] + String.valueOf(file));
            }
        }
        catch (IOException iOException) {
            throw NcipherKeyStoreData.a(iOException);
        }
        try {
            if (!file.canWrite()) {
                throw new IOException(a[14] + String.valueOf(file));
            }
        }
        catch (IOException iOException) {
            throw NcipherKeyStoreData.a(iOException);
        }
        HashSet<String> hashSet2 = new HashSet<String>();
        boolean bl2 = true;
        try {
            for (Map.Entry<String, byte[]> entry : this.fileset.entrySet()) {
                File file2;
                byte[] byArray;
                String string;
                block28: {
                    block27: {
                        string = entry.getKey();
                        if (this.deletedFilenames == null) break block27;
                        try {
                            if (this.deletedFilenames.contains(string)) {
                                continue;
                            }
                            break block27;
                            catch (IOException iOException) {
                                throw NcipherKeyStoreData.a(iOException);
                            }
                        }
                        catch (IOException iOException) {
                            throw NcipherKeyStoreData.a(iOException);
                        }
                    }
                    byArray = entry.getValue();
                    String[] stringArray = a;
                    file2 = new File(file, stringArray[4] + string);
                    File file3 = new File(file, string);
                    try {
                        if (file3.isDirectory()) {
                            throw new IOException(stringArray[29] + String.valueOf(file3));
                        }
                    }
                    catch (IOException iOException) {
                        throw NcipherKeyStoreData.a(iOException);
                    }
                    if (!file3.exists()) break block28;
                    try {
                        block29: {
                            if (file3.canWrite()) break block28;
                            break block29;
                            catch (IOException iOException) {
                                throw NcipherKeyStoreData.a(iOException);
                            }
                        }
                        throw new IOException(a[43] + String.valueOf(file3));
                    }
                    catch (IOException iOException) {
                        throw NcipherKeyStoreData.a(iOException);
                    }
                }
                hashSet2.add(string);
                FileUtils.save((File)file2, (boolean)true, (FileUtils.Saver)new FileUtils.ByteSaver(byArray));
            }
            bl2 = false;
            hashSet = hashSet2;
        }
        catch (Throwable throwable) {
            try {
                if (bl2) {
                    NcipherKeyStoreData.rollbackWrittenFiles(file, hashSet2);
                }
            }
            catch (IOException iOException) {
                throw NcipherKeyStoreData.a(iOException);
            }
            throw throwable;
        }
        try {
            if (bl2) {
                NcipherKeyStoreData.rollbackWrittenFiles(file, hashSet2);
            }
        }
        catch (IOException iOException) {
            throw NcipherKeyStoreData.a(iOException);
        }
        return hashSet;
    }

    void commitWrittenFiles(File file, Set<String> set) throws IOException {
        File file2;
        Iterator<String> iterator;
        Iterator<String> iterator2 = set.iterator();
        while (iterator2.hasNext()) {
            File object;
            String[] stringArray;
            block21: {
                iterator = iterator2.next();
                stringArray = a;
                object = new File(file, stringArray[4] + iterator);
                file2 = new File(file, (String)((Object)iterator));
                try {
                    try {
                        if (!file2.exists() || file2.delete()) break block21;
                    }
                    catch (IOException iOException) {
                        throw NcipherKeyStoreData.a(iOException);
                    }
                    logger.warning(a[27] + String.valueOf(file2));
                }
                catch (IOException iOException) {
                    throw NcipherKeyStoreData.a(iOException);
                }
            }
            try {
                if (object.renameTo(file2)) {
                    iterator2.remove();
                    continue;
                }
            }
            catch (IOException iOException) {
                throw NcipherKeyStoreData.a(iOException);
            }
            stringArray = a;
            logger.warning(stringArray[1] + String.valueOf(object) + stringArray[26] + String.valueOf(file2));
        }
        if (this.deletedFilenames != null) {
            for (String string : this.deletedFilenames) {
                file2 = new File(file, string);
                if (!file2.exists()) continue;
                boolean bl2 = file2.delete();
                try {
                    if (bl2) continue;
                    logger.warning(a[2] + String.valueOf(file2));
                }
                catch (IOException iOException) {
                    throw NcipherKeyStoreData.a(iOException);
                }
            }
        }
        try {
            if (!set.isEmpty()) {
                throw new IOException(a[18]);
            }
        }
        catch (IOException iOException) {
            throw NcipherKeyStoreData.a(iOException);
        }
        if (this.deletedFilenames != null) {
            iterator = this.deletedFilenames.iterator();
            try {
                while (true) {
                    try {
                        if (!iterator.hasNext() || this.deletedFilenames.size() <= MAX_DELETED_FILENAMES_TO_TRACK) break;
                    }
                    catch (IOException iOException) {
                        throw NcipherKeyStoreData.a(iOException);
                    }
                    iterator.next();
                    iterator.remove();
                }
            }
            catch (IOException iOException) {
                throw NcipherKeyStoreData.a(iOException);
            }
        }
    }

    static void rollbackWrittenFiles(File file, Set<String> set) {
        for (String string : set) {
            String[] stringArray = a;
            File file2 = new File(file, stringArray[35] + string);
            try {
                try {
                    if (!file2.exists() || file2.delete()) continue;
                }
                catch (RuntimeException runtimeException) {
                    throw NcipherKeyStoreData.a(runtimeException);
                }
                logger.warning(a[24] + String.valueOf(file2));
            }
            catch (RuntimeException runtimeException) {
                throw NcipherKeyStoreData.a(runtimeException);
            }
        }
    }

    @NotNull
    private static ClassFilter createClassFilter() {
        ClassFilter classFilter;
        try {
            classFilter = new ClassFilterBuilder().addClasses(false, new String[]{NcipherKeyStoreData.class.getName(), String.class.getName(), LinkedHashSet.class.getName(), HashSet.class.getName(), HashMap.class.getName(), a[22]}).build();
            if (classFilter == null) {
                NcipherKeyStoreData.$$$reportNull$$$0(0);
            }
        }
        catch (RuntimeException runtimeException) {
            throw NcipherKeyStoreData.a(runtimeException);
        }
        return classFilter;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[44];
                var3_1 = 0;
                var2_2 = "K,H`6D\u0019j-\tn5@]>,jk*I\\lbBg#RMq0L\"<HU{1LvzGKq/\tn5BXrbMk)J\u0003>$@n?R\\jbJm4UXw,Z\"3OO\u007f.@fzGPr'Gc7D\u0003>\u0016X#@n?E\u0019j-\tp?OXs'\td(NT>\u0016X#@n?E\u0019j-\tf?M\\j'\td3M\\>\u000e@\u0019\u0019/c@\u0014x\u001fR6j\\\u001d\u0005A,Lu\u0005\u0007s-Mw6Df x+Eg)DM>!Fl.@Pp1\t 7N]k.L zGPr'\u0013\"&x+Eg4@T{bJm4UXw,Z\"3MU{%HnzBQ\u007f0Ha.DKmx\t\u0011}0Lc.Dzr#Zq\u001cHUj'[\u001fx+Eg)DM>!Fl.@Pp1\t -NKr&\u000b\"<HU{x\t\u000bu'P]0B\\}1Y]\u0005i-[n>?}-D-6\u0016M{!A-)DKh'[-)DZk0@v#\u000eR{;Zv5S\\1,Jk*I\\lmga3QQ{0bg#rMq0LF;UXJP!@r2DKU'PQ.NK{\u0006Hv;\u0001O\u007f.@f;UPq,\td;HU{&\u0013\"<HU{1LvzBVp6Hk4R\u0019w,_c6H]>$@n?OXs'\u0013\"\u001eK,H`6D\u0019j-\tu(HM{b]mzEPl'Jv5S@$b\u000bu'P]0B\\}1Y]EP!@r2DKU'PQ.NK{\u0006Hv;\u0001O\u007f.@f;UPq,\td;HU{&\u0013\"1D@m6Fp?l\\j#Mc.@\u0019w1\tv5N\u0019m*Fp.\u000fOP!@r2DKU'PQ.NK{\u0006Hv;\u0001O\u007f.@f;UPq,\td;HU{&\u0013\"<HU{1LvzBVp6Hk4R\u0019x+EgzVPj*\tl/MU>!Fl.DWj1NP-]\";MU>$@n?R\u0019w,\tv2D\u0019x+Eg)DM>!Fw6E\u0019|'\tp?OXs'M\"3OMqbYn;B\\>jYg(LPm1@m4\u0001Il-Kn?L\u00067\u000e@\u0019H/ `\u0014Dr\u0004;\u0007\n\u001d,x+Eg4@T{bMm?R\u0019p-]\"8D^w,\tu3UQ>`Bg#~S}'Jq*~\u001b$b\u0005}#[f\u0005\u0002E\u0000*P!@r2DK>)L{)UVl'\tf;UX>&Lq?SP\u007f.@x?E\u0019j-\tl/MU#X#@n?E\u0019j-\tf?M\\j'\td3M\\>-G\"(NUr Ha1\u001b\u0019\fp#DgzHJ>,\\n6\u0004>6F\"BX#@n?E\u0019j-\tf?M\\j'\tg\"HJj+GezGPr'\t*-HUrbHv.DTn6\tv5\u0001K{,Ho?\u0001Vh'[\".NI7x\t7P!@r2DK>)L{)UVl'\tf;UX>&Lq?SP\u007f.@x?E\u0019j-\tw4DAn'Jv?E\u0019j;Yg`\u0001JK,H`6D\u0019j-\tq;W\\>$@n?\u0001[{!Hw)D\u0019\u007fbMk(DZj-[{zVPj*\tv2D\u0019m#DgzOXs'\tk)\u0001Ppb]j?\u0001N\u007f;\u0013\"\rp#DgzHJ>'Dr.X\u0011@\u0019H/ `\u0014Dr\u0004;\u0005}\u0014Ci\r*^\fFv\u0014TUrbDg.IVzb\fqt\u0004J>/\\q.\u0001Wq6\tp?ULl,\tl/MUSP!@r2DKU'PQ.NK{\u0006Hv;\u0001O\u007f.@f;UPq,\td;HU{&\u0013\"1D@m6Fp?l\\j#Mc.@\u0019}-Gv;HWmb@n6D^\u007f.\ta2@K\u007f!]g(R\u001ep\u0001@r2DK>)L{)UVl'\t`#U\\mb@qzOLr.\u0005A,Lu\u0005\u001ex+Eg)DM>!Fl.@Pp1\t 9@Kz`\td3M\\$b/}-D,6\u0016M{!A,1D@m6Fp?\u000fW}+Yj?S\u0017s#QF?M\\j'MD3M\\p#Dg)\u001cs-[g\u001eDU{6LfzLLm6\t`?\u0001Il-_k>D]CP!@r2DKU'PQ.NK{\u0006Hv;\u0001O\u007f.@f;UPq,\td;HU{&\u0013\"\u0014N\u0019u'Pq.NK{\u000fLv;EXj#\tr(DJ{,],^K,H`6D\u0019j-\tn5@]>,jk*I\\lbBg#RMq0L\"<HU{1LvzGKq/\tn5BXrbMk)J\u0003>$@n?R\\jbJm4UXw,Z\">TIr+Jc.D\u0019x+Eg4@T{x\t\u0011P-]\";\u0001]w0La.NKgx\t";
                var4_3 = "K,H`6D\u0019j-\tn5@]>,jk*I\\lbBg#RMq0L\"<HU{1LvzGKq/\tn5BXrbMk)J\u0003>$@n?R\\jbJm4UXw,Z\"3OO\u007f.@fzGPr'Gc7D\u0003>\u0016X#@n?E\u0019j-\tp?OXs'\td(NT>\u0016X#@n?E\u0019j-\tf?M\\j'\td3M\\>\u000e@\u0019\u0019/c@\u0014x\u001fR6j\\\u001d\u0005A,Lu\u0005\u0007s-Mw6Df x+Eg)DM>!Fl.@Pp1\t 7N]k.L zGPr'\u0013\"&x+Eg4@T{bJm4UXw,Z\"3MU{%HnzBQ\u007f0Ha.DKmx\t\u0011}0Lc.Dzr#Zq\u001cHUj'[\u001fx+Eg)DM>!Fl.@Pp1\t -NKr&\u000b\"<HU{x\t\u000bu'P]0B\\}1Y]\u0005i-[n>?}-D-6\u0016M{!A-)DKh'[-)DZk0@v#\u000eR{;Zv5S\\1,Jk*I\\lmga3QQ{0bg#rMq0LF;UXJP!@r2DKU'PQ.NK{\u0006Hv;\u0001O\u007f.@f;UPq,\td;HU{&\u0013\"<HU{1LvzBVp6Hk4R\u0019w,_c6H]>$@n?OXs'\u0013\"\u001eK,H`6D\u0019j-\tu(HM{b]mzEPl'Jv5S@$b\u000bu'P]0B\\}1Y]EP!@r2DKU'PQ.NK{\u0006Hv;\u0001O\u007f.@f;UPq,\td;HU{&\u0013\"1D@m6Fp?l\\j#Mc.@\u0019w1\tv5N\u0019m*Fp.\u000fOP!@r2DKU'PQ.NK{\u0006Hv;\u0001O\u007f.@f;UPq,\td;HU{&\u0013\"<HU{1LvzBVp6Hk4R\u0019x+EgzVPj*\tl/MU>!Fl.DWj1NP-]\";MU>$@n?R\u0019w,\tv2D\u0019x+Eg)DM>!Fw6E\u0019|'\tp?OXs'M\"3OMqbYn;B\\>jYg(LPm1@m4\u0001Il-Kn?L\u00067\u000e@\u0019H/ `\u0014Dr\u0004;\u0007\n\u001d,x+Eg4@T{bMm?R\u0019p-]\"8D^w,\tu3UQ>`Bg#~S}'Jq*~\u001b$b\u0005}#[f\u0005\u0002E\u0000*P!@r2DK>)L{)UVl'\tf;UX>&Lq?SP\u007f.@x?E\u0019j-\tl/MU#X#@n?E\u0019j-\tf?M\\j'\td3M\\>-G\"(NUr Ha1\u001b\u0019\fp#DgzHJ>,\\n6\u0004>6F\"BX#@n?E\u0019j-\tf?M\\j'\tg\"HJj+GezGPr'\t*-HUrbHv.DTn6\tv5\u0001K{,Ho?\u0001Vh'[\".NI7x\t7P!@r2DK>)L{)UVl'\tf;UX>&Lq?SP\u007f.@x?E\u0019j-\tw4DAn'Jv?E\u0019j;Yg`\u0001JK,H`6D\u0019j-\tq;W\\>$@n?\u0001[{!Hw)D\u0019\u007fbMk(DZj-[{zVPj*\tv2D\u0019m#DgzOXs'\tk)\u0001Ppb]j?\u0001N\u007f;\u0013\"\rp#DgzHJ>'Dr.X\u0011@\u0019H/ `\u0014Dr\u0004;\u0005}\u0014Ci\r*^\fFv\u0014TUrbDg.IVzb\fqt\u0004J>/\\q.\u0001Wq6\tp?ULl,\tl/MUSP!@r2DKU'PQ.NK{\u0006Hv;\u0001O\u007f.@f;UPq,\td;HU{&\u0013\"1D@m6Fp?l\\j#Mc.@\u0019}-Gv;HWmb@n6D^\u007f.\ta2@K\u007f!]g(R\u001ep\u0001@r2DK>)L{)UVl'\t`#U\\mb@qzOLr.\u0005A,Lu\u0005\u001ex+Eg)DM>!Fl.@Pp1\t 9@Kz`\td3M\\$b/}-D,6\u0016M{!A,1D@m6Fp?\u000fW}+Yj?S\u0017s#QF?M\\j'MD3M\\p#Dg)\u001cs-[g\u001eDU{6LfzLLm6\t`?\u0001Il-_k>D]CP!@r2DKU'PQ.NK{\u0006Hv;\u0001O\u007f.@f;UPq,\td;HU{&\u0013\"\u0014N\u0019u'Pq.NK{\u000fLv;EXj#\tr(DJ{,],^K,H`6D\u0019j-\tn5@]>,jk*I\\lbBg#RMq0L\"<HU{1LvzGKq/\tn5BXrbMk)J\u0003>$@n?R\\jbJm4UXw,Z\">TIr+Jc.D\u0019x+Eg4@T{x\t\u0011P-]\";\u0001]w0La.NKgx\t".length();
                var1_4 = 92;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = NcipherKeyStoreData.a(v0, NcipherKeyStoreData.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "\"S\u0012 `\u0016\u0019l{\u001e){\u0007\u0004>u[2q\u0007\u000e?0\u0012#(\u0016\u0006<d\u0002\u001a\u0019~\u001a2d\u0016K8\u007f[?~\u0016\u0019;b\u0012$mS\r%|\u001ej(";
                    var4_3 = "\"S\u0012 `\u0016\u0019l{\u001e){\u0007\u0004>u[2q\u0007\u000e?0\u0012#(\u0016\u0006<d\u0002\u001a\u0019~\u001a2d\u0016K8\u007f[?~\u0016\u0019;b\u0012$mS\r%|\u001ej(".length();
                    var1_4 = 31;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 66;
                        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++] = NcipherKeyStoreData.a(v0, NcipherKeyStoreData.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;
            }
        }
        NcipherKeyStoreData.a = var5;
        NcipherKeyStoreData.APP_PREFIX_KEY_JCECSP = NcipherKeyStoreData.a[10];
        NcipherKeyStoreData.logger = Logger.getLogger(NcipherKeyStoreData.class.getName());
        var0_6 = NcipherKeyStoreData.a;
        NcipherKeyStoreData.MAX_DELETED_FILENAMES_TO_TRACK = ConfigFactory.getIntProperty((String)var0_6[37], (int)5000);
        NcipherKeyStoreData.PAT_ALPHANUM = Pattern.compile(var0_6[19]);
        NcipherKeyStoreData.PAT_ALPHANUM_WITH_DASH_AND_UNDERSCORE = Pattern.compile(var0_6[31]);
        NcipherKeyStoreData.CLASS_FILTER = NcipherKeyStoreData.createClassFilter();
    }

    private static /* synthetic */ void $$$reportNull$$$0(int n2) {
        String[] stringArray = a;
        throw new IllegalStateException(String.format(stringArray[32], stringArray[12], stringArray[8]));
    }

    private static Throwable a(Throwable throwable) {
        return throwable;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x29);
        }
        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 -> 14;
                    case 1 -> 82;
                    case 2 -> 57;
                    case 3 -> 18;
                    case 4 -> 74;
                    case 5 -> 49;
                    default -> 41;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

