/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.module.ModuleDigest
 *  com.l7tech.gateway.common.module.ModuleLoadingException
 *  com.l7tech.util.ExceptionUtils
 *  org.jetbrains.annotations.NotNull
 *  org.jetbrains.annotations.Nullable
 */
package com.l7tech.server.policy.module;

import com.l7tech.gateway.common.module.ModuleDigest;
import com.l7tech.gateway.common.module.ModuleLoadingException;
import com.l7tech.server.policy.module.BaseAssertionModule;
import com.l7tech.server.policy.module.ModuleData;
import com.l7tech.server.policy.module.ModuleException;
import com.l7tech.server.policy.module.ModulesConfig;
import com.l7tech.server.policy.module.c;
import com.l7tech.server.policy.module.d;
import com.l7tech.server.policy.module.e;
import com.l7tech.server.policy.module.f;
import com.l7tech.util.ExceptionUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/*
 * Exception performing whole class analysis ignored.
 */
public abstract class ModulesScanner<T extends BaseAssertionModule> {
    private static final Logger a;
    protected File lastScanDir = null;
    protected long lastScanDirModTime = 0L;
    protected final Map<String, T> scannedModules = new ConcurrentHashMap<String, T>();
    protected final Map<String, Long> failModTimes = new ConcurrentHashMap<String, Long>();
    protected final Map<String, Long> skipModTimes = new ConcurrentHashMap<String, Long>();
    private static final String[] j;

    @NotNull
    protected abstract ModuleLoadStatus<T> onModuleLoad(ModuleData var1) throws ModuleException;

    protected abstract boolean onModuleUnload(T var1) throws ModuleException;

    protected void onScanComplete(boolean bl2) {
    }

    public T getModule(String string) {
        return (T)((BaseAssertionModule)this.scannedModules.get(string));
    }

