/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.security.rbac.EntityProtectionInfo
 *  com.l7tech.gateway.common.security.rbac.Permission
 *  com.l7tech.gateway.common.security.rbac.RbacAdmin
 *  com.l7tech.gateway.common.security.rbac.Role
 *  com.l7tech.gateway.common.security.rbac.RoleAssignment
 *  com.l7tech.identity.Group
 *  com.l7tech.identity.Identity
 *  com.l7tech.identity.IdentityProvider
 *  com.l7tech.identity.User
 *  com.l7tech.objectmodel.DeleteException
 *  com.l7tech.objectmodel.Entity
 *  com.l7tech.objectmodel.EntityHeader
 *  com.l7tech.objectmodel.EntityHeaderSet
 *  com.l7tech.objectmodel.EntityType
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.PersistentEntity
 *  com.l7tech.objectmodel.SaveException
 *  com.l7tech.objectmodel.SecurityZone
 *  com.l7tech.objectmodel.UpdateException
 *  com.l7tech.policy.AssertionAccess
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.Pair
 *  jakarta.inject.Inject
 *  org.jetbrains.annotations.NotNull
 *  org.springframework.context.ApplicationEvent
 *  org.springframework.context.ApplicationEventPublisher
 *  org.springframework.context.ApplicationEventPublisherAware
 */
package com.l7tech.server.security.rbac;

import com.l7tech.gateway.common.security.rbac.EntityProtectionInfo;
import com.l7tech.gateway.common.security.rbac.Permission;
import com.l7tech.gateway.common.security.rbac.RbacAdmin;
import com.l7tech.gateway.common.security.rbac.Role;
import com.l7tech.gateway.common.security.rbac.RoleAssignment;
import com.l7tech.identity.Group;
import com.l7tech.identity.Identity;
import com.l7tech.identity.IdentityProvider;
import com.l7tech.identity.User;
import com.l7tech.objectmodel.DeleteException;
import com.l7tech.objectmodel.Entity;
import com.l7tech.objectmodel.EntityHeader;
import com.l7tech.objectmodel.EntityHeaderSet;
import com.l7tech.objectmodel.EntityType;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.PersistentEntity;
import com.l7tech.objectmodel.SaveException;
import com.l7tech.objectmodel.SecurityZone;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.policy.AssertionAccess;
import com.l7tech.server.EntityCrud;
import com.l7tech.server.event.admin.AdminEvent;
import com.l7tech.server.identity.HasDefaultRole;
import com.l7tech.server.identity.IdentityProviderFactory;
import com.l7tech.server.policy.AssertionAccessManager;
import com.l7tech.server.security.rbac.ProtectedEntityTracker;
import com.l7tech.server.security.rbac.RoleManager;
import com.l7tech.server.security.rbac.SecurityZoneManager;
import com.l7tech.server.util.JaasUtils;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.Pair;
import jakarta.inject.Inject;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jetbrains.annotations.NotNull;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;

/*
 * Exception performing whole class analysis ignored.
 */
