package com.apiguard3.url_matcher;

import android.graphics.Color;
import android.os.Process;
import android.os.SystemClock;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.ViewConfiguration;
import android.webkit.URLUtil;
import android.widget.ExpandableListView;
import com.apiguard3.internal.checkCertificates;
import com.apiguard3.internal.getState;
import com.apiguard3.internal.log;
import com.bytedance.covode.number.Covode;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.json.JSONArray;

public class MatchesConfig {
    public static int getBody = 1;
    public static int getHeaders;
    public Matches AGRequest = Matches.getBody;
    public List<MatchConfig> getMethod = new ArrayList();

    static {
        Covode.recordClassIndex(2535);
    }

    public MatchesConfig() {
    }

    public List<MatchConfig> AGRequest() {
        boolean z;
        int i = getHeaders + 91;
        getBody = i % 128;
        if (i % 2 != 0) {
            z = false;
        } else {
            z = true;
        }
        if (!z) {
            List<MatchConfig> list = this.getMethod;
            int i2 = getBody + 9;
            getHeaders = i2 % 128;
            int i3 = i2 % 2;
            return list;
        }
        List<MatchConfig> list2 = this.getMethod;
        throw new NullPointerException("hashCode");
    }

    public Matches getMethod() {
        int i = getHeaders;
        int i2 = i + 113;
        getBody = i2 % 128;
        int i3 = i2 % 2;
        Matches matches = this.AGRequest;
        int i4 = i + 113;
        getBody = i4 % 128;
        if (i4 % 2 != 0) {
            return matches;
        }
        throw new NullPointerException("hashCode");
    }

    public int hashCode() {
        int hashCode;
        int i = getHeaders + 67;
        getBody = i % 128;
        if (i % 2 != 0) {
            hashCode = ((this.AGRequest.hashCode() + 527) * 31) + this.getMethod.hashCode();
        } else {
            hashCode = ((this.AGRequest.hashCode() + 12713) * 92) >>> this.getMethod.hashCode();
        }
        int i2 = getBody + 53;
        getHeaders = i2 % 128;
        if (i2 % 2 == 0) {
            return hashCode;
        }
        throw new NullPointerException("hashCode");
    }

    public enum Matches {
        AGRequest,
        getHeaders,
        getMethod,
        getBody;
        
        public static int AGRequest$Builder;
        public static int method;
        public static int url;

        public static void getUrl() {
            method = 15;
        }

        /* access modifiers changed from: public */
        static {
            int i = AGRequest$Builder + 119;
            url = i % 128;
            int i2 = i % 2;
        }

        public static Matches getMethod(String str) {
            int i = url + 91;
            AGRequest$Builder = i % 128;
            int i2 = i % 2;
            switch (str.hashCode()) {
                case 64897:
                    if (str.equals(getMethod(!PhoneNumberUtils.is12Key('0'), "\u0004￹\u0004", 87 - Color.blue(0), 3 - (Process.myTid() >> 22), (SystemClock.elapsedRealtime() > 0 ? 1 : (SystemClock.elapsedRealtime() == 0 ? 0 : -1))).intern())) {
                        int i3 = AGRequest$Builder + 47;
                        url = i3 % 128;
                        int i4 = i3 % 2;
                        return AGRequest;
                    }
                    break;
                case 64972:
                    if (str.equals(getMethod(URLUtil.isDataUrl("data:"), "\f\u0001￴", TextUtils.getOffsetAfter("", 0) + 92, TextUtils.getCapsMode("", 0, 0) + 3, 3 - (ViewConfiguration.getPressedStateDuration() >> 16)).intern())) {
                        int i5 = AGRequest$Builder + 69;
                        url = i5 % 128;
                        int i6 = i5 % 2;
                        return getHeaders;
                    }
                    break;
                case 2402104:
                    if (str.equals(getMethod(!PhoneNumberUtils.isStartsPostDial('0'), "\u0002￹\u0002\u0003", 91 - KeyEvent.getDeadChar(0, 0), 4 - TextUtils.getOffsetAfter("", 0), TextUtils.getOffsetBefore("", 0) + 1).intern())) {
                        int i7 = AGRequest$Builder + 81;
                        url = i7 % 128;
                        int i8 = i7 % 2;
                        return getMethod;
                    }
                    break;
                case 452152962:
                    if (str.equals(getMethod(Process.supportsProcesses(), "￼\b\r\u0002￵￻\u0002�", 91 - (ViewConfiguration.getTouchSlop() >> 8), (ViewConfiguration.getScrollFriction() > 0.0f ? 1 : (ViewConfiguration.getScrollFriction() == 0.0f ? 0 : -1)) + 7, 5 - (ExpandableListView.getPackedPositionForGroup(0) > 0 ? 1 : (ExpandableListView.getPackedPositionForGroup(0) == 0 ? 0 : -1))).intern())) {
                        return getBody;
                    }
                    break;
            }
            checkCertificates.getMethod(log.getBody.getHeaders, getState.getHeaders.values);
            return getBody;
        }

