package com.ss.android.ugc.aweme.legoImp.task;

import X.AnonymousClass2UX;
import X.C12422nK;
import X.RTn;
import com.bytedance.covode.number.Covode;
import java.util.Map;

public class InitAppsFlyer$2 implements RTn {
    public final /* synthetic */ long LIZ;
    public final /* synthetic */ InitAppsFlyer LIZIZ;

    static {
        Covode.recordClassIndex(90455);
    }

    public final void LIZ(String str) {
        AnonymousClass2UX r1 = new AnonymousClass2UX();
        r1.LIZ("conversion_fail_message", str);
        C12422nK.LIZ("af_conversion_fail", r1.LIZ);
    }

    public final void LIZIZ(String str) {
        AnonymousClass2UX r1 = new AnonymousClass2UX();
        r1.LIZ("attribution_fail_message", str);
        C12422nK.LIZ("af_attribution_fail", r1.LIZ);
    }

    public final void LIZIZ(Map<String, String> map) {
        String str;
        AnonymousClass2UX r2 = new AnonymousClass2UX();
        if (map != null) {
            str = map.toString();
        } else {
            str = "";
        }
        r2.LIZ("attribution_data", str);
        C12422nK.LIZ("app_open_attribution", r2.LIZ);
    }

    /* JADX WARNING: Can't wrap try/catch for region: R(9:6|7|8|(1:10)|11|12|(1:14)(1:20)|15|(2:17|(2:19|21)(2:22|(1:24)(8:25|(1:29)|30|31|32|33|37|(2:39|40)(2:41|(2:43|44)(2:45|47)))))(1:51)) */
    /* JADX WARNING: Missing exception handler attribute for start block: B:11:0x0052 */
    /* JADX WARNING: Removed duplicated region for block: B:14:0x006b A[Catch:{ Exception -> 0x0117 }] */
    /* JADX WARNING: Removed duplicated region for block: B:17:0x0079 A[Catch:{ Exception -> 0x0117 }] */
    /* JADX WARNING: Removed duplicated region for block: B:20:0x008c A[Catch:{ Exception -> 0x0117 }] */
    /* JADX WARNING: Removed duplicated region for block: B:51:? A[RETURN, SYNTHETIC] */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZ(java.util.Map<java.lang.String, java.lang.Object> r9) {
        /*
            r8 = this;
            java.lang.String r4 = "af_dp"
            java.lang.String r6 = "is_appsflyer_first_launch"
            java.lang.String r7 = "appsflyer_repo"
            X.C13672pL.LIZ = r9     // Catch:{ Exception -> 0x0117 }
            java.lang.String r0 = "is_first_launch"
            java.lang.Object r0 = r9.get(r0)     // Catch:{ Exception -> 0x0117 }
            java.lang.String r0 = r0.toString()     // Catch:{ Exception -> 0x0117 }
            java.lang.Boolean r0 = java.lang.Boolean.valueOf(r0)     // Catch:{ Exception -> 0x0117 }
            boolean r0 = r0.booleanValue()     // Catch:{ Exception -> 0x0117 }
            if (r0 == 0) goto L_0x0117
            com.bytedance.keva.Keva r0 = com.bytedance.keva.Keva.getRepo(r7)     // Catch:{ Exception -> 0x0117 }
            r5 = 1
            boolean r0 = r0.getBoolean(r6, r5)     // Catch:{ Exception -> 0x0117 }
            if (r0 == 0) goto L_0x0117
            java.lang.String r0 = "af_status"
            java.lang.Object r0 = r9.get(r0)     // Catch:{ NullPointerException -> 0x0052 }
            java.lang.Object r0 = java.util.Objects.requireNonNull(r0)     // Catch:{ NullPointerException -> 0x0052 }
            java.lang.String r1 = r0.toString()     // Catch:{ NullPointerException -> 0x0052 }
            java.lang.String r0 = "Non-organic"
            boolean r0 = r0.equalsIgnoreCase(r1)     // Catch:{ NullPointerException -> 0x0052 }
            if (r0 == 0) goto L_0x0052
            java.lang.String r3 = "af_conversion_success"
            X.2UX r2 = new X.2UX     // Catch:{ NullPointerException -> 0x0052 }
            r2.<init>()     // Catch:{ NullPointerException -> 0x0052 }
            java.lang.String r1 = "conversion_data"
            java.lang.String r0 = r9.toString()     // Catch:{ NullPointerException -> 0x0052 }
            r2.LIZ((java.lang.String) r1, (java.lang.String) r0)     // Catch:{ NullPointerException -> 0x0052 }
            java.util.Map<java.lang.String, java.lang.String> r0 = r2.LIZ     // Catch:{ NullPointerException -> 0x0052 }
            X.C12422nK.LIZ((java.lang.String) r3, (java.util.Map<java.lang.String, java.lang.String>) r0)     // Catch:{ NullPointerException -> 0x0052 }
        L_0x0052:
            com.bytedance.keva.Keva r1 = com.bytedance.keva.Keva.getRepo(r7)     // Catch:{ Exception -> 0x0117 }
            r0 = 0
            r1.storeBoolean(r6, r0)     // Catch:{ Exception -> 0x0117 }
            com.ss.android.ugc.aweme.ug.IUgCommonService r0 = com.ss.android.ugc.aweme.ug.UgCommonServiceImpl.LJIIL()     // Catch:{ Exception -> 0x0117 }
            X.2pN r0 = r0.LJIIJ()     // Catch:{ Exception -> 0x0117 }
            r0.LIZ((java.util.Map<java.lang.String, ? extends java.lang.Object>) r9)     // Catch:{ Exception -> 0x0117 }
            java.lang.Object r0 = r9.get(r4)     // Catch:{ Exception -> 0x0117 }
            if (r0 == 0) goto L_0x008c
            java.lang.Object r0 = r9.get(r4)     // Catch:{ Exception -> 0x0117 }
            java.lang.String r2 = r0.toString()     // Catch:{ Exception -> 0x0117 }
        L_0x0073:
            boolean r0 = android.text.TextUtils.isEmpty(r2)     // Catch:{ Exception -> 0x0117 }
            if (r0 != 0) goto L_0x0117
            android.net.Uri r0 = android.net.Uri.parse(r2)     // Catch:{ Exception -> 0x0117 }
            java.lang.String r0 = r0.getScheme()     // Catch:{ Exception -> 0x0117 }
            java.lang.String r6 = r0.toLowerCase()     // Catch:{ Exception -> 0x0117 }
            boolean r0 = android.text.TextUtils.isEmpty(r6)     // Catch:{ Exception -> 0x0117 }
            if (r0 == 0) goto L_0x0090
            goto L_0x008f
        L_0x008c:
            java.lang.String r2 = ""
            goto L_0x0073
        L_0x008f:
            return
        L_0x0090:
            X.S9P r0 = X.S9P.LJI     // Catch:{ Exception -> 0x0117 }
            boolean r0 = r0.LIZ(r2)     // Catch:{ Exception -> 0x0117 }
            if (r0 == 0) goto L_0x0099
            return
        L_0x0099:
            java.lang.String r0 = "sslocal"
            boolean r0 = r0.equals(r6)     // Catch:{ Exception -> 0x0117 }
            if (r0 != 0) goto L_0x00a9
            java.lang.String r0 = "localsdk"
            boolean r0 = r0.equals(r6)     // Catch:{ Exception -> 0x0117 }
            if (r0 == 0) goto L_0x00af
        L_0x00a9:
            X.LyV r0 = X.LyV.LIZ     // Catch:{ Exception -> 0x0117 }
            java.lang.String r2 = r0.LIZIZ(r2)     // Catch:{ Exception -> 0x0117 }
        L_0x00af:
            android.net.Uri r4 = android.net.Uri.parse(r2)     // Catch:{ Exception -> 0x0117 }
            org.json.JSONObject r7 = new org.json.JSONObject     // Catch:{ Exception -> 0x0117 }
            r7.<init>()     // Catch:{ Exception -> 0x0117 }
            java.lang.String r1 = "channel"
            java.lang.String r0 = "appsflyer"
            r7.put(r1, r0)     // Catch:{ JSONException -> 0x00df }
            java.lang.String r0 = "target"
            r7.put(r0, r2)     // Catch:{ JSONException -> 0x00df }
            long r2 = android.os.SystemClock.uptimeMillis()     // Catch:{ JSONException -> 0x00df }
            X.7im r0 = X.AnonymousClass2HX.LIZ     // Catch:{ JSONException -> 0x00df }
            long r0 = r0.LJFF     // Catch:{ JSONException -> 0x00df }
            long r2 = r2 - r0
            java.lang.String r0 = "total_time"
            r7.put(r0, r2)     // Catch:{ JSONException -> 0x00df }
            long r2 = android.os.SystemClock.uptimeMillis()     // Catch:{ JSONException -> 0x00df }
            long r0 = r8.LIZ     // Catch:{ JSONException -> 0x00df }
            long r2 = r2 - r0
            java.lang.String r0 = "fetch_time"
            r7.put(r0, r2)     // Catch:{ JSONException -> 0x00df }
            goto L_0x00e3
        L_0x00df:
            r0 = move-exception
            X.0HH.LIZ(r0)     // Catch:{ Exception -> 0x0117 }
        L_0x00e3:
            java.lang.String r0 = "deep_link"
            X.9LK.LIZ(r0, r7)     // Catch:{ Exception -> 0x0117 }
            X.2pU r2 = X.C10712kZ.LIZ     // Catch:{ Exception -> 0x0117 }
            r2.LIZ(r4, r6, r5)     // Catch:{ Exception -> 0x0117 }
            X.3a9 r0 = X.C224738l.LJIIL     // Catch:{ Exception -> 0x0117 }
            X.38l r0 = r0.LIZ()     // Catch:{ Exception -> 0x0117 }
            boolean r0 = r0.LIZJ     // Catch:{ Exception -> 0x0117 }
            if (r0 != 0) goto L_0x0106
            X.2kY r1 = new X.2kY     // Catch:{ Exception -> 0x0117 }
            r1.<init>()     // Catch:{ Exception -> 0x0117 }
            android.content.Intent r0 = r2.LIZJ()     // Catch:{ Exception -> 0x0117 }
            r1.LIZ = r0     // Catch:{ Exception -> 0x0117 }
            X.CqM.LIZ(r1)     // Catch:{ Exception -> 0x0117 }
            return
        L_0x0106:
            boolean r0 = r2.LIZ()     // Catch:{ Exception -> 0x0117 }
            if (r0 != 0) goto L_0x0110
            r2.LIZIZ()     // Catch:{ Exception -> 0x0117 }
            return
        L_0x0110:
            org.greenrobot.eventbus.EventBus r0 = org.greenrobot.eventbus.EventBus.LIZ()     // Catch:{ Exception -> 0x0117 }
            org.greenrobot.eventbus.EventBus.LIZ(r0, r2)     // Catch:{ Exception -> 0x0117 }
        L_0x0117:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.legoImp.task.InitAppsFlyer$2.LIZ(java.util.Map):void");
    }

    public InitAppsFlyer$2(InitAppsFlyer initAppsFlyer, long j) {
        this.LIZIZ = initAppsFlyer;
        this.LIZ = j;
    }
}
