Skip to content

[BUG] HookParam call timing problem #47

@cesaryuan

Description

@cesaryuan

复现步骤:

  1. 创建模块,代码如下,启用模块
loadApp(name = "com.wibo.bigbang.ocr") {
  findClass(name = "okhttp3.Request\$Builder").hook {
      injectMember {
          method {
              name = "addHeader"
              param(StringClass,StringClass)
              returnType = "okhttp3.Request\$Builder"
          }
          beforeHook {
              val a1 = args().first().string();
              loggerD("checkEqual", "", LoggerType.LOGD)
              val a2 = args().first().string();
              loggerD(
                  tag = "checkEqual",
                  msg = "${a1 == a2} $a1 $a2"
              )
          }
      }
  }
}
  1. 安装宿主app:布丁扫描,启动宿主APP

  2. 观察Logcat,发现有好几次输出了false,按理来说应该始终是true才对
    image

  3. 把a1后面的loggerD("checkEqual", "", LoggerType.LOGD)删掉后,程序运行正常(始终输出true
    image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedThis bug was fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions