package com.apiguard3.io;

import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.media.AudioTrack;
import android.os.Process;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewConfiguration;
import com.apiguard3.internal.getMethod;
import com.bytedance.covode.number.Covode;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Map;
import java.util.TreeMap;

public final class KernelPayloadInstance implements Serializable {
    public static int getHeaders = 0;
    public static char[] getMethod = {'U', 's', 'e', ' ', 'K', 'r', 'n', 'l', 'P', 'a', 'y', 'o', 'd', 'S', 'i', 'z', 't', 'x', 'V', 'W', 'X', 'Y', 'Z', '[', '\\'};
    public static char getUrl = 5;
    public static int newBuilder = 1;
    public static final long serialVersionUID = 3128887582760800825L;
    public transient Map<String, String> AGRequest;
    public transient Map<String, String> getBody;

    static {
        Covode.recordClassIndex(2528);
    }

    public KernelPayloadInstance() {
    }

    public final Object writeReplace() {
        KernelPayloadSerializationProxy kernelPayloadSerializationProxy = new KernelPayloadSerializationProxy(this);
        int i = newBuilder + 61;
        getHeaders = i % 128;
        if (i % 2 == 0) {
            return kernelPayloadSerializationProxy;
        }
        throw new NullPointerException("hashCode");
    }

    public static final class KernelPayloadSerializationProxy implements Serializable {
        public static int AGRequest = 0;
        public static char[] getBody = {'U', 'T', 'F', '-', '8', 's', 'i', 'd', '/', 'l', 'r', '[', '}', '0', 'D', 'h', '+', 'g', 'E', ';', 'x', '\'', '5', '`', 'q', '=', '<', 'z', 'f', '6', 'V', 'W', 'X', 'Y', 'Z', '\\'};
        public static char getHeaders = 6;
        public static int getMethod = 1;
        public static final long serialVersionUID = 4032605224111506387L;
        public final TreeMap<String, String> maxPayload;
        public final TreeMap<String, String> minPayload;
        public final byte[] shaHash;

        static {
            Covode.recordClassIndex(2529);
        }

        public final Object readResolve() {
            Class cls = byte[].class;
            StringBuilder sb = new StringBuilder();
            sb.append(this.minPayload.toString());
            sb.append(this.maxPayload.toString());
            Object bytes = sb.toString().getBytes(Charset.forName(getHeaders("\u0001\u0002\u0003\u0004m", (byte) (53 - View.getDefaultSize(0, 0)), 5 - (AudioTrack.getMinVolume() > 0.0f ? 1 : (AudioTrack.getMinVolume() == 0.0f ? 0 : -1))).intern()));
            try {
                Object[] objArr = new Object[2];
                objArr[1] = getHeaders("\u0000\u000b\b\t\n\u000b\u0006\u0011\u000e\u000f\u0010\u0011\f\u000b\u0013\u0014\u0015\u0016\u0015\n\u0005\u0015\u0019\u001a\u001b\u001c\"\u0010\u0011\u001c", (byte) ((ViewConfiguration.getPressedStateDuration() >> 16) + 83), View.MeasureSpec.getMode(0) + 30).intern().getBytes(Charset.forName(getHeaders("\u0001\u0002\u0003\u0004m", (byte) ((ViewConfiguration.getScrollBarFadeDuration() >> 16) + 53), Color.green(0) + 5).intern()));
                objArr[0] = bytes;
                if (Arrays.equals((byte[]) ((Class) getMethod.AGRequest((char) Color.blue(0), 40 - View.MeasureSpec.getMode(0), (ViewConfiguration.getTouchSlop() >> 8) + 5997)).getMethod("getUrl", new Class[]{cls, cls}).invoke((Object) null, objArr), this.shaHash)) {
                    return new KernelPayloadInstance(this.minPayload, this.maxPayload);
                }
                int i = AGRequest + 63;
                getMethod = i % 128;
                int i2 = i % 2;
                return null;
            } catch (Throwable th) {
                Throwable cause = th.getCause();
                if (cause != null) {
                    throw cause;
                }
                throw th;
            }
        }