    protected T insertModule(@NotNull T t2) {
        try {
            if (t2 == null) {
                ModulesScanner.a(0);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw ModulesScanner.b(illegalArgumentException);
        }
        return (T)((BaseAssertionModule)this.scannedModules.put(((BaseAssertionModule)t2).getName(), t2));
    }

    protected T removeModule(@NotNull T t2) {
        try {
            if (t2 == null) {
                ModulesScanner.a(1);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw ModulesScanner.b(illegalArgumentException);
        }
        return (T)((BaseAssertionModule)this.scannedModules.remove(((BaseAssertionModule)t2).getName()));
    }

    private void a() {
        this.scannedModules.clear();
    }

    protected void clearFailedModTimes() {
        this.failModTimes.clear();
    }

    protected void clearSkippedModTimes() {
        this.skipModTimes.clear();
    }

    public Collection<T> getModules() {
        return Collections.unmodifiableCollection(this.scannedModules.values());
    }

    protected boolean isScanNeeded(File file, long l2) {
        boolean bl2;
        block8: {
            block7: {
                try {
                    block6: {
                        try {
                            try {
                                if (!file.equals(this.lastScanDir) || l2 != this.lastScanDirModTime) break block6;
                            }
                            catch (IllegalArgumentException illegalArgumentException) {
                                throw ModulesScanner.b(illegalArgumentException);
                            }
                            if (this.failModTimes.isEmpty()) break block7;
                        }
                        catch (IllegalArgumentException illegalArgumentException) {
                            throw ModulesScanner.b(illegalArgumentException);
                        }
                    }
                    bl2 = true;
                    break block8;
                }
                catch (IllegalArgumentException illegalArgumentException) {
                    throw ModulesScanner.b(illegalArgumentException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    protected boolean processRemovedModules(@NotNull Set<String> set) {
        try {
            if (set == null) {
                ModulesScanner.a(2);
            }
        }
        catch (ModuleException moduleException) {
            throw ModulesScanner.b(moduleException);
        }
        boolean bl2 = false;
        for (BaseAssertionModule baseAssertionModule : this.scannedModules.values()) {
            String string = baseAssertionModule.getName();
            try {
                if (baseAssertionModule.isFromDb() || set.contains(string)) continue;
            }
            catch (ModuleException moduleException) {
                throw ModulesScanner.b(moduleException);
            }
            String[] stringArray = j;
            a.fine(stringArray[46] + string);
            try {
                if (this.skipModTimes.get(string) != null) continue;
                if (this.onModuleUnload(baseAssertionModule)) {
                    bl2 = true;
                    continue;
                }
                this.skipModTimes.put(baseAssertionModule.getName(), baseAssertionModule.getModifiedTime());
            }
            catch (ModuleException moduleException) {
                stringArray = j;
                a.log(Level.WARNING, stringArray[4] + baseAssertionModule.getName() + stringArray[37]);
                a.log(Level.WARNING, stringArray[15] + ExceptionUtils.getMessage((Throwable)moduleException), moduleException);
            }
        }
        return bl2;
    }

    protected void cleanRemovedFailedModules(@NotNull Set<String> set) {
        try {
            if (set == null) {
                ModulesScanner.a(3);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw ModulesScanner.b(illegalArgumentException);
        }
        Set<String> set2 = this.failModTimes.keySet();
        for (String string : set2) {
            try {
                if (set.contains(string)) continue;
                a.info(j[30] + string);
                this.failModTimes.remove(string);
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw ModulesScanner.b(illegalArgumentException);
            }
        }
    }

    /*
     * Unable to fully structure code
     */
    protected boolean processNewOrChangedModules(@NotNull File[] var1_1, @NotNull Set<String> var2_2) {
        try {
            if (var1_1 == null) {
                ModulesScanner.a(4);
            }
        }
        catch (IOException v0) {
            throw ModulesScanner.b(v0);
        }
        try {
            if (var2_2 == null) {
                ModulesScanner.a(5);
            }
        }
        catch (IOException v1) {
            throw ModulesScanner.b(v1);
        }
        var3_3 = false;
        for (File var7_7 : var1_1) {
            block38: {
                if (var7_7.isFile()) break block38;
                try {
                    block39: {
                        if (!ModulesScanner.a.isLoggable(Level.FINE)) continue;
                        break block39;
                        catch (IOException v2) {
                            throw ModulesScanner.b(v2);
                        }
                    }
                    ModulesScanner.a.info(ModulesScanner.j[36] + var7_7.getAbsolutePath() + ModulesScanner.j[51]);
                    continue;
                }
                catch (IOException v3) {
                    throw ModulesScanner.b(v3);
                }
            }
            var8_8 = var7_7.getName();
            try {
                if (var2_2.contains(var8_8)) {
                    continue;
                }
            }
            catch (IOException v4) {
                throw ModulesScanner.b(v4);
            }
            var9_9 = var7_7.lastModified();
            try {
                if (Long.valueOf(var9_9).equals(this.skipModTimes.get(var8_8))) {
                    ModulesScanner.a.finer(ModulesScanner.j[0] + var8_8 + ModulesScanner.j[55]);
                    continue;
                }
            }
            catch (IOException v5) {
                throw ModulesScanner.b(v5);
            }
            try {
                block37: {
                    block36: {
                        block40: {
                            block35: {
                                block34: {
                                    block33: {
                                        var11_10 = (BaseAssertionModule)this.scannedModules.get(var8_8);
                                        try {
                                            if (var11_10 != null) break block33;
                                            if (!Long.valueOf(var9_9).equals(this.failModTimes.get(var8_8))) break block34;
                                        }
                                        catch (IOException v6) {
                                            throw ModulesScanner.b(v6);
                                        }
                                        var14_16 = ModulesScanner.j;
                                        ModulesScanner.a.fine(var14_16[52] + var8_8 + var14_16[33]);
                                        continue;
                                    }
                                    if (var11_10.getModifiedTime() == var9_9) {
                                        var14_16 = ModulesScanner.j;
                                        ModulesScanner.a.fine(var14_16[25] + var8_8 + var14_16[22]);
                                        continue;
                                    }
                                }
                                var14_16 = ModulesScanner.j;
                                ModulesScanner.a.info(var14_16[31] + var8_8);
                                var12_14 = new DigestBuilder().file(var7_7).build();
                                try {
                                    if (var11_10 == null || !var11_10.getDigest().equals(var12_14)) break block35;
                                }
                                catch (IOException v7) {
                                    throw ModulesScanner.b(v7);
                                }
                                var14_16 = ModulesScanner.j;
                                ModulesScanner.a.info(var14_16[56] + var8_8 + var14_16[57]);
                                continue;
                            }
                            var13_15 = this.onModuleLoad(new c(this, var7_7, var12_14, var9_9));
                            if (var3_3) ** GOTO lbl86
                            if (var13_15.isPrevModuleUnloaded()) ** GOTO lbl86
                            break block40;
                            catch (IOException v8) {
                                throw ModulesScanner.b(v8);
                            }
                        }
                        try {
                            block41: {
                                if (var13_15.getLoadedModule() == null) break block36;
                                break block41;
                                catch (IOException v9) {
                                    throw ModulesScanner.b(v9);
                                }
                            }
                            v10 = true;
                            break block37;
                        }
                        catch (IOException v11) {
                            throw ModulesScanner.b(v11);
                        }
                    }
                    v10 = var3_3 = false;
                }
                if (var13_15.getLoadedModule() == null) {
                    var14_16 = ModulesScanner.j;
                    ModulesScanner.a.warning(var14_16[21] + var8_8 + var14_16[9]);
                    this.skipModTimes.put(var8_8, var9_9);
                    continue;
                }
                this.skipModTimes.remove(var13_15.getLoadedModule().getName());
            }
            catch (IOException var11_11) {
                var14_16 = ModulesScanner.j;
                ModulesScanner.a.log(Level.SEVERE, var14_16[19] + var8_8 + var14_16[3] + ExceptionUtils.getMessage((Throwable)var11_11), var11_11);
                this.failModTimes.put(var8_8, var9_9);
            }
            catch (ModuleException var11_12) {
                var14_16 = ModulesScanner.j;
                ModulesScanner.a.log(Level.SEVERE, var14_16[54] + var8_8 + var14_16[49] + ExceptionUtils.getMessage((Throwable)var11_12), var11_12);
                this.failModTimes.put(var8_8, var9_9);
            }
            catch (Throwable var11_13) {
                var14_16 = ModulesScanner.j;
                ModulesScanner.a.log(Level.SEVERE, var14_16[28] + var8_8 + var14_16[49] + ExceptionUtils.getMessage((Throwable)var11_13), var11_13);
                this.failModTimes.put(var8_8, var9_9);
            }
        }
        return var3_3;
    }

    /*
     * Loose catch block
     */
    public void loadServerModuleFile(@NotNull File file, @NotNull String string, @NotNull String string2) throws ModuleLoadingException {
        long l2;
        String string3;
        block21: {
            try {
                if (file == null) {
                    ModulesScanner.a(6);
                }
            }
            catch (ModuleException moduleException) {
                throw ModulesScanner.b(moduleException);
            }
            try {
                if (string == null) {
                    ModulesScanner.a(7);
                }
            }
            catch (ModuleException moduleException) {
                throw ModulesScanner.b(moduleException);
            }
            try {
                if (string2 == null) {
                    ModulesScanner.a(8);
                }
            }
            catch (ModuleException moduleException) {
                throw ModulesScanner.b(moduleException);
            }
            string3 = file.getName();
            l2 = file.lastModified();
            BaseAssertionModule baseAssertionModule = (BaseAssertionModule)this.scannedModules.get(string3);
            if (baseAssertionModule == null) break block21;
            try {
                block23: {
                    if (!string.equals(baseAssertionModule.getDigest())) break block21;
                    break block23;
                    catch (ModuleException moduleException) {
                        throw ModulesScanner.b(moduleException);
                    }
                }
                a.info(j[12] + string3 + j[1]);
                return;
            }
            catch (ModuleException moduleException) {
                throw ModulesScanner.b(moduleException);
            }
        }
        for (BaseAssertionModule baseAssertionModule : this.getModules()) {
            try {
                if (!string.equals(baseAssertionModule.getDigest())) continue;
                throw new ModuleLoadingException(j[39] + string2 + j[47]);
            }
            catch (ModuleException moduleException) {
                throw ModulesScanner.b(moduleException);
            }
        }
        try {
            ModuleLoadStatus<T> moduleLoadStatus = this.onModuleLoad(new d(this, file, string, l2, string2));
            try {
                if (moduleLoadStatus.getLoadedModule() == null) {
                    a.warning(j[38] + string3 + j[10]);
                    throw new ModuleLoadingException(j[21] + string3 + j[9]);
                }
            }
            catch (ModuleException moduleException) {
                throw ModulesScanner.b(moduleException);
            }
        }
        catch (ModuleException moduleException) {
            throw new ModuleLoadingException((Throwable)moduleException);
        }
    }

    public void updateServerModuleFile(@NotNull File file, @NotNull String string, @NotNull String string2) {
        block13: {
            try {
                if (file == null) {
                    ModulesScanner.a(9);
                }
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw ModulesScanner.b(illegalArgumentException);
            }
            try {
                if (string == null) {
                    ModulesScanner.a(10);
                }
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw ModulesScanner.b(illegalArgumentException);
            }
            try {
                if (string2 == null) {
                    ModulesScanner.a(11);
                }
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw ModulesScanner.b(illegalArgumentException);
            }
            String string3 = file.getName();
            BaseAssertionModule baseAssertionModule = (BaseAssertionModule)this.scannedModules.get(string3);
            try {
                try {
                    if (baseAssertionModule == null || !string.equals(baseAssertionModule.getDigest())) break block13;
                }
                catch (IllegalArgumentException illegalArgumentException) {
                    throw ModulesScanner.b(illegalArgumentException);
                }
                baseAssertionModule.setEntityName(string2);
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw ModulesScanner.b(illegalArgumentException);
            }
        }
    }

    public void unloadServerModuleFile(@NotNull File file, @NotNull String string, @NotNull String string2) throws ModuleLoadingException {
        try {
            if (file == null) {
                ModulesScanner.a(12);
            }
        }
        catch (ModuleException moduleException) {
            throw ModulesScanner.b(moduleException);
        }
        try {
            if (string == null) {
                ModulesScanner.a(13);
            }
        }
        catch (ModuleException moduleException) {
            throw ModulesScanner.b(moduleException);
        }
        try {
            if (string2 == null) {
                ModulesScanner.a(14);
            }
        }
        catch (ModuleException moduleException) {
            throw ModulesScanner.b(moduleException);
        }
        String string3 = file.getName();
        T t2 = this.getModule(string3);
        try {
            if (t2 == null) {
                throw new ModuleLoadingException(j[14] + string3 + "\"");
            }
        }
        catch (ModuleException moduleException) {
            throw ModulesScanner.b(moduleException);
        }
        try {
            if (!string.equals(((BaseAssertionModule)t2).getDigest())) {
                throw new ModuleLoadingException(j[40] + string3 + "\"");
            }
        }
        catch (ModuleException moduleException) {
            throw ModulesScanner.b(moduleException);
        }
        try {
            try {
                if (!this.onModuleUnload(t2)) {
                    throw new ModuleLoadingException(j[8] + string3 + "\"");
                }
            }
            catch (ModuleLoadingException moduleLoadingException) {
                throw ModulesScanner.b((Exception)((Object)moduleLoadingException));
            }
        }
        catch (ModuleException moduleException) {
            throw new ModuleLoadingException(j[41] + string3 + "\"", (Throwable)moduleException);
        }
    }

    public boolean isServerModuleFileLoaded(@NotNull File file, @NotNull String string, @NotNull String string2) {
        boolean bl2;
        block14: {
            block13: {
                try {
                    if (file == null) {
                        ModulesScanner.a(15);
                    }
                }
                catch (IllegalArgumentException illegalArgumentException) {
                    throw ModulesScanner.b(illegalArgumentException);
                }
                try {
                    if (string == null) {
                        ModulesScanner.a(16);
                    }
                }
                catch (IllegalArgumentException illegalArgumentException) {
                    throw ModulesScanner.b(illegalArgumentException);
                }
                try {
                    if (string2 == null) {
                        ModulesScanner.a(17);
                    }
                }
                catch (IllegalArgumentException illegalArgumentException) {
                    throw ModulesScanner.b(illegalArgumentException);
                }
                String string3 = file.getName();
                BaseAssertionModule baseAssertionModule = (BaseAssertionModule)this.scannedModules.get(string3);
                try {
                    try {
                        if (baseAssertionModule == null || !string.equals(baseAssertionModule.getDigest())) break block13;
                    }
                    catch (IllegalArgumentException illegalArgumentException) {
                        throw ModulesScanner.b(illegalArgumentException);
                    }
                    bl2 = true;
                    break block14;
                }
                catch (IllegalArgumentException illegalArgumentException) {
                    throw ModulesScanner.b(illegalArgumentException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    protected synchronized boolean scanModules(@NotNull ModulesConfig modulesConfig) {
        try {
            if (modulesConfig == null) {
                ModulesScanner.a(18);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw ModulesScanner.b(illegalArgumentException);
        }
        try {
            if (!modulesConfig.isFeatureEnabled()) {
                return false;
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw ModulesScanner.b(illegalArgumentException);
        }
        try {
            if (!modulesConfig.isScanningEnabled()) {
                return false;
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw ModulesScanner.b(illegalArgumentException);
        }
        File file = modulesConfig.getModuleDir();
        long l2 = file.lastModified();
        try {
            if (!this.isScanNeeded(file, l2)) {
                a.finest(j[27]);
                return false;
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw ModulesScanner.b(illegalArgumentException);
        }
        String[] stringArray = j;
        a.log(Level.FINE, stringArray[50], file.getAbsolutePath());
        boolean bl2 = false;
        try {
            this.lastScanDir = file;
            this.lastScanDirModTime = l2;
            HashSet<String> hashSet = new HashSet<String>();
            HashSet<String> hashSet2 = new HashSet<String>();
            File[] fileArray = file.listFiles(new e(this, modulesConfig, hashSet, hashSet2));
            if (fileArray == null) {
                a.log(Level.WARNING, stringArray[48] + file.getName());
                boolean bl3 = false;
                return bl3;
            }
            Arrays.sort(fileArray, new f(this));
            for (String string : hashSet2) {
                hashSet.remove(string);
            }
            if (this.processRemovedModules(hashSet)) {
                bl2 = true;
            }
            this.cleanRemovedFailedModules(hashSet);
            if (this.processNewOrChangedModules(fileArray, hashSet2)) {
                bl2 = true;
            }
            boolean bl4 = bl2;
            return bl4;
        }
        finally {
            this.onScanComplete(bl2);
        }
    }

    protected void reset() {
        this.lastScanDir = null;
        this.lastScanDirModTime = 0L;
    }

    public synchronized void destroy() {
        for (BaseAssertionModule baseAssertionModule : this.scannedModules.values()) {
            try {
                this.onModuleUnload(baseAssertionModule);
            }
            catch (Throwable throwable) {
                String[] stringArray = j;
                a.log(Level.WARNING, stringArray[2] + baseAssertionModule.getName() + stringArray[53] + ExceptionUtils.getMessage((Throwable)throwable), throwable);
            }
        }
        this.a();
        this.clearFailedModTimes();
        this.clearSkippedModTimes();
        this.reset();
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[60];
                var3_1 = 0;
                var2_2 = "I8K`epgg\u007fH`slee\u007fCf{|)\"$\"s\u0005|~wje\u007fL{d9jh:Fddld 7D|y>} <Mny~ld\"E-W`e9~h6Ij7lg--@h~j}e-Lap9do;Pcr9\"]\u007f\rfpwfr6Kh7p} *K{~u)i+\u0005l\u007fxgg:V&-9\u0018F>Lcr})t0\u0005zyufa;\u0005bx}|l:\u0005\fm0Az{|Mi8@|c\u0019c3@nyKlm0Sjs_hi3@kZvmu3@|\u0016u1I`v}Ze-SjeTfd*IjQpee+F>Lcr})t0\u0005zyufa;\u0005bx}|l:\u001e/dmhg:A/qpeerKnz|)\"5\"\u007fHnerld\u007fD|7jbi/Ujs5)w6Ic7wft\u007fGj7ufa;@k7x} +Mfd9}i2@!5\"\u007fHnerld\u007fD|7jbi/Ujs5)w6Ic7wft\u007fGj7ufa;@k7x} +Mfd9}i2@!\nj>WBx}|l:V\u0015W0K(c9{e3Jns9do;Pcr9+\ns+Dhr}Oi3@3M0Az{|)a/Ujvkz 1J{7{li1B/{vhd:A47j}a8@k7\u007f`l:\bavtl }\u0007E-W`e#)\u0014l0DkD|{v:WBx}|l:cf{|\fi1VjemDo;Pcr\u0006m0Az{|!U1Dm{|)t0\u0005}rxm >V|rk}i0K/zvmu3@/L\u0011u/Anc|mE1Qfc`Ga2@\bM0Az{|)\"\u0012\"\u007fRnd9go+\u0005l\u007fxgg:A!\u0016u/Anc|Ze-SjeTfd*IjQpee.c0H {.}e<M d|{v:W gvei<\\ zvmu3@ Zvmu3@|Dzhn1@}\u0015S4L\u007fg|m 2Jkbul 9Lcr9+\u000bs<DaZvmu3@|bN0\u0005ndjlr+L`y9do;Pcr9oi3@|7xmd:A#7klm0Sjs9fr\u007fAfdxkl:V/dpgc:\u0005`bk)l>V{7jja1\t/vwm 1J/qx`l*Wjd9}o\u007fWjckp4U1Mny}ee;\u0005jozlp+L`y9~h6Ij7ufa;Lap9hs,@}cpfn\u007fH`slee\u007f~>A-Bzz|gt\u007fC`e9IN0QAbue /D}vtlt:W/0<z'\u007fJi7<z.zV/zlzt\u007fK`c9ke\u007fKz{uBF0Whrm}i1B/v{fu+\u0005ivpee;\u0005bx}|l:\u0005{\u007fx} 7D|7{le1\u0005}rtfv:A/xk)d6Vnuulde\u0005(C7@l|pgg\u007fH`slee\u007fRfcq)u/Anc|m +Lbrj}a2U57\ne1Qfc`Ga2@`\"\u007fVfyzl 6Q|7tfd6Cftx}i0K/cpde\u007fMndw.t\u007fFgvwne;\u0005|~wje\u007fQgr9ea,Q/cpde\u007fL{7\u007fhi3@k7mf 3Jns9zu<Fjdjou3Iv9\u000fm0Az{|Oi3@Avtls\u0018i,vjeolr\u0012JkbulF6Ij[vhd:A\u001dT7L|7pz 1J{7xg -@hbuhr\u007fCf{|)[,,\u007fH`slee\u007fRf{u)b:\u0005}rm{i:A/sl{i1B/y|qt\u007fFgvwneq\bM0Az{|)\"\u001eC>Kaxm)l0Dk7}|p3Llvml 2Jkbul }UC>Kaxm)u1I`v})m0Az{|)a,\u0005k~~ls+\u0005`q9eo>Ajs9hn;\u0005|cxne;\u0005i~ul 2L|zx}c7\u001e/dmhg:A/qpeerKnz|)\"0E-W`e9~h6Ij7lgl0Dk~wn 2Jkbul;\u007fV{v~ld\u007fCf{|$n>Hj7;\u0015p-JlrjzR:H`a|mM0Az{|z\u0017d6Vnuuld\u0012JkbulF6IjYxde,\fr:H`a|Do;Pcr\u001ap-JlrjzN:R@eZaa1BjsTfd*Ijd5P-Jlrjzi1B/zvmu3@/cqht\u007fMnd9ke:K/e|do)@k7v{ ;L|v{ee;\u001f/5\"d\u0005Bx}|l:\u0005x~ma :]ntm)c0K{rw} <Mjtrzu2\u0005n{kla;\\/{vhd:A!-F>Lcr})t0\u0005hrm)t7@/qpee\u007fIfdm)f0W/zvmu3@|7}`re\u0005\"]\u007f\rfpwfr6Kh7p} *K{~u)i+\u0005l\u007fxgg:V&-92S<Daypgg\u007fFzdmfm\u007fD|d|{t6Ja7tfd*Ijd9mi-@lcv{y\u007f^?j7'.\u0011]s\u0005||pyp6Kh7p}.q\u000b\u0016I8K`epgg\u007fH`slee\u007fCf{|)\"\u0002:\u007f!U1Dm{|)t0\u0005cxxm >V|rk}i0K/zvmu3@/LP\"\u007fVfyzl 6Q|7tfd6Cftx}i0K/cpde\u007fMndw.t\u007fFgvwne;\u0005|~wje\u007fQgr9ea,Q/cpde\u007fL{7nhs\u007fVd~iye;\u000b\u0015W0K(c9{e3Jns9do;Pcr9+$\"s\u0005|~wje\u007fL{d9jh:Fddld 7D|y>} <Mny~ld";
                var4_3 = "I8K`epgg\u007fH`slee\u007fCf{|)\"$\"s\u0005|~wje\u007fL{d9jh:Fddld 7D|y>} <Mny~ld\"E-W`e9~h6Ij7lg--@h~j}e-Lap9do;Pcr9\"]\u007f\rfpwfr6Kh7p} *K{~u)i+\u0005l\u007fxgg:V&-9\u0018F>Lcr})t0\u0005zyufa;\u0005bx}|l:\u0005\fm0Az{|Mi8@|c\u0019c3@nyKlm0Sjs_hi3@kZvmu3@|\u0016u1I`v}Ze-SjeTfd*IjQpee+F>Lcr})t0\u0005zyufa;\u0005bx}|l:\u001e/dmhg:A/qpeerKnz|)\"5\"\u007fHnerld\u007fD|7jbi/Ujs5)w6Ic7wft\u007fGj7ufa;@k7x} +Mfd9}i2@!5\"\u007fHnerld\u007fD|7jbi/Ujs5)w6Ic7wft\u007fGj7ufa;@k7x} +Mfd9}i2@!\nj>WBx}|l:V\u0015W0K(c9{e3Jns9do;Pcr9+\ns+Dhr}Oi3@3M0Az{|)a/Ujvkz 1J{7{li1B/{vhd:A47j}a8@k7\u007f`l:\bavtl }\u0007E-W`e#)\u0014l0DkD|{v:WBx}|l:cf{|\fi1VjemDo;Pcr\u0006m0Az{|!U1Dm{|)t0\u0005}rxm >V|rk}i0K/zvmu3@/L\u0011u/Anc|mE1Qfc`Ga2@\bM0Az{|)\"\u0012\"\u007fRnd9go+\u0005l\u007fxgg:A!\u0016u/Anc|Ze-SjeTfd*IjQpee.c0H {.}e<M d|{v:W gvei<\\ zvmu3@ Zvmu3@|Dzhn1@}\u0015S4L\u007fg|m 2Jkbul 9Lcr9+\u000bs<DaZvmu3@|bN0\u0005ndjlr+L`y9do;Pcr9oi3@|7xmd:A#7klm0Sjs9fr\u007fAfdxkl:V/dpgc:\u0005`bk)l>V{7jja1\t/vwm 1J/qx`l*Wjd9}o\u007fWjckp4U1Mny}ee;\u0005jozlp+L`y9~h6Ij7ufa;Lap9hs,@}cpfn\u007fH`slee\u007f~>A-Bzz|gt\u007fC`e9IN0QAbue /D}vtlt:W/0<z'\u007fJi7<z.zV/zlzt\u007fK`c9ke\u007fKz{uBF0Whrm}i1B/v{fu+\u0005ivpee;\u0005bx}|l:\u0005{\u007fx} 7D|7{le1\u0005}rtfv:A/xk)d6Vnuulde\u0005(C7@l|pgg\u007fH`slee\u007fRfcq)u/Anc|m +Lbrj}a2U57\ne1Qfc`Ga2@`\"\u007fVfyzl 6Q|7tfd6Cftx}i0K/cpde\u007fMndw.t\u007fFgvwne;\u0005|~wje\u007fQgr9ea,Q/cpde\u007fL{7\u007fhi3@k7mf 3Jns9zu<Fjdjou3Iv9\u000fm0Az{|Oi3@Avtls\u0018i,vjeolr\u0012JkbulF6Ij[vhd:A\u001dT7L|7pz 1J{7xg -@hbuhr\u007fCf{|)[,,\u007fH`slee\u007fRf{u)b:\u0005}rm{i:A/sl{i1B/y|qt\u007fFgvwneq\bM0Az{|)\"\u001eC>Kaxm)l0Dk7}|p3Llvml 2Jkbul }UC>Kaxm)u1I`v})m0Az{|)a,\u0005k~~ls+\u0005`q9eo>Ajs9hn;\u0005|cxne;\u0005i~ul 2L|zx}c7\u001e/dmhg:A/qpeerKnz|)\"0E-W`e9~h6Ij7lgl0Dk~wn 2Jkbul;\u007fV{v~ld\u007fCf{|$n>Hj7;\u0015p-JlrjzR:H`a|mM0Az{|z\u0017d6Vnuuld\u0012JkbulF6IjYxde,\fr:H`a|Do;Pcr\u001ap-JlrjzN:R@eZaa1BjsTfd*Ijd5P-Jlrjzi1B/zvmu3@/cqht\u007fMnd9ke:K/e|do)@k7v{ ;L|v{ee;\u001f/5\"d\u0005Bx}|l:\u0005x~ma :]ntm)c0K{rw} <Mjtrzu2\u0005n{kla;\\/{vhd:A!-F>Lcr})t0\u0005hrm)t7@/qpee\u007fIfdm)f0W/zvmu3@|7}`re\u0005\"]\u007f\rfpwfr6Kh7p} *K{~u)i+\u0005l\u007fxgg:V&-92S<Daypgg\u007fFzdmfm\u007fD|d|{t6Ja7tfd*Ijd9mi-@lcv{y\u007f^?j7'.\u0011]s\u0005||pyp6Kh7p}.q\u000b\u0016I8K`epgg\u007fH`slee\u007fCf{|)\"\u0002:\u007f!U1Dm{|)t0\u0005cxxm >V|rk}i0K/zvmu3@/LP\"\u007fVfyzl 6Q|7tfd6Cftx}i0K/cpde\u007fMndw.t\u007fFgvwne;\u0005|~wje\u007fQgr9ea,Q/cpde\u007fL{7nhs\u007fVd~iye;\u000b\u0015W0K(c9{e3Jns9do;Pcr9+$\"s\u0005|~wje\u007fL{d9jh:Fddld 7D|y>} <Mny~ld".length();
                var1_4 = 22;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = ModulesScanner.a(v0, ModulesScanner.b(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "^\rvTCC\u000bP\r|GFAz\\\u000f}A";
                    var4_3 = "^\rvTCC\u000bP\r|GFAz\\\u000f}A".length();
                    var1_4 = 6;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 49;
                        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++] = ModulesScanner.a(v0, ModulesScanner.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;
            }
        }
        ModulesScanner.j = var5;
        ModulesScanner.a = Logger.getLogger(ModulesScanner.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 2[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 b(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] ^ 5);
        }
        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 -> 12;
                    case 1 -> 83;
                    case 2 -> 41;
                    case 3 -> 3;
                    case 4 -> 27;
                    case 5 -> 21;
                    default -> 5;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }

    /*
     * Exception performing whole class analysis ignored.
     */
    public static class DigestBuilder {
        private File a = null;
        private boolean b = true;
        private static final String[] c;

        public DigestBuilder file(@NotNull File file) {
            try {
                if (file == null) {
                    DigestBuilder.a(0);
                }
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw DigestBuilder.a(illegalArgumentException);
            }
            this.a = file;
            return this;
        }

        public DigestBuilder closeFile(boolean bl2) {
            this.b = bl2;
            return this;
        }

        @NotNull
        public String build() throws IOException {
            String string;
            try {
                if (this.a == null) {
                    throw new IllegalArgumentException(c[7]);
                }
            }
            catch (IOException iOException) {
                throw DigestBuilder.a(iOException);
            }
            try {
                string = ModuleDigest.hexEncodedDigest((InputStream)new FileInputStream(this.a), (boolean)this.b);
                if (string == null) {
                    DigestBuilder.a(1);
                }
            }
            catch (IOException iOException) {
                throw DigestBuilder.a(iOException);
            }
            return string;
        }

        /*
         * 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.analyseInnerClassesPass1(ClassFile.java:923)
             *     at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1035)
             *     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;
        }

        /*
         * Unable to fully structure code
         */
        static {
            block10: {
                block9: {
                    var5 = new String[8];
                    var3_1 = 0;
                    var2_2 = "\u0005N}R$\u0019&\u0003BxR;K \u0010DbR8A>\u000fBiR%A6\u0013MuR\u0005A6\u0013Mu\u000e\u001bM3\bOu\u000flj;\u0001Dc\t\n[;\nEu\u000f>'Sw\b%K<\u0012\u0001v\u0012:\u000e\u0012(Nd3=B>FQq\u000f)C7\u0012Db]o\u000b!A\u0001\u007f\u001bh\u000b!H\u0004c]%[!\u0012\u0001~\u0012<\u000e0\u0003\u0001~\b$B*&o\u007f\t\u0006[>\n\u0001}\u0018<F=\u0002\u00015\u000ef\u000b!FLe\u000e<\u000e<\tU0\u000f-Z'\u0014O0\u0013=B>\u0005\u0004Ty\u0011,\u0004\u0000H|\u0018<\u0005N}R$\u0019&\u0003BxR;K \u0010DbR8A>\u000fBiR%A6\u0013MuR\u0005A6\u0013Mu\u000e\u001bM3\bOu\u000flj;\u0001Dc\t\n[;\nEu\u000f";
                    var4_3 = "\u0005N}R$\u0019&\u0003BxR;K \u0010DbR8A>\u000fBiR%A6\u0013MuR\u0005A6\u0013Mu\u000e\u001bM3\bOu\u000flj;\u0001Dc\t\n[;\nEu\u000f>'Sw\b%K<\u0012\u0001v\u0012:\u000e\u0012(Nd3=B>FQq\u000f)C7\u0012Db]o\u000b!A\u0001\u007f\u001bh\u000b!H\u0004c]%[!\u0012\u0001~\u0012<\u000e0\u0003\u0001~\b$B*&o\u007f\t\u0006[>\n\u0001}\u0018<F=\u0002\u00015\u000ef\u000b!FLe\u000e<\u000e<\tU0\u000f-Z'\u0014O0\u0013=B>\u0005\u0004Ty\u0011,\u0004\u0000H|\u0018<\u0005N}R$\u0019&\u0003BxR;K \u0010DbR8A>\u000fBiR%A6\u0013MuR\u0005A6\u0013Mu\u000e\u001bM3\bOu\u000flj;\u0001Dc\t\n[;\nEu\u000f".length();
                    var1_4 = 60;
                    var0_5 = -1;
lbl7:
                    // 2 sources

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

                    while (true) {
                        var5[var3_1++] = DigestBuilder.a(v0, DigestBuilder.a(v2));
                        if ((var0_5 += var1_4) < var4_3) {
                            var1_4 = var2_2.charAt(var0_5);
                            ** continue;
                        }
                        var2_2 = "\u0016^j\u000e\u0013\u0016^j\u000e~[%\u001eYi\u001f~Z!PYs\u00072";
                        var4_3 = "\u0016^j\u000e\u0013\u0016^j\u000e~[%\u001eYi\u001f~Z!PYs\u00072".length();
                        var1_4 = 4;
                        var0_5 = -1;
lbl22:
                        // 2 sources

                        while (true) {
                            v0 = 111;
                            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++] = DigestBuilder.a(v0, DigestBuilder.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;
                }
            }
            DigestBuilder.c = var5;
        }

        private static char[] a(String string) {
            char[] cArray = string.toCharArray();
            if (cArray.length < 2) {
                cArray = cArray;
                cArray[0] = (char)(cArray[0] ^ 0x2B);
            }
            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 -> 31;
                        case 1 -> 88;
                        case 2 -> 105;
                        case 3 -> 4;
                        case 4 -> 49;
                        case 5 -> 87;
                        default -> 43;
                    })));
                    ++n3;
                    n4 = n4;
                } while (n4 > n3);
            }
            return new String(cArray2).intern();
        }
    }

    protected static class ModuleLoadStatus<T extends BaseAssertionModule> {
        private boolean a;
        private T b;

        public ModuleLoadStatus() {
            this(false, null);
        }

        public ModuleLoadStatus(boolean bl2, @Nullable T t2) {
            this.a = bl2;
            this.b = t2;
        }

        public boolean isPrevModuleUnloaded() {
            return this.a;
        }

        public void setPrevModuleUnloaded(boolean bl2) {
            this.a = bl2;
        }

        public T getLoadedModule() {
            return this.b;
        }

        public void setLoadedModule(@Nullable T t2) {
            this.b = t2;
        }
    }
}

