Amour v4.6.9版本的 MD5 值为:60db0759ce21a7c5858136dd0821206f
以下内容为反编译后的 b.java 源代码,内容仅作参考
package com.blankj.utilcode.util;
import android.content.ClipData;
import android.content.ComponentName;
import android.content.Intent;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import androidx.collection.SimpleArrayMap;
import com.blankj.utilcode.util.k;
import java.io.StringReader;
import java.io.StringWriter;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Formatter;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.Executors;
import javax.xml.transform.Transformer;
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 final class b {
public static final char[] f1337a = {'V', 'D', 'I', 'W', 'E', 'A'};
public static final String f1338b = System.getProperty("file.separator");
public static final String f1339c = System.getProperty("line.separator");
public static final a f1340d = new a();
public static final SimpleArrayMap<Class, AbstractC0033b> f1341e;
public static final class a {
public final String f1342a;
public final String f1343b = k.b();
public final k.a f1344c = new k.a();
public a() {
if ("mounted".equals(Environment.getExternalStorageState()) && g.a().getExternalFilesDir(null) != null) {
StringBuilder sb2 = new StringBuilder();
sb2.append(g.a().getExternalFilesDir(null));
String str = b.f1338b;
sb2.append(str);
sb2.append("log");
sb2.append(str);
this.f1342a = sb2.toString();
return;
}
StringBuilder sb3 = new StringBuilder();
sb3.append(g.a().getFilesDir());
String str2 = b.f1338b;
sb3.append(str2);
sb3.append("log");
sb3.append(str2);
this.f1342a = sb3.toString();
}
public final String toString() {
String replace;
StringBuilder sb2 = new StringBuilder("process: ");
String str = this.f1343b;
if (str == null) {
replace = "";
} else {
replace = str.replace(":", "_");
}
sb2.append(replace);
String str2 = b.f1339c;
a1.i.m(sb2, str2, "logSwitch: true", str2, "consoleSwitch: true");
sb2.append(str2);
sb2.append("tag: ");
k.f("");
sb2.append("null");
sb2.append(str2);
a1.i.m(sb2, "headSwitch: true", str2, "fileSwitch: false", str2);
sb2.append("dir: ");
a1.i.m(sb2, this.f1342a, str2, "filePrefix: util", str2);
a1.i.m(sb2, "borderSwitch: true", str2, "singleTagSwitch: true", str2);
sb2.append("consoleFilter: ");
char[] cArr = b.f1337a;
sb2.append(cArr[0]);
sb2.append(str2);
sb2.append("fileFilter: ");
sb2.append(cArr[0]);
sb2.append(str2);
sb2.append("stackDeep: 1");
sb2.append(str2);
a1.i.m(sb2, "stackOffset: 0", str2, "saveDays: -1", str2);
sb2.append("formatter: ");
sb2.append(b.f1341e);
sb2.append(str2);
sb2.append("fileWriter: null");
sb2.append(str2);
a1.i.m(sb2, "onConsoleOutputListener: null", str2, "onFileOutputListener: null", str2);
sb2.append("fileExtraHeader: ");
sb2.append(this.f1344c.a());
return sb2.toString();
}
}
public static abstract class AbstractC0033b<T> {
public abstract String a();
}
public static final class c {
public static String a(Bundle bundle) {
String a10;
Iterator<String> it2 = bundle.keySet().iterator();
if (!it2.hasNext()) {
return "Bundle {}";
}
StringBuilder sb2 = new StringBuilder(128);
sb2.append("Bundle { ");
while (true) {
String next = it2.next();
Object obj = bundle.get(next);
sb2.append(next);
sb2.append('=');
if (obj instanceof Bundle) {
if (obj == bundle) {
a10 = "(this Bundle)";
} else {
a10 = a((Bundle) obj);
}
sb2.append(a10);
} else {
sb2.append(b.b(obj));
}
if (!it2.hasNext()) {
sb2.append(" }");
return sb2.toString();
}
sb2.append(", ");
}
}
public static String b(Intent intent) {
boolean z10;
String b10;
StringBuilder sb2 = new StringBuilder(128);
sb2.append("Intent { ");
String action = intent.getAction();
boolean z11 = false;
boolean z12 = true;
if (action != null) {
sb2.append("act=");
sb2.append(action);
z10 = false;
} else {
z10 = true;
}
Set<String> categories = intent.getCategories();
if (categories != null) {
if (!z10) {
sb2.append(' ');
}
sb2.append("cat=[");
for (String str : categories) {
if (!z12) {
sb2.append(',');
}
sb2.append(str);
z12 = false;
}
sb2.append("]");
z10 = false;
}
Uri data = intent.getData();
if (data != null) {
if (!z10) {
sb2.append(' ');
}
sb2.append("dat=");
sb2.append(data);
z10 = false;
}
String type = intent.getType();
if (type != null) {
if (!z10) {
sb2.append(' ');
}
sb2.append("typ=");
sb2.append(type);
z10 = false;
}
int flags = intent.getFlags();
if (flags != 0) {
if (!z10) {
sb2.append(' ');
}
sb2.append("flg=0x");
sb2.append(Integer.toHexString(flags));
z10 = false;
}
String str2 = intent.getPackage();
if (str2 != null) {
if (!z10) {
sb2.append(' ');
}
sb2.append("pkg=");
sb2.append(str2);
z10 = false;
}
ComponentName component = intent.getComponent();
if (component != null) {
if (!z10) {
sb2.append(' ');
}
sb2.append("cmp=");
sb2.append(component.flattenToShortString());
z10 = false;
}
Rect sourceBounds = intent.getSourceBounds();
if (sourceBounds != null) {
if (!z10) {
sb2.append(' ');
}
sb2.append("bnds=");
sb2.append(sourceBounds.toShortString());
z10 = false;
}
ClipData clipData = intent.getClipData();
if (clipData != null) {
if (!z10) {
sb2.append(' ');
}
ClipData.Item itemAt = clipData.getItemAt(0);
if (itemAt == null) {
sb2.append("ClipData.Item {}");
} else {
sb2.append("ClipData.Item { ");
String htmlText = itemAt.getHtmlText();
if (htmlText != null) {
sb2.append("H:");
sb2.append(htmlText);
sb2.append("}");
} else {
CharSequence text = itemAt.getText();
if (text != null) {
sb2.append("T:");
sb2.append(text);
sb2.append("}");
} else {
Uri uri = itemAt.getUri();
if (uri != null) {
sb2.append("U:");
sb2.append(uri);
sb2.append("}");
} else {
Intent intent2 = itemAt.getIntent();
if (intent2 != null) {
sb2.append("I:");
sb2.append(b(intent2));
sb2.append("}");
} else {
sb2.append("NULL}");
}
}
}
}
}
z10 = false;
}
Bundle extras = intent.getExtras();
if (extras != null) {
if (!z10) {
sb2.append(' ');
}
sb2.append("extras={");
sb2.append(a(extras));
sb2.append('}');
} else {
z11 = z10;
}
Intent selector = intent.getSelector();
if (selector != null) {
if (!z11) {
sb2.append(' ');
}
sb2.append("sel={");
if (selector == intent) {
b10 = "(this Intent)";
} else {
b10 = b(selector);
}
sb2.append(b10);
sb2.append("}");
}
sb2.append(" }");
return sb2.toString();
}
public static String c(int i, Object obj) {
ArrayList arrayList;
if (obj.getClass().isArray()) {
if (obj instanceof Object[]) {
return Arrays.deepToString((Object[]) obj);
}
if (obj instanceof boolean[]) {
return Arrays.toString((boolean[]) obj);
}
if (obj instanceof byte[]) {
return Arrays.toString((byte[]) obj);
}
if (obj instanceof char[]) {
return Arrays.toString((char[]) obj);
}
if (obj instanceof double[]) {
return Arrays.toString((double[]) obj);
}
if (obj instanceof float[]) {
return Arrays.toString((float[]) obj);
}
if (obj instanceof int[]) {
return Arrays.toString((int[]) obj);
}
if (obj instanceof long[]) {
return Arrays.toString((long[]) obj);
}
if (obj instanceof short[]) {
return Arrays.toString((short[]) obj);
}
throw new IllegalArgumentException("Array has incompatible type: " + obj.getClass());
} else if (obj instanceof Throwable) {
String str = u.i.f14046a;
ArrayList arrayList2 = new ArrayList();
for (Throwable th2 = (Throwable) obj; th2 != null && !arrayList2.contains(th2); th2 = th2.getCause()) {
arrayList2.add(th2);
}
int size = arrayList2.size();
ArrayList arrayList3 = new ArrayList();
int i10 = size - 1;
ArrayList a10 = u.i.a((Throwable) arrayList2.get(i10));
while (true) {
size--;
if (size < 0) {
break;
}
if (size != 0) {
arrayList = u.i.a((Throwable) arrayList2.get(size - 1));
int size2 = a10.size() - 1;
int size3 = arrayList.size();
while (true) {
size3--;
if (size2 < 0 || size3 < 0) {
break;
}
if (((String) a10.get(size2)).equals((String) arrayList.get(size3))) {
a10.remove(size2);
}
size2--;
}
} else {
arrayList = a10;
}
if (size == i10) {
arrayList3.add(((Throwable) arrayList2.get(size)).toString());
} else {
arrayList3.add(" Caused by: " + ((Throwable) arrayList2.get(size)).toString());
}
arrayList3.addAll(a10);
a10 = arrayList;
}
StringBuilder sb2 = new StringBuilder();
Iterator it2 = arrayList3.iterator();
while (it2.hasNext()) {
sb2.append((String) it2.next());
sb2.append(u.i.f14046a);
}
return sb2.toString();
} else if (obj instanceof Bundle) {
return a((Bundle) obj);
} else {
if (obj instanceof Intent) {
return b((Intent) obj);
}
if (i == 32) {
if (obj instanceof CharSequence) {
String obj2 = obj.toString();
try {
int length = obj2.length();
for (int i11 = 0; i11 < length; i11++) {
char charAt = obj2.charAt(i11);
if (charAt == '{') {
obj2 = new JSONObject(obj2).toString(4);
break;
} else if (charAt == '[') {
obj2 = new JSONArray(obj2).toString(4);
break;
} else if (Character.isWhitespace(charAt)) {
}
}
return obj2;
} catch (JSONException e10) {
e10.printStackTrace();
return obj2;
}
}
try {
return k.c().g(obj);
} catch (Throwable unused) {
return obj.toString();
}
} else if (i == 48) {
String obj3 = obj.toString();
try {
StreamSource streamSource = new StreamSource(new StringReader(obj3));
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);
return streamResult.getWriter().toString().replaceFirst(">", ">" + b.f1339c);
} catch (Exception e11) {
e11.printStackTrace();
return obj3;
}
} else {
return obj.toString();
}
}
}
}
public static final class d {
public final String f1345a;
public final String[] f1346b;
public d(String str, String str2, String[] strArr) {
this.f1345a = str;
this.f1346b = strArr;
}
}
static {
Executors.newSingleThreadExecutor();
f1341e = new SimpleArrayMap<>();
}
public static void a(Object... objArr) {
d dVar;
String sb2;
String[] split;
f1340d.getClass();
String str = "";
k.f("");
StackTraceElement[] stackTrace = new Throwable().getStackTrace();
int i = 1;
if (3 >= stackTrace.length) {
String c4 = c(stackTrace[3]);
if (k.f("")) {
int indexOf = c4.indexOf(46);
if (indexOf == -1) {
str = c4;
} else {
str = c4.substring(0, indexOf);
}
}
dVar = new d(str, ": ", null);
} else {
StackTraceElement stackTraceElement = stackTrace[3];
String c10 = c(stackTraceElement);
if (k.f("")) {
int indexOf2 = c10.indexOf(46);
if (indexOf2 == -1) {
str = c10;
} else {
str = c10.substring(0, indexOf2);
}
}
String formatter = new Formatter().format("%s, %s.%s(%s:%d)", Thread.currentThread().getName(), stackTraceElement.getClassName(), stackTraceElement.getMethodName(), c10, Integer.valueOf(stackTraceElement.getLineNumber())).toString();
dVar = new d(str, a1.i.g(" [", formatter, "]: "), new String[]{formatter});
}
int length = objArr.length;
String str2 = f1339c;
if (length == 1) {
Object obj = objArr[0];
if (obj == null) {
sb2 = "null";
} else {
sb2 = b(obj);
}
} else {
StringBuilder sb3 = new StringBuilder();
int length2 = objArr.length;
for (int i10 = 0; i10 < length2; i10++) {
Object obj2 = objArr[i10];
sb3.append("args[");
sb3.append(i10);
sb3.append("] = ");
sb3.append(b(obj2));
sb3.append(str2);
}
sb2 = sb3.toString();
}
if (sb2.length() == 0) {
sb2 = "log nothing";
}
StringBuilder sb4 = new StringBuilder(" ");
sb4.append(str2);
sb4.append("┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────");
sb4.append(str2);
String[] strArr = dVar.f1346b;
if (strArr != null) {
for (String str3 : strArr) {
sb4.append("│ ");
sb4.append(str3);
sb4.append(str2);
}
sb4.append("├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄");
sb4.append(str2);
}
for (String str4 : sb2.split(str2)) {
sb4.append("│ ");
sb4.append(str4);
sb4.append(str2);
}
sb4.append("└────────────────────────────────────────────────────────────────────────────────────────────────────────────────");
String sb5 = sb4.toString();
int length3 = sb5.length();
int i11 = length3 - 113;
int i12 = i11 / 1100;
String str5 = dVar.f1345a;
if (i12 > 0) {
StringBuilder sb6 = new StringBuilder();
int i13 = 1100;
sb6.append(sb5.substring(0, 1100));
sb6.append(str2);
sb6.append("└────────────────────────────────────────────────────────────────────────────────────────────────────────────────");
d(3, str5, sb6.toString());
while (i < i12) {
StringBuilder q = androidx.constraintlayout.motion.utils.a.q(" ", str2, "┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────", str2, "│ ");
int i14 = i13 + 1100;
q.append(sb5.substring(i13, i14));
q.append(str2);
q.append("└────────────────────────────────────────────────────────────────────────────────────────────────────────────────");
d(3, str5, q.toString());
i++;
i13 = i14;
}
if (i13 != i11) {
StringBuilder q2 = androidx.constraintlayout.motion.utils.a.q(" ", str2, "┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────", str2, "│ ");
q2.append(sb5.substring(i13, length3));
d(3, str5, q2.toString());
return;
}
return;
}
d(3, str5, sb5);
}
public static String b(Object obj) {
String obj2;
if (obj == null) {
return "null";
}
SimpleArrayMap<Class, AbstractC0033b> simpleArrayMap = f1341e;
if (!simpleArrayMap.isEmpty()) {
Class<?> cls = obj.getClass();
if (cls.isAnonymousClass() || cls.isSynthetic()) {
Type[] genericInterfaces = cls.getGenericInterfaces();
if (genericInterfaces.length == 1) {
Type type = genericInterfaces[0];
while (type instanceof ParameterizedType) {
type = ((ParameterizedType) type).getRawType();
}
obj2 = type.toString();
} else {
Type genericSuperclass = cls.getGenericSuperclass();
while (genericSuperclass instanceof ParameterizedType) {
genericSuperclass = ((ParameterizedType) genericSuperclass).getRawType();
}
obj2 = genericSuperclass.toString();
}
if (obj2.startsWith("class ")) {
obj2 = obj2.substring(6);
} else if (obj2.startsWith("interface ")) {
obj2 = obj2.substring(10);
}
try {
cls = Class.forName(obj2);
} catch (ClassNotFoundException e10) {
e10.printStackTrace();
}
}
AbstractC0033b abstractC0033b = simpleArrayMap.get(cls);
if (abstractC0033b != null) {
return abstractC0033b.a();
}
}
return c.c(-1, obj);
}
public static String c(StackTraceElement stackTraceElement) {
String fileName = stackTraceElement.getFileName();
if (fileName != null) {
return fileName;
}
String className = stackTraceElement.getClassName();
String[] split = className.split("\\.");
if (split.length > 0) {
className = split[split.length - 1];
}
int indexOf = className.indexOf(36);
if (indexOf != -1) {
className = className.substring(0, indexOf);
}
return a1.i.f(className, ".java");
}
public static void d(int i, String str, String str2) {
Log.println(i, str, str2);
f1340d.getClass();
}
}