1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| function printStack() { Java.perform(function() { var Exception = Java.use("java.lang.Exception"); var ins = Exception.$new("Exception"); var straces = ins.getStackTrace(); if (straces != undefined && straces != null) { var strace = straces.toString(); var replaceStr = strace.replace(/,/g, "\r\n"); console.log( "============================= Stack start =======================" ); console.log(replaceStr); console.log( "============================= Stack end =======================\r\n" ); Exception.$dispose(); } }); }
|