discord-jadx/app/src/main/java/com/discord/stores/StoreDynamicLink$storeLinkI...

121 lines
5.0 KiB
Java

package com.discord.stores;
import android.net.Uri;
import com.discord.stores.StoreDynamicLink;
import d0.g0.t;
import d0.z.d.m;
import j0.k.b;
import java.util.List;
import java.util.ListIterator;
import kotlin.text.MatchResult;
import kotlin.text.Regex;
/* compiled from: StoreDynamicLink.kt */
public final class StoreDynamicLink$storeLinkIfExists$1<T, R> implements b<Uri, StoreDynamicLink.DynamicLinkData> {
public static final StoreDynamicLink$storeLinkIfExists$1 INSTANCE = new StoreDynamicLink$storeLinkIfExists$1();
/* JADX WARNING: Removed duplicated region for block: B:44:0x00ce */
public final StoreDynamicLink.DynamicLinkData call(Uri uri) {
String str;
String str2;
String str3;
String str4;
List<String> groupValues;
String str5;
String path;
List<String> groupValues2;
String str6;
String path2;
String str7 = null;
if (m.areEqual(uri, Uri.EMPTY)) {
return null;
}
c.a.d.p0.b bVar = c.a.d.p0.b.F;
m.checkNotNullExpressionValue(uri, "uri");
m.checkNotNullParameter(uri, "$this$isInviteLink");
boolean z2 = false;
String str8 = "";
if (t.equals(uri.getHost(), c.a.d.p0.b.d, true) || ((t.equals(uri.getHost(), c.a.d.p0.b.a, true) || t.equals(uri.getHost(), c.a.d.p0.b.b, true)) && (path2 = uri.getPath()) != null && c.a.d.p0.b.n.matches(path2))) {
Regex regex = c.a.d.p0.b.n;
String path3 = uri.getPath();
if (path3 == null) {
path3 = str8;
}
m.checkNotNullExpressionValue(path3, "uri.path ?: \"\"");
MatchResult matchEntire = regex.matchEntire(path3);
if (!(matchEntire == null || (groupValues2 = matchEntire.getGroupValues()) == null)) {
ListIterator<String> listIterator = groupValues2.listIterator(groupValues2.size());
while (true) {
if (!listIterator.hasPrevious()) {
str6 = null;
break;
}
str6 = listIterator.previous();
if (!t.isBlank(str6)) {
break;
}
}
str = str6;
c.a.d.p0.b bVar2 = c.a.d.p0.b.F;
m.checkNotNullParameter(uri, "$this$isGuildTemplateLink");
if (t.equals(uri.getHost(), c.a.d.p0.b.e, true) || ((t.equals(uri.getHost(), c.a.d.p0.b.a, true) || t.equals(uri.getHost(), c.a.d.p0.b.b, true)) && (path = uri.getPath()) != null && c.a.d.p0.b.p.matches(path))) {
z2 = true;
}
if (z2) {
Regex regex2 = c.a.d.p0.b.p;
String path4 = uri.getPath();
if (path4 != null) {
str8 = path4;
}
m.checkNotNullExpressionValue(str8, "uri.path ?: \"\"");
MatchResult matchEntire2 = regex2.matchEntire(str8);
if (!(matchEntire2 == null || (groupValues = matchEntire2.getGroupValues()) == null)) {
ListIterator<String> listIterator2 = groupValues.listIterator(groupValues.size());
while (true) {
if (!listIterator2.hasPrevious()) {
str5 = null;
break;
}
str5 = listIterator2.previous();
if (!t.isBlank(str5)) {
break;
}
}
str2 = str5;
str3 = uri.getQueryParameter("fingerprint");
str4 = uri.getQueryParameter("attemptId");
str7 = uri.getQueryParameter("auth_token");
return new StoreDynamicLink.DynamicLinkData(str3, str4, str, str2, str7);
}
}
str2 = null;
str3 = uri.getQueryParameter("fingerprint");
str4 = uri.getQueryParameter("attemptId");
str7 = uri.getQueryParameter("auth_token");
return new StoreDynamicLink.DynamicLinkData(str3, str4, str, str2, str7);
}
}
str = null;
c.a.d.p0.b bVar2 = c.a.d.p0.b.F;
m.checkNotNullParameter(uri, "$this$isGuildTemplateLink");
z2 = true;
if (z2) {
}
str2 = null;
try {
str3 = uri.getQueryParameter("fingerprint");
} catch (Exception unused) {
str3 = null;
}
try {
str4 = uri.getQueryParameter("attemptId");
} catch (Exception unused2) {
str4 = null;
}
try {
str7 = uri.getQueryParameter("auth_token");
} catch (Exception unused3) {
}
return new StoreDynamicLink.DynamicLinkData(str3, str4, str, str2, str7);
}
}