/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.common.http.GenericHttpException
 *  com.l7tech.common.http.GenericHttpRequest
 *  com.l7tech.common.http.GenericHttpRequestParams
 *  com.l7tech.common.http.HttpMethod
 *  com.l7tech.common.http.prov.apache.components.HttpComponentsClient
 *  org.apache.hc.client5.http.io.HttpClientConnectionManager
 */
package com.l7tech.server.util;

import com.l7tech.common.http.GenericHttpException;
import com.l7tech.common.http.GenericHttpRequest;
import com.l7tech.common.http.GenericHttpRequestParams;
import com.l7tech.common.http.HttpMethod;
import com.l7tech.common.http.prov.apache.components.HttpComponentsClient;
import com.l7tech.server.util.HttpClientFactory;
import java.security.GeneralSecurityException;
import org.apache.hc.client5.http.io.HttpClientConnectionManager;

class a
extends HttpComponentsClient {
    final HttpClientFactory this$0;
    private static final String v = a.b(2, a.c(" Uc#\r"));

    a(HttpClientFactory httpClientFactory, HttpClientConnectionManager httpClientConnectionManager, int n2, int n3) {
        this.this$0 = httpClientFactory;
        super(httpClientConnectionManager, n2, n3);
    }

    /*
     * Enabled aggressive block sorting
     * Enabled unnecessary exception pruning
     * Enabled aggressive exception aggregation
     */
    public GenericHttpRequest createRequest(HttpMethod httpMethod, GenericHttpRequestParams genericHttpRequestParams) throws GenericHttpException {
        String string = genericHttpRequestParams.getTargetUrl().getProtocol();
        try {
            if (!v.equalsIgnoreCase(string)) return super.createRequest(httpMethod, genericHttpRequestParams);
            try {
                genericHttpRequestParams.setSslContext(this.this$0.a());
                genericHttpRequestParams.setHostnameVerifier(this.this$0.e);
                return super.createRequest(httpMethod, genericHttpRequestParams);
            }
            catch (GeneralSecurityException generalSecurityException) {
                throw new GenericHttpException((Throwable)generalSecurityException);
            }
        }
        catch (GenericHttpException genericHttpException) {
            throw a.a(genericHttpException);
        }
    }

    private static GenericHttpException a(GenericHttpException genericHttpException) {
        return genericHttpException;
    }

    private static char[] c(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x41);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String b(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 -> 74;
                    case 1 -> 35;
                    case 2 -> 21;
                    case 3 -> 81;
                    case 4 -> 124;
                    case 5 -> 73;
                    default -> 65;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

