2021-06-27 20:44:35 +00:00
|
|
|
package com.discord.stores;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.net.Uri;
|
|
|
|
import c.d.b.a.a;
|
|
|
|
import com.discord.utilities.intent.IntentUtils;
|
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
|
|
import d0.g0.t;
|
|
|
|
import d0.g0.w;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import j0.l.e.j;
|
|
|
|
import java.util.Objects;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
import rx.Emitter;
|
|
|
|
import rx.Observable;
|
|
|
|
/* compiled from: StoreDynamicLink.kt */
|
|
|
|
public final class StoreDynamicLink {
|
|
|
|
private static final Companion Companion = new Companion(null);
|
|
|
|
@Deprecated
|
|
|
|
private static final long DYNAMIC_LINK_TIMEOUT_MS = 1000;
|
|
|
|
private final Dispatcher dispatcher;
|
|
|
|
private final StoreStream stream;
|
|
|
|
|
|
|
|
/* compiled from: StoreDynamicLink.kt */
|
|
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: StoreDynamicLink.kt */
|
|
|
|
public static final class DynamicLinkData {
|
|
|
|
private final String attemptId;
|
|
|
|
private final String authToken;
|
|
|
|
private final String fingerprint;
|
|
|
|
private final String guildTemplateCode;
|
|
|
|
private final String inviteCode;
|
|
|
|
|
|
|
|
public DynamicLinkData(String str, String str2, String str3, String str4, String str5) {
|
|
|
|
this.fingerprint = str;
|
|
|
|
this.attemptId = str2;
|
|
|
|
this.inviteCode = str3;
|
|
|
|
this.guildTemplateCode = str4;
|
|
|
|
this.authToken = str5;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ DynamicLinkData copy$default(DynamicLinkData dynamicLinkData, String str, String str2, String str3, String str4, String str5, int i, Object obj) {
|
|
|
|
if ((i & 1) != 0) {
|
|
|
|
str = dynamicLinkData.fingerprint;
|
|
|
|
}
|
|
|
|
if ((i & 2) != 0) {
|
|
|
|
str2 = dynamicLinkData.attemptId;
|
|
|
|
}
|
|
|
|
if ((i & 4) != 0) {
|
|
|
|
str3 = dynamicLinkData.inviteCode;
|
|
|
|
}
|
|
|
|
if ((i & 8) != 0) {
|
|
|
|
str4 = dynamicLinkData.guildTemplateCode;
|
|
|
|
}
|
|
|
|
if ((i & 16) != 0) {
|
|
|
|
str5 = dynamicLinkData.authToken;
|
|
|
|
}
|
|
|
|
return dynamicLinkData.copy(str, str2, str3, str4, str5);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String component1() {
|
|
|
|
return this.fingerprint;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String component2() {
|
|
|
|
return this.attemptId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String component3() {
|
|
|
|
return this.inviteCode;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String component4() {
|
|
|
|
return this.guildTemplateCode;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String component5() {
|
|
|
|
return this.authToken;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final DynamicLinkData copy(String str, String str2, String str3, String str4, String str5) {
|
|
|
|
return new DynamicLinkData(str, str2, str3, str4, str5);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!(obj instanceof DynamicLinkData)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
DynamicLinkData dynamicLinkData = (DynamicLinkData) obj;
|
|
|
|
return m.areEqual(this.fingerprint, dynamicLinkData.fingerprint) && m.areEqual(this.attemptId, dynamicLinkData.attemptId) && m.areEqual(this.inviteCode, dynamicLinkData.inviteCode) && m.areEqual(this.guildTemplateCode, dynamicLinkData.guildTemplateCode) && m.areEqual(this.authToken, dynamicLinkData.authToken);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String getAttemptId() {
|
|
|
|
return this.attemptId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String getAuthToken() {
|
|
|
|
return this.authToken;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String getFingerprint() {
|
|
|
|
return this.fingerprint;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String getGuildTemplateCode() {
|
|
|
|
return this.guildTemplateCode;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String getInviteCode() {
|
|
|
|
return this.inviteCode;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
|
|
|
String str = this.fingerprint;
|
|
|
|
int i = 0;
|
|
|
|
int hashCode = (str != null ? str.hashCode() : 0) * 31;
|
|
|
|
String str2 = this.attemptId;
|
|
|
|
int hashCode2 = (hashCode + (str2 != null ? str2.hashCode() : 0)) * 31;
|
|
|
|
String str3 = this.inviteCode;
|
|
|
|
int hashCode3 = (hashCode2 + (str3 != null ? str3.hashCode() : 0)) * 31;
|
|
|
|
String str4 = this.guildTemplateCode;
|
|
|
|
int hashCode4 = (hashCode3 + (str4 != null ? str4.hashCode() : 0)) * 31;
|
|
|
|
String str5 = this.authToken;
|
|
|
|
if (str5 != null) {
|
|
|
|
i = str5.hashCode();
|
|
|
|
}
|
|
|
|
return hashCode4 + i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
StringBuilder L = a.L("DynamicLinkData(fingerprint=");
|
|
|
|
L.append(this.fingerprint);
|
|
|
|
L.append(", attemptId=");
|
|
|
|
L.append(this.attemptId);
|
|
|
|
L.append(", inviteCode=");
|
|
|
|
L.append(this.inviteCode);
|
|
|
|
L.append(", guildTemplateCode=");
|
|
|
|
L.append(this.guildTemplateCode);
|
|
|
|
L.append(", authToken=");
|
|
|
|
return a.D(L, this.authToken, ")");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public StoreDynamicLink(StoreStream storeStream, Dispatcher dispatcher) {
|
|
|
|
m.checkNotNullParameter(storeStream, "stream");
|
|
|
|
m.checkNotNullParameter(dispatcher, "dispatcher");
|
|
|
|
this.stream = storeStream;
|
|
|
|
this.dispatcher = dispatcher;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ StoreStream access$getStream$p(StoreDynamicLink storeDynamicLink) {
|
|
|
|
return storeDynamicLink.stream;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$handleDataReceived(StoreDynamicLink storeDynamicLink, DynamicLinkData dynamicLinkData, Context context) {
|
|
|
|
storeDynamicLink.handleDataReceived(dynamicLinkData, context);
|
|
|
|
}
|
|
|
|
|
|
|
|
private final Observable<Uri> getDynamicLinkObservable(Intent intent) {
|
|
|
|
Observable n = Observable.n(new StoreDynamicLink$getDynamicLinkObservable$firebaseDynamicLinks$1(intent), Emitter.BackpressureMode.BUFFER);
|
|
|
|
m.checkNotNullExpressionValue(n, "Observable.create({\n ….BackpressureMode.BUFFER)");
|
2021-07-03 23:36:06 +00:00
|
|
|
Observable<Uri> L = Observable.H(new j(Uri.EMPTY).q(1000, TimeUnit.MILLISECONDS), n).L(StoreDynamicLink$getDynamicLinkObservable$1.INSTANCE);
|
|
|
|
m.checkNotNullExpressionValue(L, "Observable\n .merg…ErrorReturn { Uri.EMPTY }");
|
|
|
|
return L;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final void handleDataReceived(DynamicLinkData dynamicLinkData, Context context) {
|
|
|
|
String guildTemplateCode;
|
|
|
|
String inviteCode;
|
|
|
|
this.dispatcher.schedule(new StoreDynamicLink$handleDataReceived$1(this, dynamicLinkData));
|
|
|
|
if (dynamicLinkData != null && (inviteCode = dynamicLinkData.getInviteCode()) != null && (!t.isBlank(inviteCode))) {
|
|
|
|
IntentUtils.RouteBuilders routeBuilders = IntentUtils.RouteBuilders.INSTANCE;
|
|
|
|
String inviteCode2 = dynamicLinkData.getInviteCode();
|
|
|
|
Objects.requireNonNull(inviteCode2, "null cannot be cast to non-null type kotlin.CharSequence");
|
|
|
|
IntentUtils.consumeRoutingIntent$default(IntentUtils.INSTANCE, routeBuilders.selectInvite(w.trim(inviteCode2).toString(), "Deeplink"), context, null, 4, null);
|
|
|
|
} else if (dynamicLinkData != null && (guildTemplateCode = dynamicLinkData.getGuildTemplateCode()) != null && (!t.isBlank(guildTemplateCode))) {
|
|
|
|
IntentUtils.RouteBuilders routeBuilders2 = IntentUtils.RouteBuilders.INSTANCE;
|
|
|
|
String guildTemplateCode2 = dynamicLinkData.getGuildTemplateCode();
|
|
|
|
Objects.requireNonNull(guildTemplateCode2, "null cannot be cast to non-null type kotlin.CharSequence");
|
|
|
|
IntentUtils.consumeRoutingIntent$default(IntentUtils.INSTANCE, routeBuilders2.selectGuildTemplate(w.trim(guildTemplateCode2).toString(), "Deeplink"), context, null, 4, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void storeLinkIfExists(Intent intent, Context context) {
|
|
|
|
m.checkNotNullParameter(intent, "intent");
|
|
|
|
m.checkNotNullParameter(context, "context");
|
2021-07-03 23:36:06 +00:00
|
|
|
Observable<R> F = getDynamicLinkObservable(intent).F(StoreDynamicLink$storeLinkIfExists$1.INSTANCE);
|
|
|
|
m.checkNotNullExpressionValue(F, "getDynamicLinkObservable…ode, authToken)\n }");
|
|
|
|
Observable t = ObservableExtensionsKt.computationBuffered(F).r().t(StoreDynamicLink$storeLinkIfExists$2.INSTANCE);
|
|
|
|
m.checkNotNullExpressionValue(t, "getDynamicLinkObservable… )\n }\n }");
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(t, StoreDynamicLink.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new StoreDynamicLink$storeLinkIfExists$3(this, context), 62, (Object) null);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|