package com.apiguard3.internal;

import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.SystemClock;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ExpandableListView;
import com.apiguard3.AGState;
import com.apiguard3.APIGuard;
import com.apiguard3.internal.log;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public final class APIGuard$InitializationCallback {
    public static int AGRequest$Builder;
    public static int addHeader = 1;
    public static final APIGuard$InitializationCallback getUrl = new APIGuard$InitializationCallback();
    public static long url;
    public Map<String, log> AGRequest = new HashMap();
    public log.getBody getBody;
    public generateHeaders getHeaders;
    public pushMinPayload getMethod;
    public transformRequest method;
    public volatile boolean newBuilder;

    public static void getMethod() {
        url = -1626822001641815388L;
    }

    static {
        Covode.recordClassIndex(2405);
        AGRequest$Builder = 0;
        getMethod();
        int i = addHeader + 47;
        AGRequest$Builder = i % 128;
        int i2 = i % 2;
    }

    public APIGuard$InitializationCallback() {
        AGRequest("ﲧ繧箂眶灔涁椫橝柮挜屎姡").intern();
        this.getBody = log.getBody.getHeaders;
        this.newBuilder = false;
    }

    public static APIGuard$InitializationCallback getBody() {
        int i = AGRequest$Builder + 19;
        addHeader = i % 128;
        if (i % 2 != 0) {
            return getUrl;
        }
        APIGuard$InitializationCallback aPIGuard$InitializationCallback = getUrl;
        throw new NullPointerException("hashCode");
    }

    public final synchronized void getUrl() {
        MethodCollector.i(6483);
        generateHeaders generateheaders = this.getHeaders;
        if (generateheaders == null) {
            MethodCollector.o(6483);
            return;
        }
        int i = addHeader + 117;
        AGRequest$Builder = i % 128;
        int i2 = i % 2;
        generateheaders.getBody();
        int i3 = AGRequest$Builder + 11;
        addHeader = i3 % 128;
        if (i3 % 2 != 0) {
            MethodCollector.o(6483);
        } else {
            MethodCollector.o(6483);
        }
    }

    public static int AGRequest() {
        int i = addHeader + 99;
        AGRequest$Builder = i % 128;
        int i2 = i % 2;
        String intern = AGRequest("ﲧ繧箂眶灔涁椫橝柮挜屎姡").intern();
        try {
            Object[] objArr = new Object[2];
            objArr[1] = Integer.valueOf(log.getBody.getHeaders.getBody());
            objArr[0] = intern;
            int intValue = ((Integer) ((Class) getMethod.AGRequest((char) (27326 - (SystemClock.elapsedRealtime() > 0 ? 1 : (SystemClock.elapsedRealtime() == 0 ? 0 : -1))), 24 - (ExpandableListView.getPackedPositionForGroup(0) > 0 ? 1 : (ExpandableListView.getPackedPositionForGroup(0) == 0 ? 0 : -1)), 2060 - Color.red(0))).getMethod("getBody", new Class[]{String.class, Integer.TYPE}).invoke((Object) null, objArr)).intValue();
            int i3 = addHeader + 5;
            AGRequest$Builder = i3 % 128;
            int i4 = i3 % 2;
            return intValue;
        } catch (Throwable th) {
            Throwable cause = th.getCause();
            if (cause != null) {
                throw cause;
            }
            throw th;
        }
    }

    public final synchronized log.getBody getHeaders() {
        MethodCollector.i(6122);
        int i = AGRequest$Builder + 97;
        int i2 = i % 128;
        addHeader = i2;
        int i3 = i % 2;
        log.getBody getbody = this.getBody;
        int i4 = i2 + 37;
        AGRequest$Builder = i4 % 128;
        if (i4 % 2 == 0) {
            MethodCollector.o(6122);
            return getbody;
        }
        MethodCollector.o(6122);
        return getbody;
    }

    public static /* synthetic */ generateHeaders AGRequest(APIGuard$InitializationCallback aPIGuard$InitializationCallback) {
        int i = addHeader + 75;
        AGRequest$Builder = i % 128;
        int i2 = i % 2;
        return aPIGuard$InitializationCallback.getHeaders;
    }

    public static /* synthetic */ transformRequest getHeaders(APIGuard$InitializationCallback aPIGuard$InitializationCallback) {
        int i = AGRequest$Builder + 55;
        int i2 = i % 128;
        addHeader = i2;
        int i3 = i % 2;
        transformRequest transformrequest = aPIGuard$InitializationCallback.method;
        int i4 = i2 + 65;
        AGRequest$Builder = i4 % 128;
        int i5 = i4 % 2;
        return transformrequest;
    }

    public static /* synthetic */ pushMinPayload getBody(APIGuard$InitializationCallback aPIGuard$InitializationCallback) {
        int i = addHeader + 55;
        int i2 = i % 128;
        AGRequest$Builder = i2;
        int i3 = i % 2;
        pushMinPayload pushminpayload = aPIGuard$InitializationCallback.getMethod;
        int i4 = i2 + 89;
        addHeader = i4 % 128;
        int i5 = i4 % 2;
        return pushminpayload;
    }

    public final synchronized log getMethod(String str) {
        MethodCollector.i(6104);
        int i = AGRequest$Builder + 93;
        addHeader = i % 128;
        if (i % 2 == 0) {
            try {
                throw new NullPointerException("hashCode");
            } catch (Throwable th) {
                MethodCollector.o(6104);
                throw th;
            }
        } else if (str != null) {
            log log = this.AGRequest.get(str);
            int i2 = AGRequest$Builder + 25;
            addHeader = i2 % 128;
            if (i2 % 2 != 0) {
                MethodCollector.o(6104);
                return log;
            }
            MethodCollector.o(6104);
            return log;
        } else {
            IllegalArgumentException illegalArgumentException = new IllegalArgumentException(AGRequest("㟱딜━崁镽쵫՗㴌疱궡ᶏ嗼跸얛﷚㗄氻ꐢ?ᐒ䱢葦뱟Ⲹ撦鲝풍಺䓢糪뒕✲弴霽켍ݴ㽫睘꽜").intern());
            MethodCollector.o(6104);
            throw illegalArgumentException;
        }
    }

    public final synchronized void getUrl(final APIGuard.Callback callback) {
        MethodCollector.i(6060);
        int i = addHeader + 123;
        AGRequest$Builder = i % 128;
        if (i % 2 != 0) {
            boolean z = this.newBuilder;
            try {
                throw new NullPointerException("hashCode");
            } catch (Throwable th) {
                MethodCollector.o(6060);
                throw th;
            }
        } else if (this.newBuilder) {
            MethodCollector.o(6060);
        } else {
            this.newBuilder = true;
            updateKernel.getMethod().post(new Runnable() {
                public static long AGRequest = -1790202851029041327L;
                public static int AGRequest$Builder = 1;
                public static int addHeader;
                public static int getBody;
                public static char getHeaders = 0;

                static {
                    Covode.recordClassIndex(2406);
                }

                public final void run() {
                    try {
                        APIGuard$InitializationCallback.getMethod(APIGuard$InitializationCallback.this, APIGuard$InitializationCallback.AGRequest());
                        HashMap hashMap = new HashMap();
                        APIGuard$InitializationCallback.getHeaders(APIGuard$InitializationCallback.this, new transformRequest(callback));
                        hashMap.put(getBody("뽑", "芌酟䷛펁ᖋ頛꾍즵", "묝멒䪎欄", (char) TextUtils.getCapsMode("", 0, 0), TextUtils.indexOf("", '0', 0, 0) + 1).intern(), APIGuard$InitializationCallback.getHeaders(APIGuard$InitializationCallback.this));
                        APIGuard$InitializationCallback.AGRequest(APIGuard$InitializationCallback.this, new pushMinPayload());
                        APIGuard$InitializationCallback.getBody(APIGuard$InitializationCallback.this).getHeaders();
                        hashMap.put(getBody("뽑", "繆ꐌ풃톄企㐎ᥜﻳ", "층Ꜵ杖", (char) TextUtils.indexOf("", ""), 1453798606 - View.MeasureSpec.makeMeasureSpec(0, 0)).intern(), APIGuard$InitializationCallback.getBody(APIGuard$InitializationCallback.this));
                        APIGuard$InitializationCallback.getMethod(APIGuard$InitializationCallback.this, new generateHeaders());
                        hashMap.put(getBody("뽑", "ᆴ瞞ꪥ︊둜윅痄泧?", "內ꡏ⭐ꘙ", (char) (TextUtils.indexOf("", '0', 0, 0) + 1), Drawable.resolveOpacity(0, 0)).intern(), APIGuard$InitializationCallback.AGRequest(APIGuard$InitializationCallback.this));
                        APIGuard$InitializationCallback.getHeaders(APIGuard$InitializationCallback.this, (Map) hashMap);
                    } catch (Throwable th) {
                        Throwable cause = th.getCause();
                        if (cause != null) {
                            throw cause;
                        }
                        throw th;
                    }
                }

                /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r10v1, resolved type: char[]} */
                /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r10v2, resolved type: java.lang.String} */
                /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r9v1, resolved type: char[]} */
                /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r9v2, resolved type: java.lang.String} */
                /* 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{r8v5, resolved type: java.lang.String} */
                /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r9v4, resolved type: java.lang.String} */
                /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r10v4, resolved type: java.lang.String} */
                /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r10v5, resolved type: java.lang.String} */
                /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r9v5, resolved type: java.lang.String} */
                /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r8v6, 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 getBody(java.lang.String r8, java.lang.String r9, java.lang.String r10, char r11, int r12) {
                    /*
                        r2 = 2
                        if (r10 != 0) goto L_0x0060
                    L_0x0003:
                        char[] r10 = (char[]) r10
                        r0 = 32
                        if (r9 != 0) goto L_0x0052
                    L_0x0009:
                        char[] r9 = (char[]) r9
                        r4 = 0
                        if (r8 != 0) goto L_0x004d
                    L_0x000e:
                        char[] r8 = (char[]) r8
                        java.lang.Object r5 = r10.clone()
                        char[] r5 = (char[]) r5
                        java.lang.Object r6 = r8.clone()
                        char[] r6 = (char[]) r6
                        char r0 = r5[r4]
                        r11 = r11 ^ r0
                        char r0 = (char) r11
                        r5[r4] = r0
                        char r1 = r6[r2]
                        char r0 = (char) r12
                        int r1 = r1 + r0
                        char r0 = (char) r1
                        r6[r2] = r0
                        int r8 = r9.length
                        char[] r7 = new char[r8]
                    L_0x002c:
                        if (r4 >= r8) goto L_0x006e
                        com.apiguard3.internal.setNextFocusUpId.getHeaders(r5, r6, r4)
                        char r1 = r9[r4]
                        int r0 = r4 + 3
                        int r0 = r0 % 4
                        char r0 = r5[r0]
                        r1 = r1 ^ r0
                        long r2 = (long) r1
                        long r0 = AGRequest
                        long r2 = r2 ^ r0
                        int r0 = getBody
                        long r0 = (long) r0
                        long r2 = r2 ^ r0
                        char r0 = getHeaders
                        long r0 = (long) r0
                        long r2 = r2 ^ r0
                        int r0 = (int) r2
                        char r0 = (char) r0
                        r7[r4] = r0
                        int r4 = r4 + 1
                        goto L_0x002c
                    L_0x004d:
                        char[] r8 = r8.toCharArray()
                        goto L_0x000e
                    L_0x0052:
                        char[] r9 = r9.toCharArray()
                        int r0 = addHeader
                        int r1 = r0 + 41
                        int r0 = r1 % 128
                        AGRequest$Builder = r0
                        int r1 = r1 % r2
                        goto L_0x0009
                    L_0x0060:
                        int r0 = AGRequest$Builder
                        int r1 = r0 + 15
                        int r0 = r1 % 128
                        addHeader = r0
                        int r1 = r1 % r2
                        char[] r10 = r10.toCharArray()
                        goto L_0x0003
                    L_0x006e:
                        java.lang.String r0 = new java.lang.String
                        r0.<init>(r7)
                        return r0
                    */
                    throw new UnsupportedOperationException("Method not decompiled: com.apiguard3.internal.APIGuard$InitializationCallback.AnonymousClass3.getBody(java.lang.String, java.lang.String, java.lang.String, char, int):java.lang.String");
                }
            });
            int i2 = addHeader + 49;
            AGRequest$Builder = i2 % 128;
            if (i2 % 2 == 0) {
                MethodCollector.o(6060);
            } else {
                MethodCollector.o(6060);
            }
        }
    }

    /* 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 AGRequest(java.lang.String r8) {
        /*
            r0 = 97
            if (r8 != 0) goto L_0x0034
        L_0x0004:
            char[] r8 = (char[]) r8
            r0 = 0
            char r7 = r8[r0]
            int r1 = r8.length
            r0 = 1
            int r1 = r1 - r0
            char[] r5 = new char[r1]
            r6 = 1
        L_0x000f:
            int r0 = r8.length
            if (r6 < r0) goto L_0x0018
            java.lang.String r0 = new java.lang.String
            r0.<init>(r5)
            return r0
        L_0x0018:
            int r0 = addHeader
            int r1 = r0 + 67
            int r0 = r1 % 128
            AGRequest$Builder = r0
            int r0 = r1 % 2
            int r4 = r6 + -1
            char r1 = r8[r6]
            int r0 = r6 * r7
            r1 = r1 ^ r0
            long r2 = (long) r1
            long r0 = url
            long r2 = r2 ^ r0
            int r0 = (int) r2
            char r0 = (char) r0
            r5[r4] = r0
            int r6 = r6 + 1
            goto L_0x000f
        L_0x0034:
            int r0 = addHeader
            int r1 = r0 + 67
            int r0 = r1 % 128
            AGRequest$Builder = r0
            int r0 = r1 % 2
            char[] r8 = r8.toCharArray()
            goto L_0x0004
        */
        throw new UnsupportedOperationException("Method not decompiled: com.apiguard3.internal.APIGuard$InitializationCallback.AGRequest(java.lang.String):java.lang.String");
    }

    public final synchronized void getUrl(APIGuard$Callback aPIGuard$Callback) {
        MethodCollector.i(6486);
        for (log headers : this.AGRequest.values()) {
            int i = AGRequest$Builder + 19;
            addHeader = i % 128;
            int i2 = i % 2;
            headers.getHeaders(aPIGuard$Callback);
            int i3 = addHeader + 23;
            AGRequest$Builder = i3 % 128;
            int i4 = i3 % 2;
        }
        MethodCollector.o(6486);
    }

    private synchronized void AGRequest(Map<String, log> map) {
        MethodCollector.i(6102);
        int i = AGRequest$Builder + 77;
        addHeader = i % 128;
        int i2 = i % 2;
        this.AGRequest.putAll(map);
        int i3 = AGRequest$Builder + 77;
        addHeader = i3 % 128;
        if (i3 % 2 != 0) {
            MethodCollector.o(6102);
        } else {
            MethodCollector.o(6102);
        }
    }

    public final synchronized void getUrl(log.getBody getbody) {
        log next;
        MethodCollector.i(6127);
        if (getbody != null) {
            this.getBody = getbody;
            checkCertificates.AGRequest(getbody);
            int body = getbody.getBody();
            String intern = AGRequest("ﲧ繧箂眶灔涁椫橝柮挜屎姡").intern();
            try {
                Object[] objArr = new Object[2];
                objArr[1] = Integer.valueOf(body);
                objArr[0] = intern;
                ((Class) getMethod.AGRequest((char) (27324 - TextUtils.lastIndexOf("", '0', 0, 0)), 23 - TextUtils.lastIndexOf("", '0', 0, 0), (KeyEvent.getMaxKeyCode() >> 16) + 2060)).getMethod("getUrl", new Class[]{String.class, Integer.TYPE}).invoke((Object) null, objArr);
                Iterator<log> it = this.AGRequest.values().iterator();
                while (it.hasNext()) {
                    int i = addHeader + 91;
                    AGRequest$Builder = i % 128;
                    if (i % 2 == 0) {
                        next = it.next();
                    } else {
                        next = it.next();
                    }
                    next.getUrl(getbody);
                }
                MethodCollector.o(6127);
            } catch (Throwable th) {
                Throwable cause = th.getCause();
                if (cause != null) {
                    MethodCollector.o(6127);
                    throw cause;
                } else {
                    MethodCollector.o(6127);
                    throw th;
                }
            }
        } else {
            int i2 = AGRequest$Builder + 105;
            addHeader = i2 % 128;
            if (i2 % 2 != 0) {
                MethodCollector.o(6127);
            } else {
                MethodCollector.o(6127);
            }
        }
    }

    public final synchronized void AGRequest(AGState aGState) {
        MethodCollector.i(6207);
        int i = AGRequest$Builder + 105;
        addHeader = i % 128;
        int i2 = i % 2;
        if (aGState.equals(AGState.APIGuardStateReady)) {
            pushMinPayload pushminpayload = this.getMethod;
            if (pushminpayload != null) {
                pushminpayload.getBody();
            }
            generateHeaders generateheaders = this.getHeaders;
            if (generateheaders != null) {
                int i3 = addHeader + 107;
                AGRequest$Builder = i3 % 128;
                int i4 = i3 % 2;
                generateheaders.getUrl();
            }
        }
        int i5 = AGRequest$Builder + 45;
        addHeader = i5 % 128;
        if (i5 % 2 != 0) {
            MethodCollector.o(6207);
        } else {
            MethodCollector.o(6207);
        }
    }

    public static /* synthetic */ generateHeaders getMethod(APIGuard$InitializationCallback aPIGuard$InitializationCallback, generateHeaders generateheaders) {
        int i = addHeader + 125;
        AGRequest$Builder = i % 128;
        int i2 = i % 2;
        aPIGuard$InitializationCallback.getHeaders = generateheaders;
        return generateheaders;
    }

    public static /* synthetic */ void getMethod(APIGuard$InitializationCallback aPIGuard$InitializationCallback, int i) {
        int i2 = AGRequest$Builder + 69;
        addHeader = i2 % 128;
        int i3 = i2 % 2;
        aPIGuard$InitializationCallback.getUrl(log.getBody.AGRequest(i));
        int i4 = addHeader + 67;
        AGRequest$Builder = i4 % 128;
        int i5 = i4 % 2;
    }

    public static /* synthetic */ pushMinPayload AGRequest(APIGuard$InitializationCallback aPIGuard$InitializationCallback, pushMinPayload pushminpayload) {
        int i = AGRequest$Builder;
        int i2 = i + 63;
        addHeader = i2 % 128;
        int i3 = i2 % 2;
        aPIGuard$InitializationCallback.getMethod = pushminpayload;
        int i4 = i + 109;
        addHeader = i4 % 128;
        if (i4 % 2 != 0) {
            return pushminpayload;
        }
        throw new NullPointerException("hashCode");
    }

    public static /* synthetic */ transformRequest getHeaders(APIGuard$InitializationCallback aPIGuard$InitializationCallback, transformRequest transformrequest) {
        char c;
        int i = AGRequest$Builder + 35;
        addHeader = i % 128;
        if (i % 2 != 0) {
            c = '+';
        } else {
            c = 'C';
        }
        aPIGuard$InitializationCallback.method = transformrequest;
        if (c != 'C') {
            int i2 = AGRequest$Builder + 91;
            addHeader = i2 % 128;
            int i3 = i2 % 2;
            return transformrequest;
        }
        throw new NullPointerException("hashCode");
    }

    public static /* synthetic */ void getHeaders(APIGuard$InitializationCallback aPIGuard$InitializationCallback, Map map) {
        int i = AGRequest$Builder + 113;
        addHeader = i % 128;
        int i2 = i % 2;
        aPIGuard$InitializationCallback.AGRequest((Map<String, log>) map);
        int i3 = addHeader + 61;
        AGRequest$Builder = i3 % 128;
        if (i3 % 2 != 0) {
            throw new NullPointerException("hashCode");
        }
    }
}
