package com.l7tech.server.policy.assertion.xmlsec;

import com.l7tech.common.io.CertUtils;
import com.l7tech.gateway.common.audit.AssertionMessages;
import com.l7tech.gateway.common.audit.Audit;
import com.l7tech.gateway.common.audit.AuditHaver;
import com.l7tech.message.Message;
import com.l7tech.policy.assertion.AssertionStatus;
import com.l7tech.policy.assertion.IdentityTarget;
import com.l7tech.policy.assertion.IdentityTargetable;
import com.l7tech.policy.assertion.MessageTargetable;
import com.l7tech.policy.assertion.PolicyAssertionException;
import com.l7tech.policy.assertion.TargetMessageType;
import com.l7tech.policy.assertion.xmlsec.SecurityHeaderAddressable;
import com.l7tech.policy.variable.NoSuchVariableException;
import com.l7tech.security.xml.decorator.DecorationRequirements;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.policy.assertion.AssertionStatusException;
import com.l7tech.server.policy.assertion.ServerAssertion;
import com.l7tech.util.ConfigFactory;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.HexUtils;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.logging.Level;
import java.util.logging.Logger;

public class AddWssEncryptionSupport implements AuditHaver {
   static boolean a;
   private final AuditHaver b;
   private final MessageTargetable c;
   private final X509Certificate d;
   private final SecurityHeaderAddressable e;
   private final IdentityTarget f;
   private static final String[] g;

   public AddWssEncryptionSupport(AuditHaver var1, Logger var2, MessageTargetable var3, SecurityHeaderAddressable var4, IdentityTargetable var5) {
      this.b = var1;
      this.c = var3;
      this.e = var4;
      this.f = new IdentityTarget(var5.getIdentityTarget());
      X509Certificate var6 = null;
      if (!var4.getRecipientContext().localRecipient()) {
         try {
            var6 = CertUtils.decodeCert(HexUtils.decodeBase64(var4.getRecipientContext().getBase64edX509Certificate(), true));
         } catch (CertificateException var8) {
            var2.log(Level.WARNING, g[2] + var8.getMessage(), var8);
            var6 = null;
         }
      }

      this.d = var6;
   }

   public Message getTargetMessage(PolicyEnforcementContext var1) throws AssertionStatusException {
      try {
         return var1.getTargetMessage(this.c);
      } catch (NoSuchVariableException var3) {
         this.getAuditor().logAndAudit(AssertionMessages.MESSAGE_TARGET_ERROR, new String[]{var3.getVariable(), ExceptionUtils.getMessage(var3)});
         throw new AssertionStatusException(AssertionStatus.FAILED);
      }
   }

   public Audit getAuditor() {
      return this.b.getAuditor();
   }