        public KernelPayloadSerializationProxy(KernelPayloadInstance kernelPayloadInstance) {
            Class cls = byte[].class;
            if (kernelPayloadInstance.AGRequest != null) {
                this.minPayload = new TreeMap<>(kernelPayloadInstance.AGRequest);
            } else {
                this.minPayload = new TreeMap<>();
            }
            if (kernelPayloadInstance.AGRequest != null) {
                this.maxPayload = new TreeMap<>(kernelPayloadInstance.getBody);
            } else {
                this.maxPayload = new TreeMap<>();
            }
            StringBuilder sb = new StringBuilder();
            sb.append(this.minPayload.toString());
            sb.append(this.maxPayload.toString());
            Object bytes = sb.toString().getBytes(Charset.forName(getHeaders("\u0001\u0002\u0003\u0004m", (byte) (53 - View.MeasureSpec.getMode(0)), Color.red(0) + 5).intern()));
            try {
                Object[] objArr = new Object[2];
                objArr[1] = getHeaders("\u0000\u000b\b\t\n\u000b\u0006\u0011\u000e\u000f\u0010\u0011\f\u000b\u0013\u0014\u0015\u0016\u0015\n\u0005\u0015\u0019\u001a\u001b\u001c\"\u0010\u0011\u001c", (byte) ((Process.myTid() >> 22) + 83), 29 - TextUtils.lastIndexOf("", '0', 0)).intern().getBytes(Charset.forName(getHeaders("\u0001\u0002\u0003\u0004m", (byte) (53 - (ViewConfiguration.getMinimumFlingVelocity() >> 16)), TextUtils.lastIndexOf("", '0', 0) + 6).intern()));
                objArr[0] = bytes;
                this.shaHash = (byte[]) ((Class) getMethod.AGRequest((char) (ViewConfiguration.getMaximumFlingVelocity() >> 16), Drawable.resolveOpacity(0, 0) + 40, Drawable.resolveOpacity(0, 0) + 5997)).getMethod("getUrl", new Class[]{cls, cls}).invoke((Object) null, objArr);
            } catch (Throwable th) {
                Throwable cause = th.getCause();
                if (cause != null) {
                    throw cause;
                }
                throw th;
            }
        }

