package com.appsflyer.internal;

import android.content.Context;
import android.database.Cursor;
import com.bytedance.covode.number.Covode;
import java.util.Map;

public final class ck extends cf {
    static {
        Covode.recordClassIndex(2678);
    }

    public ck(Runnable runnable) {
        super("samsung", runnable);
    }

    public final void AFKeystoreWrapper(Context context) {
        valueOf(context, new ax<Map<String, Object>>(context, "com.sec.android.app.samsungapps.referrer", "FBA3AF4E7757D9016E953FB3EE4671CA2BD9AF725F9A53D52ED4A38EAAA08901") {
            static {
                Covode.recordClassIndex(2679);
            }

            /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r5v0, resolved type: java.lang.Object[]} */
            /* JADX WARNING: Multi-variable type inference failed */
            /* Code decompiled incorrectly, please refer to instructions dump. */
            public static android.database.Cursor com_appsflyer_internal_ck$3_android_content_ContentResolver_query(android.content.ContentResolver r16, android.net.Uri r17, java.lang.String[] r18, java.lang.String r19, java.lang.String[] r20, java.lang.String r21) {
                /*
                    r2 = 13952(0x3680, float:1.9551E-41)
                    com.bytedance.frameworks.apm.trace.MethodCollector.i(r2)
                    r0 = 240004(0x3a984, float:3.36317E-40)
                    X.3GY.LIZ(r0)
                    r0 = 5
                    java.lang.Object[] r5 = new java.lang.Object[r0]
                    r0 = 0
                    r11 = r17
                    r5[r0] = r11
                    r0 = 1
                    r12 = r18
                    r5[r0] = r12
                    r0 = 2
                    r13 = r19
                    r5[r0] = r13
                    r0 = 3
                    r14 = r20
                    r5[r0] = r14
                    r0 = 4
                    r15 = r21
                    r5[r0] = r15
                    r3 = 0
                    r6 = 240004(0x3a984, float:3.36317E-40)
                    java.lang.String r7 = "android.database.Cursor"
                    r8 = 0
                    r9 = -1994093426(0xffffffff89248c8e, float:-1.980687E-33)
                    r10 = 2
                    r4 = r16
                    android.util.Pair r1 = X.3GY.LIZ(r3, r4, r5, r6, r7, r8, r9, r10)
                    java.lang.Object r0 = r1.first
                    java.lang.Boolean r0 = (java.lang.Boolean) r0
                    boolean r0 = r0.booleanValue()
                    if (r0 == 0) goto L_0x004a
                    java.lang.Object r0 = r1.second
                    android.database.Cursor r0 = (android.database.Cursor) r0
                L_0x0046:
                    com.bytedance.frameworks.apm.trace.MethodCollector.o(r2)
                    return r0
                L_0x004a:
                    r10 = r4
                    android.database.Cursor r0 = r10.query(r11, r12, r13, r14, r15)
                    goto L_0x0046
                */
                throw new UnsupportedOperationException("Method not decompiled: com.appsflyer.internal.ck.AnonymousClass3.com_appsflyer_internal_ck$3_android_content_ContentResolver_query(android.content.ContentResolver, android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String):android.database.Cursor");
            }

            /* access modifiers changed from: private */
            /* JADX WARNING: Code restructure failed: missing block: B:21:0x00d0, code lost:
                if (r2 != null) goto L_0x00d2;
             */
            /* renamed from: AFInAppEventType */
            /* Code decompiled incorrectly, please refer to instructions dump. */
            public java.util.Map<java.lang.String, java.lang.Object> values() {
                /*
                    r11 = this;
                    java.lang.String r4 = "FEATURE_NOT_SUPPORTED"
                    java.lang.String r3 = "response"
                    r2 = 0
                    android.content.Context r0 = r11.AFInAppEventType     // Catch:{ Exception -> 0x00be }
                    android.content.ContentResolver r5 = r0.getContentResolver()     // Catch:{ Exception -> 0x00be }
                    java.lang.StringBuilder r1 = new java.lang.StringBuilder     // Catch:{ Exception -> 0x00be }
                    java.lang.String r0 = "content://"
                    r1.<init>(r0)     // Catch:{ Exception -> 0x00be }
                    java.lang.String r0 = r11.values     // Catch:{ Exception -> 0x00be }
                    r1.append(r0)     // Catch:{ Exception -> 0x00be }
                    java.lang.String r0 = r1.toString()     // Catch:{ Exception -> 0x00be }
                    android.net.Uri r6 = android.net.Uri.parse(r0)     // Catch:{ Exception -> 0x00be }
                    r7 = 0
                    r8 = 0
                    r9 = 0
                    r10 = 0
                    android.database.Cursor r2 = com_appsflyer_internal_ck$3_android_content_ContentResolver_query(r5, r6, r7, r8, r9, r10)     // Catch:{ Exception -> 0x00be }
                    if (r2 == 0) goto L_0x00b4
                    boolean r0 = r2.moveToFirst()     // Catch:{ Exception -> 0x00be }
                    if (r0 == 0) goto L_0x00ac
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this     // Catch:{ Exception -> 0x00be }
                    java.util.Map<java.lang.String, java.lang.Object> r1 = r0.values     // Catch:{ Exception -> 0x00be }
                    java.lang.String r0 = "OK"
                    r1.put(r3, r0)     // Catch:{ Exception -> 0x00be }
                    java.lang.String r1 = "referrer"
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this     // Catch:{ Exception -> 0x00be }
                    java.util.Map<java.lang.String, java.lang.Object> r0 = r0.values     // Catch:{ Exception -> 0x00be }
                    valueOf(r1, r0, r2)     // Catch:{ Exception -> 0x00be }
                    java.lang.String r1 = "click_ts"
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this     // Catch:{ Exception -> 0x00be }
                    java.util.Map<java.lang.String, java.lang.Object> r0 = r0.values     // Catch:{ Exception -> 0x00be }
                    AFInAppEventParameterName(r1, r0, r2)     // Catch:{ Exception -> 0x00be }
                    java.lang.String r1 = "install_begin_ts"
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this     // Catch:{ Exception -> 0x00be }
                    java.util.Map<java.lang.String, java.lang.Object> r0 = r0.values     // Catch:{ Exception -> 0x00be }
                    AFInAppEventParameterName(r1, r0, r2)     // Catch:{ Exception -> 0x00be }
                    java.lang.String r1 = "install_end_ts"
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this     // Catch:{ Exception -> 0x00be }
                    java.util.Map<java.lang.String, java.lang.Object> r0 = r0.values     // Catch:{ Exception -> 0x00be }
                    AFInAppEventParameterName(r1, r0, r2)     // Catch:{ Exception -> 0x00be }
                    java.lang.String r1 = "organic_keywords"
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this     // Catch:{ Exception -> 0x00be }
                    java.util.Map<java.lang.String, java.lang.Object> r0 = r0.values     // Catch:{ Exception -> 0x00be }
                    valueOf(r1, r0, r2)     // Catch:{ Exception -> 0x00be }
                    java.lang.String r1 = "attr_type"
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this     // Catch:{ Exception -> 0x00be }
                    java.util.Map<java.lang.String, java.lang.Object> r0 = r0.values     // Catch:{ Exception -> 0x00be }
                    valueOf(r1, r0, r2)     // Catch:{ Exception -> 0x00be }
                    java.util.HashMap r5 = new java.util.HashMap     // Catch:{ Exception -> 0x00be }
                    r5.<init>()     // Catch:{ Exception -> 0x00be }
                    java.lang.String r6 = "instant"
                    int r1 = r2.getColumnIndex(r6)     // Catch:{ Exception -> 0x00be }
                    r0 = -1
                    if (r1 == r0) goto L_0x008d
                    java.lang.String r0 = r2.getString(r1)     // Catch:{ Exception -> 0x00be }
                    if (r0 == 0) goto L_0x008d
                    boolean r0 = java.lang.Boolean.parseBoolean(r0)     // Catch:{ Exception -> 0x00be }
                    java.lang.Boolean r0 = java.lang.Boolean.valueOf(r0)     // Catch:{ Exception -> 0x00be }
                    r5.put(r6, r0)     // Catch:{ Exception -> 0x00be }
                L_0x008d:
                    java.lang.String r0 = "click_server_ts"
                    AFInAppEventParameterName(r0, r5, r2)     // Catch:{ Exception -> 0x00be }
                    java.lang.String r0 = "install_begin_server_ts"
                    AFInAppEventParameterName(r0, r5, r2)     // Catch:{ Exception -> 0x00be }
                    java.lang.String r0 = "install_version"
                    valueOf(r0, r5, r2)     // Catch:{ Exception -> 0x00be }
                    boolean r0 = r5.isEmpty()     // Catch:{ Exception -> 0x00be }
                    if (r0 != 0) goto L_0x00d0
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this     // Catch:{ Exception -> 0x00be }
                    java.util.Map<java.lang.String, java.lang.Object> r1 = r0.values     // Catch:{ Exception -> 0x00be }
                    java.lang.String r0 = "custom"
                    r1.put(r0, r5)     // Catch:{ Exception -> 0x00be }
                    goto L_0x00d0
                L_0x00ac:
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this     // Catch:{ Exception -> 0x00be }
                    java.util.Map<java.lang.String, java.lang.Object> r0 = r0.values     // Catch:{ Exception -> 0x00be }
                    r0.put(r3, r4)     // Catch:{ Exception -> 0x00be }
                    goto L_0x00d0
                L_0x00b4:
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this     // Catch:{ Exception -> 0x00be }
                    java.util.Map<java.lang.String, java.lang.Object> r1 = r0.values     // Catch:{ Exception -> 0x00be }
                    java.lang.String r0 = "SERVICE_UNAVAILABLE"
                    r1.put(r3, r0)     // Catch:{ Exception -> 0x00be }
                    goto L_0x00d0
                L_0x00be:
                    r1 = move-exception
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this     // Catch:{ all -> 0x0111 }
                    java.util.Map<java.lang.String, java.lang.Object> r0 = r0.values     // Catch:{ all -> 0x0111 }
                    r0.put(r3, r4)     // Catch:{ all -> 0x0111 }
                    java.lang.String r0 = r1.getMessage()     // Catch:{ all -> 0x0111 }
                    com.appsflyer.AFLogger.valueOf(r0, r1)     // Catch:{ all -> 0x0111 }
                    if (r2 == 0) goto L_0x00d5
                    goto L_0x00d2
                L_0x00d0:
                    if (r2 == 0) goto L_0x00d5
                L_0x00d2:
                    r2.close()
                L_0x00d5:
                    android.content.Context r0 = r11.AFInAppEventType
                    android.content.pm.PackageManager r2 = r0.getPackageManager()
                    java.lang.String r1 = r11.values
                    r0 = 128(0x80, float:1.794E-43)
                    android.content.pm.ProviderInfo r0 = r2.resolveContentProvider(r1, r0)
                    java.lang.String r3 = r0.packageName
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this
                    java.util.Map<java.lang.String, java.lang.Object> r2 = r0.values
                    android.content.Context r0 = r11.AFInAppEventType
                    long r0 = com.appsflyer.internal.ac.valueOf(r0, r3)
                    java.lang.Long r1 = java.lang.Long.valueOf(r0)
                    java.lang.String r0 = "api_ver"
                    r2.put(r0, r1)
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this
                    java.util.Map<java.lang.String, java.lang.Object> r2 = r0.values
                    android.content.Context r0 = r11.AFInAppEventType
                    java.lang.String r1 = com.appsflyer.internal.ac.values((android.content.Context) r0, (java.lang.String) r3)
                    java.lang.String r0 = "api_ver_name"
                    r2.put(r0, r1)
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this
                    r0.AFKeystoreWrapper()
                    com.appsflyer.internal.ck r0 = com.appsflyer.internal.ck.this
                    java.util.Map<java.lang.String, java.lang.Object> r0 = r0.values
                    return r0
                L_0x0111:
                    r0 = move-exception
                    if (r2 == 0) goto L_0x0117
                    r2.close()
                L_0x0117:
                    throw r0
                */
                throw new UnsupportedOperationException("Method not decompiled: com.appsflyer.internal.ck.AnonymousClass3.values():java.util.Map");
            }

            public static void AFInAppEventParameterName(String str, Map<String, Object> map, Cursor cursor) {
                int columnIndex = cursor.getColumnIndex(str);
                if (columnIndex != -1) {
                    long j = cursor.getLong(columnIndex);
                    if (j != 0) {
                        map.put(str, Long.valueOf(j));
                    }
                }
            }

            public static void valueOf(String str, Map<String, Object> map, Cursor cursor) {
                String string;
                int columnIndex = cursor.getColumnIndex(str);
                if (columnIndex != -1 && (string = cursor.getString(columnIndex)) != null) {
                    map.put(str, string);
                }
            }
        });
    }
}
