YukiHookAPI: [BUG] When set param.result after get it value was still original

For Example:

// getSystemProperty is a method read var from android.os.SystemProperties
val x: String? = getSystemProperty("debug.xxx")
if (x != null && x != "") {
    result = x.split(",")
}
// logger.debug is some wrap of YukiHookLogger
logger.debug(
    "Invoke X", "${appInfo.packageName}, $x, $result"
)

When debug.xxx is set to 1,2 the log out pkg_name, 1,2, [1, 2], but upgrade to 1.1.6 it became pkg_name, 1,2, [x, y], the x and y is it’s original value.

Using System.out.println has same phenomenon.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 20

Most upvoted comments

看了一下,这可能确实是 API 的 bug,因为从 1.1.5 开始为了做兼容重写了对接 Xposed API 都底层代码,可能是我当时没考虑这种情况,我只代理了设置返回值的 callback,忽略了方法还需要更新修改后的原值的问题,应该设置两个 callback,此问题应该只会影响调试效果,但是不会影响最终作用效果。

这里 是可能发生问题的代码段。

我将会在下个版本一同修复这个问题。

临时的解决方案:设置 result 后将其保存为自定义变量把值存起来。