请问打印调用堆栈,特殊调用如何跟踪
在用xp模块hook了 StringBuilder的toString下面是打印堆栈的代码和信息
Throwable ex = new Throwable();
StackTraceElement[] stackElements = ex.getStackTrace();
if (stackElements != null) {
for (int i = 0; i < stackElements.length; i++) {
XposedBridge.log("ssDump Stack"+ i +": "+ stackElements.getClassName()
+"----"+stackElements.getFileName()
+"----" + stackElements.getLineNumber()
+"----" +stackElements.getMethodName());
}
}
[ 2024-01-18T01:02:27.779 10399:9577: 10130 I/LSPosed-Bridge] ---------------start----------------
[ 2024-01-18T01:02:27.780 10399:9577: 10130 I/LSPosed-Bridge] ssDump Stack0: com.test.sopse.MainHook$8----MainHook.java----602----afterHookedMethod
[ 2024-01-18T01:02:27.780 10399:9577: 10130 I/LSPosed-Bridge] ssDump Stack1: de.robv.android.xposed.XposedBridge$LegacyApiSupport----null----33----handleAfter
[ 2024-01-18T01:02:27.780 10399:9577: 10130 I/LSPosed-Bridge] ssDump Stack2: J----null----292----callback
[ 2024-01-18T01:02:27.780 10399:9577: 10130 I/LSPosed-Bridge] ssDump Stack3: LSPHooker_----null----8----toString
[ 2024-01-18T01:02:27.780 10399:9577: 10130 I/LSPosed-Bridge] ssDump Stack4: org.json.JSONStringer----JSONStringer.java----443----toString
[ 2024-01-18T01:02:27.780 10399:9577: 10130 I/LSPosed-Bridge] ssDump Stack5: org.json.JSONObject----JSONObject.java----703----toString
[ 2024-01-18T01:02:27.780 10399:9577: 10130 I/LSPosed-Bridge] ssDump Stack6: dx0.j----null----258----d
[ 2024-01-18T01:02:27.780 10399:9577: 10130 I/LSPosed-Bridge] ssDump Stack7: dx0.k----null----468----onCronetTaskCompleted
如何追踪Dump Stack6: dx0.j----null----258----d 和Dump Stack7: dx0.k----null----468----onCronetTaskCompleted
还请前辈指点下。
页:
[1]