正在查看: Namma Yatri v3.3.7 应用的 SpotlightIntegration.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Namma Yatri v3.3.7 应用的 SpotlightIntegration.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package io.sentry;
import io.sentry.C0953p2;
import java.io.Closeable;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URI;
import java.util.concurrent.RejectedExecutionException;
import java.util.zip.GZIPOutputStream;
public final class SpotlightIntegration implements InterfaceC0907e0, C0953p2.c, Closeable {
private C0953p2 a;
private ILogger b = C0996z0.e();
private X c = E0.e();
private void l(HttpURLConnection httpURLConnection) {
try {
httpURLConnection.getInputStream().close();
} catch (IOException unused) {
} catch (Throwable th) {
httpURLConnection.disconnect();
throw th;
}
httpURLConnection.disconnect();
}
public void r0(C0997z1 c0997z1) {
try {
if (this.a == null) {
throw new IllegalArgumentException("SentryOptions are required to send envelopes.");
}
HttpURLConnection y = y(Y());
try {
OutputStream outputStream = y.getOutputStream();
try {
GZIPOutputStream gZIPOutputStream = new GZIPOutputStream(outputStream);
try {
this.a.getSerializer().b(c0997z1, gZIPOutputStream);
gZIPOutputStream.close();
if (outputStream != null) {
outputStream.close();
}
this.b.c(EnumC0921h2.DEBUG, "Envelope sent to spotlight: %d", Integer.valueOf(y.getResponseCode()));
} finally {
}
} finally {
}
} catch (Throwable th) {
try {
this.b.b(EnumC0921h2.ERROR, "An exception occurred while submitting the envelope to the Sentry server.", th);
this.b.c(EnumC0921h2.DEBUG, "Envelope sent to spotlight: %d", Integer.valueOf(y.getResponseCode()));
} catch (Throwable th2) {
this.b.c(EnumC0921h2.DEBUG, "Envelope sent to spotlight: %d", Integer.valueOf(y.getResponseCode()));
l(y);
throw th2;
}
}
l(y);
} catch (Exception e) {
this.b.b(EnumC0921h2.ERROR, "An exception occurred while creating the connection to spotlight.", e);
}
}
private HttpURLConnection y(String str) {
HttpURLConnection httpURLConnection = (HttpURLConnection) URI.create(str).toURL().openConnection();
httpURLConnection.setReadTimeout(1000);
httpURLConnection.setConnectTimeout(1000);
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setDoOutput(true);
httpURLConnection.setRequestProperty("Content-Encoding", "gzip");
httpURLConnection.setRequestProperty("Content-Type", "application/x-sentry-envelope");
httpURLConnection.setRequestProperty("Accept", "application/json");
httpURLConnection.setRequestProperty("Connection", "close");
httpURLConnection.connect();
return httpURLConnection;
}
public String Y() {
C0953p2 c0953p2 = this.a;
return (c0953p2 == null || c0953p2.getSpotlightConnectionUrl() == null) ? io.sentry.util.s.a() ? "http://10.0.2.2:8969/stream" : "http://localhost:8969/stream" : this.a.getSpotlightConnectionUrl();
}
@Override
public void c(final C0997z1 c0997z1, B b) {
try {
this.c.submit(new Runnable() {
@Override
public final void run() {
SpotlightIntegration.this.r0(c0997z1);
}
});
} catch (RejectedExecutionException e) {
this.b.b(EnumC0921h2.WARNING, "Spotlight envelope submission rejected.", e);
}
}
@Override
public void close() {
this.c.a(0L);
C0953p2 c0953p2 = this.a;
if (c0953p2 == null || c0953p2.getBeforeEnvelopeCallback() != this) {
return;
}
this.a.setBeforeEnvelopeCallback(null);
}
@Override
public void e(N n, C0953p2 c0953p2) {
this.a = c0953p2;
this.b = c0953p2.getLogger();
if (c0953p2.getBeforeEnvelopeCallback() != null || !c0953p2.isEnableSpotlight()) {
this.b.c(EnumC0921h2.DEBUG, "SpotlightIntegration is not enabled. BeforeEnvelopeCallback is already set or spotlight is not enabled.", new Object[0]);
return;
}
this.c = new C0866a2();
c0953p2.setBeforeEnvelopeCallback(this);
this.b.c(EnumC0921h2.DEBUG, "SpotlightIntegration enabled.", new Object[0]);
}
}