/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.common.io.AliasNotFoundException
 *  com.l7tech.common.io.CertGenParams
 *  com.l7tech.common.io.KeyGenParams
 *  com.l7tech.gateway.common.security.keystore.SsgKeyEntry
 *  com.l7tech.gateway.common.security.keystore.SsgKeyMetadata
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.ObjectNotFoundException
 *  com.l7tech.objectmodel.SaveException
 *  com.l7tech.objectmodel.UpdateException
 *  com.l7tech.security.cert.BouncyCastleCertUtils
 *  com.l7tech.security.prov.CertificateRequest
 *  com.l7tech.util.ConfigFactory
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.NotFuture
 *  org.jetbrains.annotations.NotNull
 *  org.jetbrains.annotations.Nullable
 *  org.springframework.context.ApplicationEvent
 *  org.springframework.context.ApplicationListener
 */
package com.l7tech.server.security.keystore;

import com.l7tech.common.io.AliasNotFoundException;
import com.l7tech.common.io.CertGenParams;
import com.l7tech.common.io.KeyGenParams;
import com.l7tech.gateway.common.security.keystore.SsgKeyEntry;
import com.l7tech.gateway.common.security.keystore.SsgKeyMetadata;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.ObjectNotFoundException;
import com.l7tech.objectmodel.SaveException;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.security.cert.BouncyCastleCertUtils;
import com.l7tech.security.prov.CertificateRequest;
import com.l7tech.server.event.system.Started;
import com.l7tech.server.event.system.Stopped;
import com.l7tech.server.security.keystore.KeyAccessFilter;
import com.l7tech.server.security.keystore.ReplaceCertificateChainManager;
import com.l7tech.server.security.keystore.SsgKeyMetadataManager;
import com.l7tech.server.security.keystore.SsgKeyStore;
import com.l7tech.server.security.keystore.a;
import com.l7tech.server.security.keystore.b;
import com.l7tech.server.security.keystore.c;
import com.l7tech.server.security.keystore.d;
import com.l7tech.util.ConfigFactory;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.NotFuture;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.KeyPair;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.SignatureException;
import java.security.UnrecoverableKeyException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.security.auth.x500.X500Principal;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;

/*
 * Exception performing whole class analysis ignored.
 */