        /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r6v1, resolved type: char[]} */
        /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r6v2, resolved type: java.lang.String} */
        /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r6v4, 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(boolean r5, java.lang.String r6, int r7, int r8, int r9) {
            /*
                if (r6 != 0) goto L_0x0071
            L_0x0002:
                char[] r6 = (char[]) r6
                char[] r4 = new char[r8]
                r3 = 0
                r2 = 0
            L_0x0008:
                if (r2 < r8) goto L_0x0056
                r0 = 93
                if (r9 > 0) goto L_0x0048
            L_0x000e:
                r6 = 1
                if (r5 != 0) goto L_0x0017
            L_0x0011:
                java.lang.String r0 = new java.lang.String
                r0.<init>(r4)
                return r0
            L_0x0017:
                char[] r5 = new char[r8]
                int r0 = url
                int r1 = r0 + 89
                int r0 = r1 % 128
                AGRequest$Builder = r0
                int r0 = r1 % 2
                r2 = 0
            L_0x0024:
                if (r2 < r8) goto L_0x0028
                r4 = r5
                goto L_0x0011
            L_0x0028:
                int r0 = AGRequest$Builder
                int r1 = r0 + 23
                int r0 = r1 % 128
                url = r0
                int r0 = r1 % 2
                if (r0 == 0) goto L_0x003e
                int r0 = r8 - r2
                int r0 = r0 - r6
                char r0 = r4[r0]
                r5[r2] = r0
                int r2 = r2 + 1
                goto L_0x0024
            L_0x003e:
                int r0 = r8 % r2
                int r0 = r0 + r3
                char r0 = r4[r0]
                r5[r2] = r0
                int r2 = r2 + 32
                goto L_0x0024
            L_0x0048:
                char[] r1 = new char[r8]
                java.lang.System.arraycopy(r4, r3, r1, r3, r8)
                int r0 = r8 - r9
                java.lang.System.arraycopy(r1, r3, r4, r0, r9)
                java.lang.System.arraycopy(r1, r9, r4, r3, r0)
                goto L_0x000e
            L_0x0056:
                int r0 = AGRequest$Builder
                int r1 = r0 + 23
                int r0 = r1 % 128
                url = r0
                int r0 = r1 % 2
                char r0 = r6[r2]
                int r0 = r0 + r7
                char r0 = (char) r0
                r4[r2] = r0
                char r1 = r4[r2]
                int r0 = method
                int r1 = r1 - r0
                char r0 = (char) r1
                r4[r2] = r0
                int r2 = r2 + 1
                goto L_0x0008
            L_0x0071:
                int r0 = AGRequest$Builder
                int r1 = r0 + 3
                int r0 = r1 % 128
                url = r0
                int r0 = r1 % 2
                char[] r6 = r6.toCharArray()
                goto L_0x0002
            */
            throw new UnsupportedOperationException("Method not decompiled: com.apiguard3.url_matcher.MatchesConfig.Matches.getMethod(boolean, java.lang.String, int, int, int):java.lang.String");
        }
    }

    public MatchesConfig(JSONArray jSONArray) {
        if (jSONArray != null && jSONArray.length() != 0) {
            String str = (String) jSONArray.opt(0);
            if (str == null || str.isEmpty()) {
                this.AGRequest = Matches.getBody;
            } else {
                this.AGRequest = Matches.getMethod(str);
            }
            if (this.AGRequest == Matches.getBody) {
                this.getMethod = Collections.emptyList();
                return;
            }
            for (int i = 1; i < jSONArray.length(); i++) {
                JSONArray jSONArray2 = (JSONArray) jSONArray.opt(i);
                if (jSONArray2 != null) {
                    this.getMethod.add(new MatchConfig(jSONArray2));
                }
            }
        }
    }

    public boolean equals(Object obj) {
        boolean z;
        int i = getHeaders;
        int i2 = i + 87;
        getBody = i2 % 128;
        int i3 = i2 % 2;
        if (this != obj) {
            z = true;
        } else {
            z = false;
        }
        if (z) {
            if (obj != null && getClass() == obj.getClass()) {
                MatchesConfig matchesConfig = (MatchesConfig) obj;
                if (this.AGRequest.equals(matchesConfig.AGRequest)) {
                    int i4 = getBody + 49;
                    getHeaders = i4 % 128;
                    if (i4 % 2 != 0 ? this.getMethod.equals(matchesConfig.getMethod) : this.getMethod.equals(matchesConfig.getMethod)) {
                        return true;
                    }
                }
                int i5 = getBody + 97;
                getHeaders = i5 % 128;
                int i6 = i5 % 2;
            }
            return false;
        }
        int i7 = i + 21;
        getBody = i7 % 128;
        if (i7 % 2 != 0) {
            return true;
        }
        return false;
    }
}
