正在查看: 管控平台 v5.2.3.0. 应用的 a.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 管控平台 v5.2.3.0. 应用的 a.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package io.sentry.dsn;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import org.slf4j.b;
import org.slf4j.c;
public class a {
private static final b k = c.i(a.class);
private String f3227a;
private String f3228b;
private String f3229c;
private String d;
private String e;
private int f;
private String g;
private Set<String> h;
private Map<String, String> i;
private URI j;
public a(String str) throws InvalidDsnException {
this(URI.create(str));
}
public static String a() {
String c2 = b.a.g.b.c("dsn");
if (io.sentry.util.a.a(c2)) {
c2 = b.a.g.b.c("dns");
}
if (!io.sentry.util.a.a(c2)) {
return c2;
}
k.warn("*** Couldn't find a suitable DSN, Sentry operations will do nothing! See documentation: https://docs.sentry.io/clients/java/ ***");
return "noop://localhost?async=false";
}
private void b(URI uri) {
this.e = uri.getHost();
this.f = uri.getPort();
}
private void c(URI uri) {
String query = uri.getQuery();
if (query == null || query.isEmpty()) {
return;
}
for (String str : query.split("&")) {
try {
String[] split = str.split("=");
this.i.put(URLDecoder.decode(split[0], "UTF-8"), split.length > 1 ? URLDecoder.decode(split[1], "UTF-8") : null);
} catch (UnsupportedEncodingException e) {
throw new IllegalArgumentException("Impossible to decode the query parameter '" + str + "'", e);
}
}
}
private void d(URI uri) {
String path = uri.getPath();
if (path == null) {
return;
}
int lastIndexOf = path.lastIndexOf("/") + 1;
this.g = path.substring(0, lastIndexOf);
this.f3229c = path.substring(lastIndexOf);
}
private void e(URI uri) {
String scheme = uri.getScheme();
if (scheme == null) {
return;
}
String[] split = scheme.split("\\+");
this.h.addAll(Arrays.asList(split).subList(0, split.length - 1));
this.d = split[split.length - 1];
}
private void f(URI uri) {
String userInfo = uri.getUserInfo();
if (userInfo == null) {
return;
}
String[] split = userInfo.split(":");
this.f3228b = split[0];
if (split.length > 1) {
this.f3227a = split[1];
}
}
private void n() {
this.i = Collections.unmodifiableMap(this.i);
this.h = Collections.unmodifiableSet(this.h);
}
private void o() {
LinkedList linkedList = new LinkedList();
if (this.e == null) {
linkedList.add("host");
}
String str = this.d;
if (str != null && !str.equalsIgnoreCase("noop") && !this.d.equalsIgnoreCase("out")) {
if (this.f3228b == null) {
linkedList.add("public key");
}
String str2 = this.f3229c;
if (str2 == null || str2.isEmpty()) {
linkedList.add("project ID");
}
}
if (linkedList.isEmpty()) {
return;
}
throw new InvalidDsnException("Invalid DSN, the following properties aren't set '" + linkedList + "'");
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || a.class != obj.getClass()) {
return false;
}
a aVar = (a) obj;
if (this.f != aVar.f || !this.e.equals(aVar.e) || !this.i.equals(aVar.i) || !this.g.equals(aVar.g) || !this.f3229c.equals(aVar.f3229c)) {
return false;
}
String str = this.d;
if (str == null ? aVar.d == null : str.equals(aVar.d)) {
return this.h.equals(aVar.h) && this.f3228b.equals(aVar.f3228b) && this.f3227a.equals(aVar.f3227a);
}
return false;
}
public Map<String, String> g() {
return this.i;
}
public String h() {
return this.f3229c;
}
public int hashCode() {
return (((((((this.f3228b.hashCode() * 31) + this.f3229c.hashCode()) * 31) + this.e.hashCode()) * 31) + this.f) * 31) + this.g.hashCode();
}
public String i() {
return this.d;
}
public Set<String> j() {
return this.h;
}
public String k() {
return this.f3228b;
}
public String l() {
return this.f3227a;
}
public URI m() {
return this.j;
}
public String toString() {
return "Dsn{uri=" + this.j + '}';
}
public a(URI uri) throws InvalidDsnException {
if (uri == null) {
throw new InvalidDsnException("DSN constructed with null value!");
}
this.i = new HashMap();
this.h = new HashSet();
e(uri);
f(uri);
b(uri);
d(uri);
c(uri);
n();
o();
try {
this.j = new URI(this.d, null, this.e, this.f, this.g, null, null);
} catch (URISyntaxException e) {
throw new InvalidDsnException("Impossible to determine Sentry's URI from the DSN '" + uri + "'", e);
}
}
}