public abstract class JdkKeyStoreBackedSsgKeyStore
implements SsgKeyStore {
    private static final Logger a;
    private static final boolean b;
    private static final long c = 5000L;
    private static final String d;
    private static final AtomicBoolean e;
    private static BlockingQueue<Runnable> f;
    private static ExecutorService g;
    protected final KeyAccessFilter keyAccessFilter;
    private final SsgKeyMetadataManager h;
    private static final String[] x;

    protected JdkKeyStoreBackedSsgKeyStore(@NotNull KeyAccessFilter keyAccessFilter, @NotNull SsgKeyMetadataManager ssgKeyMetadataManager) {
        if (keyAccessFilter == null) {
            JdkKeyStoreBackedSsgKeyStore.a(0);
        }
        if (ssgKeyMetadataManager == null) {
            JdkKeyStoreBackedSsgKeyStore.a(1);
        }
        this.keyAccessFilter = keyAccessFilter;
        this.h = ssgKeyMetadataManager;
    }

    private boolean a() {
        return ConfigFactory.getBooleanProperty((String)x[21], (boolean)false);
    }

    protected abstract KeyStore keyStore() throws KeyStoreException;

    protected abstract String getFormat();

    protected long getRefreshTime() {
        return ConfigFactory.getTimeUnitProperty((String)x[36], (long)5000L);
    }

    public String getId() {
        return String.valueOf(this.getGoid());
    }

    @Override
    public List<String> getAliases() throws KeyStoreException {
        KeyStore keyStore = this.keyStore();
        ArrayList<String> arrayList = new ArrayList<String>();
        Enumeration<String> enumeration = keyStore.aliases();
        while (enumeration.hasMoreElements()) {
            String string = enumeration.nextElement();
            try {
                if (!keyStore.isKeyEntry(string)) continue;
                arrayList.add(string);
            }
            catch (KeyStoreException keyStoreException) {
                throw JdkKeyStoreBackedSsgKeyStore.a(keyStoreException);
            }
        }
        return arrayList;
    }

    /*
     * Loose catch block
     */
    @Override
    public SsgKeyEntry getCertificateChain(String string) throws ObjectNotFoundException, KeyStoreException {
        String[] stringArray;
        Key key;
        X509Certificate[] x509CertificateArray;
        Certificate[] certificateArray;
        KeyStore keyStore;
        block28: {
            keyStore = this.keyStore();
            certificateArray = keyStore.getCertificateChain(string);
            try {
                if (certificateArray != null || !b) break block28;
            }
            catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                throw JdkKeyStoreBackedSsgKeyStore.a(noSuchAlgorithmException);
            }
            x509CertificateArray = keyStore.aliases();
            while (x509CertificateArray.hasMoreElements()) {
                String string2 = x509CertificateArray.nextElement();
                if (!string2.equalsIgnoreCase(string)) continue;
                string = string2;
                certificateArray = keyStore.getCertificateChain(string);
                break;
            }
        }
        try {
            if (certificateArray == null) {
                throw new ObjectNotFoundException(x[17] + this.getName() + x[38] + string);
            }
        }
        catch (NoSuchAlgorithmException noSuchAlgorithmException) {
            throw JdkKeyStoreBackedSsgKeyStore.a(noSuchAlgorithmException);
        }
        try {
            if (certificateArray.length < 1) {
                throw new KeyStoreException(x[31] + this.getName() + x[50] + string);
            }
        }
        catch (NoSuchAlgorithmException noSuchAlgorithmException) {
            throw JdkKeyStoreBackedSsgKeyStore.a(noSuchAlgorithmException);
        }
        x509CertificateArray = new X509Certificate[certificateArray.length];
        int n2 = 0;
        while (true) {
            block31: {
                block30: {
                    block29: {
                        if (n2 >= certificateArray.length) break;
                        try {
                            block33: {
                                if (certificateArray[n2] != null) break block29;
                                break block33;
                                catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                                    throw JdkKeyStoreBackedSsgKeyStore.a(noSuchAlgorithmException);
                                }
                            }
                            throw new KeyStoreException(x[31] + this.getName() + x[32] + string + x[39]);
                        }
                        catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                            throw JdkKeyStoreBackedSsgKeyStore.a(noSuchAlgorithmException);
                        }
                    }
                    try {
                        if (!(certificateArray[n2] instanceof X509Certificate)) break block30;
                        x509CertificateArray[n2] = (X509Certificate)certificateArray[n2];
                        break block31;
                    }
                    catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                        throw JdkKeyStoreBackedSsgKeyStore.a(noSuchAlgorithmException);
                    }
                }
                String string3 = String.valueOf(certificateArray[n2].getClass());
                String string4 = string;
                String string5 = this.getName();
                String[] stringArray2 = x;
                throw new KeyStoreException(stringArray2[31] + string5 + stringArray2[55] + string4 + stringArray2[35] + string3);
            }
            ++n2;
        }
        PrivateKey privateKey = null;
        try {
            key = keyStore.getKey(string, this.getEntryPassword());
            if (key instanceof PrivateKey) {
                privateKey = (PrivateKey)key;
            }
        }
        catch (NoSuchAlgorithmException noSuchAlgorithmException) {
            String string6 = ExceptionUtils.getMessage((Throwable)noSuchAlgorithmException);
            String string7 = string;
            String string8 = this.getName();
            stringArray = x;
            this.getLogger().log(Level.WARNING, stringArray[0] + string8 + stringArray[27] + string7 + stringArray[4] + string6, noSuchAlgorithmException);
        }
        catch (UnrecoverableKeyException unrecoverableKeyException) {
            String string9 = ExceptionUtils.getMessage((Throwable)unrecoverableKeyException);
            String string10 = string;
            String string11 = this.getName();
            stringArray = x;
            this.getLogger().log(Level.WARNING, stringArray[11] + string11 + stringArray[42] + string10 + stringArray[14] + string9, unrecoverableKeyException);
        }
        key = new SsgKeyEntry(this.getGoid(), string, x509CertificateArray, privateKey);
        try {
            SsgKeyMetadata ssgKeyMetadata = this.h.findMetadata(this.getGoid(), string);
            try {
                if (ssgKeyMetadata != null) {
                    key.attachMetadata(ssgKeyMetadata);
                }
            }
            catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                throw JdkKeyStoreBackedSsgKeyStore.a(noSuchAlgorithmException);
            }
        }
        catch (FindException findException) {
            String string12 = ExceptionUtils.getMessage((Throwable)findException);
            String string13 = string;
            String string14 = this.getName();
            stringArray = x;
            this.getLogger().log(Level.WARNING, stringArray[51] + string14 + stringArray[42] + string13 + stringArray[14] + string12, findException);
        }
        try {
            if (this.keyAccessFilter.isRestrictedAccessKeyEntry((SsgKeyEntry)key)) {
                key.setRestrictedAccess();
            }
        }
        catch (NoSuchAlgorithmException noSuchAlgorithmException) {
            throw JdkKeyStoreBackedSsgKeyStore.a(noSuchAlgorithmException);
        }
        return key;
    }

    protected abstract Logger getLogger();

    /*
     * Loose catch block
     * Enabled force condition propagation
     * Lifted jumps to return sites
     */
    private void a(SsgKeyEntry ssgKeyEntry, boolean bl2, boolean bl3) throws KeyStoreException {
        ReplaceCertificateChainManager replaceCertificateChainManager;
        KeyStore keyStore;
        PrivateKey privateKey;
        Certificate[] certificateArray;
        String string;
        block28: {
            block26: {
                block25: {
                    string = ssgKeyEntry.getAlias();
                    if (string == null) throw new KeyStoreException(x[41]);
                    try {
                        if (string.trim().length() >= 1) break block25;
                        throw new KeyStoreException(x[41]);
                        catch (UnrecoverableKeyException unrecoverableKeyException) {
                            throw JdkKeyStoreBackedSsgKeyStore.a(unrecoverableKeyException);
                        }
                    }
                    catch (UnrecoverableKeyException unrecoverableKeyException) {
                        throw JdkKeyStoreBackedSsgKeyStore.a(unrecoverableKeyException);
                    }
                }
                certificateArray = ssgKeyEntry.getCertificateChain();
                if (certificateArray == null) throw new KeyStoreException(x[44]);
                try {
                    if (certificateArray.length >= 1) break block26;
                    throw new KeyStoreException(x[44]);
                    catch (UnrecoverableKeyException unrecoverableKeyException) {
                        throw JdkKeyStoreBackedSsgKeyStore.a(unrecoverableKeyException);
                    }
                }
                catch (UnrecoverableKeyException unrecoverableKeyException) {
                    throw JdkKeyStoreBackedSsgKeyStore.a(unrecoverableKeyException);
                }
            }
            try {
                privateKey = ssgKeyEntry.getPrivateKey();
                try {
                    if (privateKey == null) {
                        throw new KeyStoreException(x[37]);
                    }
                }
                catch (UnrecoverableKeyException unrecoverableKeyException) {
                    throw JdkKeyStoreBackedSsgKeyStore.a(unrecoverableKeyException);
                }
            }
            catch (UnrecoverableKeyException unrecoverableKeyException) {
                String[] stringArray = x;
                throw new KeyStoreException(stringArray[20]);
            }
            keyStore = this.keyStore();
            this.a(privateKey, (X509Certificate[])certificateArray);
            if (bl2) break block28;
            try {
                if (!keyStore.containsAlias(string)) break block28;
                throw new KeyStoreException(x[7] + string + "'");
                catch (UnrecoverableKeyException unrecoverableKeyException) {
                    throw JdkKeyStoreBackedSsgKeyStore.a(unrecoverableKeyException);
                }
            }
            catch (UnrecoverableKeyException unrecoverableKeyException) {
                throw JdkKeyStoreBackedSsgKeyStore.a(unrecoverableKeyException);
            }
        }
        try {
            replaceCertificateChainManager = this.a(keyStore, string, certificateArray, true);
            replaceCertificateChainManager.update(bl3);
        }
        catch (ReplaceCertificateChainManager.ReplaceCertificateChainException replaceCertificateChainException) {
            String[] stringArray = x;
            a.log(Level.WARNING, stringArray[49] + replaceCertificateChainException.getMessage(), replaceCertificateChainException);
            throw new KeyStoreException(stringArray[28] + replaceCertificateChainException.getMessage());
        }
        try {
            keyStore.setKeyEntry(string, privateKey, this.getEntryPassword(), certificateArray);
            return;
        }
        catch (Exception exception) {
            try {
                replaceCertificateChainManager.rollback();
                if (!keyStore.containsAlias(string)) throw exception;
                keyStore.deleteEntry(string);
                throw exception;
            }
            catch (UnrecoverableKeyException unrecoverableKeyException) {
                throw JdkKeyStoreBackedSsgKeyStore.a(unrecoverableKeyException);
            }
            {
                catch (KeyStoreException keyStoreException) {
                    String[] stringArray = x;
                    a.log(Level.WARNING, stringArray[1] + string + stringArray[12]);
                }
            }
            throw exception;
        }
    }

    private ReplaceCertificateChainManager a(KeyStore keyStore, String string, Certificate[] certificateArray, boolean bl2) throws ReplaceCertificateChainManager.ReplaceCertificateChainException {
        return new ReplaceCertificateChainManager.Builder().a(keyStore).a(this::getEntryPassword).a(string).b(bl2).a(this.a()).a(certificateArray).build();
    }

    private void a(PrivateKey privateKey, X509Certificate[] x509CertificateArray) throws KeyStoreException {
        try {
            String[] stringArray = x;
            KeyStore keyStore = KeyStore.getInstance(stringArray[46]);
            keyStore.load(null, null);
            keyStore.setKeyEntry(stringArray[43], privateKey, this.getEntryPassword(), x509CertificateArray);
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            keyStore.store(byteArrayOutputStream, this.getEntryPassword());
            KeyStore keyStore2 = KeyStore.getInstance(stringArray[8]);
            keyStore2.load(new ByteArrayInputStream(byteArrayOutputStream.toByteArray()), this.getEntryPassword());
        }
        catch (IOException | NoSuchAlgorithmException | CertificateException exception) {
            a.info(x[29] + exception.getMessage());
            throw new KeyStoreException(exception);
        }
    }

    protected abstract char[] getEntryPassword();

    @Override
    public boolean isMutable() {
        return true;
    }

    @Override
    public boolean isKeyExportSupported() {
        return true;
    }

    @Override
    public SsgKeyStore getKeyStore() {
        return this;
    }

    @Override
    public synchronized Future<Boolean> storePrivateKeyEntry(Runnable runnable, SsgKeyEntry ssgKeyEntry, boolean bl2, boolean bl3) throws KeyStoreException {
        return this.storePrivateKeyEntry(false, runnable, ssgKeyEntry, bl2, bl3);
    }

    @Override
    public synchronized Future<Boolean> storePrivateKeyEntry(boolean bl2, Runnable runnable, SsgKeyEntry ssgKeyEntry, boolean bl3) throws KeyStoreException {
        return this.storePrivateKeyEntry(bl2, runnable, ssgKeyEntry, bl3, false);
    }

    @Override
    public synchronized Future<Boolean> storePrivateKeyEntry(boolean bl2, Runnable runnable, SsgKeyEntry ssgKeyEntry, boolean bl3, boolean bl4) throws KeyStoreException {
        try {
            if (ssgKeyEntry == null) {
                throw new NullPointerException(x[23]);
            }
        }
        catch (UnrecoverableKeyException unrecoverableKeyException) {
            throw JdkKeyStoreBackedSsgKeyStore.a(unrecoverableKeyException);
        }
        try {
            if (ssgKeyEntry.getAlias() == null) {
                throw new NullPointerException(x[22]);
            }
        }
        catch (UnrecoverableKeyException unrecoverableKeyException) {
            throw JdkKeyStoreBackedSsgKeyStore.a(unrecoverableKeyException);
        }
        try {
            if (ssgKeyEntry.getAlias().length() < 1) {
                throw new IllegalArgumentException(x[5]);
            }
        }
        catch (UnrecoverableKeyException unrecoverableKeyException) {
            throw JdkKeyStoreBackedSsgKeyStore.a(unrecoverableKeyException);
        }
        try {
            PrivateKey privateKey = ssgKeyEntry.getPrivateKey();
            try {
                if (privateKey == null) {
                    throw new NullPointerException(x[45]);
                }
            }
            catch (UnrecoverableKeyException unrecoverableKeyException) {
                throw JdkKeyStoreBackedSsgKeyStore.a(unrecoverableKeyException);
            }
        }
        catch (UnrecoverableKeyException unrecoverableKeyException) {
            throw new IllegalArgumentException(x[15], unrecoverableKeyException);
        }
        return this.mutateKeystore(bl2, runnable, new a(this, ssgKeyEntry, bl3, bl4));
    }

    @Override
    public synchronized Future<Boolean> deletePrivateKeyEntry(Runnable runnable, String string) throws KeyStoreException {
        return this.deletePrivateKeyEntry(false, runnable, string);
    }

    @Override
    public synchronized Future<Boolean> deletePrivateKeyEntry(boolean bl2, Runnable runnable, String string) throws KeyStoreException {
        return this.mutateKeystore(bl2, runnable, new b(this, string));
    }

    @Override
    public synchronized Future<X509Certificate> generateKeyPair(Runnable runnable, String string, KeyGenParams keyGenParams, CertGenParams certGenParams, @Nullable SsgKeyMetadata ssgKeyMetadata) throws GeneralSecurityException {
        return this.mutateKeystore(runnable, new c(this, string, certGenParams, keyGenParams, ssgKeyMetadata));
    }

    /*
     * Unable to fully structure code
     */
    private boolean a(KeyStore var1_1, X500Principal var2_2) throws KeyStoreException {
        block6: {
            block7: {
                var3_3 = var1_1.aliases();
                try {
                    if (var3_3 == null) break block6;
lbl4:
                    // 3 sources

                    while (var3_3.hasMoreElements()) {
                        break block7;
                    }
                    break block6;
                }
                catch (KeyStoreException v0) {
                    throw JdkKeyStoreBackedSsgKeyStore.a(v0);
                }
            }
            var4_4 = var3_3.nextElement();
            var5_5 = var1_1.getCertificateChain(var4_4);
            if (var5_5 == null) ** GOTO lbl4
            for (Certificate var9_9 : var5_5) {
                var11_11 = JdkKeyStoreBackedSsgKeyStore.x;
                var10_10 = ((X509Certificate)var9_9).getSubjectX500Principal().getName(var11_11[40]);
                try {
                    if (!var10_10.equalsIgnoreCase(var2_2.getName(var11_11[9]))) continue;
                    return true;
                }
                catch (KeyStoreException v1) {
                    throw JdkKeyStoreBackedSsgKeyStore.a(v1);
                }
            }
            ** GOTO lbl4
        }
        return false;
    }

    @Override
    public synchronized List<String> findImpactedKeysByReplaceCertChain(String string, X509Certificate[] x509CertificateArray) throws AliasNotFoundException, GeneralSecurityException {
        KeyStore keyStore = this.keyStore();
        try {
            return this.a(keyStore, string, x509CertificateArray, false).getImpactedKeys();
        }
        catch (ReplaceCertificateChainManager.ReplaceCertificateChainException replaceCertificateChainException) {
            String[] stringArray = x;
            a.log(Level.WARNING, stringArray[53] + replaceCertificateChainException.getMessage(), replaceCertificateChainException);
            throw new GeneralSecurityException(stringArray[47] + replaceCertificateChainException.getMessage());
        }
    }

    @Override
    public synchronized Future<Boolean> replaceCertificateChain(Runnable runnable, String string, X509Certificate[] x509CertificateArray, boolean bl2) throws InvalidKeyException, KeyStoreException {
        block7: {
            try {
                block6: {
                    try {
                        try {
                            if (x509CertificateArray == null || x509CertificateArray.length < 1) break block6;
                        }
                        catch (InvalidKeyException invalidKeyException) {
                            throw JdkKeyStoreBackedSsgKeyStore.a(invalidKeyException);
                        }
                        if (x509CertificateArray[0] != null) break block7;
                    }
                    catch (InvalidKeyException invalidKeyException) {
                        throw JdkKeyStoreBackedSsgKeyStore.a(invalidKeyException);
                    }
                }
                throw new IllegalArgumentException(x[13]);
            }
            catch (InvalidKeyException invalidKeyException) {
                throw JdkKeyStoreBackedSsgKeyStore.a(invalidKeyException);
            }
        }
        return this.mutateKeystore(runnable, new d(this, string, x509CertificateArray, bl2));
    }

    /*
     * Loose catch block
     * Enabled force condition propagation
     * Lifted jumps to return sites
     */
    @Override
    public synchronized CertificateRequest makeCertificateSigningRequest(String string, CertGenParams certGenParams) throws InvalidKeyException, SignatureException, KeyStoreException {
        try {
            Certificate[] certificateArray;
            PrivateKey privateKey;
            block13: {
                try {
                    if (certGenParams.getSubjectDn() == null) {
                        throw new KeyStoreException(x[54]);
                    }
                }
                catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                    throw JdkKeyStoreBackedSsgKeyStore.a(noSuchAlgorithmException);
                }
                KeyStore keyStore = this.keyStore();
                Key key = keyStore.getKey(string, this.getEntryPassword());
                privateKey = (PrivateKey)key;
                certificateArray = keyStore.getCertificateChain(string);
                if (certificateArray == null) throw new KeyStoreException(x[24] + string + x[48]);
                try {
                    if (certificateArray.length >= 1) break block13;
                    throw new KeyStoreException(x[24] + string + x[48]);
                    catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                        throw JdkKeyStoreBackedSsgKeyStore.a(noSuchAlgorithmException);
                    }
                }
                catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                    throw JdkKeyStoreBackedSsgKeyStore.a(noSuchAlgorithmException);
                }
            }
            try {
                if (!(certificateArray[0] instanceof X509Certificate)) {
                    throw new KeyStoreException(x[26] + string + x[16]);
                }
            }
            catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                throw JdkKeyStoreBackedSsgKeyStore.a(noSuchAlgorithmException);
            }
            X509Certificate x509Certificate = (X509Certificate)certificateArray[0];
            KeyPair keyPair = new KeyPair(x509Certificate.getPublicKey(), privateKey);
            return BouncyCastleCertUtils.makeCertificateRequest((CertGenParams)certGenParams, (KeyPair)keyPair);
        }
        catch (NoSuchAlgorithmException noSuchAlgorithmException) {
            throw new InvalidKeyException(x[34] + string, noSuchAlgorithmException);
        }
        catch (UnrecoverableKeyException unrecoverableKeyException) {
            throw new KeyStoreException(unrecoverableKeyException);
        }
    }

    @Override
    public void updateKeyMetadata(Goid goid, @NotNull String string, @Nullable SsgKeyMetadata ssgKeyMetadata) throws UpdateException, FindException, SaveException {
        try {
            if (string == null) {
                JdkKeyStoreBackedSsgKeyStore.a(2);
            }
        }
        catch (UpdateException updateException) {
            throw JdkKeyStoreBackedSsgKeyStore.a((Exception)((Object)updateException));
        }
        this.h.updateMetadataForKey(goid, string, ssgKeyMetadata);
    }

    /*
     * Unable to fully structure code
     */
    protected <OUT> Future<OUT> submitMutation(boolean var1_1, Callable<OUT> var2_2) throws KeyStoreException {
        block8: {
            block10: {
                block9: {
                    block11: {
                        if (!JdkKeyStoreBackedSsgKeyStore.e.get()) ** GOTO lbl8
                        if (!var1_1) break block8;
                        break block11;
                        catch (Exception v0) {
                            throw JdkKeyStoreBackedSsgKeyStore.a(v0);
                        }
                    }
                    try {
                        block12: {
                            v1 = JdkKeyStoreBackedSsgKeyStore.a;
                            if (!JdkKeyStoreBackedSsgKeyStore.e.get()) break block9;
                            break block12;
                            catch (Exception v2) {
                                throw JdkKeyStoreBackedSsgKeyStore.a(v2);
                            }
                        }
                        v3 = JdkKeyStoreBackedSsgKeyStore.x[2];
                        break block10;
                    }
                    catch (Exception v4) {
                        throw JdkKeyStoreBackedSsgKeyStore.a(v4);
                    }
                }
                v3 = ".";
            }
            v1.info(JdkKeyStoreBackedSsgKeyStore.x[6] + v3);
            try {
                return new NotFuture(var2_2.call());
            }
            catch (Exception var3_3) {
                return new NotFuture(var3_3);
            }
        }
        return JdkKeyStoreBackedSsgKeyStore.g.submit(var2_2);
    }

    protected <OUT> Future<OUT> mutateKeystore(Runnable runnable, Callable<OUT> callable) throws KeyStoreException {
        return this.mutateKeystore(false, runnable, callable);
    }

    protected abstract <OUT> Future<OUT> mutateKeystore(boolean var1, Runnable var2, Callable<OUT> var3) throws KeyStoreException;

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[56];
                var3_1 = 0;
                var2_2 = "TU~\u0005G\u0006$sOh\u0014\u0017\u001d.x\u001by\tG\u0013khU-\u0013R\u0004?!^c\u0004E\u000fkhU-:s=kJ^t\u0003C\u00199d\u001b/BTx\u001cSV%nO-\u0011B\u0002$lZy\u0019T\u0017'mB-\u0013[\u0013*oN}P\\\u00132!Ld\u0004_V*mRl\u0003\u0017\u0016!\u0013~\u0015E\u0000.s\u001bc\u001fCV8uZ\u007f\u0004R\u0012b/\u000fj^t1T\u0015.rHK\u0019[\u0002.s\u0002;\u001b\u001fdUy\u0002NQ8!Za\u0019V\u0005klN~\u0004\u0017\u0018$u\u001bo\u0015\u0017\u0013&qOt*THd\u001ePV(tI\u007f\u0015Y\u0002kuS\u007f\u0015V\u0012kgT\u007fP\\\u00132rOb\u0002RV&tOl\u0004^\u0019%3J^t\u0003C\u00199d\u001bl\u001cE\u0013*eB-\u0013X\u0018?`Rc\u0003\u0017\u0017%!^c\u0004E\u000fkvRy\u0018\u0017\u0002#d\u001bl\u001c^\u00178!\u001c\u0003kP~\u0007S}NB\u0005Cx\u000fl^y\u0011S\u0017?`vl\u001eV\u0011.s,TU\u007f\u0015T\u0019=dIl\u0012[\u0013kj^tP^\u0018kb^\u007f\u0004\u0017\u0013%uItP^\u0018kJ^t\u0003C\u00199d\u001b)!Zk\u0004R\u0004kgZd\u001cB\u0004.!Zi\u0014^\u0018,!RyPC\u0019kuShP\\\u00132rOb\u0002RX*B^\u007f\u0004\u0017\u0015#`RcPZ\u00038u\u001bn\u001fY\u0002*hU-\u0011CV'dZ~\u0004\u0017\u0019%d\u001bn\u0015E\u0002e\u0002;\u001b#dUy\u0002NQ8!K\u007f\u0019A\u0017?d\u001bf\u0015NV&tHyPU\u0013kqIh\u0003R\u0018?\u001c!R~PY\u0019?!ZcPoX~1\u0002-\u0013R\u0004?h]d\u0013V\u0002.\tJ^t\u0003C\u00199d\u001b\u0011tKi\u0011C\u0013\u0000dB@\u0015C\u0017/`OlObT`^[A?dXe^D\u00139w^\u007f^D\u0013(tId\u0004NX dB~\u0004X\u0004./Qi\u001bU\u0017(j^i^T\u001e.bPK\u001fE5*r^D\u001eD\u0013%rRy\u0019A\u0013\nmRl\u0003z\u0017?bS@TUl\u0012[\u0013kuT-\u0003C\u00199d\u001b}\u0002^\u0000*u^-\u001bR\u000fkdUy\u0002NV<hOePB\u00189dXb\u0006R\u0004*cWhPG\u0004\"wZy\u0015\u0017\u001d.x#j^t#C\u00199d\u0015l\u001c[\u0019<EN}\u001c^\u0015*u^~2N%>cQh\u0013C2\u0005\u001edUy\u0002NQ8!Za\u0019V\u0005klN~\u0004\u0017\u0018$u\u001bo\u0015\u0017\u0018>mW\u0016dUy\u0002NV&tHyPY\u0019?!YhPY\u0003'm%DCd\u0003C\u001f%f\u001bn\u0015E\u0002\"gRn\u0011C\u0013kbSl\u0019YV-nI-\u0011[\u001f*r\u001b@bT`_[A?dXe_D\u00139w^\u007f_D\u0013(tId\u0004NY dB~\u0004X\u0004..qi\u001b|\u00132ROb\u0002R4*bPh\u0014d\u0005,J^t#C\u00199d\u001fDCd\u0003C\u001f%f\u001bn\u0015E\u0002\"gRn\u0011C\u0013kgT\u007fPV\u001a\"`H-\f!Ld\u0004_V*mRl\u0003\u0017#TUl\u0012[\u0013kuT-\u0003C\u00199d\u001b}\u0002^\u0000*u^-\u001bR\u000fkdUy\u0002NZk\u0016TUl\u0012[\u0013kuT-\u0019Z\u0006$sO-\u001bR\u000fq!>@Ij\u0005Z\u0013%u\u001bk\u001fEV\u000bOTy>B\u001a'!Kl\u0002V\u001b.u^\u007fP\u0010S8&\u001bb\u0016\u0017S8/\u001e~PZ\u00038u\u001bc\u001fCV)d\u001bc\u0005[\u001a\tJ^t\u0003C\u00199d\u001b\u0012!^c\u0004E\u000fkvRy\u0018\u0017\u0017'hZ~P\u0006=Rc\u0019CH$J^t\u0003C\u00199d\u001bn\u001fY\u0002*hU~PY\u0019kj^tP@\u001f?i\u001bl\u001c^\u00178!*!Xb\u001eC\u0017\"oH-\u0011\u0017\u0018$o\u0016U^\u0002Fr!xh\u0002C\u001f-hXl\u0004RV$g\u001by\tG\u0013k\u0017j^t#C\u00199d}d\u001cR5*bSh5O\u0006\"sB7TUl\u0012[\u0013kuT-\u0003C\u00199d\u001b}\u0002^\u0000*u^-\u001bR\u000fkdUy\u0002NV<hOePY\u0003'm\u001b}\u0002^\u0000*u^-\u001bR\u000f9!_b\u0015DV%nO-\u0013X\u0018?`RcPV\u00182!Xh\u0002C\u001f-hXl\u0004RV(iZd\u001e\u0017\u0013%uItP@\u001f?i\u001bl\u001c^\u00178!(!Xb\u001eC\u0017\"oH-\u0011\u0017\u0018>mW-\u0015Y\u00029x\u001bd\u001e\u0017\u001f?r\u001bn\u0015E\u0002kbSl\u0019Y\u0007S}NB\u0005Cx:TUl\u0012[\u0013kuT-\u0003C\u00199d\u001b}\u0002^\u0000*u^-\u001bR\u000fkdUy\u0002NV<hOePY\u0003'm\u001bb\u0002\u0017\u0013&qOtPV\u001a\"`H\f!Ld\u0004_V*mRl\u0003\u0017\u0005`Wd\u0011DFTUl\u0012[\u0013kuT-\u0003C\u00199d\u001b}\u0002^\u0000*u^-\u001bR\u000fkdUy\u0002NV<hOePY\u0003'm\u001bb\u0002\u0017\u0013&qOtPT\u00139uRk\u0019T\u0017?d\u001bn\u0018V\u001f%#dUy\u0002NQ8!K\u007f\u0019A\u0017?d\u001bf\u0015NV&tHyPU\u0013kqIh\u0003R\u0018?\u0003kP~+TUl\u0012[\u0013kuT-\u0016^\u0018/!R`\u0000V\u0015?d_-\u0013R\u0004?h]d\u0013V\u0002.!Xe\u0011^\u0018q!\t!R~PR\u001b;uB#TUl\u0012[\u0013kuT-\u0003C\u00199d\u001b}\u0002^\u0000*u^-\u001bR\u000fkdUy\u0002NZk5!Xb\u001eC\u0017\"oH-\u0011YV.lKy\t\u0017\u0015.sOd\u0016^\u0015*u^-\u0013_\u0017\"o\u001bh\u001eC\u00042!]b\u0002\u0017\u0017'hZ~P3TUl\u0012[\u0013kuT-\u0002R\u00029h^{\u0015\u0017\u001d.x\u001bh\u001eC\u00042!Vh\u0004V\u0012*uZ-\u0016X\u0004kJ^t\u0003C\u00199d\u001b\u0005`Wd\u0011D/GZd\u001cR\u0012kuT-\u0017R\u0002kuShP^\u001b;`Xy\u0015SV(dIy\u0019Q\u001f(`OhPT\u001e*hU~J\u0017";
                var4_3 = "TU~\u0005G\u0006$sOh\u0014\u0017\u001d.x\u001by\tG\u0013khU-\u0013R\u0004?!^c\u0004E\u000fkhU-:s=kJ^t\u0003C\u00199d\u001b/BTx\u001cSV%nO-\u0011B\u0002$lZy\u0019T\u0017'mB-\u0013[\u0013*oN}P\\\u00132!Ld\u0004_V*mRl\u0003\u0017\u0016!\u0013~\u0015E\u0000.s\u001bc\u001fCV8uZ\u007f\u0004R\u0012b/\u000fj^t1T\u0015.rHK\u0019[\u0002.s\u0002;\u001b\u001fdUy\u0002NQ8!Za\u0019V\u0005klN~\u0004\u0017\u0018$u\u001bo\u0015\u0017\u0013&qOt*THd\u001ePV(tI\u007f\u0015Y\u0002kuS\u007f\u0015V\u0012kgT\u007fP\\\u00132rOb\u0002RV&tOl\u0004^\u0019%3J^t\u0003C\u00199d\u001bl\u001cE\u0013*eB-\u0013X\u0018?`Rc\u0003\u0017\u0017%!^c\u0004E\u000fkvRy\u0018\u0017\u0002#d\u001bl\u001c^\u00178!\u001c\u0003kP~\u0007S}NB\u0005Cx\u000fl^y\u0011S\u0017?`vl\u001eV\u0011.s,TU\u007f\u0015T\u0019=dIl\u0012[\u0013kj^tP^\u0018kb^\u007f\u0004\u0017\u0013%uItP^\u0018kJ^t\u0003C\u00199d\u001b)!Zk\u0004R\u0004kgZd\u001cB\u0004.!Zi\u0014^\u0018,!RyPC\u0019kuShP\\\u00132rOb\u0002RX*B^\u007f\u0004\u0017\u0015#`RcPZ\u00038u\u001bn\u001fY\u0002*hU-\u0011CV'dZ~\u0004\u0017\u0019%d\u001bn\u0015E\u0002e\u0002;\u001b#dUy\u0002NQ8!K\u007f\u0019A\u0017?d\u001bf\u0015NV&tHyPU\u0013kqIh\u0003R\u0018?\u001c!R~PY\u0019?!ZcPoX~1\u0002-\u0013R\u0004?h]d\u0013V\u0002.\tJ^t\u0003C\u00199d\u001b\u0011tKi\u0011C\u0013\u0000dB@\u0015C\u0017/`OlObT`^[A?dXe^D\u00139w^\u007f^D\u0013(tId\u0004NX dB~\u0004X\u0004./Qi\u001bU\u0017(j^i^T\u001e.bPK\u001fE5*r^D\u001eD\u0013%rRy\u0019A\u0013\nmRl\u0003z\u0017?bS@TUl\u0012[\u0013kuT-\u0003C\u00199d\u001b}\u0002^\u0000*u^-\u001bR\u000fkdUy\u0002NV<hOePB\u00189dXb\u0006R\u0004*cWhPG\u0004\"wZy\u0015\u0017\u001d.x#j^t#C\u00199d\u0015l\u001c[\u0019<EN}\u001c^\u0015*u^~2N%>cQh\u0013C2\u0005\u001edUy\u0002NQ8!Za\u0019V\u0005klN~\u0004\u0017\u0018$u\u001bo\u0015\u0017\u0018>mW\u0016dUy\u0002NV&tHyPY\u0019?!YhPY\u0003'm%DCd\u0003C\u001f%f\u001bn\u0015E\u0002\"gRn\u0011C\u0013kbSl\u0019YV-nI-\u0011[\u001f*r\u001b@bT`_[A?dXe_D\u00139w^\u007f_D\u0013(tId\u0004NY dB~\u0004X\u0004..qi\u001b|\u00132ROb\u0002R4*bPh\u0014d\u0005,J^t#C\u00199d\u001fDCd\u0003C\u001f%f\u001bn\u0015E\u0002\"gRn\u0011C\u0013kgT\u007fPV\u001a\"`H-\f!Ld\u0004_V*mRl\u0003\u0017#TUl\u0012[\u0013kuT-\u0003C\u00199d\u001b}\u0002^\u0000*u^-\u001bR\u000fkdUy\u0002NZk\u0016TUl\u0012[\u0013kuT-\u0019Z\u0006$sO-\u001bR\u000fq!>@Ij\u0005Z\u0013%u\u001bk\u001fEV\u000bOTy>B\u001a'!Kl\u0002V\u001b.u^\u007fP\u0010S8&\u001bb\u0016\u0017S8/\u001e~PZ\u00038u\u001bc\u001fCV)d\u001bc\u0005[\u001a\tJ^t\u0003C\u00199d\u001b\u0012!^c\u0004E\u000fkvRy\u0018\u0017\u0017'hZ~P\u0006=Rc\u0019CH$J^t\u0003C\u00199d\u001bn\u001fY\u0002*hU~PY\u0019kj^tP@\u001f?i\u001bl\u001c^\u00178!*!Xb\u001eC\u0017\"oH-\u0011\u0017\u0018$o\u0016U^\u0002Fr!xh\u0002C\u001f-hXl\u0004RV$g\u001by\tG\u0013k\u0017j^t#C\u00199d}d\u001cR5*bSh5O\u0006\"sB7TUl\u0012[\u0013kuT-\u0003C\u00199d\u001b}\u0002^\u0000*u^-\u001bR\u000fkdUy\u0002NV<hOePY\u0003'm\u001b}\u0002^\u0000*u^-\u001bR\u000f9!_b\u0015DV%nO-\u0013X\u0018?`RcPV\u00182!Xh\u0002C\u001f-hXl\u0004RV(iZd\u001e\u0017\u0013%uItP@\u001f?i\u001bl\u001c^\u00178!(!Xb\u001eC\u0017\"oH-\u0011\u0017\u0018>mW-\u0015Y\u00029x\u001bd\u001e\u0017\u001f?r\u001bn\u0015E\u0002kbSl\u0019Y\u0007S}NB\u0005Cx:TUl\u0012[\u0013kuT-\u0003C\u00199d\u001b}\u0002^\u0000*u^-\u001bR\u000fkdUy\u0002NV<hOePY\u0003'm\u001bb\u0002\u0017\u0013&qOtPV\u001a\"`H\f!Ld\u0004_V*mRl\u0003\u0017\u0005`Wd\u0011DFTUl\u0012[\u0013kuT-\u0003C\u00199d\u001b}\u0002^\u0000*u^-\u001bR\u000fkdUy\u0002NV<hOePY\u0003'm\u001bb\u0002\u0017\u0013&qOtPT\u00139uRk\u0019T\u0017?d\u001bn\u0018V\u001f%#dUy\u0002NQ8!K\u007f\u0019A\u0017?d\u001bf\u0015NV&tHyPU\u0013kqIh\u0003R\u0018?\u0003kP~+TUl\u0012[\u0013kuT-\u0016^\u0018/!R`\u0000V\u0015?d_-\u0013R\u0004?h]d\u0013V\u0002.!Xe\u0011^\u0018q!\t!R~PR\u001b;uB#TUl\u0012[\u0013kuT-\u0003C\u00199d\u001b}\u0002^\u0000*u^-\u001bR\u000fkdUy\u0002NZk5!Xb\u001eC\u0017\"oH-\u0011YV.lKy\t\u0017\u0015.sOd\u0016^\u0015*u^-\u0013_\u0017\"o\u001bh\u001eC\u00042!]b\u0002\u0017\u0017'hZ~P3TUl\u0012[\u0013kuT-\u0002R\u00029h^{\u0015\u0017\u001d.x\u001bh\u001eC\u00042!Vh\u0004V\u0012*uZ-\u0016X\u0004kJ^t\u0003C\u00199d\u001b\u0005`Wd\u0011D/GZd\u001cR\u0012kuT-\u0017R\u0002kuShP^\u001b;`Xy\u0015SV(dIy\u0019Q\u001f(`OhPT\u001e*hU~J\u0017".length();
                var1_4 = 51;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = JdkKeyStoreBackedSsgKeyStore.a(v0, JdkKeyStoreBackedSsgKeyStore.c(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "o4Q*z3\u0001M`f180\u0017\u000efG.m0\u0016Kp\u0002+wy\u0007\\qC+}y\u0005\u000eWq\r\u0012\u000eqL+j DY}V788\bGuQ\u007f";
                    var4_3 = "o4Q*z3\u0001M`f180\u0017\u000efG.m0\u0016Kp\u0002+wy\u0007\\qC+}y\u0005\u000eWq\r\u0012\u000eqL+j DY}V788\bGuQ\u007f".length();
                    var1_4 = 39;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 29;
                        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++] = JdkKeyStoreBackedSsgKeyStore.a(v0, JdkKeyStoreBackedSsgKeyStore.c(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;
            }
        }
        JdkKeyStoreBackedSsgKeyStore.x = var5;
        JdkKeyStoreBackedSsgKeyStore.d = JdkKeyStoreBackedSsgKeyStore.x[8];
        JdkKeyStoreBackedSsgKeyStore.a = Logger.getLogger(JdkKeyStoreBackedSsgKeyStore.class.getName());
        JdkKeyStoreBackedSsgKeyStore.b = ConfigFactory.getBooleanProperty((String)JdkKeyStoreBackedSsgKeyStore.x[19], (boolean)true);
        JdkKeyStoreBackedSsgKeyStore.e = new AtomicBoolean(false);
        JdkKeyStoreBackedSsgKeyStore.f = new LinkedBlockingQueue<Runnable>();
        JdkKeyStoreBackedSsgKeyStore.g = new ThreadPoolExecutor(1, 1, 300L, TimeUnit.SECONDS, JdkKeyStoreBackedSsgKeyStore.f);
    }

    /*
     * 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 2[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[] c(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x79);
        }
        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 -> 51;
                    case 1 -> 9;
                    case 2 -> 63;
                    case 3 -> 66;
                    case 4 -> 5;
                    case 5 -> 68;
                    default -> 121;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }

    public static final class StartupListener
    implements ApplicationListener {
        private static final String[] a;

        public void onApplicationEvent(ApplicationEvent applicationEvent) {
            if (applicationEvent instanceof Started) {
                String[] stringArray = a;
                a.info(stringArray[1]);
                e.set(true);
            } else if (applicationEvent instanceof Stopped) {
                a.info(a[0]);
                e.set(false);
                g.shutdown();
            }
        }

        /*
         * Enabled aggressive block sorting
         */
        static {
            String[] stringArray = new String[2];
            int n2 = 0;
            String string = "`[\u0006\u0002\u0005\u0016\u0002T\u0013\u0017\u0019\u0006\u0011LXV\n\u0005\u0005\u0010\u001eV\u0013\u001e\u0003\u0005\u001e\u0018Z\\\u001dV\u0014\u0007\tPF\u0007\u0019\u0003Q,`D\u001a\u0002\u0012\u0017\u0005]TS\u0002\u001e_\tKV\u0010\u0003\u0005\u0010\u001e\u0013U\u001c\u0004Q\u0014\tJ@\u0007\u0019\u0003\u001aL^F\u0007\u0017\u0005\u0016\u0003]\u001d";
            int n3 = "`[\u0006\u0002\u0005\u0016\u0002T\u0013\u0017\u0019\u0006\u0011LXV\n\u0005\u0005\u0010\u001eV\u0013\u001e\u0003\u0005\u001e\u0018Z\\\u001dV\u0014\u0007\tPF\u0007\u0019\u0003Q,`D\u001a\u0002\u0012\u0017\u0005]TS\u0002\u001e_\tKV\u0010\u0003\u0005\u0010\u001e\u0013U\u001c\u0004Q\u0014\tJ@\u0007\u0019\u0003\u001aL^F\u0007\u0017\u0005\u0016\u0003]\u001d".length();
            int n4 = 41;
            int n5 = -1;
            while (true) {
                int n6 = ++n5;
                stringArray[n2++] = StartupListener.a(15, StartupListener.a(string.substring(n6, n6 + n4)));
                if ((n5 += n4) >= n3) {
                    a = stringArray;
                    return;
                }
                n4 = string.charAt(n5);
            }
        }

        private static char[] a(String string) {
            char[] cArray = string.toCharArray();
            if (cArray.length < 2) {
                cArray = cArray;
                cArray[0] = (char)(cArray[0] ^ 0x63);
            }
            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 -> 60;
                        case 1 -> 60;
                        case 2 -> 124;
                        case 3 -> 121;
                        case 4 -> 126;
                        case 5 -> 112;
                        default -> 99;
                    })));
                    ++n3;
                    n4 = n4;
                } while (n4 > n3);
            }
            return new String(cArray2).intern();
        }
    }
}