        /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r12v1, resolved type: java.lang.String} */
        /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r12v3, resolved type: char[]} */
        /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r12v4, resolved type: java.lang.String} */
        /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r12v5, resolved type: java.lang.String} */
        /* JADX WARNING: Code restructure failed: missing block: B:37:0x00db, code lost:
            throw new java.lang.NullPointerException("hashCode");
         */
        /* JADX WARNING: Multi-variable type inference failed */
        /* Code decompiled incorrectly, please refer to instructions dump. */
        public static java.lang.String getHeaders(java.lang.String r12, byte r13, int r14) {
            /*
                int r0 = getMethod
                int r1 = r0 + 99
                int r0 = r1 % 128
                AGRequest = r0
                int r0 = r1 % 2
                if (r0 != 0) goto L_0x00d3
                if (r12 == 0) goto L_0x0012
                char[] r12 = r12.toCharArray()
            L_0x0012:
                char[] r12 = (char[]) r12
                char[] r11 = getBody
                char r5 = getHeaders
                char[] r4 = new char[r14]
                int r1 = r14 % 2
                r0 = 0
                r3 = 1
                if (r1 != 0) goto L_0x00c0
                r0 = 1
            L_0x0021:
                if (r0 == r3) goto L_0x002b
                int r14 = r14 + -1
                char r0 = r12[r14]
                int r0 = r0 - r13
                char r0 = (char) r0
                r4[r14] = r0
            L_0x002b:
                if (r14 <= r3) goto L_0x00c3
                r2 = 0
            L_0x002e:
                if (r2 >= r14) goto L_0x00c3
                char r7 = r12[r2]
                int r10 = r2 + 1
                char r6 = r12[r10]
                r1 = 65
                if (r7 == r6) goto L_0x00bc
                r0 = 65
            L_0x003c:
                if (r0 == r1) goto L_0x0060
                int r0 = getMethod
                int r1 = r0 + 43
                int r0 = r1 % 128
                AGRequest = r0
                int r0 = r1 % 2
                if (r0 == 0) goto L_0x0057
                int r7 = r7 * r13
                char r0 = (char) r7
                r4[r2] = r0
                int r1 = r2 * 0
                int r6 = r6 >> r13
                char r0 = (char) r6
                r4[r1] = r0
            L_0x0054:
                int r2 = r2 + 2
                goto L_0x002e
            L_0x0057:
                int r7 = r7 - r13
                char r0 = (char) r7
                r4[r2] = r0
                int r6 = r6 - r13
                char r0 = (char) r6
                r4[r10] = r0
                goto L_0x0054
            L_0x0060:
                int r9 = com.apiguard3.internal.setNextClusterForwardId.AGRequest(r7, r5)
                int r8 = com.apiguard3.internal.setNextClusterForwardId.getBody(r7, r5)
                int r7 = com.apiguard3.internal.setNextClusterForwardId.AGRequest(r6, r5)
                int r6 = com.apiguard3.internal.setNextClusterForwardId.getBody(r6, r5)
                if (r8 != r6) goto L_0x008b
                int r0 = com.apiguard3.internal.setNextClusterForwardId.getHeaders(r9, r5)
                int r1 = com.apiguard3.internal.setNextClusterForwardId.getHeaders(r7, r5)
                int r0 = com.apiguard3.internal.setNextClusterForwardId.getBody(r0, r8, r5)
                int r1 = com.apiguard3.internal.setNextClusterForwardId.getBody(r1, r6, r5)
                char r0 = r11[r0]
                r4[r2] = r0
                char r0 = r11[r1]
                r4[r10] = r0
                goto L_0x0054
            L_0x008b:
                if (r9 == r7) goto L_0x00a1
                r0 = 0
            L_0x008e:
                if (r0 == r3) goto L_0x00a3
                int r0 = com.apiguard3.internal.setNextClusterForwardId.getBody(r9, r6, r5)
                int r1 = com.apiguard3.internal.setNextClusterForwardId.getBody(r7, r8, r5)
                char r0 = r11[r0]
                r4[r2] = r0
                char r0 = r11[r1]
                r4[r10] = r0
                goto L_0x0054
            L_0x00a1:
                r0 = 1
                goto L_0x008e
            L_0x00a3:
                int r0 = com.apiguard3.internal.setNextClusterForwardId.getHeaders(r8, r5)
                int r1 = com.apiguard3.internal.setNextClusterForwardId.getHeaders(r6, r5)
                int r0 = com.apiguard3.internal.setNextClusterForwardId.getBody(r9, r0, r5)
                int r1 = com.apiguard3.internal.setNextClusterForwardId.getBody(r7, r1, r5)
                char r0 = r11[r0]
                r4[r2] = r0
                char r0 = r11[r1]
                r4[r10] = r0
                goto L_0x0054
            L_0x00bc:
                r0 = 57
                goto L_0x003c
            L_0x00c0:
                r0 = 0
                goto L_0x0021
            L_0x00c3:
                java.lang.String r2 = new java.lang.String
                r2.<init>(r4)
                int r0 = getMethod
                int r1 = r0 + 43
                int r0 = r1 % 128
                AGRequest = r0
                int r0 = r1 % 2
                return r2
            L_0x00d3:
                r0 = 0
                java.lang.String r1 = "hashCode"
                java.lang.NullPointerException r0 = new java.lang.NullPointerException     // Catch:{ all -> 0x00dc }
                r0.<init>(r1)     // Catch:{ all -> 0x00dc }
                throw r0     // Catch:{ all -> 0x00dc }
            L_0x00dc:
                r0 = move-exception
                throw r0
            */
            throw new UnsupportedOperationException("Method not decompiled: com.apiguard3.io.KernelPayloadInstance.KernelPayloadSerializationProxy.getHeaders(java.lang.String, byte, int):java.lang.String");
        }
    }

    private void readObject(ObjectInputStream objectInputStream) {
        throw new InvalidObjectException(getMethod("\u0001\u0002\u0003\u0004\u0000\u0003\u0006\u0007\u0007\f\t\u0005\f\u0005\u000e\u0006\r\u000e\u0000\u0007\u0013\u000e\t\f\u0013\u0005\u0013\u000b\u0010\u000b\t\u0006\f\u0010\r\u0000\u000b\t\u0006\u0015\u0004\u0007u", (byte) (17 - TextUtils.getOffsetBefore("", 0)), 43 - (ViewConfiguration.getScrollBarFadeDuration() >> 16)).intern());
    }

    public KernelPayloadInstance(Map<String, String> map, Map<String, String> map2) {
        this.AGRequest = map;
        this.getBody = map2;
    }

    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r11v1, resolved type: char[]} */
    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r11v2, resolved type: java.lang.String} */
    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r11v4, resolved type: java.lang.String} */
    /* JADX WARNING: Failed to insert additional move for type inference */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public static java.lang.String getMethod(java.lang.String r11, byte r12, int r13) {
        /*
            if (r11 != 0) goto L_0x00b5
        L_0x0002:
            char[] r11 = (char[]) r11
            char[] r10 = getMethod
            char r3 = getUrl
            char[] r2 = new char[r13]
            int r0 = r13 % 2
            if (r0 != 0) goto L_0x0095
        L_0x000e:
            r0 = 1
            if (r13 <= r0) goto L_0x00c5
            r4 = 0
        L_0x0012:
            if (r4 >= r13) goto L_0x00c5
            char r0 = r11[r4]
            int r9 = r4 + 1
            char r1 = r11[r9]
            if (r0 != r1) goto L_0x0031
            int r0 = r0 - r12
            char r0 = (char) r0
            r2[r4] = r0
            int r1 = r1 - r12
            char r0 = (char) r1
            r2[r9] = r0
        L_0x0024:
            int r4 = r4 + 2
            int r0 = newBuilder
            int r1 = r0 + 45
            int r0 = r1 % 128
            getHeaders = r0
            int r0 = r1 % 2
            goto L_0x0012
        L_0x0031:
            int r8 = com.apiguard3.internal.setNextClusterForwardId.AGRequest(r0, r3)
            int r7 = com.apiguard3.internal.setNextClusterForwardId.getBody(r0, r3)
            int r5 = com.apiguard3.internal.setNextClusterForwardId.AGRequest(r1, r3)
            int r6 = com.apiguard3.internal.setNextClusterForwardId.getBody(r1, r3)
            r0 = 5
            if (r7 == r6) goto L_0x0072
            r0 = 18
            if (r8 == r5) goto L_0x0059
            int r0 = com.apiguard3.internal.setNextClusterForwardId.getBody(r8, r6, r3)
            int r1 = com.apiguard3.internal.setNextClusterForwardId.getBody(r5, r7, r3)
            char r0 = r10[r0]
            r2[r4] = r0
            char r0 = r10[r1]
            r2[r9] = r0
            goto L_0x0024
        L_0x0059:
            int r0 = com.apiguard3.internal.setNextClusterForwardId.getHeaders(r7, r3)
            int r1 = com.apiguard3.internal.setNextClusterForwardId.getHeaders(r6, r3)
            int r0 = com.apiguard3.internal.setNextClusterForwardId.getBody(r8, r0, r3)
            int r1 = com.apiguard3.internal.setNextClusterForwardId.getBody(r5, r1, r3)
            char r0 = r10[r0]
            r2[r4] = r0
            char r0 = r10[r1]
            r2[r9] = r0
            goto L_0x0024
        L_0x0072:
            int r0 = newBuilder
            int r1 = r0 + 35
            int r0 = r1 % 128
            getHeaders = r0
            int r0 = r1 % 2
            int r0 = com.apiguard3.internal.setNextClusterForwardId.getHeaders(r8, r3)
            int r1 = com.apiguard3.internal.setNextClusterForwardId.getHeaders(r5, r3)
            int r0 = com.apiguard3.internal.setNextClusterForwardId.getBody(r0, r7, r3)
            int r1 = com.apiguard3.internal.setNextClusterForwardId.getBody(r1, r6, r3)
            char r0 = r10[r0]
            r2[r4] = r0
            char r0 = r10[r1]
            r2[r9] = r0
            goto L_0x0024
        L_0x0095:
            int r0 = newBuilder
            int r1 = r0 + 43
            int r0 = r1 % 128
            getHeaders = r0
            int r0 = r1 % 2
            if (r0 == 0) goto L_0x00ab
            int r13 = r13 + 125
            char r0 = r11[r13]
            int r0 = r0 >> r12
            char r0 = (char) r0
            r2[r13] = r0
            goto L_0x000e
        L_0x00ab:
            int r13 = r13 + -1
            char r0 = r11[r13]
            int r0 = r0 - r12
            char r0 = (char) r0
            r2[r13] = r0
            goto L_0x000e
        L_0x00b5:
            int r0 = getHeaders
            int r1 = r0 + 85
            int r0 = r1 % 128
            newBuilder = r0
            int r0 = r1 % 2
            char[] r11 = r11.toCharArray()
            goto L_0x0002
        L_0x00c5:
            java.lang.String r0 = new java.lang.String
            r0.<init>(r2)
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: com.apiguard3.io.KernelPayloadInstance.getMethod(java.lang.String, byte, int):java.lang.String");
    }
}
