/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.audit.AuditDetailMessage
 *  com.l7tech.gateway.common.audit.SystemMessages
 *  org.springframework.context.ApplicationEvent
 */
package com.l7tech.server.audit;

import com.l7tech.gateway.common.audit.AuditDetailMessage;
import com.l7tech.gateway.common.audit.SystemMessages;
import com.l7tech.server.audit.AuditArchiver;
import com.l7tech.server.event.system.AuditArchiverEvent;
import java.util.logging.Level;
import org.springframework.context.ApplicationEvent;

class j
implements Runnable {
    final AuditArchiver this$0;
    private static final String[] a;

    j(AuditArchiver auditArchiver) {
        this.this$0 = auditArchiver;
    }

    @Override
    public void run() {
        boolean bl2 = false;
        try {
            bl2 = this.this$0.q.tryLock();
            if (bl2) {
                String[] stringArray;
                if (AuditArchiver.a.isLoggable(Level.FINE)) {
                    stringArray = a;
                    AuditArchiver.a.fine(stringArray[1] + String.valueOf(this.this$0.q));
                }
                if (this.this$0.v.isEnabled()) {
                    this.this$0.h();
                } else {
                    String[] stringArray2 = new String[1];
                    stringArray = a;
                    stringArray2[0] = stringArray[2];
                    this.this$0.g.logAndAudit((AuditDetailMessage)SystemMessages.AUDIT_ARCHIVER_ERROR, stringArray2);
                    this.this$0.getApplicationContext().publishEvent((ApplicationEvent)new AuditArchiverEvent(this));
                }
            } else {
                AuditArchiver.a.warning(a[0] + String.valueOf(this.this$0.q));
            }
        }
        finally {
            if (bl2) {
                this.this$0.q.unlock();
            }
        }
    }

    /*
     * Enabled aggressive block sorting
     */
    static {
        String[] stringArray = new String[3];
        int n2 = 0;
        String string = "``5\u0018NUo\\[\bVZ\u0001O[K\bL\u001d`|MG\bNXS.D@\u0003\u0003\u001dBa[C\u0005\u0018SNz\u000eH\u0004L\u001dBb[\\\u0015]O\u0001bAL\n\u0018[N|\u0014\u000f\ni@\u0015\u0018QNmE\u0015A\u0015|J\u0002]TWk\\\u000f\u000fWI\u0001k@N\u0003TXE ";
        int n3 = "``5\u0018NUo\\[\bVZ\u0001O[K\bL\u001d`|MG\bNXS.D@\u0003\u0003\u001dBa[C\u0005\u0018SNz\u000eH\u0004L\u001dBb[\\\u0015]O\u0001bAL\n\u0018[N|\u0014\u000f\ni@\u0015\u0018QNmE\u0015A\u0015|J\u0002]TWk\\\u000f\u000fWI\u0001k@N\u0003TXE ".length();
        int n4 = 65;
        int n5 = -1;
        while (true) {
            int n6 = ++n5;
            stringArray[n2++] = j.a(73, j.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] ^ 0x47);
        }
        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 -> 103;
                    case 1 -> 102;
                    case 2 -> 40;
                    case 3 -> 113;
                    case 4 -> 116;
                    case 5 -> 104;
                    default -> 71;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

