小红书.apk(点击下载) / e.java


package pl2;

import a23.m0;
import a23.n3;
import a23.r3;
import a23.u2;
import ac2.h;
import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import androidx.core.app.NotificationManagerCompat;
import androidx.core.content.ContextCompat;
import com.google.android.gms.common.GoogleApiAvailabilityLight;
import com.google.gson.reflect.TypeToken;
import com.tencent.smtt.sdk.WebView;
import com.xingin.account.entities.UserInfo;
import com.xingin.android.xhscomm.router.Routers;
import com.xingin.pages.Pages;
import com.xingin.xhs.app.crash.SentryMessageDispatcherConfig;
import com.xingin.xhs.app.tracker.AppHeartbeatConfig;
import com.xingin.xhs.crash.handler.XYActivityThreadCallback;
import io.sentry.common.info.EventType;
import io.sentry.common.info.JsonUtil;
import io.sentry.core.SentryCoreConfig;
import io.sentry.core.s;
import io.sentry.monitor.fd.SentryFDMonitorConfig;
import ja.b1;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
import ki2.d;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Lambda;
import kotlin.jvm.internal.Reflection;
import kotlin.text.StringsKt__StringsJVMKt;
import mr2.y;
import t10.j0;
import xo2.h0;

@Metadata(bv = {}, d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0005\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\bÆ\u0002\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0011\u0010\u0012J\u000e\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002J\u0010\u0010\u0006\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0007J\b\u0010\u0007\u001a\u00020\u0004H\u0002J\b\u0010\b\u001a\u00020\u0004H\u0002J\u0010\u0010\t\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0002J\u0018\u0010\r\u001a\u00020\u00042\u0006\u0010\u000b\u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\fH\u0002J\b\u0010\u000e\u001a\u00020\u0004H\u0002J\b\u0010\u000f\u001a\u00020\u0004H\u0002J\b\u0010\u0010\u001a\u00020\u0004H\u0002¨\u0006\u0013"}, d2 = {"Lpl2/e;", "", "Landroid/app/Application;", "context", "", "o", "i", com.igexin.push.core.d.c.f25536c, GoogleApiAvailabilityLight.TRACKING_SOURCE_NOTIFICATION, "m", "", "duration", "Landroid/content/Context;", "t", "r", "s", "q", "<init>", "()V", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
/* compiled from: SentryInitTask.kt */
public final class e {

    /* renamed from: a  reason: collision with root package name */
    public static final e f119010a = new e();

    /* renamed from: b  reason: collision with root package name */
    public static Application f119011b;

    /* renamed from: c  reason: collision with root package name */
    public static k f119012c = new k();

    @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001¨\u0006\u0002"}, d2 = {"pl2/e$a", "Lcom/google/gson/reflect/TypeToken;", "xy_configcenter_library_release"}, k = 1, mv = {1, 6, 0})
    /* compiled from: Config.kt */
    public static final class a extends TypeToken<Integer> {
    }

    @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001¨\u0006\u0002"}, d2 = {"pl2/e$b", "Lcom/google/gson/reflect/TypeToken;", "xy_configcenter_library_release"}, k = 1, mv = {1, 6, 0})
    /* compiled from: Config.kt */
    public static final class b extends TypeToken<ul2.j> {
    }

    @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001¨\u0006\u0002"}, d2 = {"pl2/e$c", "Lcom/google/gson/reflect/TypeToken;", "xy_configcenter_library_release"}, k = 1, mv = {1, 6, 0})
    /* compiled from: Config.kt */
    public static final class c extends TypeToken<ul2.l> {
    }

    @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001¨\u0006\u0002"}, d2 = {"pl2/e$d", "Lcom/google/gson/reflect/TypeToken;", "xy_configcenter_library_release"}, k = 1, mv = {1, 6, 0})
    /* compiled from: Config.kt */
    public static final class d extends TypeToken<ul2.k> {
    }

    @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001¨\u0006\u0002"}, d2 = {"pl2/e$e", "Lcom/google/gson/reflect/TypeToken;", "xy_configcenter_library_release"}, k = 1, mv = {1, 6, 0})
    /* renamed from: pl2.e$e  reason: collision with other inner class name */
    /* compiled from: Config.kt */
    public static final class C1845e extends TypeToken<ul2.i> {
    }

    @Metadata(bv = {}, d1 = {"\u0000\u001b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010$\n\u0002\u0010\u000e\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u001e\u0010\u0006\u001a\u0010\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u0005\u0018\u00010\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\u001e\u0010\u0007\u001a\u0010\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u0005\u0018\u00010\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016¨\u0006\b"}, d2 = {"pl2/e$f", "Lio/sentry/core/o;", "Lmx2/c;", "eventInfoReadonly", "", "", "a", "b", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: SentryInitTask.kt */
    public static final class f implements io.sentry.core.o {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ Application f119013a;

        @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001¨\u0006\u0002"}, d2 = {"pl2/e$f$a", "Lcom/google/gson/reflect/TypeToken;", "xy_configcenter_library_release"}, k = 1, mv = {1, 6, 0})
        /* compiled from: Config.kt */
        public static final class a extends TypeToken<Boolean> {
        }

        public f(Application application) {
            this.f119013a = application;
        }

        @Override // io.sentry.core.o
        public Map<String, String> a(mx2.c cVar) {
            Intrinsics.checkNotNullParameter(cVar, "eventInfoReadonly");
            HashMap hashMap = new HashMap();
            mm2.h.f106815a.a(hashMap, this.f119013a);
            mm2.g.f106809a.e(cVar, hashMap, this.f119013a);
            EventType c14 = cVar.c();
            boolean z14 = false;
            if (c14 == EventType.ANR || c14 == EventType.JAVA || c14 == EventType.NATIVE) {
                ds0.f a14 = ds0.b.a();
                Boolean bool = Boolean.TRUE;
                Type type = new a().getType();
                Intrinsics.checkExpressionValueIsNotNull(type, "object : TypeToken<T>() {}.type");
                if (((Boolean) a14.j("android_crash_xhslog_upload", type, bool)).booleanValue()) {
                    hashMap.put("xhslog_crash", or2.c.n(or2.c.f115258a, null, 1, null));
                }
            }
            hashMap.put("runtime_data_v", String.valueOf(xh2.a.e()));
            hashMap.put("runtime_data_x", String.valueOf(xh2.c.a()));
            hashMap.put("runtime_data_h", XYActivityThreadCallback.f64284b.b());
            hashMap.put("device_level", aj2.f.c(this.f119013a).f().toString());
            String crashExtraMessage = WebView.getCrashExtraMessage(this.f119013a);
            Intrinsics.checkNotNullExpressionValue(crashExtraMessage, "tbsMsg");
            if (crashExtraMessage.length() > 0) {
                z14 = true;
            }
            if (z14) {
                hashMap.put("tbs_msg", crashExtraMessage);
            }
            return hashMap;
        }

        @Override // io.sentry.core.o
        public Map<String, String> b(mx2.c cVar) {
            Intrinsics.checkNotNullParameter(cVar, "eventInfoReadonly");
            HashMap hashMap = new HashMap();
            mm2.a.f106788a.a(hashMap);
            hashMap.put("rn.stage", String.valueOf(j0.f132110a.a()));
            nq2.d dVar = nq2.d.f111153a;
            if (dVar.f(cVar)) {
                hashMap.put("oom_fd", String.valueOf(dVar.d()));
                hashMap.put("oom_thread", String.valueOf(dVar.g()));
                hashMap.put("oom_vmsize", String.valueOf(dVar.h()));
                hashMap.put("oom_javaheap", String.valueOf(dVar.e()));
            }
            return hashMap;
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u001b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010$\n\u0002\u0010\u000e\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u001e\u0010\u0006\u001a\u0010\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u0005\u0018\u00010\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\u001e\u0010\u0007\u001a\u0010\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u0005\u0018\u00010\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016¨\u0006\b"}, d2 = {"pl2/e$g", "Lio/sentry/core/n;", "Lmx2/c;", "eventInfoReadonly", "", "", "a", "b", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: SentryInitTask.kt */
    public static final class g implements io.sentry.core.n {

        @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001¨\u0006\u0002"}, d2 = {"pl2/e$g$a", "Lcom/google/gson/reflect/TypeToken;", "xy_configcenter_library_release"}, k = 1, mv = {1, 6, 0})
        /* compiled from: Config.kt */
        public static final class a extends TypeToken<Boolean> {
        }

        @Override // io.sentry.core.n
        public Map<String, String> a(mx2.c cVar) {
            Intrinsics.checkNotNullParameter(cVar, "eventInfoReadonly");
            HashMap hashMap = new HashMap();
            nq2.d dVar = nq2.d.f111153a;
            if (dVar.f(cVar)) {
                String b14 = dVar.b(cVar);
                hashMap.put("scalpel-hprof", "http://others-1251524319.cos.ap-shanghai.myqcloud.com/" + b14);
            }
            Map<String, Object> d14 = cVar.d();
            if (d14 != null && d14.get("xhslog_crash") == null) {
                EventType c14 = cVar.c();
                if (c14 == EventType.ANR || c14 == EventType.JAVA || c14 == EventType.NATIVE) {
                    ds0.f a14 = ds0.b.a();
                    Boolean bool = Boolean.TRUE;
                    Type type = new a().getType();
                    Intrinsics.checkExpressionValueIsNotNull(type, "object : TypeToken<T>() {}.type");
                    if (((Boolean) a14.j("android_crash_xhslog_upload", type, bool)).booleanValue()) {
                        hashMap.put("xhslog_crash", or2.c.n(or2.c.f115258a, null, 1, null));
                    }
                }
            }
            d.a aVar = ki2.d.f98474d;
            String str = "";
            hashMap.put("shumeiIdLocal", aVar.a().e() ? h0.f155339a.e() : str);
            hashMap.put("shumeiId", aVar.a().e() ? h0.f155339a.f() : str);
            if (aVar.a().e()) {
                str = h0.f155339a.d();
            }
            hashMap.put("fId", str);
            return hashMap;
        }

        @Override // io.sentry.core.n
        public Map<String, String> b(mx2.c cVar) {
            Intrinsics.checkNotNullParameter(cVar, "eventInfoReadonly");
            return null;
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u001f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\n\u0010\u0003\u001a\u0004\u0018\u00010\u0002H\u0016J\n\u0010\u0004\u001a\u0004\u0018\u00010\u0002H\u0016J\n\u0010\u0005\u001a\u0004\u0018\u00010\u0002H\u0016J\n\u0010\u0006\u001a\u0004\u0018\u00010\u0002H\u0016J\n\u0010\u0007\u001a\u0004\u0018\u00010\u0002H\u0016J\b\u0010\t\u001a\u00020\bH\u0016J\n\u0010\u000b\u001a\u0004\u0018\u00010\nH\u0016¨\u0006\f"}, d2 = {"pl2/e$h", "Lio/sentry/core/s;", "", "getChannel", "b", "a", "getUserId", "d", "", "c", "Lio/sentry/monitor/fd/SentryFDMonitorConfig;", "e", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: SentryInitTask.kt */
    public static final class h implements s {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ Application f119014a;

        @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001¨\u0006\u0002"}, d2 = {"pl2/e$h$a", "Lcom/google/gson/reflect/TypeToken;", "xy_configcenter_library_release"}, k = 1, mv = {1, 6, 0})
        /* compiled from: Config.kt */
        public static final class a extends TypeToken<SentryFDMonitorConfig> {
        }

        public h(Application application) {
            this.f119014a = application;
        }

        @Override // io.sentry.core.s
        public String a() {
            return t10.c.f132057a.a(this.f119014a);
        }

        @Override // io.sentry.core.s
        public String b() {
            return "7470602";
        }

        @Override // io.sentry.core.s
        public int c() {
            return aj2.f.c(this.f119014a).f().getValue();
        }

        @Override // io.sentry.core.s
        public String d() {
            UserInfo S0 = b1.f94179a.S0();
            if (S0 != null) {
                return S0.getNickname();
            }
            return null;
        }

        @Override // io.sentry.core.s
        public SentryFDMonitorConfig e() {
            ds0.f a14 = ds0.b.a();
            SentryFDMonitorConfig sentryFDMonitorConfig = new SentryFDMonitorConfig();
            Type type = new a().getType();
            Intrinsics.checkExpressionValueIsNotNull(type, "object : TypeToken<T>() {}.type");
            return (SentryFDMonitorConfig) a14.j("android_sentry_fd_leak_config", type, sentryFDMonitorConfig);
        }

        @Override // io.sentry.core.s
        public String getChannel() {
            return com.xingin.utils.core.g.a(this.f119014a);
        }

        @Override // io.sentry.core.s
        public String getUserId() {
            UserInfo S0 = b1.f94179a.S0();
            if (S0 != null) {
                return S0.getUserid();
            }
            return null;
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001¨\u0006\u0002"}, d2 = {"pl2/e$i", "Lcom/google/gson/reflect/TypeToken;", "xy_configcenter_library_release"}, k = 1, mv = {1, 6, 0})
    /* compiled from: Config.kt */
    public static final class i extends TypeToken<SentryMessageDispatcherConfig> {
    }

    @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001¨\u0006\u0002"}, d2 = {"pl2/e$j", "Lcom/google/gson/reflect/TypeToken;", "xy_configcenter_library_release"}, k = 1, mv = {1, 6, 0})
    /* compiled from: Config.kt */
    public static final class j extends TypeToken<AppHeartbeatConfig> {
    }

    @Metadata(bv = {}, d1 = {"\u0000'\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\u0010\u0010\u0007\u001a\u00020\u00042\u0006\u0010\u0006\u001a\u00020\u0002H\u0016J\u001a\u0010\n\u001a\u00020\u00042\u0006\u0010\u0006\u001a\u00020\u00022\b\u0010\t\u001a\u0004\u0018\u00010\bH\u0016J\b\u0010\f\u001a\u00020\u000bH\u0002¨\u0006\r"}, d2 = {"pl2/e$k", "Lux2/b;", "", "start", "", "onAfterForegroundEvent", "duration", "onBeforeBackgroundEvent", "Landroid/os/Bundle;", "bundle", "onBeforePageResumeEvent", "", "a", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: SentryInitTask.kt */
    public static final class k implements ux2.b {
        public final boolean a() {
            d.a aVar = ki2.d.f98474d;
            if (!aVar.a().e() && !aVar.a().d()) {
                return true;
            }
            u31.n nVar = u31.n.f135849a;
            Application application = e.f119011b;
            Intrinsics.checkNotNull(application);
            if (!nVar.s(application)) {
                return true;
            }
            return false;
        }

        @Override // ux2.b
        public void onAfterForegroundEvent(long j14) {
            if (!a()) {
                e.f119010a.r();
                bn2.c.f8356a.onForegroundEvent();
                je2.i.l(j14);
            }
        }

        @Override // ux2.b
        public void onBeforeBackgroundEvent(long j14) {
            if (!a()) {
                e eVar = e.f119010a;
                eVar.s();
                v31.d.f139422a.j(2);
                Application application = e.f119011b;
                Intrinsics.checkNotNull(application);
                eVar.t(j14, application);
                bn2.c.f8356a.onBackgroundEvent();
            }
        }

        @Override // ux2.b
        public void onBeforePageResumeEvent(long j14, Bundle bundle) {
            if (!a()) {
                String string = bundle != null ? bundle.getString("adsTrackId") : null;
                String string2 = bundle != null ? bundle.getString(Routers.KEY_RAW_URL) : null;
                if (!TextUtils.isEmpty(string) && !TextUtils.isEmpty(string2)) {
                    boolean z14 = true;
                    if (!(string2 != null && (StringsKt__StringsJVMKt.startsWith$default(string2, Pages.PAGE_NEW_NOTE_DETAIL, false, 2, null)))) {
                        if (string2 == null || !(StringsKt__StringsJVMKt.startsWith$default(string2, Pages.PAGE_VIDEO_FEED, false, 2, null))) {
                            z14 = false;
                        }
                        if (!z14) {
                            fc.f.f76392a.h(j14, string, string2);
                        }
                    }
                }
            }
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001¨\u0006\u0002"}, d2 = {"pl2/e$l", "Lcom/google/gson/reflect/TypeToken;", "xy_configcenter_library_release"}, k = 1, mv = {1, 6, 0})
    /* compiled from: Config.kt */
    public static final class l extends TypeToken<AppHeartbeatConfig> {
    }

    @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001¨\u0006\u0002"}, d2 = {"pl2/e$m", "Lcom/google/gson/reflect/TypeToken;", "xy_configcenter_library_release"}, k = 1, mv = {1, 6, 0})
    /* compiled from: Config.kt */
    public static final class m extends TypeToken<AppHeartbeatConfig> {
    }

    @Metadata(bv = {}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\u0010\u0004\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"La23/n3$a;", "", "invoke", "(La23/n3$a;)V", "<anonymous>"}, k = 3, mv = {1, 6, 0})
    /* compiled from: SentryInitTask.kt */
    public static final class n extends Lambda implements Function1<n3.a, Unit> {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ long f119015a;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public n(long j14) {
            super(1);
            this.f119015a = j14;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // kotlin.jvm.functions.Function1
        public /* bridge */ /* synthetic */ Unit invoke(n3.a aVar) {
            invoke(aVar);
            return Unit.INSTANCE;
        }

        public final void invoke(n3.a aVar) {
            Intrinsics.checkNotNullParameter(aVar, "$this$withPage");
            aVar.t((int) this.f119015a);
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"La23/r3$a;", "", "a", "(La23/r3$a;)V"}, k = 3, mv = {1, 6, 0})
    /* compiled from: SentryInitTask.kt */
    public static final class o extends Lambda implements Function1<r3.a, Unit> {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ Context f119016a;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public o(Context context) {
            super(1);
            this.f119016a = context;
        }

        public final void a(r3.a aVar) {
            Intrinsics.checkNotNullParameter(aVar, "$this$withPermissionTarget");
            int i10 = 1;
            aVar.w(ContextCompat.checkSelfPermission(this.f119016a, "android.permission.READ_PHONE_STATE") == 0 ? 1 : 0);
            aVar.v((ContextCompat.checkSelfPermission(this.f119016a, "android.permission.ACCESS_FINE_LOCATION") == 0 && ContextCompat.checkSelfPermission(this.f119016a, "android.permission.ACCESS_COARSE_LOCATION") == 0) ? 1 : 0);
            aVar.y(NotificationManagerCompat.from(this.f119016a).areNotificationsEnabled() ? 1 : 0);
            aVar.u(ContextCompat.checkSelfPermission(this.f119016a, "android.permission.READ_CONTACTS") == 0 ? 1 : 0);
            aVar.B(ContextCompat.checkSelfPermission(this.f119016a, "android.permission.WRITE_EXTERNAL_STORAGE") == 0 ? 1 : 0);
            aVar.s(ContextCompat.checkSelfPermission(this.f119016a, "android.permission.READ_EXTERNAL_STORAGE") == 0 ? 1 : 0);
            aVar.t(ContextCompat.checkSelfPermission(this.f119016a, "android.permission.CAMERA") == 0 ? 1 : 0);
            if (ContextCompat.checkSelfPermission(this.f119016a, "android.permission.RECORD_AUDIO") != 0) {
                i10 = 0;
            }
            aVar.x(i10);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // kotlin.jvm.functions.Function1
        public /* bridge */ /* synthetic */ Unit invoke(r3.a aVar) {
            a(aVar);
            return Unit.INSTANCE;
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\u0010\u0004\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"La23/m0$a;", "", "invoke", "(La23/m0$a;)V", "<anonymous>"}, k = 3, mv = {1, 6, 0})
    /* compiled from: SentryInitTask.kt */
    public static final class p extends Lambda implements Function1<m0.a, Unit> {

        /* renamed from: a  reason: collision with root package name */
        public static final p f119017a = new p();

        public p() {
            super(1);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // kotlin.jvm.functions.Function1
        public /* bridge */ /* synthetic */ Unit invoke(m0.a aVar) {
            invoke(aVar);
            return Unit.INSTANCE;
        }

        public final void invoke(m0.a aVar) {
            Intrinsics.checkNotNullParameter(aVar, "$this$withEvent");
            aVar.B(u2.session_end);
        }
    }

    public static final void j(mx2.c cVar, String str) {
        f119010a.q();
        if (cVar != null) {
            nq2.d.f111153a.j(cVar);
        }
        ko2.e.e("BaseApplication", "=========================== app crashed: ===========================");
        ko2.e.e("BaseApplication", JsonUtil.toJson(cVar));
        b40.c.f6270a.g(ki2.d.f98474d.a().e(), cVar.b() - cVar.g());
    }

    public static final void k() {
        f119010a.q();
    }

    public static final void l(Throwable th3) {
        ko2.e.g("SENTRY_CUSTOM", th3);
    }

    public static final void u(long j14, Context context) {
        Intrinsics.checkNotNullParameter(context, "$context");
        new qe2.h().V(new n(j14)).X(new o(context)).x(p.f119017a).j();
    }

    @SuppressLint({"MethodTooLong"})
    public final void i(Application application) {
        Intrinsics.checkNotNullParameter(application, "context");
        f119011b = application;
        fx2.f.r(a.f119005a);
        r();
        fx2.f.B(c.f119007a);
        ds0.f a14 = ds0.b.a();
        Type type = new a().getType();
        Intrinsics.checkExpressionValueIsNotNull(type, "object : TypeToken<T>() {}.type");
        Integer num = (Integer) a14.m("android_sentry_crash_record", type, 1);
        boolean z14 = num != null && num.intValue() == 1;
        ds0.f a15 = ds0.b.a();
        ul2.j jVar = new ul2.j(true, true, new String[]{"libsentry.so", "libsgmainso"}, new String[]{"libsentry.so"}, new String[0]);
        Type type2 = new b().getType();
        Intrinsics.checkExpressionValueIsNotNull(type2, "object : TypeToken<T>() {}.type");
        ul2.j jVar2 = (ul2.j) a15.h("android_sentry_hook_switch", type2, jVar);
        ko2.e.l("sentry_hook_tag", "config: " + jVar2 + ", crash: " + z14);
        ds0.f a16 = ds0.b.a();
        ul2.l lVar = new ul2.l(false, 100);
        Type type3 = new c().getType();
        Intrinsics.checkExpressionValueIsNotNull(type3, "object : TypeToken<T>() {}.type");
        ul2.l lVar2 = (ul2.l) a16.h("android_sentry_upload_rate_limit", type3, lVar);
        ko2.e.l("sentry_hook_tag", "rate_limit_config: " + lVar2);
        int intValue = ((Number) da.c.c().i("sentry_extend_config_init", Reflection.getOrCreateKotlinClass(Integer.TYPE))).intValue();
        ds0.f a17 = ds0.b.a();
        ul2.k kVar = new ul2.k(false, 0.0d, 0.0d, null, 15, null);
        Type type4 = new d().getType();
        Intrinsics.checkExpressionValueIsNotNull(type4, "object : TypeToken<T>() {}.type");
        ul2.k kVar2 = (ul2.k) a17.h("android_sentry_sample_rate", type4, kVar);
        ko2.e.l("SENTRY", "android_sentry_sample_rate: " + kVar2);
        ds0.f a18 = ds0.b.a();
        ul2.i iVar = new ul2.i(0, 0, false, 7, null);
        Type type5 = new C1845e().getType();
        Intrinsics.checkExpressionValueIsNotNull(type5, "object : TypeToken<T>() {}.type");
        ul2.i iVar2 = (ul2.i) a18.h("android_sentry_event_del", type5, iVar);
        ko2.e.l("SENTRY", "android_sentry_event_del: " + iVar2);
        boolean booleanValue = ((Boolean) ds0.b.a().h("android_trace_check_address_valid_enable", Boolean.TYPE, Boolean.TRUE)).booleanValue();
        ko2.e.l("SENTRY", "android_trace_check_address_valid_enable: " + booleanValue);
        SentryCoreConfig.b g10 = SentryCoreConfig.b.a().d("com.xingin.xhs").h(application).e(7470602).f(7470602).g("7.47.0");
        y yVar = y.f107583a;
        fx2.f.h(g10.m((3 == yVar.a() || 2 == yVar.a()) ? false : true).c(zp2.a.I()).o(z14).p(jVar2.getJEnable(), "io.sentry.core.JavaCrashHandler").q(jVar2.getNEnable(), jVar2.getHookList(), jVar2.getOrderList(), jVar2.getIgnoreList()).n(com.xingin.utils.core.o.f(application)).v(lVar2.getEnable()).u(lVar2.getLimitCount()).r(intValue).t(booleanValue).s(kVar2.getDebugSample(), kVar2.getSampleRate(), kVar2.getUploadSampleRate(), kVar2.getSampleKeys()).k(iVar2.getEnable(), iVar2.getRecordCount(), iVar2.getLeftCount()).j(new f(application)).i(new g()).l(b.f119006a).b(), new h(application), f119012c);
        qx2.c.c();
        p();
        n();
        m(application);
    }

    public final void m(Application application) {
        ac2.h hVar = ac2.h.f2887a;
        h.a aVar = new h.a();
        aVar.c(true);
        aVar.d(false);
        Unit unit = Unit.INSTANCE;
        hVar.a(application, aVar);
    }

    public final void n() {
        ds0.f a14 = ds0.b.a();
        SentryMessageDispatcherConfig sentryMessageDispatcherConfig = new SentryMessageDispatcherConfig();
        Type type = new i().getType();
        Intrinsics.checkExpressionValueIsNotNull(type, "object : TypeToken<T>() {}.type");
        SentryMessageDispatcherConfig sentryMessageDispatcherConfig2 = (SentryMessageDispatcherConfig) a14.j("android_sentry_message_dispatcher", type, sentryMessageDispatcherConfig);
        if (sentryMessageDispatcherConfig2.enable) {
            fx2.f.C(sentryMessageDispatcherConfig2.ignoreList);
        }
    }

    public final void o(Application application) {
        Intrinsics.checkNotNullParameter(application, "context");
        f119011b = application;
        fx2.f.q(application, f119012c);
    }

    public final void p() {
        qx2.c.e(new nm2.g());
        qx2.c.e(new nm2.e());
        qx2.c.e(new nm2.b());
        qx2.c.e(new nm2.k());
        qx2.c.e(new nm2.h());
        qx2.c.e(new nm2.a());
        qx2.c.e(new nm2.f());
        qx2.c.e(new nm2.j());
        qx2.c.e(new nm2.i());
        qx2.c.e(new nm2.d());
    }

    public final void q() {
        ko2.e.l("APP_HEARTBEAT", "sendAppHeartbeat()");
        ds0.f a14 = ds0.b.a();
        AppHeartbeatConfig appHeartbeatConfig = new AppHeartbeatConfig();
        Type type = new j().getType();
        Intrinsics.checkExpressionValueIsNotNull(type, "object : TypeToken<T>() {}.type");
        if (((AppHeartbeatConfig) a14.h("android_app_heartbeat_config", type, appHeartbeatConfig)).getEnable()) {
            je2.i.j();
        }
    }

    public final void r() {
        ko2.e.l("APP_HEARTBEAT", "startAppHeartbeat()");
        ds0.f a14 = ds0.b.a();
        AppHeartbeatConfig appHeartbeatConfig = new AppHeartbeatConfig();
        Type type = new l().getType();
        Intrinsics.checkExpressionValueIsNotNull(type, "object : TypeToken<T>() {}.type");
        AppHeartbeatConfig appHeartbeatConfig2 = (AppHeartbeatConfig) a14.h("android_app_heartbeat_config", type, appHeartbeatConfig);
        if (appHeartbeatConfig2.getEnable()) {
            je2.i.n(appHeartbeatConfig2.getDuration());
        }
    }

    public final void s() {
        ko2.e.l("APP_HEARTBEAT", "stopAppHeartbeat()");
        ds0.f a14 = ds0.b.a();
        AppHeartbeatConfig appHeartbeatConfig = new AppHeartbeatConfig();
        Type type = new m().getType();
        Intrinsics.checkExpressionValueIsNotNull(type, "object : TypeToken<T>() {}.type");
        AppHeartbeatConfig appHeartbeatConfig2 = (AppHeartbeatConfig) a14.h("android_app_heartbeat_config", type, appHeartbeatConfig);
        je2.i.o();
    }

    public final void t(long j14, Context context) {
        try {
            we2.d.b(new d(j14, context));
        } catch (Exception unused) {
        }
    }
}