   public AddWssEncryptionContext buildEncryptionContext(PolicyEnforcementContext param1) throws PolicyAssertionException, AddWssEncryptionSupport.MultipleTokensException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 000: aconst_null
      // 001: astore 2
      // 002: aconst_null
      // 003: astore 3
      // 004: aconst_null
      // 005: astore 4
      // 007: aconst_null
      // 008: astore 5
      // 00a: aload 0
      // 00b: getfield com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.e Lcom/l7tech/policy/assertion/xmlsec/SecurityHeaderAddressable;
      // 00e: invokeinterface com/l7tech/policy/assertion/xmlsec/SecurityHeaderAddressable.getRecipientContext ()Lcom/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext; 1
      // 013: invokevirtual com/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext.localRecipient ()Z
      // 016: ifne 063
      // 019: aload 0
      // 01a: getfield com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.d Ljava/security/cert/X509Certificate;
      // 01d: ifnonnull 050
      // 020: goto 027
      // 023: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 026: athrow
      // 027: getstatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.g [Ljava/lang/String;
      // 02a: bipush 1
      // 02b: aaload
      // 02c: astore 6
      // 02e: aload 0
      // 02f: invokevirtual com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.getAuditor ()Lcom/l7tech/gateway/common/audit/Audit;
      // 032: getstatic com/l7tech/gateway/common/audit/AssertionMessages.EXCEPTION_WARNING_WITH_MORE_INFO Lcom/l7tech/gateway/common/audit/Messages$M;
      // 035: bipush 1
      // 036: anewarray 331
      // 039: dup
      // 03a: bipush 0
      // 03b: aload 6
      // 03d: aastore
      // 03e: invokeinterface com/l7tech/gateway/common/audit/Audit.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V 3
      // 043: new com/l7tech/server/policy/assertion/AssertionStatusException
      // 046: dup
      // 047: getstatic com/l7tech/policy/assertion/AssertionStatus.SERVER_ERROR Lcom/l7tech/policy/assertion/AssertionStatus;
      // 04a: aload 6
      // 04c: invokespecial com/l7tech/server/policy/assertion/AssertionStatusException.<init> (Lcom/l7tech/policy/assertion/AssertionStatus;Ljava/lang/String;)V
      // 04f: athrow
      // 050: aload 0
      // 051: getfield com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.d Ljava/security/cert/X509Certificate;
      // 054: astore 2
      // 055: aload 0
      // 056: getfield com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.e Lcom/l7tech/policy/assertion/xmlsec/SecurityHeaderAddressable;
      // 059: invokeinterface com/l7tech/policy/assertion/xmlsec/SecurityHeaderAddressable.getRecipientContext ()Lcom/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext; 1
      // 05e: astore 5
      // 060: goto 133
      // 063: aload 0
      // 064: invokevirtual com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a ()Z
      // 067: ifeq 133
      // 06a: aload 1
      // 06b: invokeinterface com/l7tech/server/message/PolicyEnforcementContext.getRequest ()Lcom/l7tech/message/Message; 1
      // 070: astore 6
      // 072: aload 1
      // 073: aload 6
      // 075: invokeinterface com/l7tech/server/message/PolicyEnforcementContext.getAuthenticationContext (Lcom/l7tech/message/Message;)Lcom/l7tech/server/message/AuthenticationContext; 2
      // 07a: astore 7
      // 07c: aload 6
      // 07e: invokevirtual com/l7tech/message/Message.getSecurityKnob ()Lcom/l7tech/message/SecurityKnob;
      // 081: invokeinterface com/l7tech/message/SecurityKnob.getProcessorResult ()Lcom/l7tech/security/xml/processor/ProcessorResult; 1
      // 086: astore 8
      // 088: new com/l7tech/policy/assertion/IdentityTarget
      // 08b: dup
      // 08c: invokespecial com/l7tech/policy/assertion/IdentityTarget.<init> ()V
      // 08f: aload 0
      // 090: getfield com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.f Lcom/l7tech/policy/assertion/IdentityTarget;
      // 093: invokevirtual com/l7tech/policy/assertion/IdentityTarget.equals (Ljava/lang/Object;)Z
      // 096: ifeq 0a6
      // 099: aload 7
      // 09b: invokevirtual com/l7tech/server/message/AuthenticationContext.getCredentials ()Ljava/util/List;
      // 09e: invokestatic com/l7tech/server/util/WSSecurityProcessorUtils.getSigningSecurityTokens (Ljava/util/Collection;)[Lcom/l7tech/security/token/SigningSecurityToken;
      // 0a1: astore 9
      // 0a3: goto 0da
      // 0a6: aload 8
      // 0a8: ifnull 0d4
      // 0ab: aload 7
      // 0ad: aload 8
      // 0af: aload 0
      // 0b0: getfield com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.f Lcom/l7tech/policy/assertion/IdentityTarget;
      // 0b3: invokestatic com/l7tech/server/util/WSSecurityProcessorUtils.getSigningSecurityTokenByIdentity (Lcom/l7tech/server/message/AuthenticationContext;Lcom/l7tech/security/xml/processor/ProcessorResult;Lcom/l7tech/policy/assertion/IdentityTarget;)Lcom/l7tech/security/token/SigningSecurityToken;
      // 0b6: astore 10
      // 0b8: aload 10
      // 0ba: ifnull 0cb
      // 0bd: bipush 1
      // 0be: anewarray 26
      // 0c1: dup
      // 0c2: bipush 0
      // 0c3: aload 10
      // 0c5: aastore
      // 0c6: astore 9
      // 0c8: goto 0d1
      // 0cb: bipush 0
      // 0cc: anewarray 26
      // 0cf: astore 9
      // 0d1: goto 0da
      // 0d4: bipush 0
      // 0d5: anewarray 26
      // 0d8: astore 9
      // 0da: aload 9
      // 0dc: arraylength
      // 0dd: bipush 1
      // 0de: if_icmpne 120
      // 0e1: aload 9
      // 0e3: bipush 0
      // 0e4: aaload
      // 0e5: astore 3
      // 0e6: aload 8
      // 0e8: ifnull 133
      // 0eb: aload 3
      // 0ec: instanceof com/l7tech/security/token/X509SigningSecurityToken
      // 0ef: ifeq 133
      // 0f2: goto 0f9
      // 0f5: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0f8: athrow
      // 0f9: aload 3
      // 0fa: instanceof com/l7tech/security/token/SamlSecurityToken
      // 0fd: ifeq 133
      // 100: goto 107
      // 103: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 106: athrow
      // 107: getstatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a Z
      // 10a: ifne 133
      // 10d: goto 114
      // 110: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 113: athrow
      // 114: aload 8
      // 116: invokeinterface com/l7tech/security/xml/processor/ProcessorResult.getLastKeyEncryptionAlgorithm ()Ljava/lang/String; 1
      // 11b: astore 4
      // 11d: goto 133
      // 120: aload 9
      // 122: arraylength
      // 123: bipush 1
      // 124: if_icmple 133
      // 127: new com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport$MultipleTokensException
      // 12a: dup
      // 12b: invokespecial com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport$MultipleTokensException.<init> ()V
      // 12e: athrow
      // 12f: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 132: athrow
      // 133: new com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionContext
      // 136: dup
      // 137: aload 2
      // 138: aload 3
      // 139: aload 4
      // 13b: aload 5
      // 13d: invokespecial com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionContext.<init> (Ljava/security/cert/X509Certificate;Lcom/l7tech/security/token/SigningSecurityToken;Ljava/lang/String;Lcom/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext;)V
      // 140: areturn
      // try (8 -> 16): 17 com/l7tech/policy/assertion/PolicyAssertionException
      // try (106 -> 111): 112 com/l7tech/policy/assertion/PolicyAssertionException
      // try (108 -> 117): 118 com/l7tech/policy/assertion/PolicyAssertionException
      // try (114 -> 122): 123 com/l7tech/policy/assertion/PolicyAssertionException
      // try (129 -> 137): 137 com/l7tech/policy/assertion/PolicyAssertionException
   }

   private boolean a() {
      return TargetMessageType.RESPONSE.equals(this.c.getTarget());
   }

   public void applyDecorationRequirements(
      PolicyEnforcementContext param1, DecorationRequirements param2, AddWssEncryptionContext param3, ServerAssertion param4
   ) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 0
      // 01: invokevirtual com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a ()Z
      // 04: ifeq 55
      // 07: new com/l7tech/policy/assertion/IdentityTarget
      // 0a: dup
      // 0b: invokespecial com/l7tech/policy/assertion/IdentityTarget.<init> ()V
      // 0e: aload 0
      // 0f: getfield com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.f Lcom/l7tech/policy/assertion/IdentityTarget;
      // 12: invokevirtual com/l7tech/policy/assertion/IdentityTarget.equals (Ljava/lang/Object;)Z
      // 15: ifne 55
      // 18: goto 1f
      // 1b: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1e: athrow
      // 1f: aload 2
      // 20: invokevirtual com/l7tech/security/xml/decorator/DecorationRequirements.clearTokens ()V
      // 23: aload 1
      // 24: ifnull 55
      // 27: aload 4
      // 29: ifnull 55
      // 2c: goto 33
      // 2f: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 32: athrow
      // 33: aload 1
      // 34: aload 4
      // 36: new com/l7tech/server/policy/assertion/xmlsec/a
      // 39: dup
      // 3a: aload 0
      // 3b: aload 4
      // 3d: invokeinterface com/l7tech/server/policy/assertion/ServerAssertion.getAssertion ()Lcom/l7tech/policy/assertion/Assertion; 1
      // 42: aload 2
      // 43: aload 3
      // 44: aload 4
      // 46: invokespecial com/l7tech/server/policy/assertion/xmlsec/a.<init> (Lcom/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport;Lcom/l7tech/policy/assertion/Assertion;Lcom/l7tech/security/xml/decorator/DecorationRequirements;Lcom/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionContext;Lcom/l7tech/server/policy/assertion/ServerAssertion;)V
      // 49: invokeinterface com/l7tech/server/message/PolicyEnforcementContext.addDeferredAssertion (Lcom/l7tech/server/policy/assertion/ServerAssertion;Lcom/l7tech/server/policy/assertion/ServerAssertion;)V 3
      // 4e: goto 55
      // 51: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 54: athrow
      // 55: aload 2
      // 56: invokevirtual com/l7tech/security/xml/decorator/DecorationRequirements.getKeyEncryptionAlgorithm ()Ljava/lang/String;
      // 59: ifnonnull 6b
      // 5c: aload 2
      // 5d: aload 3
      // 5e: getfield com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionContext.c Ljava/lang/String;
      // 61: invokevirtual com/l7tech/security/xml/decorator/DecorationRequirements.setKeyEncryptionAlgorithm (Ljava/lang/String;)V
      // 64: goto 6b
      // 67: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 6a: athrow
      // 6b: aload 3
      // 6c: getfield com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionContext.a Ljava/security/cert/X509Certificate;
      // 6f: ifnull 81
      // 72: aload 2
      // 73: aload 3
      // 74: getfield com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionContext.a Ljava/security/cert/X509Certificate;
      // 77: invokevirtual com/l7tech/security/xml/decorator/DecorationRequirements.setRecipientCertificate (Ljava/security/cert/X509Certificate;)V
      // 7a: goto f4
      // 7d: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 80: athrow
      // 81: aload 3
      // 82: getfield com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionContext.b Lcom/l7tech/security/token/SigningSecurityToken;
      // 85: ifnull f4
      // 88: aload 3
      // 89: getfield com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionContext.b Lcom/l7tech/security/token/SigningSecurityToken;
      // 8c: astore 5
      // 8e: aload 5
      // 90: instanceof com/l7tech/security/token/X509SigningSecurityToken
      // 93: ifeq ab
      // 96: aload 2
      // 97: aload 5
      // 99: checkcast com/l7tech/security/token/X509SigningSecurityToken
      // 9c: invokeinterface com/l7tech/security/token/X509SigningSecurityToken.getMessageSigningCertificate ()Ljava/security/cert/X509Certificate; 1
      // a1: invokevirtual com/l7tech/security/xml/decorator/DecorationRequirements.setRecipientCertificate (Ljava/security/cert/X509Certificate;)V
      // a4: goto f4
      // a7: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // aa: athrow
      // ab: aload 5
      // ad: instanceof com/l7tech/security/token/KerberosSigningSecurityToken
      // b0: ifeq c1
      // b3: aload 2
      // b4: aload 5
      // b6: invokestatic com/l7tech/server/util/WSSecurityProcessorUtils.setToken (Lcom/l7tech/security/xml/decorator/DecorationRequirements;Lcom/l7tech/security/token/SigningSecurityToken;)Z
      // b9: pop
      // ba: goto f4
      // bd: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // c0: athrow
      // c1: aload 5
      // c3: instanceof com/l7tech/security/token/SecurityContextToken
      // c6: ifne d8
      // c9: aload 5
      // cb: instanceof com/l7tech/security/token/EncryptedKey
      // ce: ifeq f4
      // d1: goto d8
      // d4: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // d7: athrow
      // d8: aload 2
      // d9: aload 5
      // db: invokestatic com/l7tech/server/util/WSSecurityProcessorUtils.setToken (Lcom/l7tech/security/xml/decorator/DecorationRequirements;Lcom/l7tech/security/token/SigningSecurityToken;)Z
      // de: ifeq f4
      // e1: goto e8
      // e4: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // e7: athrow
      // e8: aload 2
      // e9: bipush 1
      // ea: invokevirtual com/l7tech/security/xml/decorator/DecorationRequirements.setSignTimestamp (Z)V
      // ed: goto f4
      // f0: invokestatic com/l7tech/server/policy/assertion/xmlsec/AddWssEncryptionSupport.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // f3: athrow
      // f4: return
      // try (0 -> 10): 11 com/l7tech/server/policy/assertion/AssertionStatusException
      // try (13 -> 19): 20 com/l7tech/server/policy/assertion/AssertionStatusException
      // try (17 -> 34): 35 com/l7tech/server/policy/assertion/AssertionStatusException
      // try (37 -> 44): 45 com/l7tech/server/policy/assertion/AssertionStatusException
      // try (47 -> 55): 55 com/l7tech/server/policy/assertion/AssertionStatusException
      // try (63 -> 72): 72 com/l7tech/server/policy/assertion/AssertionStatusException
      // try (74 -> 82): 82 com/l7tech/server/policy/assertion/AssertionStatusException
      // try (84 -> 90): 91 com/l7tech/server/policy/assertion/AssertionStatusException
      // try (87 -> 97): 98 com/l7tech/server/policy/assertion/AssertionStatusException
      // try (93 -> 103): 104 com/l7tech/server/policy/assertion/AssertionStatusException
   }

   static {
      String[] var5 = new String[3];
      int var3 = 0;
      String var2 = "\u000bp\u00124)Y\u0013\r|\u001746\u000b\u0015\u001ez\r42\u001d\u0014F{\u001ay*\u001c\u0006\u001cv\u0010tk\u001b\u0014\r[\u001an \r\u0013\r{4\u007f</\u000b\u000fp\rs1\u0006\n.p\rI$\u0003\u000b\"\u000b~\u0011t*\u001aG\u001az\u000bh,\u000b\u0011\r?\u000br N\u0015\r|\u0016j,\u000b\t\u001c?\u001c\u007f7\u001a>)l\f\u007f7\u001a\u000e\u0007q_m,\u0002\u000bH~\u0013m$\u0017\u0014Hy\u001es)TG\u001az\u001cs5\u0007\u0002\u0006k_y \u001c\u0013H|\u001et+\u0001\u0013H}\u001a:!\u000b\u0004\u0007{\u001a~\u007fN";
      int var4 = "\u000bp\u00124)Y\u0013\r|\u001746\u000b\u0015\u001ez\r42\u001d\u0014F{\u001ay*\u001c\u0006\u001cv\u0010tk\u001b\u0014\r[\u001an \r\u0013\r{4\u007f</\u000b\u000fp\rs1\u0006\n.p\rI$\u0003\u000b\"\u000b~\u0011t*\u001aG\u001az\u000bh,\u000b\u0011\r?\u000br N\u0015\r|\u0016j,\u000b\t\u001c?\u001c\u007f7\u001a>)l\f\u007f7\u001a\u000e\u0007q_m,\u0002\u000bH~\u0013m$\u0017\u0014Hy\u001es)TG\u001az\u001cs5\u0007\u0002\u0006k_y \u001c\u0013H|\u001et+\u0001\u0013H}\u001a:!\u000b\u0004\u0007{\u001a~\u007fN"
         .length();
      char var1 = '?';
      int var0 = -1;

      while (true) {
         String var10002 = a(73, a(var2.substring(++var0, var0 + var1)));
         byte var10001 = -1;
         var5[var3++] = var10002;
         if ((var0 += var1) >= var4) {
            g = var5;
            a = ConfigFactory.getBooleanProperty(g[0], true);
            return;
         }

         var1 = var2.charAt(var0);
      }
   }

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

   private static char[] a(String var0) {
      char[] var10000 = var0.toCharArray();
      if (var10000.length < 2) {
         var10000[0] = (char)(var10000[0] ^ 46);
      }

      return var10000;
   }

   private static String a(int var0, char[] var1) {
      int var10003 = var1.length;
      int var10002 = var0;
      char[] var10001 = var1;
      int var10000 = var10003;

      for (int var2 = 0; var10000 > var2; var2++) {
         var10001[var2] = (char)(var10001[var2] ^ var10002 ^ switch (var2 % 7) {
            case 0 -> 33;
            case 1 -> 86;
            case 2 -> 54;
            case 3 -> 83;
            case 4 -> 12;
            case 5 -> 39;
            default -> 46;
         });
      }

      return new String(var10001).intern();
   }

   public static class MultipleTokensException extends Exception {
      static final long serialVersionUID = -8825657399047487863L;
   }
}
