discord-jadx/app/src/main/java/c/i/a/f/i/b/e6.java

111 lines
4.1 KiB
Java

package c.i.a.f.i.b;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Pair;
import c.i.a.f.e.o.d;
import com.airbnb.lottie.parser.AnimatableValueParser;
import com.google.android.gms.ads.identifier.AdvertisingIdClient;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Objects;
/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final /* synthetic */ class e6 implements Runnable {
public final c6 i;
public e6(c6 c6Var) {
this.i = c6Var;
}
@Override // java.lang.Runnable
public final void run() {
Pair pair;
NetworkInfo networkInfo;
URL url;
c6 c6Var = this.i;
c6Var.b();
if (c6Var.l().f1146y.b()) {
c6Var.g().m.a("Deferred Deep Link already retrieved. Not fetching again.");
return;
}
long a = c6Var.l().f1147z.a();
c6Var.l().f1147z.b(a + 1);
if (a >= 5) {
c6Var.g().i.a("Permanently failed to retrieve Deferred Deep Link. Reached maximum retries.");
c6Var.l().f1146y.a(true);
return;
}
u4 u4Var = c6Var.a;
u4Var.f().b();
u4.q(u4Var.n());
n3 z2 = u4Var.z();
z2.t();
String str = z2.f1172c;
d4 o = u4Var.o();
o.b();
Objects.requireNonNull((d) o.a.o);
long elapsedRealtime = SystemClock.elapsedRealtime();
if (o.n == null || elapsedRealtime >= o.p) {
c cVar = o.a.h;
Objects.requireNonNull(cVar);
o.p = cVar.n(str, p.b) + elapsedRealtime;
try {
AdvertisingIdClient.Info advertisingIdInfo = AdvertisingIdClient.getAdvertisingIdInfo(o.a.b);
if (advertisingIdInfo != null) {
o.n = advertisingIdInfo.getId();
o.o = advertisingIdInfo.isLimitAdTrackingEnabled();
}
if (o.n == null) {
o.n = "";
}
} catch (Exception e) {
o.g().m.b("Unable to get advertising id", e);
o.n = "";
}
pair = new Pair(o.n, Boolean.valueOf(o.o));
} else {
pair = new Pair(o.n, Boolean.valueOf(o.o));
}
if (!u4Var.h.y().booleanValue() || ((Boolean) pair.second).booleanValue() || TextUtils.isEmpty((CharSequence) pair.first)) {
u4Var.g().m.a("ADID unavailable to retrieve Deferred Deep Link. Skipping");
return;
}
d7 n = u4Var.n();
n.o();
try {
networkInfo = ((ConnectivityManager) n.a.b.getSystemService("connectivity")).getActiveNetworkInfo();
} catch (SecurityException unused) {
networkInfo = null;
}
if (!(networkInfo != null && networkInfo.isConnected())) {
u4Var.g().i.a("Network is not available for Deferred Deep Link request. Skipping");
return;
}
t9 t = u4Var.t();
u4Var.z();
String str2 = (String) pair.first;
long a2 = u4Var.o().f1147z.a() - 1;
Objects.requireNonNull(t);
try {
AnimatableValueParser.w(str2);
AnimatableValueParser.w(str);
String format = String.format("https://www.googleadservices.com/pagead/conversion/app/deeplink?id_type=adid&sdk_version=%s&rdid=%s&bundleid=%s&retry=%s", String.format("v%s.%s", 33025L, Integer.valueOf(t.y0())), str2, str, Long.valueOf(a2));
if (str.equals(t.a.h.i("debug.deferred.deeplink", ""))) {
format = format.concat("&ddl_test=1");
}
url = new URL(format);
} catch (IllegalArgumentException | MalformedURLException e2) {
t.g().f.b("Failed to create BOW URL for Deferred Deep Link. exception", e2.getMessage());
url = null;
}
d7 n2 = u4Var.n();
x4 x4Var = new x4(u4Var);
n2.b();
n2.o();
Objects.requireNonNull(url, "null reference");
n2.f().x(new f7(n2, str, url, x4Var));
}
}