package p037.p109.p111;

import android.database.Cursor;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import p037.p115.p116.InterfaceC2442;
import p037.p115.p116.p117.C2449;
import p138.p139.p143.p144.C2803;

/* JADX INFO: renamed from: މ.ސ.ޏ.ހ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C2422 {

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public static final String[] f7675 = {"tokenize=", "compress=", "content=", "languageid=", "matchinfo=", "notindexed=", "order=", "prefix=", "uncompress="};

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final String f7676;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final Set<String> f7677;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final Set<String> f7678;

    public C2422(String str, Set<String> set, String str2) {
        this.f7676 = str;
        this.f7677 = set;
        this.f7678 = m4506(str2);
    }

    public C2422(String str, Set<String> set, Set<String> set2) {
        this.f7676 = str;
        this.f7677 = set;
        this.f7678 = set2;
    }

    /* JADX WARN: Removed duplicated region for block: B:33:0x0087  */
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static Set<String> m4506(String str) {
        if (str.isEmpty()) {
            return new HashSet();
        }
        String strSubstring = str.substring(str.indexOf(40) + 1, str.lastIndexOf(41));
        ArrayList<String> arrayList = new ArrayList();
        ArrayDeque arrayDeque = new ArrayDeque();
        int i = -1;
        for (int i2 = 0; i2 < strSubstring.length(); i2++) {
            char cCharAt = strSubstring.charAt(i2);
            if (cCharAt == '\"' || cCharAt == '\'') {
                if (arrayDeque.isEmpty()) {
                    arrayDeque.push(Character.valueOf(cCharAt));
                } else if (((Character) arrayDeque.peek()).charValue() == cCharAt) {
                    arrayDeque.pop();
                }
            } else if (cCharAt != ',') {
                if (cCharAt != '[') {
                    if (cCharAt != ']') {
                        if (cCharAt != '`') {
                        }
                    } else if (!arrayDeque.isEmpty() && ((Character) arrayDeque.peek()).charValue() == '[') {
                        arrayDeque.pop();
                    }
                } else if (arrayDeque.isEmpty()) {
                    arrayDeque.push(Character.valueOf(cCharAt));
                }
            } else if (arrayDeque.isEmpty()) {
                arrayList.add(strSubstring.substring(i + 1, i2).trim());
                i = i2;
            }
        }
        arrayList.add(strSubstring.substring(i + 1).trim());
        HashSet hashSet = new HashSet();
        for (String str2 : arrayList) {
            for (String str3 : f7675) {
                if (str2.startsWith(str3)) {
                    hashSet.add(str2);
                }
            }
        }
        return hashSet;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C2422 m4507(InterfaceC2442 interfaceC2442, String str) {
        C2449 c2449 = (C2449) interfaceC2442;
        Cursor cursorM4527 = c2449.m4527(C2803.m4880("PRAGMA table_info(`", str, "`)"));
        HashSet hashSet = new HashSet();
        try {
            if (cursorM4527.getColumnCount() > 0) {
                int columnIndex = cursorM4527.getColumnIndex("name");
                while (cursorM4527.moveToNext()) {
                    hashSet.add(cursorM4527.getString(columnIndex));
                }
            }
            cursorM4527.close();
            cursorM4527 = c2449.m4527("SELECT * FROM sqlite_master WHERE `name` = '" + str + "'");
            try {
                String string = cursorM4527.moveToFirst() ? cursorM4527.getString(cursorM4527.getColumnIndexOrThrow("sql")) : "";
                cursorM4527.close();
                return new C2422(str, hashSet, m4506(string));
            } finally {
            }
        } finally {
        }
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || C2422.class != obj.getClass()) {
            return false;
        }
        C2422 c2422 = (C2422) obj;
        String str = this.f7676;
        if (str == null ? c2422.f7676 != null : !str.equals(c2422.f7676)) {
            return false;
        }
        Set<String> set = this.f7677;
        if (set == null ? c2422.f7677 != null : !set.equals(c2422.f7677)) {
            return false;
        }
        Set<String> set2 = this.f7678;
        Set<String> set3 = c2422.f7678;
        return set2 != null ? set2.equals(set3) : set3 == null;
    }

    public int hashCode() {
        String str = this.f7676;
        int iHashCode = (str != null ? str.hashCode() : 0) * 31;
        Set<String> set = this.f7677;
        int iHashCode2 = (iHashCode + (set != null ? set.hashCode() : 0)) * 31;
        Set<String> set2 = this.f7678;
        return iHashCode2 + (set2 != null ? set2.hashCode() : 0);
    }

    public String toString() {
        StringBuilder sbM4889 = C2803.m4889("FtsTableInfo{name='");
        sbM4889.append(this.f7676);
        sbM4889.append('\'');
        sbM4889.append(", columns=");
        sbM4889.append(this.f7677);
        sbM4889.append(", options=");
        sbM4889.append(this.f7678);
        sbM4889.append('}');
        return sbM4889.toString();
    }
}
