/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.jscape.inet.ftp.FtpException
 *  com.l7tech.common.io.DigestZipOutputStream
 *  com.l7tech.gateway.common.audit.Audit
 *  com.l7tech.gateway.common.audit.LoggingAudit
 *  com.l7tech.gateway.common.cluster.ClusterProperty
 *  com.l7tech.gateway.common.transport.ftp.FtpClientConfig
 *  com.l7tech.gateway.common.transport.ftp.FtpUtils
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.util.Config
 *  com.l7tech.util.ResourceUtils
 */
package com.l7tech.server.audit;

import com.jscape.inet.ftp.FtpException;
import com.l7tech.common.io.DigestZipOutputStream;
import com.l7tech.gateway.common.audit.Audit;
import com.l7tech.gateway.common.audit.LoggingAudit;
import com.l7tech.gateway.common.cluster.ClusterProperty;
import com.l7tech.gateway.common.transport.ftp.FtpClientConfig;
import com.l7tech.gateway.common.transport.ftp.FtpUtils;
import com.l7tech.objectmodel.FindException;
import com.l7tech.server.DefaultKey;
import com.l7tech.server.audit.ArchiveReceiver;
import com.l7tech.server.audit.AuditExporter;
import com.l7tech.server.audit.aj;
import com.l7tech.server.cluster.ClusterPropertyManager;
import com.l7tech.server.policy.variable.ServerVariables;
import com.l7tech.server.transport.ftp.FtpClientUtils;
import com.l7tech.util.Config;
import com.l7tech.util.ResourceUtils;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.Closeable;
import java.io.IOException;
import java.security.PrivateKey;
import java.security.SignatureException;
import java.security.cert.X509Certificate;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.X509TrustManager;

