/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.Component
 *  com.l7tech.security.prov.JceProvider
 *  com.l7tech.util.BuildInfo
 *  com.l7tech.util.ConfigFactory
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.FileUtils
 *  com.l7tech.util.JceUtil
 *  com.l7tech.util.JdkLoggerConfigurator$ResettableLogManager
 *  com.l7tech.util.Pair
 *  com.l7tech.util.StrongCryptoNotAvailableException
 *  com.l7tech.util.SyspropUtil
 *  com.mchange.v2.c3p0.C3P0Registry
 *  com.mchange.v2.c3p0.PooledDataSource
 *  com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase
 *  org.springframework.context.ApplicationEvent
 *  org.springframework.context.support.ClassPathXmlApplicationContext
 */
package com.l7tech.server.boot;

import com.l7tech.gateway.common.Component;
import com.l7tech.security.prov.JceProvider;
import com.l7tech.server.BootProcess;
import com.l7tech.server.GatewayURLStreamHandlerFactory;
import com.l7tech.server.LifecycleException;
import com.l7tech.server.NodePropertiesLoaderImpl;
import com.l7tech.server.ServerConfig;
import com.l7tech.server.boot.GatewayBootUtil;
import com.l7tech.server.boot.ShutdownWatcher;
import com.l7tech.server.boot.a;
import com.l7tech.server.event.system.ReadyForMessages;
import com.l7tech.server.log.JdkLogConfig;
import com.l7tech.server.util.FirewallUtils;
import com.l7tech.util.BuildInfo;
import com.l7tech.util.ConfigFactory;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.FileUtils;
import com.l7tech.util.JceUtil;
import com.l7tech.util.JdkLoggerConfigurator;
import com.l7tech.util.Pair;
import com.l7tech.util.StrongCryptoNotAvailableException;
import com.l7tech.util.SyspropUtil;
import com.mchange.v2.c3p0.C3P0Registry;
import com.mchange.v2.c3p0.PooledDataSource;
import com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.security.GeneralSecurityException;
import java.security.Provider;
import java.security.Security;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.Logger;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class GatewayBoot {
    protected static final Logger LOGGER;
    private static final long a = 30L;
    private static final String b;
    private static final String c;
    private static final String d;
    private static final String e;
    private final AtomicBoolean f = new AtomicBoolean(false);
    private final AtomicBoolean g = new AtomicBoolean(false);
    private ClassPathXmlApplicationContext h;
    private ShutdownWatcher i;
    public static final String SYSPROP_ENABLE_HSM;
    public static final String SYSPROP_ALLOW_CIRCULARITY;
    public static final String PKCS11_CFG_FILE;
    public static final String[] HSM_SECURITY_PROVIDERS;
    private static final String[] j;

    private static void a() {
        String[] stringArray = j;
        boolean bl2 = ConfigFactory.getBooleanProperty((String)stringArray[1], (boolean)false);
        if (bl2) {
            for (Provider provider : Security.getProviders()) {
                Security.removeProvider(provider.getName());
            }
            try {
                GatewayBoot.a(HSM_SECURITY_PROVIDERS);
                SyspropUtil.setProperty((String)JceProvider.ENGINE_PROPERTY, (String)JceProvider.PKCS11_ENGINE);
            }
            catch (LifecycleException lifecycleException) {
                throw new RuntimeException(j[23], lifecycleException);
            }
        }
    }

    private static void a(String[] stringArray) throws LifecycleException {
        for (String string : stringArray) {
            String[] stringArray2;
            try {
                Provider provider;
                if (string.contains(" ")) {
                    String[] stringArray3 = string.split(" ");
                    stringArray2 = j;
                    LOGGER.log(Level.INFO, stringArray2[12], stringArray3[0]);
                    Class<?> clazz = Class.forName(stringArray3[0]);
                    Constructor<?> constructor = clazz.getConstructor(String.class);
                    provider = (Provider)constructor.newInstance(stringArray3[1]);
                } else {
                    provider = (Provider)Class.forName(string).newInstance();
                }
                Security.addProvider(provider);
            }
            catch (ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException reflectiveOperationException) {
                stringArray2 = j;
                throw new LifecycleException(stringArray2[55] + string + stringArray2[50] + ExceptionUtils.getMessage((Throwable)reflectiveOperationException), reflectiveOperationException);
            }
        }
    }

    GatewayBoot() {
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    public void start() throws LifecycleException {
        try {
            if (!this.f.compareAndSet(false, true)) {
                return;
            }
        }
        catch (LifecycleException lifecycleException) {
            throw GatewayBoot.a(lifecycleException);
        }
        String[] stringArray = j;
        LOGGER.info(stringArray[26] + BuildInfo.getLongBuildString());
        this.g.set(false);
        boolean bl2 = false;
        try {
            long l2 = System.currentTimeMillis();
            GatewayURLStreamHandlerFactory.install();
            ServerConfig.getInstance().getLocalDirectoryProperty(stringArray[44], true);
            FirewallUtils.initializeFirewall();
            this.b();
            this.e();
            GatewayBoot.c();
            String string = this.f();
            this.a(string);
            bl2 = true;
            LOGGER.log(Level.FINE, stringArray[2], System.currentTimeMillis() - l2);
            if (!bl2) {
                this.f.set(false);
            }
        }
        catch (Throwable throwable) {
            try {
                if (!bl2) {
                    this.f.set(false);
                }
            }
            catch (LifecycleException lifecycleException) {
                throw GatewayBoot.a(lifecycleException);
            }
            throw throwable;
        }
    }

    public void destroy() {
        try {
            this.g.set(true);
            if (!this.f.get()) {
                return;
            }
        }
        catch (InterruptedException interruptedException) {
            throw GatewayBoot.a(interruptedException);
        }
        String[] stringArray = j;
        int n2 = ConfigFactory.getIntProperty((String)stringArray[61], (int)3);
        LOGGER.info(stringArray[42]);
        this.g();
        try {
            try {
                for (int i2 = 0; i2 < n2; ++i2) {
                    LOGGER.log(Level.INFO, j[17], n2 - i2);
                    Thread.sleep(1000L);
                }
            }
            catch (InterruptedException interruptedException) {
                throw GatewayBoot.a(interruptedException);
            }
        }
        catch (InterruptedException interruptedException) {
            LOGGER.info(j[3]);
        }
        this.h();
        this.h.close();
        this.f.set(false);
    }

    public void runUntilShutdown() throws LifecycleException {
        CountDownLatch countDownLatch = new CountDownLatch(1);
        CountDownLatch countDownLatch2 = new CountDownLatch(1);
        this.j();
        this.start();
        this.a(countDownLatch, countDownLatch2);
        GatewayBoot.b(countDownLatch);
        try {
            this.destroy();
        }
        finally {
            GatewayBoot.a(countDownLatch2);
        }
    }

    private void b() {
        Object object;
        String[] stringArray = j;
        if (SyspropUtil.getProperty((String)stringArray[46]) == null) {
            object = ServerConfig.getInstance().getLocalDirectoryProperty(stringArray[13], true);
            File file = new File((File)object, stringArray[47]);
            System.setProperty(stringArray[62], file.getAbsolutePath());
        }
        if (ConfigFactory.getBooleanProperty((String)(stringArray = j)[58], (boolean)true)) {
            object = new a(this, stringArray[54]);
            ((Thread)object).setDaemon(true);
            ((Thread)object).start();
        }
    }

    private static void c() {
        block4: {
            String[] stringArray = j;
            File file = ServerConfig.getInstance().getLocalDirectoryProperty(stringArray[53], true);
            File file2 = new File(file, stringArray[37]);
            try {
                try {
                    if (!file2.exists() || file2.delete()) break block4;
                }
                catch (RuntimeException runtimeException) {
                    throw GatewayBoot.a(runtimeException);
                }
                LOGGER.warning(j[0]);
            }
            catch (RuntimeException runtimeException) {
                throw GatewayBoot.a(runtimeException);
            }
        }
    }

    private static Pair<Integer, Integer> d() throws SQLException {
        int n2 = 0;
        Set set = C3P0Registry.getPooledDataSources();
        for (PooledDataSource pooledDataSource : set) {
            block3: {
                try {
                    if (!(pooledDataSource instanceof PoolBackedDataSourceBase)) break block3;
                    if (((PoolBackedDataSourceBase)pooledDataSource).getConnectionPoolDataSource() == null) continue;
                }
                catch (SQLException sQLException) {
                    throw GatewayBoot.a(sQLException);
                }
                n2 += pooledDataSource.getNumConnectionsAllUsers();
                continue;
            }
            n2 += pooledDataSource.getNumConnectionsAllUsers();
        }
        return Pair.pair((Object)set.size(), (Object)n2);
    }

    private void e() {
        String string;
        String[] stringArray;
        ArrayList<String> arrayList;
        ArrayList<String> arrayList2;
        long l2;
        boolean bl2;
        String[] stringArray2;
        block6: {
            block5: {
                stringArray2 = j;
                bl2 = ConfigFactory.getBooleanProperty((String)stringArray2[64], (boolean)false);
                l2 = System.currentTimeMillis();
                String string2 = NodePropertiesLoaderImpl.getInstance().getProperty(stringArray2[10], stringArray2[30]);
                LOGGER.log(Level.INFO, stringArray2[57], string2);
                boolean bl3 = stringArray2[41].equals(string2);
                Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
                arrayList2 = new ArrayList<String>();
                try {
                    arrayList = arrayList2;
                    String[] stringArray3 = new String[4];
                    stringArray3[0] = stringArray2[24];
                    stringArray3[1] = stringArray2[56];
                    String[] stringArray4 = stringArray3;
                    stringArray = stringArray3;
                    int n2 = 2;
                    if (!bl3) break block5;
                    string = stringArray2[27];
                    break block6;
                }
                catch (RuntimeException runtimeException) {
                    throw GatewayBoot.a(runtimeException);
                }
            }
            stringArray2 = j;
            string = stringArray2[16];
        }
        stringArray4[n2] = string;
        stringArray2 = j;
        stringArray[3] = stringArray2[32];
        arrayList.addAll(Arrays.asList(stringArray));
        Mode mode = GatewayBootUtil.getMode();
        try {
            LOGGER.log(Level.INFO, stringArray2[48], (Object)mode);
            if (Mode.TRADITIONAL.equals((Object)mode)) {
                arrayList2.addAll(Arrays.asList(stringArray2[19], stringArray2[5]));
            }
        }
        catch (RuntimeException runtimeException) {
            throw GatewayBoot.a(runtimeException);
        }
        List<String> list = GatewayBootUtil.a(mode);
        stringArray2 = j;
        LOGGER.log(Level.INFO, stringArray2[8], list);
        arrayList2.addAll(list);
        this.h = new ClassPathXmlApplicationContext(arrayList2.toArray(new String[arrayList2.size()]), false);
        this.h.setAllowCircularReferences(bl2);
        this.h.refresh();
        this.i = (ShutdownWatcher)this.h.getBean(stringArray2[60], ShutdownWatcher.class);
        LOGGER.log(Level.FINE, stringArray2[11], System.currentTimeMillis() - l2);
    }

    private String f() throws LifecycleException {
        long l2 = System.currentTimeMillis();
        this.h.start();
        String[] stringArray = j;
        LOGGER.log(Level.FINE, stringArray[25], System.currentTimeMillis() - l2);
        long l3 = System.currentTimeMillis();
        BootProcess bootProcess = (BootProcess)((Object)this.h.getBean(stringArray[63], BootProcess.class));
        bootProcess.start();
        LOGGER.log(Level.FINE, stringArray[31], System.currentTimeMillis() - l3);
        return bootProcess.getIpAddress();
    }

    private void g() {
        try {
            String[] stringArray = j;
            BootProcess bootProcess = (BootProcess)((Object)this.h.getBean(stringArray[63], BootProcess.class));
            bootProcess.stop();
            this.h.stop();
        }
        catch (Exception exception) {
            String[] stringArray = j;
            LOGGER.log(Level.WARNING, stringArray[52] + ExceptionUtils.getMessage((Throwable)exception) + stringArray[39], exception);
        }
    }

    private void h() {
        try {
            String[] stringArray = j;
            BootProcess bootProcess = (BootProcess)((Object)this.h.getBean(stringArray[38], BootProcess.class));
            bootProcess.destroy();
        }
        catch (Exception exception) {
            String[] stringArray = j;
            LOGGER.log(Level.WARNING, stringArray[29] + ExceptionUtils.getMessage((Throwable)exception) + stringArray[39], exception);
        }
    }

    private void a(String string) {
        long l2 = System.currentTimeMillis();
        String[] stringArray = j;
        LOGGER.log(Level.INFO, stringArray[28]);
        this.h.publishEvent((ApplicationEvent)new ReadyForMessages(this, Component.GW_SERVER, string));
        this.i();
        LOGGER.log(Level.FINE, stringArray[34], System.currentTimeMillis() - l2);
    }

    private void i() {
        String[] stringArray = j;
        ServerConfig serverConfig = (ServerConfig)this.h.getBean(stringArray[51], ServerConfig.class);
        File file = serverConfig.getLocalDirectoryProperty(stringArray[53], true);
        File file2 = new File(file, d);
        try {
            FileUtils.touch((File)file2);
        }
        catch (IOException iOException) {
            stringArray = j;
            LOGGER.log(Level.WARNING, stringArray[35] + String.valueOf(file2) + stringArray[43] + ExceptionUtils.getMessage((Throwable)iOException));
        }
    }

    private void a(CountDownLatch countDownLatch, CountDownLatch countDownLatch2) {
        this.i.a(countDownLatch);
        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
            countDownLatch.countDown();
            try {
                countDownLatch2.await(5L, TimeUnit.MINUTES);
            }
            catch (InterruptedException interruptedException) {
                // empty catch block
            }
            LogManager logManager = LogManager.getLogManager();
            try {
                if (logManager instanceof GatewayLogManager) {
                    ((GatewayLogManager)logManager).resetLogs();
                }
            }
            catch (InterruptedException interruptedException) {
                throw GatewayBoot.a(interruptedException);
            }
        }));
    }

    private void j() throws LifecycleException {
        String[] stringArray = j;
        if (ConfigFactory.getBooleanProperty((String)stringArray[40], (boolean)true)) {
            try {
                try {
                    JceUtil.requireStrongCryptoEnabledInJvm();
                    if (LOGGER.isLoggable(Level.CONFIG)) {
                        LOGGER.config(stringArray[15] + Arrays.toString(Security.getProviders()));
                    }
                }
                catch (LifecycleException lifecycleException) {
                    throw GatewayBoot.a(lifecycleException);
                }
            }
            catch (StrongCryptoNotAvailableException strongCryptoNotAvailableException) {
                stringArray = j;
                throw new LifecycleException(stringArray[18]);
            }
            catch (GeneralSecurityException generalSecurityException) {
                stringArray = j;
                LOGGER.log(Level.WARNING, stringArray[33] + ExceptionUtils.getMessage((Throwable)generalSecurityException) + stringArray[22], ExceptionUtils.getDebugException((Throwable)generalSecurityException));
            }
        }
    }

    private static void a(CountDownLatch countDownLatch) {
        countDownLatch.countDown();
    }

    private static void b(CountDownLatch countDownLatch) {
        try {
            countDownLatch.await();
        }
        catch (InterruptedException interruptedException) {
            LOGGER.info(j[45]);
        }
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[65];
                var3_1 = 0;
                var2_2 = "g'Cm\u000e\u001afr.\u0011l\u0018Aygb_`\u0003\u0014wfbUj\u001bQaf&\u001c`-\\!\u001b\u0003af!Y!\u0004Qgu'C!\u0004Wt-'_n\u0015Xp\u0017A-^{WWzn2]j\u0003Qq#+_/\f\u0004hn1\"@-_{\u001eZ`j,V/\u0004\\`w&^x\u0019\u0014=j,Ej\u0005F`s6Tk^\u001a\u0007P7_E$gP1`-\\ \u001b\u0003af!Y \u0004Qgu'C \u0005Qfl7Cl\u0012G:`:W\\\u0002Del0EL\u0018Zaf:E!\u000fYy\u0006P7_E4q\"`-\\!\u001b\u0003af!Y!\u0004Qgu'C!\u0004@tq6TkYR|o'_n\u001aQ\u0016F,Pm\u001bQq#!^b\u0007[{f,E5WO%~\"`-\\!\u001b\u0003af!Y!\u0004Qgu'C!\u0004@tq6TkYR|o'_n\u001aQ\fm-UjYPw-6H\u007f\u0012$@0Tn\u0003Qq##A\u007f\u001b]vb6X`\u0019\u0014vl,Ej\u000f@5j,\u0011tGIxp\nB&Uf\u0019S5xrL\fu#CK\u001eFp`6^}\u000eLp7_!\u0004Qvv0X{\u000e\u001aeh!B>F\u001aFv,aD4g$2b\u001e`\u0007@:P'Rz\u0005QFs#_ 6Deo+Pa\u0014Q:f6R \u0007_vps\u0000P\u001b]{v:\u001fl\u0011S\u001eB4Pf\u001bUwo'\u0011\\\u0012W`q+EvWdgl4Xk\u0012Ff9b1`-\\ \u001b\u0003af!Y \u0004Qgu'C \u0005Qfl7Cl\u0012G:f/Sj\u0013Ppg\u0006SL\u0018Zaf:E!\u000fYy\u001c@-_{\u001eZ`j,V/\u0004\\`w&^x\u0019\u0014|mbJ?\nG;SP6C`\u0019S5`0H\u007f\u0003[rq#Ag\u000e\u0014{l6\u0011n\u0001U|o#Sc\u0012\u001a5S.Tn\u0004Q5v2Un\u0003Q5I\u0006z/\u0003[5f,Pm\u001bQ5p6C`\u0019S5`0H\u007f\u0003[rq#Ag\u000e\u001a,`-\\ \u001b\u0003af!Y \u0004Qgu'C \u0005Qfl7Cl\u0012G:b&\\f\u0019wzm6Tw\u0003\u001amn.\u001c`-\\!\u001b\u0003af!Y!\u0004Qgu'C!\u0004Wt-'_n\u0015Xp.,-A{Xgp`7Cj$Dtmmp\u007f\u0007X|b,RjXQa`mAd\u0014G$2\u001d]f\u0019Am-!Wh\u0002$li@-Dc\u0013\u0014{l6\u0011|\u0003UgwbEg\u0012\u0014ff0Gj\u0005\u001a5W*T/?gX#+B/\u0012Zta.Tk[\u0014wv6\u0011{\u001fQgfbFn\u0004\u0014tmbT}\u0005[g#2Cj\u0007Ugj,V/\u0003\\p#1Tl\u0002F|w;\u0011\u007f\u0005[cj&T}\u0004\u001a51`-\\ \u001b\u0003af!Y \u0004Qgu'C \u0005Qfl7Cl\u0012G:g#En6Wvf1BL\u0018Zaf:E!\u000fYy$P6P}\u0003Qq##A\u007f\u001b]vb6X`\u0019\u0014vl,Ej\u000f@5j,\u0011tGIxp\tP6P}\u0003]{db1`-\\ \u001b\u0003af!Y \u0004Qgu'C \u0005Qfl7Cl\u0012G:p6Pa\u0013Ugg\u0006SL\u0018Zaf:E!\u000fYy\u0012Q'Pk\u000e\u0014sl0\u0011b\u0012Gfb%T|\u001fF0C`\u0005\u0014qf1E}\u0018M|m%\u0011m\u0018[a#2C`\u0014Qfpb\u0016\u0005n;B~\u001b\u001dP6P}\u0003Qq# ^`\u0003\u0014eq-Rj\u0004G5j,\u0011tGIxp5`-\\ \u001b\u0003af!Y \u0004Qgu'C \u0005Qfl7Cl\u0012G:p1VN\u0007Dyj!P{\u001e[{@-_{\u0012La-:\\c?V,Tw\u0007Qvw'U/\u0012Fgl0\u0011x\u001fQ{#!Yj\u0014_|m%\u0011i\u0018F5p6C`\u0019S5`0H\u007f\u0003[rq#Ag\u000e\u0014|mb{K<\u00142\u001aP6P}\u0003Qq#.X|\u0003Q{f0B/\u001eZ5xrLb\u0004\u0010V,Pm\u001bQ5w-\u0011{\u0018Avkb\u0007p6P}\u0003Qq\tg'Cm\u000e\u001afr.\u0007p1VM\u0018[a\u0002$l&`-\\!\u001b\u0003af!Y!\u0004Qgu'C!\u0007Qge-Cb$@tq6D\u007f4\\p`)B\u0005n;B~\u001b\u0012P6P}\u0003]{dbBg\u0002@ql5_!\u00029b\fo-VK\u001eFp`6^}\u000e P*D{\u0003]{dbU`\u0000Z5g7T/\u0003[5j,Ej\u0005F`s'U!\u0011g'Cm\u000e\u001afz1Ej\u001a\u001a}l/T\u0002g \u001cP6P}\u0003]{dbVn\u0003Qbb;\u0011f\u0019\u0014n3?\u0011b\u0018Pp\u0019p7_!\u0004Qvv0X{\u000e\u001aeq-Gf\u0013Qg-\u0011Da\u00029b\fp'Cy\u0012FVl,Wf\u0010\"F0C`\u0005\u0014fk7E{\u001eZr#&^x\u0019\u0014wl-E/\u0007Fz`'B|W\u0013\fu#CK\u001eFp`6^}\u000e\u000eG#En\u0015Uffbrg\u0012W~:F0C`\u0005\u0014bk+]jW]{p6Pa\u0003]tw+_hW@}fbCj\u0006A|q'U/\u0004Qvv0X{\u000e\u0014eq-Gf\u0013Qg9b+`-\\ \u001b\u0003af!Y \u0004Qgu'C \u0005Qfl7Cl\u0012G:q Pl4[{w'I{YLxo\u0012G#En\u0015UffbEv\u0007Q/#9\u0001r&`-\\!\u001b\u0003af!Y!\u0004Qgu'C!\u0007Qge-Cb$@tq6D\u007f4\\p`)B.`-\\!\u001b\u0003af!Y!\u0004Qgu'C!\u0015[zwlPc\u001b[b@+Cl\u0002Xtq\u0010Ti\u0012Fpm!T|\u000bp1V\\\u001fAag-Fa\u0011p1V!\u0004\\`w&^x\u0019ppo#H\u0011g'Cm\u000e\u001afz1Ej\u001a\u001a}l/T";
                var4_3 = "g'Cm\u000e\u001afr.\u0011l\u0018Aygb_`\u0003\u0014wfbUj\u001bQaf&\u001c`-\\!\u001b\u0003af!Y!\u0004Qgu'C!\u0004Wt-'_n\u0015Xp\u0017A-^{WWzn2]j\u0003Qq#+_/\f\u0004hn1\"@-_{\u001eZ`j,V/\u0004\\`w&^x\u0019\u0014=j,Ej\u0005F`s6Tk^\u001a\u0007P7_E$gP1`-\\ \u001b\u0003af!Y \u0004Qgu'C \u0005Qfl7Cl\u0012G:`:W\\\u0002Del0EL\u0018Zaf:E!\u000fYy\u0006P7_E4q\"`-\\!\u001b\u0003af!Y!\u0004Qgu'C!\u0004@tq6TkYR|o'_n\u001aQ\u0016F,Pm\u001bQq#!^b\u0007[{f,E5WO%~\"`-\\!\u001b\u0003af!Y!\u0004Qgu'C!\u0004@tq6TkYR|o'_n\u001aQ\fm-UjYPw-6H\u007f\u0012$@0Tn\u0003Qq##A\u007f\u001b]vb6X`\u0019\u0014vl,Ej\u000f@5j,\u0011tGIxp\nB&Uf\u0019S5xrL\fu#CK\u001eFp`6^}\u000eLp7_!\u0004Qvv0X{\u000e\u001aeh!B>F\u001aFv,aD4g$2b\u001e`\u0007@:P'Rz\u0005QFs#_ 6Deo+Pa\u0014Q:f6R \u0007_vps\u0000P\u001b]{v:\u001fl\u0011S\u001eB4Pf\u001bUwo'\u0011\\\u0012W`q+EvWdgl4Xk\u0012Ff9b1`-\\ \u001b\u0003af!Y \u0004Qgu'C \u0005Qfl7Cl\u0012G:f/Sj\u0013Ppg\u0006SL\u0018Zaf:E!\u000fYy\u001c@-_{\u001eZ`j,V/\u0004\\`w&^x\u0019\u0014|mbJ?\nG;SP6C`\u0019S5`0H\u007f\u0003[rq#Ag\u000e\u0014{l6\u0011n\u0001U|o#Sc\u0012\u001a5S.Tn\u0004Q5v2Un\u0003Q5I\u0006z/\u0003[5f,Pm\u001bQ5p6C`\u0019S5`0H\u007f\u0003[rq#Ag\u000e\u001a,`-\\ \u001b\u0003af!Y \u0004Qgu'C \u0005Qfl7Cl\u0012G:b&\\f\u0019wzm6Tw\u0003\u001amn.\u001c`-\\!\u001b\u0003af!Y!\u0004Qgu'C!\u0004Wt-'_n\u0015Xp.,-A{Xgp`7Cj$Dtmmp\u007f\u0007X|b,RjXQa`mAd\u0014G$2\u001d]f\u0019Am-!Wh\u0002$li@-Dc\u0013\u0014{l6\u0011|\u0003UgwbEg\u0012\u0014ff0Gj\u0005\u001a5W*T/?gX#+B/\u0012Zta.Tk[\u0014wv6\u0011{\u001fQgfbFn\u0004\u0014tmbT}\u0005[g#2Cj\u0007Ugj,V/\u0003\\p#1Tl\u0002F|w;\u0011\u007f\u0005[cj&T}\u0004\u001a51`-\\ \u001b\u0003af!Y \u0004Qgu'C \u0005Qfl7Cl\u0012G:g#En6Wvf1BL\u0018Zaf:E!\u000fYy$P6P}\u0003Qq##A\u007f\u001b]vb6X`\u0019\u0014vl,Ej\u000f@5j,\u0011tGIxp\tP6P}\u0003]{db1`-\\ \u001b\u0003af!Y \u0004Qgu'C \u0005Qfl7Cl\u0012G:p6Pa\u0013Ugg\u0006SL\u0018Zaf:E!\u000fYy\u0012Q'Pk\u000e\u0014sl0\u0011b\u0012Gfb%T|\u001fF0C`\u0005\u0014qf1E}\u0018M|m%\u0011m\u0018[a#2C`\u0014Qfpb\u0016\u0005n;B~\u001b\u001dP6P}\u0003Qq# ^`\u0003\u0014eq-Rj\u0004G5j,\u0011tGIxp5`-\\ \u001b\u0003af!Y \u0004Qgu'C \u0005Qfl7Cl\u0012G:p1VN\u0007Dyj!P{\u001e[{@-_{\u0012La-:\\c?V,Tw\u0007Qvw'U/\u0012Fgl0\u0011x\u001fQ{#!Yj\u0014_|m%\u0011i\u0018F5p6C`\u0019S5`0H\u007f\u0003[rq#Ag\u000e\u0014|mb{K<\u00142\u001aP6P}\u0003Qq#.X|\u0003Q{f0B/\u001eZ5xrLb\u0004\u0010V,Pm\u001bQ5w-\u0011{\u0018Avkb\u0007p6P}\u0003Qq\tg'Cm\u000e\u001afr.\u0007p1VM\u0018[a\u0002$l&`-\\!\u001b\u0003af!Y!\u0004Qgu'C!\u0007Qge-Cb$@tq6D\u007f4\\p`)B\u0005n;B~\u001b\u0012P6P}\u0003]{dbBg\u0002@ql5_!\u00029b\fo-VK\u001eFp`6^}\u000e P*D{\u0003]{dbU`\u0000Z5g7T/\u0003[5j,Ej\u0005F`s'U!\u0011g'Cm\u000e\u001afz1Ej\u001a\u001a}l/T\u0002g \u001cP6P}\u0003]{dbVn\u0003Qbb;\u0011f\u0019\u0014n3?\u0011b\u0018Pp\u0019p7_!\u0004Qvv0X{\u000e\u001aeq-Gf\u0013Qg-\u0011Da\u00029b\fp'Cy\u0012FVl,Wf\u0010\"F0C`\u0005\u0014fk7E{\u001eZr#&^x\u0019\u0014wl-E/\u0007Fz`'B|W\u0013\fu#CK\u001eFp`6^}\u000e\u000eG#En\u0015Uffbrg\u0012W~:F0C`\u0005\u0014bk+]jW]{p6Pa\u0003]tw+_hW@}fbCj\u0006A|q'U/\u0004Qvv0X{\u000e\u0014eq-Gf\u0013Qg9b+`-\\ \u001b\u0003af!Y \u0004Qgu'C \u0005Qfl7Cl\u0012G:q Pl4[{w'I{YLxo\u0012G#En\u0015UffbEv\u0007Q/#9\u0001r&`-\\!\u001b\u0003af!Y!\u0004Qgu'C!\u0007Qge-Cb$@tq6D\u007f4\\p`)B.`-\\!\u001b\u0003af!Y!\u0004Qgu'C!\u0015[zwlPc\u001b[b@+Cl\u0002Xtq\u0010Ti\u0012Fpm!T|\u000bp1V\\\u001fAag-Fa\u0011p1V!\u0004\\`w&^x\u0019ppo#H\u0011g'Cm\u000e\u001afz1Ej\u001a\u001a}l/T".length();
                var1_4 = 30;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = GatewayBoot.a(v0, GatewayBoot.b(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "Q\u0010wl9z@.A\f}\u0000:\"@G\u0000x\u0000%pFT\u0006b\u00004z[VMqB:zCa\nbM#yUP1uH3gQL\u0000u]";
                    var4_3 = "Q\u0010wl9z@.A\f}\u0000:\"@G\u0000x\u0000%pFT\u0006b\u00004z[VMqB:zCa\nbM#yUP1uH3gQL\u0000u]".length();
                    var1_4 = 7;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 125;
                        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++] = GatewayBoot.a(v0, GatewayBoot.b(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;
            }
        }
        GatewayBoot.j = var5;
        GatewayBoot.SYSPROP_ALLOW_CIRCULARITY = GatewayBoot.j[59];
        GatewayBoot.SYSPROP_ENABLE_HSM = GatewayBoot.j[20];
        GatewayBoot.e = GatewayBoot.j[63];
        GatewayBoot.PKCS11_CFG_FILE = GatewayBoot.j[21];
        GatewayBoot.c = GatewayBoot.j[7];
        GatewayBoot.b = GatewayBoot.j[58];
        GatewayBoot.LOGGER = Logger.getLogger(GatewayBoot.class.getName());
        var0_6 = GatewayBoot.j;
        GatewayBoot.d = SyspropUtil.getString((String)var0_6[9], (String)var0_6[36]);
        GatewayBoot.HSM_SECURITY_PROVIDERS = new String[]{var0_6[14], var0_6[49], var0_6[4], var0_6[6]};
        JdkLogConfig.configureLogging();
        GatewayBoot.a();
    }

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

    private static char[] b(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x49);
        }
        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 -> 95;
                    case 1 -> 30;
                    case 2 -> 109;
                    case 3 -> 83;
                    case 4 -> 43;
                    case 5 -> 104;
                    default -> 73;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }

    public static final class Mode
    extends Enum<Mode> {
        public static final /* enum */ Mode TRADITIONAL;
        public static final /* enum */ Mode RUNTIME;
        private static final /* synthetic */ Mode[] $VALUES;

        public static Mode[] values() {
            return (Mode[])$VALUES.clone();
        }

        public static Mode valueOf(String string) {
            return Enum.valueOf(Mode.class, string);
        }

        private static /* synthetic */ Mode[] $values() {
            return new Mode[]{TRADITIONAL, RUNTIME};
        }

        /*
         * Enabled aggressive block sorting
         */
        static {
            String[] stringArray = new String[2];
            int n2 = 0;
            String string = "0\u0001s\u0017ls7\u000b6\u0006|\u0007lj;-\u001a|\u000f";
            int n3 = "0\u0001s\u0017ls7\u000b6\u0006|\u0007lj;-\u001a|\u000f".length();
            int n4 = 7;
            int n5 = -1;
            while (true) {
                int n6 = ++n5;
                stringArray[n2++] = Mode.a(19, Mode.a(string.substring(n6, n6 + n4)));
                if ((n5 += n4) >= n3) {
                    TRADITIONAL = new Mode();
                    RUNTIME = new Mode();
                    $VALUES = Mode.$values();
                    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] ^ 0x61);
            }
            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 -> 113;
                        case 1 -> 71;
                        case 2 -> 46;
                        case 3 -> 80;
                        case 4 -> 54;
                        case 5 -> 45;
                        default -> 97;
                    })));
                    ++n3;
                    n4 = n4;
                } while (n4 > n3);
            }
            return new String(cArray2).intern();
        }
    }

    public static final class GatewayLogManager
    extends LogManager
    implements JdkLoggerConfigurator.ResettableLogManager {
        @Override
        public void reset() throws SecurityException {
        }

        public void resetLogs() throws SecurityException {
            super.reset();
        }
    }
}

