Giter Site home page Giter Site logo

Comments (10)

buffcow avatar buffcow commented on September 15, 2024 2

ok, 也可以考虑一下不在hook 资源的情况下,也可以快捷的 根据资源名称获取 app 资源的值😀

这属于额外扩展了,可以加上

好的 辛苦了👍

from yukihookapi.

fankes avatar fankes commented on September 15, 2024 1
injectResource {
    conditions {
        name = "example_name"
        string()
    }
    // 加上 ab
    replaceTo { "${it}ab" }
}

根据你的需求,这个方法增加的扩展为在回调中可以拿到 it 并在最后一位返回需要修改的内容。

from yukihookapi.

fankes avatar fankes commented on September 15, 2024

你可以在宿主的资源或上下文扩展方法中调用 injectModuleAppResources 把模块的资源注入宿主,然后用宿主的资源直接获取。
这个方法不是必须的扩展,不会被添加。
参考文档→这里

from yukihookapi.

buffcow avatar buffcow commented on September 15, 2024

你可以在宿主的资源或上下文扩展方法中调用 injectModuleAppResources 把模块的资源注入宿主,然后用宿主的资源直接获取。 这个方法不是必须的扩展,不会被添加。 参考文档→这里

我不是想获取模块的资源,而是获取被hook的宿主的res资源噢

from yukihookapi.

buffcow avatar buffcow commented on September 15, 2024

就比方说,我有个这样的需求:
hook app 的 res,将 string 为 example_name 的值加上ab

目前的代码是这样的:

            injectResource {
                conditions {
                    name = "example_name"
                    string()
                }
                // 获取原有的值
                val id = appResources!!.getIdentifier(
                    "example_name",
                    "string",
                    packageName
                )
                // 加上 ab
                replaceTo(appResources!!.getString(id) + "ab")
            }

from yukihookapi.

fankes avatar fankes commented on September 15, 2024

这样啊,后面可以加一个扩展

from yukihookapi.

buffcow avatar buffcow commented on September 15, 2024

ok, 也可以考虑一下不在hook 资源的情况下,也可以快捷的 根据资源名称获取 app 资源的值😀

from yukihookapi.

fankes avatar fankes commented on September 15, 2024

ok, 也可以考虑一下不在hook 资源的情况下,也可以快捷的 根据资源名称获取 app 资源的值😀

这属于额外扩展了,可以加上

from yukihookapi.

buffcow avatar buffcow commented on September 15, 2024

nice

from yukihookapi.

fankes avatar fankes commented on September 15, 2024

1.2.0 版本已发布,该功能已添加。

from yukihookapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.