在hook log相关方法时,如果打开日志输出,会StackOverflowError
CB2Git opened this issue · 1 comments
CB2Git commented
说明
尝试hook Log的方法,当我设置PineConfig.debug
为true的时候,会出现StackOverflowError,当我设置PineConfig.debug
为false,一切正常
可复现代码
PineConfig.debug = true
Pine.hook( Log::class.java.getDeclaredMethod("i", String::class.java, String::class.java),
object : MethodHook() {
override fun beforeCall(callFrame: Pine.CallFrame) {
}
override fun afterCall(callFrame: Pine.CallFrame) {
}
})
异常堆栈
FATAL EXCEPTION: main
Process: com.shein.carsh, PID: 15464
java.lang.StackOverflowError: stack size 8192KB
at android.icu.util.ULocale.equals(ULocale.java:697)
at android.icu.impl.ICUCurrencyDisplayInfoProvider.getInstance(ICUCurrencyDisplayInfoProvider.java:43)
at android.icu.text.CurrencyDisplayNames.getInstance(CurrencyDisplayNames.java:38)
at android.icu.util.Currency.getName(Currency.java:542)
at android.icu.util.Currency.getSymbol(Currency.java:489)
at android.icu.util.Currency.getSymbol(Currency.java:479)
at java.util.Currency.getSymbol(Currency.java:497)
at java.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:713)
at java.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:102)
at java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:156)
at java.util.Formatter.getZero(Formatter.java:2287)
at java.util.Formatter.<init>(Formatter.java:1896)
at java.util.Formatter.<init>(Formatter.java:1918)
at java.lang.String.format(String.java:2870)
at top.canyie.pine.Pine.log(Pine.java:745)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:85)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
at top.canyie.pine.entry.Arm64Entry.intBridge(Arm64Entry.java:28)
at top.canyie.pine.Pine.handleCall(Pine.java:660)
at top.canyie.pine.entry.Arm64Entry.handleBridge(Arm64Entry.java:158)
canyie commented
那我能咋办嘛……
为什么会有 hook log 这种需求……