public class FtpArchiveReceiver
implements ArchiveReceiver,
PropertyChangeListener {
    private static final Logger a;
    private static final long b = 600000L;
    public static final String TIMESTAMP_PATTERN;
    private final Config c;
    private final ClusterPropertyManager d;
    private final AuditExporter e;
    private final X509TrustManager f;
    private final HostnameVerifier g;
    private final DefaultKey h;
    private final X509Certificate i;
    private final PrivateKey j;
    private FtpClientConfig k;
    private String l;
    private long m;
    private final ReentrantLock n = new ReentrantLock();
    private DigestZipOutputStream o;
    private AuditExporter.ExportedInfo p;
    private static final String[] q;

    public FtpArchiveReceiver(Config config, ClusterPropertyManager clusterPropertyManager, AuditExporter auditExporter, X509TrustManager x509TrustManager, HostnameVerifier hostnameVerifier, DefaultKey defaultKey) {
        if (config == null) {
            String[] stringArray = q;
            throw new NullPointerException(stringArray[11]);
        }
        try {
            if (clusterPropertyManager == null) {
                throw new NullPointerException(q[26]);
            }
        }
        catch (Exception exception) {
            throw FtpArchiveReceiver.a(exception);
        }
        try {
            if (auditExporter == null) {
                throw new NullPointerException(q[10]);
            }
        }
        catch (Exception exception) {
            throw FtpArchiveReceiver.a(exception);
        }
        try {
            if (x509TrustManager == null) {
                throw new NullPointerException(q[23]);
            }
        }
        catch (Exception exception) {
            throw FtpArchiveReceiver.a(exception);
        }
        try {
            if (defaultKey == null) {
                throw new NullPointerException(q[22]);
            }
        }
        catch (Exception exception) {
            throw FtpArchiveReceiver.a(exception);
        }
        this.c = config;
        this.d = clusterPropertyManager;
        this.e = auditExporter;
        this.f = x509TrustManager;
        this.g = hostnameVerifier;
        this.h = defaultKey;
        try {
            this.i = defaultKey.getServerSslInfo().getCertificate();
            this.j = defaultKey.getServerSslInfo().getPrivateKey();
        }
        catch (Exception exception) {
            throw new RuntimeException(q[18], exception);
        }
        this.e();
    }

    @Override
    public boolean isEnabled() {
        boolean bl2 = false;
        FtpClientConfig ftpClientConfig = this.k;
        if (ftpClientConfig != null) {
            bl2 = ftpClientConfig.isEnabled();
        }
        return bl2;
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     * Unable to fully structure code
     */
    @Override
    public AuditExporter.ExportedInfo archiveRecords(long var1_1, long var3_2) {
        try {
            if (this.k == null) {
                FtpArchiveReceiver.a.warning(FtpArchiveReceiver.q[21]);
                return null;
            }
        }
        catch (Exception v0) {
            throw FtpArchiveReceiver.a(v0);
        }
        this.n.lock();
        try {
            block19: {
                block16: {
                    block17: {
                        var5_3 = this.a();
                        if (var5_3 == null) {
                            var25_5 = FtpArchiveReceiver.q;
                            FtpArchiveReceiver.a.warning(var25_5[31]);
                            var6_7 = null;
                            return var6_7;
                        }
                        if (FtpArchiveReceiver.a.isLoggable(Level.FINE)) {
                            var9_10 = this.m;
                            var11_11 = var3_2;
                            var13_12 = var1_1;
                            var25_6 = FtpArchiveReceiver.q;
                            FtpArchiveReceiver.a.fine(var25_6[32] + var13_12 + var25_6[42] + var11_11 + var25_6[9] + var9_10 + var25_6[12]);
                        }
                        var6_8 = this.e.exportAudits(var1_1, var3_2, var5_3, this.m, this.p);
                        this.p = var6_8;
                        if (this.p == null) ** GOTO lbl31
                        try {
                            block18: {
                                if (this.p.hasTransferredFullRange()) break block16;
                                break block18;
                                catch (Exception v1) {
                                    throw FtpArchiveReceiver.a(v1);
                                }
                            }
                            if (!FtpArchiveReceiver.a.isLoggable(Level.FINE)) break block17;
                        }
                        catch (Exception v2) {
                            throw FtpArchiveReceiver.a(v2);
                        }
                        var15_13 = var3_2;
                        var17_14 = var1_1;
                        var25_6 = FtpArchiveReceiver.q;
                        FtpArchiveReceiver.a.fine(var25_6[0] + var17_14 + var25_6[13] + var15_13 + var25_6[15]);
                    }
                    this.c();
                    break block19;
                }
                if (FtpArchiveReceiver.a.isLoggable(Level.FINE)) {
                    var19_15 = this.p.getTransferredBytes();
                    var21_16 = this.p.getLatestTime();
                    var23_17 = this.p.getEarliestTime();
                    var25_6 = FtpArchiveReceiver.q;
                    FtpArchiveReceiver.a.fine(var25_6[20] + var23_17 + var25_6[13] + var21_16 + var25_6[3] + var19_15 + var25_6[5]);
                }
            }
            var7_18 = var6_8;
            return var7_18;
        }
        catch (Exception var5_4) {
            FtpArchiveReceiver.a.log(Level.WARNING, FtpArchiveReceiver.q[16], var5_4);
            this.c();
            var6_9 = null;
            return var6_9;
        }
        finally {
            this.n.unlock();
        }
    }

    /*
     * Loose catch block
     */
    private DigestZipOutputStream a() {
        block10: {
            block11: {
                try {
                    if (!this.n.isHeldByCurrentThread()) {
                        a.warning(q[35] + Thread.currentThread().getName());
                        return null;
                    }
                }
                catch (FtpException ftpException) {
                    throw FtpArchiveReceiver.a((Exception)((Object)ftpException));
                }
                if (this.o != null) break block10;
                try {
                    block12: {
                        if (!a.isLoggable(Level.FINE)) break block11;
                        break block12;
                        catch (FtpException ftpException) {
                            throw FtpArchiveReceiver.a((Exception)((Object)ftpException));
                        }
                    }
                    a.fine(q[24]);
                }
                catch (FtpException ftpException) {
                    throw FtpArchiveReceiver.a((Exception)((Object)ftpException));
                }
            }
            try {
                this.o = this.e.newAuditExportOutputStream(FtpClientUtils.getUploadOutputStream(this.k, this.b(), this.h, this.f, this.g));
                this.d();
            }
            catch (FtpException ftpException) {
                String[] stringArray = q;
                a.log(Level.WARNING, stringArray[28], ftpException);
            }
            catch (IOException iOException) {
                a.log(Level.WARNING, q[30], iOException);
            }
        }
        return this.o;
    }

    private String b() {
        String[] stringArray = q;
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(stringArray[19]);
        simpleDateFormat.setTimeZone(TimeZone.getTimeZone(stringArray[36]));
        return this.l + simpleDateFormat.format(new Date(System.currentTimeMillis())) + stringArray[34];
    }

    @Override
    public boolean flush() {
        if (this.n.tryLock()) {
            try {
                boolean bl2 = this.c();
                return bl2;
            }
            finally {
                this.n.unlock();
            }
        }
        return false;
    }

    /*
     * Loose catch block
     */
    private boolean c() {
        block21: {
            block22: {
                try {
                    if (!this.n.isHeldByCurrentThread()) {
                        a.warning(q[2] + Thread.currentThread().getName());
                        return false;
                    }
                }
                catch (SignatureException signatureException) {
                    throw FtpArchiveReceiver.a(signatureException);
                }
                if (this.o != null) break block21;
                try {
                    block23: {
                        if (!a.isLoggable(Level.FINE)) break block22;
                        break block23;
                        catch (SignatureException signatureException) {
                            throw FtpArchiveReceiver.a(signatureException);
                        }
                    }
                    a.fine(q[4]);
                }
                catch (SignatureException signatureException) {
                    throw FtpArchiveReceiver.a(signatureException);
                }
            }
            return true;
        }
        try {
            if (a.isLoggable(Level.FINE)) {
                a.fine(q[1]);
            }
        }
        catch (SignatureException signatureException) {
            throw FtpArchiveReceiver.a(signatureException);
        }
        try {
            this.e.addXmlSignature(this.o, this.p, this.i, this.j);
            this.p = null;
        }
        catch (SignatureException signatureException) {
            boolean bl2;
            String[] stringArray;
            try {
                stringArray = q;
                a.log(Level.WARNING, stringArray[29], signatureException);
                bl2 = false;
            }
            catch (Throwable throwable) {
                try {
                    this.p = null;
                    ResourceUtils.closeQuietly((Closeable)this.o);
                    if (a.isLoggable(Level.FINE)) {
                        a.fine(q[38] + String.valueOf(this.o));
                    }
                }
                catch (SignatureException signatureException2) {
                    throw FtpArchiveReceiver.a(signatureException2);
                }
                this.o = null;
                throw throwable;
            }
            try {
                this.p = null;
                ResourceUtils.closeQuietly((Closeable)this.o);
                if (a.isLoggable(Level.FINE)) {
                    a.fine(stringArray[38] + String.valueOf(this.o));
                }
            }
            catch (SignatureException signatureException3) {
                throw FtpArchiveReceiver.a(signatureException3);
            }
            this.o = null;
            return bl2;
        }
        ResourceUtils.closeQuietly((Closeable)this.o);
        if (a.isLoggable(Level.FINE)) {
            String[] stringArray = q;
            a.fine(stringArray[25] + String.valueOf(this.o));
        }
        this.o = null;
        return true;
    }

    /*
     * Enabled aggressive block sorting
     * Enabled unnecessary exception pruning
     * Enabled aggressive exception aggregation
     */
    private void d() {
        try {
            if (!this.n.isHeldByCurrentThread()) {
                a.warning(q[39] + Thread.currentThread().getName());
                return;
            }
        }
        catch (NullPointerException nullPointerException) {
            throw FtpArchiveReceiver.a(nullPointerException);
        }
        try {
            if (a.isLoggable(Level.FINE)) {
                a.fine(q[27] + String.valueOf(this.o));
            }
        }
        catch (NullPointerException nullPointerException) {
            throw FtpArchiveReceiver.a(nullPointerException);
        }
        Thread thread = new Thread((Runnable)new aj(this), q[6] + System.currentTimeMillis());
        thread.setDaemon(true);
        thread.start();
    }

    @Override
    public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
        this.e();
    }

    /*
     * Loose catch block
     */
    private void e() {
        try {
            if (a.isLoggable(Level.FINE)) {
                a.fine(q[40]);
            }
        }
        catch (Exception exception) {
            throw FtpArchiveReceiver.a(exception);
        }
        try {
            String[] stringArray;
            block13: {
                String string;
                block14: {
                    String string2;
                    stringArray = q;
                    ClusterProperty clusterProperty = (ClusterProperty)this.d.findByUniqueName(stringArray[17]);
                    try {
                        string2 = clusterProperty == null ? null : clusterProperty.getValue();
                    }
                    catch (Exception exception) {
                        throw FtpArchiveReceiver.a(exception);
                    }
                    string = string2;
                    if (string == null) break block13;
                    try {
                        block15: {
                            if (string.trim().length() != 0) break block14;
                            break block15;
                            catch (Exception exception) {
                                throw FtpArchiveReceiver.a(exception);
                            }
                        }
                        a.warning(q[33]);
                        break block13;
                    }
                    catch (Exception exception) {
                        throw FtpArchiveReceiver.a(exception);
                    }
                }
                try {
                    this.k = FtpUtils.deserialize((String)string);
                    this.k.setPass(ServerVariables.expandSinglePasswordOnlyVariable((Audit)new LoggingAudit(a), this.k.getPass()));
                }
                catch (Exception exception) {
                    stringArray = q;
                    a.log(Level.WARNING, stringArray[41], exception);
                }
            }
            stringArray = q;
            this.l = this.c.getProperty(stringArray[37]);
            this.m = this.c.getLongProperty(stringArray[8], 1000000000L);
        }
        catch (FindException findException) {
            a.log(Level.WARNING, q[14], findException);
        }
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[43];
                var3_1 = 0;
                var2_2 = "\\=.7K:jk<\u007f#[-wzx-'M&lj+\u007f0O'ykxw\u0019%K6;+@.>H\f\u000f\u0003\\*vg.:\u0010K*{g.:0\u000e=lo6,$K;0 v@Z0-'O->z*6'Jijax<.A:{.7*6^<j.++0K(s./7+B,>`7+bF&rj11%\u000e=vkx3-M\"$.\u0003St\u007f,T1/bA<j~-+b]=lk92bG:>`-3.\u0002ipa,7+@.>z7\u007f!B&mkv\u0006.:&6K:!H\f\u000f\u0003\\*vg.:\u0010K*{g.:0\u0003\u001cnb7>&y(jm0:0\u0003\u0016w!&;c\u0004zj\u007f\u000bef\u0001sc+,l}nD)!o-;+Z\blm064K;Xz(\u0012#V\u001cnb7>&h rk\u000b68K(St\u007f&K:jg6>6G&p.;0,H y{*:&\u000e=q.9<!K9j.5>:\u000e)O-;+Z\ff~7-6K;>~9-#C,jk*\u007f/[:j.606\u000e+{.6*.Bg(]=-4K;]a69+Iino*>/K={|x27]=>`7+bL,>`-3.\u0000\u0007.:&6K:0\u0003.b\u007f8K*--\\ilk9;+@.>H\f\u000fbO<zg,\u007f#\\*vg.:0\u000e;{m=64K;>m71$G.k|9++A'0\u0016Sq\u007f,A=>h-3.Wi{v(00Z,z \u001eK*--\\i{v(00Z pix>7J j.*:!A;z}v\u0019o-;+Zg\u007f|;7+X,l >+2\u0000*q`>6%N]=-4K;>m71$G.k|9++A'>k*--\\s>{6> B,>z7\u007f-L=\u007fg6\u007f)K0m.>00\u000e:wi66,Ii{v(00Z,z.9*&G=m \u0016w!&;c\u0004zj\u007f\u000bef\u0001sc+,l}nD)%K /-\\={jx>7J j.*:!A;z}x(+Z!>z12'\u000e p.\u0003*H\f\u000fbO<zg,\u007f#\\*vg.:b\\,}k1)'\\ipa,\u007f!A'xg?*0K-0']+8\tK0Mz7-'\u000e9\u007f|92'Z,l.5*1Zipa,\u007f Kip{43l(Z**1Z\u0004\u007f`98'\\ino*>/K={|x27]=>`7+bL,>`-3.\u00003M*:#Z pix1'YiXZ\b\u007f#[-wzx>0M!wx=\u007f8G9>{(3-O->},-'O$0 v)H\f\u000f\u0003\\*vg.:\u0010K*{g.:0\u000e=lo6,$K;>m722B,jkx9-\\i2M4*1Z,l^*02K;jw\u0015>,O.{|x/#\\(sk,:0\u000e$k},\u007f,A=>l=\u007f,[%r 8],>0Z pix\u0019\u0016~\blm064K\u001b{m=64K;>z*>,]/{|x(#Z*vk*\u007f6F;{o<\u007f$A;>.K*--\\i}|=>6G'y.7*6^<j.++0K(s.>00\u000e(kj1+bK1na*+l5K*--\\i\u007fj<6,Iimg?1#Z<lkx+-\u000e=vkx::^&lz=;bO<zg,\u007f#\\*vg.:l.K*--\\i}|=>6G'y.7*6^<j.++0K(s.>00\u000e(kj1+bK1na*+l4M7*.J'9zx8'Ziq{,/7Zimz*:#Cixa*\u007f#[-wzx-'M&ljx::^&lz=-0],>0Z pix::^&lzx9-\\i\u007f{<66\u000e;{m7-&]iig,7bZ skx6,\u000e\u0012EG6)#B z.p:/^=g'x,'\\ \u007fb1%'Ji}a69+I<lo,6-@ilk,-+K?{jx90A$>z0:bJ(jo:>1Kg\u0004 \"62JZ0-'O->z*6'Jijax8'Zijf=\u007f-[=n{,\u007f5F rkx1-Ziva4;+@.>z0:bB&}ec\u007f0K=k|66,Iip{43l\u0003I\u0015\u000b\u001ao-;+Z\blm064K;Xz(\u0019+B,n|=9+V)H\f\u000f\u0003\\*vg.:\u0010K*{g.:0\u000e=lo6,$K;>m722B,jkx9-\\iBZ*6'Jijax,6O;j.,-#@:xk*\u007f5O=}f=-bZ!lk9;bY!wb=\u007f,A=>f73&G'y.,7'\u000e%qm3q\u0018\\=3-O-w`?\u007f!A'xg?*0O=wa6q";
                var4_3 = "\\=.7K:jk<\u007f#[-wzx-'M&lj+\u007f0O'ykxw\u0019%K6;+@.>H\f\u000f\u0003\\*vg.:\u0010K*{g.:0\u000e=lo6,$K;0 v@Z0-'O->z*6'Jijax<.A:{.7*6^<j.++0K(s./7+B,>`7+bF&rj11%\u000e=vkx3-M\"$.\u0003St\u007f,T1/bA<j~-+b]=lk92bG:>`-3.\u0002ipa,7+@.>z7\u007f!B&mkv\u0006.:&6K:!H\f\u000f\u0003\\*vg.:\u0010K*{g.:0\u0003\u001cnb7>&y(jm0:0\u0003\u0016w!&;c\u0004zj\u007f\u000bef\u0001sc+,l}nD)!o-;+Z\blm064K;Xz(\u0012#V\u001cnb7>&h rk\u000b68K(St\u007f&K:jg6>6G&p.;0,H y{*:&\u000e=q.9<!K9j.5>:\u000e)O-;+Z\ff~7-6K;>~9-#C,jk*\u007f/[:j.606\u000e+{.6*.Bg(]=-4K;]a69+Iino*>/K={|x27]=>`7+bL,>`-3.\u0000\u0007.:&6K:0\u0003.b\u007f8K*--\\ilk9;+@.>H\f\u000fbO<zg,\u007f#\\*vg.:0\u000e;{m=64K;>m71$G.k|9++A'0\u0016Sq\u007f,A=>h-3.Wi{v(00Z,z \u001eK*--\\i{v(00Z pix>7J j.*:!A;z}v\u0019o-;+Zg\u007f|;7+X,l >+2\u0000*q`>6%N]=-4K;>m71$G.k|9++A'>k*--\\s>{6> B,>z7\u007f-L=\u007fg6\u007f)K0m.>00\u000e:wi66,Ii{v(00Z,z.9*&G=m \u0016w!&;c\u0004zj\u007f\u000bef\u0001sc+,l}nD)%K /-\\={jx>7J j.*:!A;z}x(+Z!>z12'\u000e p.\u0003*H\f\u000fbO<zg,\u007f#\\*vg.:b\\,}k1)'\\ipa,\u007f!A'xg?*0K-0']+8\tK0Mz7-'\u000e9\u007f|92'Z,l.5*1Zipa,\u007f Kip{43l(Z**1Z\u0004\u007f`98'\\ino*>/K={|x27]=>`7+bL,>`-3.\u00003M*:#Z pix1'YiXZ\b\u007f#[-wzx>0M!wx=\u007f8G9>{(3-O->},-'O$0 v)H\f\u000f\u0003\\*vg.:\u0010K*{g.:0\u000e=lo6,$K;>m722B,jkx9-\\i2M4*1Z,l^*02K;jw\u0015>,O.{|x/#\\(sk,:0\u000e$k},\u007f,A=>l=\u007f,[%r 8],>0Z pix\u0019\u0016~\blm064K\u001b{m=64K;>z*>,]/{|x(#Z*vk*\u007f6F;{o<\u007f$A;>.K*--\\i}|=>6G'y.7*6^<j.++0K(s.>00\u000e(kj1+bK1na*+l5K*--\\i\u007fj<6,Iimg?1#Z<lkx+-\u000e=vkx::^&lz=;bO<zg,\u007f#\\*vg.:l.K*--\\i}|=>6G'y.7*6^<j.++0K(s.>00\u000e(kj1+bK1na*+l4M7*.J'9zx8'Ziq{,/7Zimz*:#Cixa*\u007f#[-wzx-'M&ljx::^&lz=-0],>0Z pix::^&lzx9-\\i\u007f{<66\u000e;{m7-&]iig,7bZ skx6,\u000e\u0012EG6)#B z.p:/^=g'x,'\\ \u007fb1%'Ji}a69+I<lo,6-@ilk,-+K?{jx90A$>z0:bJ(jo:>1Kg\u0004 \"62JZ0-'O->z*6'Jijax8'Zijf=\u007f-[=n{,\u007f5F rkx1-Ziva4;+@.>z0:bB&}ec\u007f0K=k|66,Iip{43l\u0003I\u0015\u000b\u001ao-;+Z\blm064K;Xz(\u0019+B,n|=9+V)H\f\u000f\u0003\\*vg.:\u0010K*{g.:0\u000e=lo6,$K;>m722B,jkx9-\\iBZ*6'Jijax,6O;j.,-#@:xk*\u007f5O=}f=-bZ!lk9;bY!wb=\u007f,A=>f73&G'y.,7'\u000e%qm3q\u0018\\=3-O-w`?\u007f!A'xg?*0O=wa6q".length();
                var1_4 = 32;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = FtpArchiveReceiver.a(v0, FtpArchiveReceiver.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "V'82S1k?:+!V9cv3+7\u001f>`m$n!Z,}v,86[xim&#sK0j?-/'^:nl,`\u0003?sn";
                    var4_3 = "V'82S1k?:+!V9cv3+7\u001f>`m$n!Z,}v,86[xim&#sK0j?-/'^:nl,`\u0003?sn".length();
                    var1_4 = 52;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 47;
                        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++] = FtpArchiveReceiver.a(v0, FtpArchiveReceiver.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;
            }
        }
        FtpArchiveReceiver.q = var5;
        FtpArchiveReceiver.TIMESTAMP_PATTERN = FtpArchiveReceiver.q[7];
        FtpArchiveReceiver.a = Logger.getLogger(FtpArchiveReceiver.class.getName());
    }

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

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x20);
        }
        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 -> 48;
                    case 1 -> 102;
                    case 2 -> 97;
                    case 3 -> 124;
                    case 4 -> 16;
                    case 5 -> 119;
                    default -> 32;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

