Sunbit v2.4.4版本的 MD5 值为:a5021e5e2a58eb1d6741b432fe7533c4
以下内容为反编译后的 k.java 源代码,内容仅作参考
package e.h.a;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import d.b.f.u.x;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.ArrayList;
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;
class k implements m {
private static final int c = 2;
private final ThreadLocal<String> f12910a = new ThreadLocal<>();
private final List<g> b = new ArrayList();
@NonNull
private String g(@NonNull String str, @Nullable Object... objArr) {
return (objArr == null || objArr.length == 0) ? str : String.format(str, objArr);
}
@Override
public void a(@Nullable Object obj) {
a(3, (Throwable) null, o.b(obj), new Object[0]);
}
@Override
public m b(String str) {
if (str != null) {
this.f12910a.set(str);
}
return this;
}
@Override
public void c(@NonNull String str, @Nullable Object... objArr) {
a(3, (Throwable) null, str, objArr);
}
@Override
public void d(@NonNull String str, @Nullable Object... objArr) {
a(2, (Throwable) null, str, objArr);
}
@Override
public void e(@NonNull String str, @Nullable Object... objArr) {
a(null, str, objArr);
}
@Override
public void f(@NonNull String str, @Nullable Object... objArr) {
a(5, (Throwable) null, str, objArr);
}
@Override
public void a(@Nullable Throwable th, @NonNull String str, @Nullable Object... objArr) {
a(6, th, str, objArr);
}
@Override
public void b(@NonNull String str, @Nullable Object... objArr) {
a(4, (Throwable) null, str, objArr);
}
@Override
public void c(@Nullable String str) {
if (o.a((CharSequence) str)) {
a("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);
a((Object) streamResult.getWriter().toString().replaceFirst(">", ">\n"));
} catch (TransformerException unused) {
e("Invalid xml", new Object[0]);
}
}
@Nullable
private String b() {
String str = this.f12910a.get();
if (str != null) {
this.f12910a.remove();
return str;
}
return null;
}
@Override
public void a(@NonNull String str, @Nullable Object... objArr) {
a(7, (Throwable) null, str, objArr);
}
@Override
public void a(@Nullable String str) {
if (o.a((CharSequence) str)) {
a("Empty/Null json content");
return;
}
try {
String trim = str.trim();
if (trim.startsWith(x.D)) {
a((Object) new q.e.i(trim).toString(2));
} else if (trim.startsWith(x.F)) {
a((Object) new q.e.f(trim).toString(2));
} else {
e("Invalid Json", new Object[0]);
}
} catch (q.e.g unused) {
e("Invalid Json", new Object[0]);
}
}
@Override
public synchronized void a(int i2, @Nullable String str, @Nullable String str2, @Nullable Throwable th) {
if (th != null && str2 != null) {
str2 = str2 + " : " + o.a(th);
}
if (th != null && str2 == null) {
str2 = o.a(th);
}
if (o.a((CharSequence) str2)) {
str2 = "Empty/NULL log message";
}
for (g gVar : this.b) {
if (gVar.a(i2, str)) {
gVar.a(i2, str, str2);
}
}
}
@Override
public void a() {
this.b.clear();
}
@Override
public void a(@NonNull g gVar) {
this.b.add(o.a(gVar));
}
private synchronized void a(int i2, @Nullable Throwable th, @NonNull String str, @Nullable Object... objArr) {
o.a(str);
a(i2, b(), g(str, objArr), th);
}
}