package o; import android.text.TextUtils; import java.util.ArrayList; import java.util.regex.Matcher; import java.util.regex.Pattern; /* renamed from: o.gU, reason: case insensitive filesystem */ /* loaded from: classes3.dex */ public final class C14833gU { public static final C14833gU e = new C14833gU(); private C14833gU() { } public static Throwable c(String str, String str2) { String str3; C14957gcv.e(str, ""); String[] strArr = (String[]) new gdW("#").e(str).toArray(new String[0]); ArrayList arrayList = new ArrayList(); for (String str4 : strArr) { if (!TextUtils.isEmpty(str4)) { String[] strArr2 = (String[]) new gdW(" \\(").e(str4).toArray(new String[0]); String str5 = null; int i = -1; if (!(strArr2.length == 0)) { String str6 = strArr2[0]; if (strArr2.length < 2) { break; } String[] strArr3 = (String[]) new gdW("\\.dart:").e(gdZ.a(strArr2[1], ")", "")).toArray(new String[0]); if (!(strArr3.length == 0)) { if (strArr3.length == 1) { str5 = strArr3[0]; } else { String str7 = strArr3[0]; StringBuilder sb = new StringBuilder(); sb.append(str7); sb.append(".dart"); str5 = sb.toString(); Matcher matcher = Pattern.compile("[1-9]\\d*").matcher(strArr3[1]); if (matcher.find()) { String group = matcher.group(); C14957gcv.c((Object) group, ""); i = Integer.parseInt(group); } } } str3 = str5; str5 = str6; } else { str3 = null; } arrayList.add(new StackTraceElement("Dart", str5, str3, i)); } } Throwable th = new Throwable(str2); if (arrayList.size() > 0) { th.setStackTrace((StackTraceElement[]) arrayList.toArray(new StackTraceElement[arrayList.size()])); } C14957gcv.c((Object) th, ""); return th; } }