public class RbacAdminImpl
implements ApplicationEventPublisherAware,
RbacAdmin {
    public static final String ROLE_ASSIGNMENT_AUDIT_FORMAT;
    public static final String ROLE_UNASSIGNMENT_AUDIT_FORMAT;
    private static final Logger a;
    private final RoleManager b;
    @Inject
    private SecurityZoneManager securityZoneManager;
    @Inject
    private AssertionAccessManager assertionAccessManager;
    @Inject
    private EntityCrud entityCrud;
    @Inject
    private IdentityProviderFactory identityProviderFactory;
    @Inject
    private ProtectedEntityTracker protectedEntityTracker;
    @Inject
    private ApplicationEventPublisher applicationEventPublisher;
    private static final String[] c;

    public RbacAdminImpl(RoleManager roleManager) {
        this.b = roleManager;
    }

    public Collection<Role> findAllRoles() throws FindException {
        Collection collection = this.b.findAll();
        for (Role role : collection) {
            this.a(role);
        }
        return collection;
    }

    public Role findRoleByPrimaryKey(Goid goid) throws FindException {
        return this.a((Role)this.b.findByPrimaryKey(goid));
    }

    public Collection<EntityHeader> findAllRoleHeaders() throws FindException {
        Collection collection = this.b.findAllHeaders();
        return collection;
    }

    @NotNull
    public Collection<Permission> findCurrentUserPermissions() throws FindException {
        HashSet<Permission> hashSet;
        User user = JaasUtils.getCurrentUser();
        try {
            if (user == null) {
                throw new FindException(c[27]);
            }
        }
        catch (FindException findException) {
            throw RbacAdminImpl.a((Exception)((Object)findException));
        }
        HashSet<Permission> hashSet2 = new HashSet<Permission>();
        Collection<Role> collection = this.b.getAssignedRoles(user);
        for (Role object : collection) {
            for (Permission permission3 : object.getPermissions()) {
                Permission permission2 = permission3.getAnonymousClone();
                hashSet2.add(permission2);
            }
        }
        if (hashSet2.isEmpty()) {
            Role role = this.a(user.getProviderId());
            for (Permission permission : role.getPermissions()) {
                Permission permission3;
                permission3 = permission.getAnonymousClone();
                hashSet2.add(permission3);
            }
        }
        try {
            hashSet = hashSet2;
            if (hashSet == null) {
                RbacAdminImpl.a(0);
            }
        }
        catch (FindException findException) {
            throw RbacAdminImpl.a((Exception)((Object)findException));
        }
        return hashSet;
    }

    @NotNull
    public Map<String, EntityProtectionInfo> findProtectedEntities() throws FindException {
        Map<String, EntityProtectionInfo> map;
        try {
            if (this.protectedEntityTracker == null) {
                throw new FindException(c[1]);
            }
        }
        catch (FindException findException) {
            throw RbacAdminImpl.a((Exception)((Object)findException));
        }
        try {
            map = this.protectedEntityTracker.getProtectedEntities();
            if (map == null) {
                RbacAdminImpl.a(1);
            }
        }
        catch (FindException findException) {
            throw RbacAdminImpl.a((Exception)((Object)findException));
        }
        return map;
    }

    @NotNull
    public Pair<Collection<Permission>, Map<String, EntityProtectionInfo>> findCurrentUserPermissionsAndProtectedEntities() throws FindException {
        Pair pair;
        Collection<Permission> collection = this.findCurrentUserPermissions();
        Map<String, EntityProtectionInfo> map = this.findProtectedEntities();
        try {
            pair = Pair.pair(collection, map);
            if (pair == null) {
                RbacAdminImpl.a(2);
            }
        }
        catch (FindException findException) {
            throw RbacAdminImpl.a((Exception)((Object)findException));
        }
        return pair;
    }

    private Role a(Goid goid) throws FindException {
        IdentityProvider identityProvider = this.identityProviderFactory.getProvider(goid);
        if (identityProvider instanceof HasDefaultRole) {
            HasDefaultRole hasDefaultRole = (HasDefaultRole)identityProvider;
            Goid goid2 = hasDefaultRole.getDefaultRoleId();
            try {
                if (goid2 != null) {
                    return (Role)this.b.findByPrimaryKey(goid2);
                }
            }
            catch (FindException findException) {
                throw RbacAdminImpl.a((Exception)((Object)findException));
            }
        }
        return null;
    }

    public Collection<Role> findRolesForUser(User user) throws FindException {
        try {
            if (user == null) {
                throw new IllegalArgumentException(c[15]);
            }
        }
        catch (FindException findException) {
            throw RbacAdminImpl.a((Exception)((Object)findException));
        }
        ArrayList<Role> arrayList = new ArrayList<Role>();
        arrayList.addAll(this.b.getAssignedRoles(user, true, false));
        for (Role role : arrayList) {
            this.a(role);
        }
        return arrayList;
    }

    public Role findDefaultRoleForIdentityProvider(Goid goid) throws FindException {
        return this.a(goid);
    }

    public Collection<Role> findRolesForGroup(@NotNull Group group) throws FindException {
        try {
            if (group == null) {
                RbacAdminImpl.a(3);
            }
        }
        catch (FindException findException) {
            throw RbacAdminImpl.a((Exception)((Object)findException));
        }
        Collection<Role> collection = this.b.getAssignedRoles(group);
        for (Role role : collection) {
            this.a(role);
        }
        return collection;
    }

    /*
     * Exception decompiling
     */
    private Role a(Role var1_1) {
        /*
         * 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: Back jump on a try block [egrp 2[TRYBLOCK] [1, 0, 3 : 25->40)] com.l7tech.objectmodel.FindException
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs.insertExceptionBlocks(Op02WithProcessedDataAndRefs.java:2283)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:415)
         *     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:1055)
         *     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");
    }

    public Goid saveRole(@NotNull Role role, @NotNull Collection<Pair<RoleAssignment, Identity>> collection, @NotNull Collection<RoleAssignment> collection2) throws SaveException {
        Goid goid;
        try {
            if (role == null) {
                RbacAdminImpl.a(4);
            }
        }
        catch (UpdateException updateException) {
            throw RbacAdminImpl.a((Exception)((Object)updateException));
        }
        try {
            if (collection == null) {
                RbacAdminImpl.a(5);
            }
        }
        catch (UpdateException updateException) {
            throw RbacAdminImpl.a((Exception)((Object)updateException));
        }
        try {
            if (collection2 == null) {
                RbacAdminImpl.a(6);
            }
        }
        catch (UpdateException updateException) {
            throw RbacAdminImpl.a((Exception)((Object)updateException));
        }
        if (role.isUnsaved()) {
            goid = this.b.save((PersistentEntity)role);
        } else {
            goid = role.getGoid();
            try {
                this.b.update((PersistentEntity)role);
            }
            catch (UpdateException updateException) {
                throw new SaveException(updateException.getMessage(), (Throwable)updateException);
            }
        }
        for (Pair<RoleAssignment, Identity> roleAssignment : collection) {
            String[] stringArray = c;
            this.applicationEventPublisher.publishEvent((ApplicationEvent)new AdminEvent(this, stringArray[22].formatted(((Identity)roleAssignment.right).getClass().getSimpleName(), ((RoleAssignment)roleAssignment.left).getIdentityId(), ((Identity)roleAssignment.right).getName(), role.getName()), Level.INFO){
                static final long serialVersionUID = -234685293298361530L;
            });
        }
        for (RoleAssignment roleAssignment : collection2) {
            Identity identity = this.a(roleAssignment.getProviderId(), roleAssignment.getIdentityId(), roleAssignment.getEntityType());
            String string = "";
            String string2 = "";
            if (identity != null) {
                string = identity.getClass().getSimpleName();
                string2 = identity.getName();
            }
            this.applicationEventPublisher.publishEvent((ApplicationEvent)new AdminEvent(this, c[30].formatted(string, roleAssignment.getIdentityId(), string2, role.getName()), Level.INFO){
                static final long serialVersionUID = -558003895463694170L;
            });
        }
        return goid;
    }

    private Identity a(Goid goid, String string, @NotNull String string2) {
        try {
            if (string2 == null) {
                RbacAdminImpl.a(7);
            }
        }
        catch (FindException findException) {
            throw RbacAdminImpl.a((Exception)((Object)findException));
        }
        try {
            IdentityProvider identityProvider = this.identityProviderFactory.getProvider(goid);
            if (string2.equalsIgnoreCase(EntityType.USER.getName())) {
                return identityProvider.getUserManager().findByPrimaryKey(string);
            }
            try {
                if (string2.equalsIgnoreCase(EntityType.GROUP.getName())) {
                    return identityProvider.getGroupManager().findByPrimaryKey(string);
                }
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw RbacAdminImpl.a(illegalArgumentException);
            }
        }
        catch (FindException findException) {
            // empty catch block
        }
        return null;
    }

    public Goid saveRole(@NotNull Role role) throws SaveException {
        try {
            if (role == null) {
                RbacAdminImpl.a(8);
            }
        }
        catch (SaveException saveException) {
            throw RbacAdminImpl.a((Exception)((Object)saveException));
        }
        return this.saveRole(role, Collections.emptyList(), Collections.emptyList());
    }

    public void deleteRole(Role role) throws DeleteException {
        this.b.delete((PersistentEntity)role);
    }

    public EntityHeaderSet<EntityHeader> findEntities(EntityType entityType) throws FindException {
        return this.entityCrud.findAll(entityType.getEntityClass());
    }

    public Collection<SecurityZone> findAllSecurityZones() throws FindException {
        return this.securityZoneManager.findAll();
    }

    public SecurityZone findSecurityZoneByPrimaryKey(Goid goid) throws FindException {
        return (SecurityZone)this.securityZoneManager.findByPrimaryKey(goid);
    }

    public Goid saveSecurityZone(SecurityZone securityZone) throws SaveException {
        if (SecurityZone.DEFAULT_GOID.equals((Object)securityZone.getGoid())) {
            Goid goid = this.securityZoneManager.save((PersistentEntity)securityZone);
            this.securityZoneManager.createRoles((PersistentEntity)securityZone);
            return goid;
        }
        Goid goid = securityZone.getGoid();
        try {
            this.securityZoneManager.update((PersistentEntity)securityZone);
            this.securityZoneManager.updateRoles((PersistentEntity)securityZone);
        }
        catch (UpdateException updateException) {
            throw new SaveException(ExceptionUtils.getMessage((Throwable)updateException), (Throwable)updateException);
        }
        return goid;
    }

    public void deleteSecurityZone(SecurityZone securityZone) throws DeleteException {
        this.securityZoneManager.delete((PersistentEntity)securityZone);
    }

    public Collection<EntityHeader> findEntitiesByTypeAndSecurityZoneGoid(@NotNull EntityType entityType, Goid goid) throws FindException {
        try {
            if (entityType == null) {
                RbacAdminImpl.a(9);
            }
        }
        catch (FindException findException) {
            throw RbacAdminImpl.a((Exception)((Object)findException));
        }
        return this.entityCrud.findByEntityTypeAndSecurityZoneGoid(entityType, goid);
    }

    public void setSecurityZoneForEntities(Goid goid, @NotNull EntityType entityType, @NotNull Collection<Serializable> collection) throws UpdateException {
        try {
            if (entityType == null) {
                RbacAdminImpl.a(10);
            }
        }
        catch (UpdateException updateException) {
            throw RbacAdminImpl.a((Exception)((Object)updateException));
        }
        try {
            if (collection == null) {
                RbacAdminImpl.a(11);
            }
        }
        catch (UpdateException updateException) {
            throw RbacAdminImpl.a((Exception)((Object)updateException));
        }
        this.entityCrud.setSecurityZoneForEntities(goid, entityType, collection);
    }

    public void setSecurityZoneForEntities(Goid goid, @NotNull Map<EntityType, Collection<Serializable>> map) throws UpdateException {
        try {
            if (map == null) {
                RbacAdminImpl.a(12);
            }
        }
        catch (UpdateException updateException) {
            throw RbacAdminImpl.a((Exception)((Object)updateException));
        }
        this.entityCrud.setSecurityZoneForEntities(goid, map);
    }

    public Collection<AssertionAccess> findAccessibleAssertions() throws FindException {
        return this.assertionAccessManager.findAllRegistered();
    }

    /*
     * Loose catch block
     */
    public Goid saveAssertionAccess(AssertionAccess assertionAccess) throws UpdateException {
        String string = assertionAccess.getName();
        try {
            if (string == null) {
                throw new IllegalArgumentException(c[0]);
            }
        }
        catch (FindException findException) {
            throw RbacAdminImpl.a((Exception)((Object)findException));
        }
        try {
            Goid goid;
            block10: {
                goid = assertionAccess.getGoid();
                if (assertionAccess.isUnsaved()) {
                    goid = this.assertionAccessManager.save((PersistentEntity)assertionAccess);
                    assertionAccess.setGoid(goid);
                    return goid;
                }
                AssertionAccess assertionAccess2 = (AssertionAccess)this.assertionAccessManager.findByPrimaryKey(goid);
                if (assertionAccess2 == null) break block10;
                try {
                    block11: {
                        if (string.equals(assertionAccess2.getName())) break block10;
                        break block11;
                        catch (FindException findException) {
                            throw RbacAdminImpl.a((Exception)((Object)findException));
                        }
                    }
                    throw new UpdateException(c[24]);
                }
                catch (FindException findException) {
                    throw RbacAdminImpl.a((Exception)((Object)findException));
                }
            }
            this.assertionAccessManager.update((PersistentEntity)assertionAccess);
            return goid;
        }
        catch (FindException | SaveException throwable) {
            throw new UpdateException(c[12] + ExceptionUtils.getMessage((Throwable)throwable), throwable);
        }
    }

    public EntityHeader findHeader(EntityType entityType, Serializable serializable) throws FindException {
        return this.entityCrud.findHeader(entityType, serializable);
    }

    public Entity find(@NotNull EntityHeader entityHeader) throws FindException {
        try {
            if (entityHeader == null) {
                RbacAdminImpl.a(13);
            }
        }
        catch (FindException findException) {
            throw RbacAdminImpl.a((Exception)((Object)findException));
        }
        return this.entityCrud.find(entityHeader);
    }

    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
        this.applicationEventPublisher = applicationEventPublisher;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[32];
                var3_1 = 0;
                var2_2 = "h\u007f\u00005,YdFb23=H~Z,\u001e%-Y-Am\u00055~Lc\tm\u0000#;_y@c\u001dp=AlZ\u007fS>?@h'y~\u001c$;NyLh6>*DyPX\u00011=Fh[,\u001a#~Cb],\u0012&?DaHn\u001f5%Oe\u001d4\u001bCy@x\u001a5-ot}u\u00035\u001fCizi\u0010%,DyPV\u001c>;jb@h\nLb\u00079*TYP|\u0016\fHy\u00179*ihEi\u00075:\u0004Oe\u001d4\tLb\u00079*TDM\u007f3jc\u0006<:C*],\u001590I-R<\u000epv\u000e-R=\u000ey~Yb\tm\u0007$?Ne\tx\u001cpy\nv\u001bqTw~\u007fbEi\u0011Oe\u001d4\fBaL\u007f5?,j\u007fFy\u0003\u001f\f\u007fSs{^-\u0001)\u0000y~L~Ze\u0014>;I-]cSu-\r_F`\u0016-Jc\u001e\u007f2\u001ayLo\u001b\u007f-H\u007f_i\u0001\u007f-Hn\\~\u001a$'\u0002\u007fKm\u0010\u007f\fOlJM\u0017=7CDD|\u001f\u001aOe\u001d4\u001dX\u007f[i\u001d$\u000b^h[\\\u0016\"3D~Ze\u001c>-#|b\u001222H-]cS%.Il]iS1-^h[x\u001a?0\rlJo\u0016#-\u0017-\nHy\u00179*liMi\u0017\u001aZi\u0007\u0003;Nx[e\u0007)\u0004BcLJ\u001c\"\u001bCy@x\u001a5-\u0014|\u007f\u0016\"~NlGb\u001c$~Oh\tb\u0006<2\u0003\u0005N~\u001c%.*iB\u001c$\u0010XaE,\u001e5*EbM,V#p\b~\ta\u0006#*\rcFxS\";Yx[bS>+Aa\u0004]u\u00035\fOe\u001d4\u0017IhGx\u001a$'.Oe\u001d4\u001dX\u007f[i\u001d$\u000b^h[\\\u0016\"3D~Ze\u001c>-lcM\\\u0001?*Hn]i\u0017\u00150Yd]e\u0016#-Jc\u001e\u007f2\u001ayLo\u001b\u007f-H\u007f_i\u0001\u007f-Hn\\~\u001a$'\u0002\u007fKm\u0010\u007f\fOlJM\u0017=7CDD|\u001f\u001f\f\u007fSs{^-\u0001)\u0000y~L~Ze\u0014>;I-]cSu-\r_F`\u0016\bZm\u00055\fBaLH|b\u001222H-]cS36LcNiS$6H-H\u007f\u00005,YdFbS32L~Z,\u001d13H-FjS10\rhQe\u0000$7Cj\tM\u0000#;_y@c\u001d\u0011=NhZ\u007f>h~\u0014%3Hc],\u0015?,\rMgc\u0007\u001e+Aa\t|\u0012\"?@h]i\u0001py\b~\u000e,\u001c6~\b~\u0007)\u0000p3X~],\u001d?*\roL,\u001d%2A\u0015Oe\u001d4\u000e_b]i\u0010$;IHGx\u001a$7H~\u0019jc\u0006<:C*],\u00145*\rn\\~\u000150Y-\\\u007f\u0016\"#\f\u007fSs{^-\u0001)\u0000y~XcH\u007f\u000099ChM,\u0015\"1@-\f\u007fS\u00021Ah\u0004[c\u001f5";
                var4_3 = "h\u007f\u00005,YdFb23=H~Z,\u001e%-Y-Am\u00055~Lc\tm\u0000#;_y@c\u001dp=AlZ\u007fS>?@h'y~\u001c$;NyLh6>*DyPX\u00011=Fh[,\u001a#~Cb],\u0012&?DaHn\u001f5%Oe\u001d4\u001bCy@x\u001a5-ot}u\u00035\u001fCizi\u0010%,DyPV\u001c>;jb@h\nLb\u00079*TYP|\u0016\fHy\u00179*ihEi\u00075:\u0004Oe\u001d4\tLb\u00079*TDM\u007f3jc\u0006<:C*],\u001590I-R<\u000epv\u000e-R=\u000ey~Yb\tm\u0007$?Ne\tx\u001cpy\nv\u001bqTw~\u007fbEi\u0011Oe\u001d4\fBaL\u007f5?,j\u007fFy\u0003\u001f\f\u007fSs{^-\u0001)\u0000y~L~Ze\u0014>;I-]cSu-\r_F`\u0016-Jc\u001e\u007f2\u001ayLo\u001b\u007f-H\u007f_i\u0001\u007f-Hn\\~\u001a$'\u0002\u007fKm\u0010\u007f\fOlJM\u0017=7CDD|\u001f\u001aOe\u001d4\u001dX\u007f[i\u001d$\u000b^h[\\\u0016\"3D~Ze\u001c>-#|b\u001222H-]cS%.Il]iS1-^h[x\u001a?0\rlJo\u0016#-\u0017-\nHy\u00179*liMi\u0017\u001aZi\u0007\u0003;Nx[e\u0007)\u0004BcLJ\u001c\"\u001bCy@x\u001a5-\u0014|\u007f\u0016\"~NlGb\u001c$~Oh\tb\u0006<2\u0003\u0005N~\u001c%.*iB\u001c$\u0010XaE,\u001e5*EbM,V#p\b~\ta\u0006#*\rcFxS\";Yx[bS>+Aa\u0004]u\u00035\fOe\u001d4\u0017IhGx\u001a$'.Oe\u001d4\u001dX\u007f[i\u001d$\u000b^h[\\\u0016\"3D~Ze\u001c>-lcM\\\u0001?*Hn]i\u0017\u00150Yd]e\u0016#-Jc\u001e\u007f2\u001ayLo\u001b\u007f-H\u007f_i\u0001\u007f-Hn\\~\u001a$'\u0002\u007fKm\u0010\u007f\fOlJM\u0017=7CDD|\u001f\u001f\f\u007fSs{^-\u0001)\u0000y~L~Ze\u0014>;I-]cSu-\r_F`\u0016\bZm\u00055\fBaLH|b\u001222H-]cS36LcNiS$6H-H\u007f\u00005,YdFbS32L~Z,\u001d13H-FjS10\rhQe\u0000$7Cj\tM\u0000#;_y@c\u001d\u0011=NhZ\u007f>h~\u0014%3Hc],\u0015?,\rMgc\u0007\u001e+Aa\t|\u0012\"?@h]i\u0001py\b~\u000e,\u001c6~\b~\u0007)\u0000p3X~],\u001d?*\roL,\u001d%2A\u0015Oe\u001d4\u000e_b]i\u0010$;IHGx\u001a$7H~\u0019jc\u0006<:C*],\u00145*\rn\\~\u000150Y-\\\u007f\u0016\"#\f\u007fSs{^-\u0001)\u0000y~XcH\u007f\u000099ChM,\u0015\"1@-\f\u007fS\u00021Ah\u0004[c\u001f5".length();
                var1_4 = 49;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = RbacAdminImpl.a(v0, RbacAdminImpl.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "\u000bxTt|Y*\u0006.\u0007~y_dOx\u0007>>DoJ+\u0012%6G*\u000bxT\u00056Fo\u0006Fn\u00153<X";
                    var4_3 = "\u000bxTt|Y*\u0006.\u0007~y_dOx\u0007>>DoJ+\u0012%6G*\u000bxT\u00056Fo\u0006Fn\u00153<X".length();
                    var1_4 = 35;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 86;
                        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++] = RbacAdminImpl.a(v0, RbacAdminImpl.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;
            }
        }
        RbacAdminImpl.c = var5;
        RbacAdminImpl.ROLE_UNASSIGNMENT_AUDIT_FORMAT = RbacAdminImpl.c[28];
        RbacAdminImpl.ROLE_ASSIGNMENT_AUDIT_FORMAT = RbacAdminImpl.c[9];
        RbacAdminImpl.a = Logger.getLogger(RbacAdminImpl.class.getName());
    }

    /*
     * 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 6[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[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x5C);
        }
        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 -> 120;
                    case 1 -> 93;
                    case 2 -> 34;
                    case 3 -> 1;
                    case 4 -> 15;
                    case 5 -> 124;
                    default -> 92;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

