package com.discord.widgets.debugging; import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.TextView; import androidx.fragment.app.Fragment; import c.a.d.l; import c.a.l.b; import c.d.b.a.a; import com.discord.app.AppFragment; import com.discord.app.AppLog; import com.discord.databinding.WidgetFatalCrashBinding; import com.discord.utilities.logging.Logger; import com.discord.utilities.view.text.LinkifiedTextView; import com.discord.utilities.viewbinding.FragmentViewBindingDelegate; import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt; import d0.z.d.m; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.reflect.KProperty; /* compiled from: WidgetFatalCrash.kt */ public final class WidgetFatalCrash extends AppFragment { public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.W(WidgetFatalCrash.class, "binding", "getBinding()Lcom/discord/databinding/WidgetFatalCrashBinding;", 0)}; public static final Companion Companion = new Companion(null); private static final String INTENT_EXTRA_CRASH_SOURCE = "INTENT_EXTRA_CRASH_SOURCE"; private static final String INTENT_EXTRA_CRASH_TIME = "INTENT_EXTRA_CRASH_TIME"; private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding$default(this, WidgetFatalCrash$binding$2.INSTANCE, null, 2, null); /* compiled from: WidgetFatalCrash.kt */ public static final class Companion { private Companion() { } public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) { this(); } @SuppressLint({"SimpleDateFormat"}) private final Intent createIntent(String str) { Bundle bundle = new Bundle(); bundle.putString("INTENT_EXTRA_CRASH_SOURCE", str); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); String format = simpleDateFormat.format(new Date()); bundle.putString("INTENT_EXTRA_CRASH_TIME", format + " GMT"); Intent putExtras = new Intent().putExtras(bundle); m.checkNotNullExpressionValue(putExtras, "Intent().putExtras(extras)"); return putExtras; } public final void launch(Context context, Throwable th, String str) { m.checkNotNullParameter(context, "context"); m.checkNotNullParameter(th, "throwable"); m.checkNotNullParameter(str, "crashSource"); AppLog appLog = AppLog.g; String simpleName = WidgetFatalCrash.class.getSimpleName(); m.checkNotNullExpressionValue(simpleName, "WidgetFatalCrash::class.java.simpleName"); Logger.e$default(appLog, simpleName, new Throwable(str, th), null, 4, null); l.d(context, WidgetFatalCrash.class, createIntent(str)); } } public WidgetFatalCrash() { super(2131559005); } private final WidgetFatalCrashBinding getBinding() { return (WidgetFatalCrashBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]); } public static final void launch(Context context, Throwable th, String str) { Companion.launch(context, th, str); } /* JADX DEBUG: Can't convert new array creation: APUT found in different block: 0x004d: APUT (r2v3 java.lang.Object[]), (0 ??[int, short, byte, char]), (r6v0 java.lang.String) */ /* JADX DEBUG: Can't convert new array creation: APUT found in different block: 0x0073: APUT (r6v2 java.lang.Object[]), (0 ??[int, short, byte, char]), (r9v5 java.lang.String) */ @Override // com.discord.app.AppFragment public void onViewBound(View view) { m.checkNotNullParameter(view, "view"); super.onViewBound(view); LinkifiedTextView linkifiedTextView = getBinding().f; m.checkNotNullExpressionValue(linkifiedTextView, "binding.fatalCrashTestersInvite"); linkifiedTextView.setText(b.j(this, 2131887891, new Object[]{"https://discord.gg/discord-testers"}, null, 4)); Bundle extras = getMostRecentIntent().getExtras(); TextView textView = getBinding().e; m.checkNotNullExpressionValue(textView, "binding.fatalCrashSource"); Object[] objArr = new Object[1]; objArr[0] = extras != null ? extras.getString("INTENT_EXTRA_CRASH_SOURCE", getString(2131893598)) : null; textView.setText(b.j(this, 2131887890, objArr, null, 4)); TextView textView2 = getBinding().g; m.checkNotNullExpressionValue(textView2, "binding.fatalCrashTime"); Object[] objArr2 = new Object[1]; objArr2[0] = extras != null ? extras.getString("INTENT_EXTRA_CRASH_TIME") : null; textView2.setText(b.j(this, 2131887892, objArr2, null, 4)); TextView textView3 = getBinding().b; m.checkNotNullExpressionValue(textView3, "binding.fatalCrashAppVersion"); textView3.setText(b.j(this, 2131887885, new Object[]{"82.12 - Beta"}, null, 4)); TextView textView4 = getBinding().d; m.checkNotNullExpressionValue(textView4, "binding.fatalCrashOsVersion"); textView4.setText(b.j(this, 2131887888, new Object[]{String.valueOf(Build.VERSION.SDK_INT)}, null, 4)); TextView textView5 = getBinding().f1776c; m.checkNotNullExpressionValue(textView5, "binding.fatalCrashDevice"); textView5.setText(b.j(this, 2131887887, new Object[]{Build.MODEL + ' ' + Build.PRODUCT}, null, 4)); } }