package com.apiguard3.internal;

import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Process;
import android.telephony.PhoneNumberUtils;
import android.text.AndroidCharacter;
import android.text.TextUtils;
import android.view.ViewConfiguration;
import com.apiguard3.APIGuard;
import com.apiguard3.BuildConfig;
import com.apiguard3.internal.log;
import com.bytedance.covode.number.Covode;

public final class transformRequest implements log {
    public static int AGRequest;
    public static int getMethod = 97;
    public static int newBuilder = 1;
    public log.getBody getBody = log.getBody.getMethod;
    public volatile boolean getHeaders;
    public APIGuard.Callback getUrl;

    static {
        Covode.recordClassIndex(2524);
    }

    public final void getUrl(log.getBody getbody) {
        int i = newBuilder + 35;
        AGRequest = i % 128;
        int i2 = i % 2;
    }

    public transformRequest(APIGuard.Callback callback) {
        this.getUrl = callback;
    }

    public final void getHeaders(APIGuard$Callback aPIGuard$Callback) {
        int i = newBuilder + 59;
        AGRequest = i % 128;
        if (i % 2 != 0) {
            if (this.getUrl == null) {
                return;
            }
        } else if (this.getUrl == null) {
            return;
        }
        if (aPIGuard$Callback.getMethod.compareTo(this.getBody) <= 0) {
            if (BuildConfig.AGRequest.booleanValue()) {
                int i2 = newBuilder + 3;
                AGRequest = i2 % 128;
                if (i2 % 2 == 0 ? (aPIGuard$Callback instanceof onInitializationFailure) : (aPIGuard$Callback instanceof onInitializationFailure)) {
                    this.getUrl.log(aPIGuard$Callback.toString());
                    return;
                }
            }
            StringBuilder sb = new StringBuilder(getHeaders(TextUtils.isDigitsOnly(""), "\u000e￯\t\u0003￢￼\t\u0011", 159 - (ViewConfiguration.getMinimumFlingVelocity() >> 16), (Process.myPid() >> 22) + 8, 4 - Color.alpha(0)).intern());
            String str = aPIGuard$Callback.getBody;
            String str2 = aPIGuard$Callback.AGRequest;
            if (!TextUtils.isEmpty(str)) {
                sb.append(str);
                sb.append(getHeaders(PhoneNumberUtils.isWellFormedSmsAddress(""), "\u0000", TextUtils.indexOf("", "", 0, 0) + 129, 5 - AndroidCharacter.getEastAsianWidth('0'), 1 - Drawable.resolveOpacity(0, 0)).intern());
            }
            if (!TextUtils.isEmpty(str2) && aPIGuard$Callback.getMethod.compareTo(log.getBody.getMethod) == 0) {
                sb.append(str2);
            }
            this.getUrl.log(sb.toString());
        }
    }

    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r8v1, resolved type: char[]} */
    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r8v2, resolved type: java.lang.String} */
    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r8v4, resolved type: java.lang.String} */
    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r8v5, resolved type: java.lang.String} */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public static java.lang.String getHeaders(boolean r7, java.lang.String r8, int r9, int r10, int r11) {
        /*
            r6 = 1
            r4 = 0
            if (r8 != 0) goto L_0x0026
        L_0x0004:
            char[] r8 = (char[]) r8
            char[] r3 = new char[r10]
            r2 = 0
        L_0x0009:
            if (r2 >= r10) goto L_0x002b
            char r0 = r8[r2]
            int r0 = r0 + r9
            char r0 = (char) r0
            r3[r2] = r0
            char r1 = r3[r2]
            int r0 = getMethod
            int r1 = r1 - r0
            char r0 = (char) r1
            r3[r2] = r0
            int r2 = r2 + 1
            int r0 = newBuilder
            int r1 = r0 + 7
            int r0 = r1 % 128
            AGRequest = r0
            int r0 = r1 % 2
            goto L_0x0009
        L_0x0026:
            char[] r8 = r8.toCharArray()
            goto L_0x0004
        L_0x002b:
            if (r11 <= 0) goto L_0x003a
            char[] r1 = new char[r10]
            java.lang.System.arraycopy(r3, r4, r1, r4, r10)
            int r0 = r10 - r11
            java.lang.System.arraycopy(r1, r4, r3, r0, r11)
            java.lang.System.arraycopy(r1, r11, r3, r4, r0)
        L_0x003a:
            if (r7 == 0) goto L_0x004e
            char[] r2 = new char[r10]
            r5 = 0
        L_0x003f:
            r0 = 95
            if (r5 < r10) goto L_0x0054
            int r0 = newBuilder
            int r1 = r0 + 73
            int r0 = r1 % 128
            AGRequest = r0
            int r0 = r1 % 2
            r3 = r2
        L_0x004e:
            java.lang.String r0 = new java.lang.String
            r0.<init>(r3)
            return r0
        L_0x0054:
            int r0 = newBuilder
            int r1 = r0 + 97
            int r0 = r1 % 128
            AGRequest = r0
            int r0 = r1 % 2
            if (r0 != 0) goto L_0x006a
            int r0 = r10 - r5
            int r0 = r0 - r6
            char r0 = r3[r0]
            r2[r5] = r0
            int r5 = r5 + 1
            goto L_0x003f
        L_0x006a:
            int r0 = r10 >> r5
            int r0 = r0 + r4
            char r0 = r3[r0]
            r2[r5] = r0
            int r5 = r5 + 124
            goto L_0x003f
        */
        throw new UnsupportedOperationException("Method not decompiled: com.apiguard3.internal.transformRequest.getHeaders(boolean, java.lang.String, int, int, int):java.lang.String");
    }
}
