/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  jakarta.servlet.ServletException
 *  jakarta.servlet.http.HttpServletRequest
 *  jakarta.servlet.http.HttpServletResponse
 *  org.apache.catalina.servlets.DefaultServlet
 */
package com.l7tech.server.transport.http;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import org.apache.catalina.servlets.DefaultServlet;

public class SsgDefaultServlet
extends DefaultServlet {
    static final long serialVersionUID = 5794002515924604026L;
    private static final String a = SsgDefaultServlet.a(105, SsgDefaultServlet.a("w%6\u0011,\u001e="));

    protected void serveResource(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, boolean bl2, String string) throws IOException, ServletException {
        block4: {
            String string2 = this.getRelativePath(httpServletRequest);
            try {
                try {
                    if (string2 == null || !string2.toLowerCase().contains(a)) break block4;
                }
                catch (IOException iOException) {
                    throw SsgDefaultServlet.a(iOException);
                }
                httpServletResponse.sendError(404);
                return;
            }
            catch (IOException iOException) {
                throw SsgDefaultServlet.a(iOException);
            }
        }
        super.serveResource(httpServletRequest, httpServletResponse, bl2, string);
    }

    private static IOException a(IOException iOException) {
        return iOException;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x32);
        }
        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 -> 105;
                    case 1 -> 41;
                    case 2 -> 61;
                    case 3 -> 85;
                    case 4 -> 44;
                    case 5 -> 25;
                    default -> 50;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

