花瓣 v4.6.12版本的 MD5 值为:6a3515d4d16d98931f1b3d25a91b257e
以下内容为反编译后的 jad_er.java 源代码,内容仅作参考
package com.jd.ad.sdk.jad_wh;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class jad_er implements jad_jt {
public final ThreadLocal<String> jad_an = new ThreadLocal<>();
public final List<jad_cp> jad_bo = new ArrayList();
@Override
public jad_jt jad_an(String str) {
if (str != null) {
this.jad_an.set(str);
}
return this;
}
@Override
public void jad_bo(@NonNull String str, @Nullable Object... objArr) {
jad_an(4, (Throwable) null, str, objArr);
}
@Override
public void jad_cp(@NonNull String str, @Nullable Object... objArr) {
jad_an(2, (Throwable) null, str, objArr);
}
@Override
public void jad_dq(@NonNull String str, @Nullable Object... objArr) {
jad_an(5, (Throwable) null, str, objArr);
}
@Override
public void jad_er(@NonNull String str, @Nullable Object... objArr) {
jad_an(3, (Throwable) null, str, objArr);
}
@Override
public void jad_an(@Nullable Throwable th, @NonNull String str, @Nullable Object... objArr) {
jad_an(6, th, str, objArr);
}
@Override
public void jad_bo(@Nullable String str) {
if (jad_hu.jad_an((CharSequence) str)) {
jad_an("Empty/Null json content");
return;
}
try {
String trim = str.trim();
if (trim.startsWith("{")) {
jad_an((Object) new JSONObject(trim).toString(2));
} else if (trim.startsWith("[")) {
jad_an((Object) new JSONArray(trim).toString(2));
} else {
jad_an(6, (Throwable) null, "Invalid Json", new Object[0]);
}
} catch (JSONException unused) {
jad_an(6, (Throwable) null, "Invalid Json", new Object[0]);
}
}
@Override
public void jad_cp(@Nullable String str) {
if (jad_hu.jad_an((CharSequence) str)) {
jad_an("Empty/Null xml content");
return;
}
try {
StreamSource streamSource = new StreamSource(new StringReader(str));
StreamResult streamResult = new StreamResult(new StringWriter());
Transformer newTransformer = TransformerFactory.newInstance().newTransformer();
newTransformer.setOutputProperty("indent", "yes");
newTransformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
newTransformer.transform(streamSource, streamResult);
jad_an((Object) streamResult.getWriter().toString().replaceFirst(">", ">\n"));
} catch (TransformerException unused) {
jad_an(6, (Throwable) null, "Invalid xml", new Object[0]);
}
}
@Override
public void jad_an(@NonNull String str, @Nullable Object... objArr) {
jad_an(7, (Throwable) null, str, objArr);
}
@Override
public void jad_an(@Nullable Object obj) {
String deepToString;
if (obj == null) {
deepToString = "null";
} else if (!obj.getClass().isArray()) {
deepToString = obj.toString();
} else if (obj instanceof boolean[]) {
deepToString = Arrays.toString((boolean[]) obj);
} else if (obj instanceof byte[]) {
deepToString = Arrays.toString((byte[]) obj);
} else if (obj instanceof char[]) {
deepToString = Arrays.toString((char[]) obj);
} else if (obj instanceof short[]) {
deepToString = Arrays.toString((short[]) obj);
} else if (obj instanceof int[]) {
deepToString = Arrays.toString((int[]) obj);
} else if (obj instanceof long[]) {
deepToString = Arrays.toString((long[]) obj);
} else if (obj instanceof float[]) {
deepToString = Arrays.toString((float[]) obj);
} else if (obj instanceof double[]) {
deepToString = Arrays.toString((double[]) obj);
} else {
deepToString = obj instanceof Object[] ? Arrays.deepToString((Object[]) obj) : "Couldn't find a correct type for the object";
}
jad_an(3, (Throwable) null, deepToString, new Object[0]);
}
@Override
public synchronized void jad_an(int i2, @Nullable String str, @Nullable String str2, @Nullable Throwable th) {
if (th != null && str2 != null) {
str2 = str2 + " : " + jad_hu.jad_an(th);
}
if (th != null && str2 == null) {
str2 = jad_hu.jad_an(th);
}
if (jad_hu.jad_an((CharSequence) str2)) {
str2 = "Empty/NULL log message";
}
for (jad_cp jad_cpVar : this.jad_bo) {
if (jad_cpVar.jad_an(i2, str)) {
jad_cpVar.jad_an(i2, str, str2);
}
}
}
@Override
public void jad_an() {
this.jad_bo.clear();
}
@Override
public void jad_an(@NonNull jad_cp jad_cpVar) {
this.jad_bo.add(jad_cpVar);
}
public final synchronized void jad_an(int i2, @Nullable Throwable th, @NonNull String str, @Nullable Object... objArr) {
str.getClass();
String str2 = this.jad_an.get();
if (str2 != null) {
this.jad_an.remove();
} else {
str2 = null;
}
if (objArr != null && objArr.length != 0) {
str = String.format(str, objArr);
}
jad_an(i2, str2, str, th);
}
}