import{_ as s,o as n,c as e,a}from"./app.fb8271cf.js";const o={},l=a(`

Notice

The English translation of this page has not been completed, you are welcome to contribute translations to us.

You can use the Chrome Translation Plugin to translate entire pages for reference.

YukiResourcesHookCreator - class

class YukiResourcesHookCreator(internal val packageParam: PackageParam, internal val hookResources: HookResources)

Change Records

v1.0.80 added

v1.1.0 modified

\u4FEE\u6B63\u62FC\u5199\u9519\u8BEF\u7684 Creater \u547D\u540D\u5230 Creator

Function Illustrate

YukiHookAPI \u7684 Resources \u6838\u5FC3 Hook \u5B9E\u73B0\u7C7B\u3002

injectResource - method

inline fun injectResource(tag: String, initiate: ResourceHookCreator.() -> Unit): ResourceHookCreator.Result

Change Records

v1.0.80 added

Function Illustrate

\u6CE8\u5165\u8981 Hook \u7684 Resources\u3002

Function Example

\u4F60\u53EF\u4EE5\u6CE8\u5165\u4EFB\u610F Resources\uFF0C\u4F7F\u7528 injectResource \u5373\u53EF\u521B\u5EFA\u4E00\u4E2A Hook \u5BF9\u8C61\u3002

The following example

injectResource {
    // Your code here.
}

\u4F60\u8FD8\u53EF\u4EE5\u81EA\u5B9A\u4E49 tag\uFF0C\u65B9\u4FBF\u4F60\u5728\u8C03\u8BD5\u7684\u65F6\u5019\u80FD\u591F\u533A\u5206\u4F60\u7684 Hook \u5BF9\u8C61\u3002

The following example

injectResource(tag = "KuriharaYuki") {
    // Your code here.
}

ResourcesHookCreator - class

inner class ResourcesHookCreator internal constructor(private val tag: String)

Change Records

v1.0.80 added

v1.1.0 modified

\u79FB\u9664 packageName

\u4FEE\u6B63\u62FC\u5199\u9519\u8BEF\u7684 Creater \u547D\u540D\u5230 Creator

Function Illustrate

Hook \u6838\u5FC3\u529F\u80FD\u5B9E\u73B0\u7C7B\u3002

\u67E5\u627E\u548C\u5904\u7406\u9700\u8981 Hook \u7684 Resources\u3002

resourceId - field

var resourceId: Int

Change Records

v1.0.80 added

Function Illustrate

\u76F4\u63A5\u8BBE\u7F6E\u9700\u8981\u66FF\u6362\u7684 Resources Id\u3002

Notice

\u4E0D\u5EFA\u8BAE\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u7F6E\u76EE\u6807\u9700\u8981 Hook \u7684 Resources Id\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 conditions \u65B9\u6CD5\u3002

Function Example

\u4F60\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u5E76\u6307\u5B9A\u76EE\u6807 Hook APP \u7684 Resources Id\u3002

The following example

injectResource {
    resourceId = 0x7f060001.toInt()
    replaceTo(...)
}

conditions - method

inline fun conditions(initiate: ConditionFinder.() -> Unit)

Change Records

v1.0.80 added

Function Illustrate

\u8BBE\u7F6E Resources \u67E5\u627E\u6761\u4EF6\u3002

\u82E5\u4F60\u8BBE\u7F6E\u4E86 resourceId \u5219\u6B64\u65B9\u6CD5\u5C06\u4E0D\u4F1A\u88AB\u4F7F\u7528\u3002

Function Example

\u4F60\u53EF\u53C2\u8003 ConditionFinder \u67E5\u770B\u8BE6\u7EC6\u7528\u6CD5\u3002

The following example

injectResource {
    conditions {
        name = "test_string"
        string()
    }
    replaceTo(...)
}

replaceTo - method

fun replaceTo(any: Any)

Change Records

v1.0.80 added

Function Illustrate

\u66FF\u6362\u6307\u5B9A Resources \u4E3A\u6307\u5B9A\u7684\u503C\u3002

Function Example

\u4F60\u53EF\u4EE5\u66FF\u6362\u627E\u5230\u7684 Resources \u4E3A\u4F60\u60F3\u8981\u7684\u503C\uFF0C\u53EF\u4EE5\u662F String\u3001Drawable \u7B49\u3002

\u6BD4\u5982\u6211\u4EEC\u8981\u66FF\u6362\u4E00\u4E2A\u627E\u5230\u7684\u5B57\u7B26\u4E32 Resources\u3002

The following example

injectResource {
    conditions {
        name = "test_string"
        string()
    }
    replaceTo("replace string")
}

\u6216\u662F\u66FF\u6362\u4E3A\u4E00\u4E2A Drawable\uFF0C\u4F60\u65E0\u9700\u5BF9\u76EE\u6807 Resources \u5B9E\u73B0 fwd \u65B9\u6CD5\u6216 DrawableLoader\u3002

The following example

injectResource {
    conditions {
        name = "test_drawable"
        drawable()
    }
    replaceTo(ColorDrawable(Color.RED))
}

replaceToTrue - method

fun replaceToTrue()

Change Records

v1.0.80 added

Function Illustrate

\u66FF\u6362\u6307\u5B9A Resources \u4E3A true\u3002

Pay Attention

\u786E\u4FDD\u76EE\u6807\u66FF\u6362 Resources \u7684\u7C7B\u578B\u4E3A Boolean\u3002

replaceToFalse - method

fun replaceToFalse()

Change Records

v1.0.80 added

Function Illustrate

\u66FF\u6362\u6307\u5B9A Resources \u4E3A false\u3002

Pay Attention

\u786E\u4FDD\u76EE\u6807\u66FF\u6362 Resources \u7684\u7C7B\u578B\u4E3A Boolean\u3002

replaceToModuleResource - method

fun replaceToModuleResource(resId: Int)

Change Records

v1.0.80 added

Function Illustrate

\u66FF\u6362\u4E3A\u5F53\u524D Xposed \u6A21\u5757\u7684 Resources\u3002

\u4F60\u53EF\u4EE5\u76F4\u63A5\u4F7F\u7528\u6A21\u5757\u7684 R.string.xxx\u3001R.mipmap.xxx\u3001R.drawable.xxx \u66FF\u6362 Hook APP \u7684 Resources\u3002

Function Example

\u4F7F\u7528\u6B64\u65B9\u6CD5\u53EF\u975E\u5E38\u65B9\u4FBF\u5730\u4F7F\u7528\u5F53\u524D\u6A21\u5757\u7684 Resources \u53BB\u66FF\u6362\u76EE\u6807 Hook APP \u7684 Resources\u3002

\u8FD9\u4E2A\u8FC7\u7A0B\u4F60\u65E0\u9700\u5BF9\u76EE\u6807 Resources \u5B9E\u73B0 fwd \u65B9\u6CD5\u3002

\u6BD4\u5982\u6211\u4EEC\u8981\u66FF\u6362\u4E00\u4E2A\u5B57\u7B26\u4E32\u3002

The following example

injectResource {
    conditions {
        name = "test_string"
        string()
    }
    replaceToModuleResource(R.string.module_string)
}

\u8FD8\u53EF\u4EE5\u66FF\u6362\u4E00\u4E9B\u590D\u6742\u7684 Resources\uFF0C\u6BD4\u5982 xml \u521B\u5EFA\u7684 drawable\u3002

The following example

injectResource {
    conditions {
        name = "test_drawable"
        drawable()
    }
    replaceToModuleResource(R.drawable.module_drawable)
}

injectAsLayout - method

fun injectAsLayout(initiate: YukiResources.LayoutInflatedParam.() -> Unit)

Change Records

v1.0.80 added

Function Illustrate

\u4F5C\u4E3A\u88C5\u8F7D\u7684\u5E03\u5C40\u6CE8\u5165\u3002

Function Example

\u4F60\u53EF\u4EE5\u76F4\u63A5\u6CE8\u5165\u4E00\u4E2A\u5E03\u5C40\u76D1\u542C\u5E76\u4FEE\u6539\u5B83\u7684\u5185\u90E8 View\u3002

The following example

injectResource {
    conditions {
        name = "activity_main"
        layout()
    }
    injectAsLayout {
        findViewByIdentifier<View>(name = "test_view")?.isVisible = false
        findViewByIdentifier<TextView>(name = "test_text_view")?.text = "Hook this"
    }
}

\u4F60\u8FD8\u53EF\u4EE5\u901A\u8FC7 currentView \u62FF\u5230 Context\u3002

The following example

injectResource {
    conditions {
        name = "activity_main"
        layout()
    }
    injectAsLayout {
        Toast.makeText(currentView.context, "Hook this", Toast.LENGTH_SHORT).show()
    }
}

ConditionFinder - class

inner class ConditionFinder internal constructor()

Change Records

v1.0.80 added

Function Illustrate

Resources \u67E5\u627E\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002

name - field

var name: String

Change Records

v1.0.80 added

Function Illustrate

\u8BBE\u7F6E Resources \u540D\u79F0\u3002

anim - method

fun anim()

Change Records

v1.0.80 added

Function Illustrate

\u8BBE\u7F6E Resources \u7C7B\u578B\u4E3A\u52A8\u753B\u3002

animator - method

fun animator()

Change Records

v1.0.80 added

Function Illustrate

\u8BBE\u7F6E Resources \u7C7B\u578B\u4E3A\u5C5E\u6027\u52A8\u753B\u3002

bool - method

fun bool()

Change Records

v1.0.80 added

Function Illustrate

\u8BBE\u7F6E Resources \u7C7B\u578B\u4E3A\u5E03\u6717(Boolean)\u3002

color - method

fun color()

Change Records

v1.0.80 added

Function Illustrate

\u8BBE\u7F6E Resources \u7C7B\u578B\u4E3A\u989C\u8272(Color)\u3002

dimen - method

fun dimen()

Change Records

v1.0.80 added

Function Illustrate

\u8BBE\u7F6E Resources \u7C7B\u578B\u4E3A\u5C3A\u5BF8(Dimention)\u3002

drawable - method

fun drawable()

Change Records

v1.0.80 added

Function Illustrate

\u8BBE\u7F6E Resources \u7C7B\u578B\u4E3A Drawable\u3002

integer - method

fun integer()

Change Records

v1.0.80 added

Function Illustrate

\u8BBE\u7F6E Resources \u7C7B\u578B\u4E3A\u6574\u578B(Integer)\u3002

layout - method

fun layout()

Change Records

v1.0.80 added

Function Illustrate

\u8BBE\u7F6E Resources \u7C7B\u578B\u4E3A\u5E03\u5C40(Layout)\u3002

plurals - method

fun plurals()

Change Records

v1.0.80 added

Function Illustrate

\u8BBE\u7F6E Resources \u7C7B\u578B\u4E3A Plurals\u3002

string - method

fun string()

Change Records

v1.0.80 added

Function Illustrate

\u8BBE\u7F6E Resources \u7C7B\u578B\u4E3A\u5B57\u7B26\u4E32(String)\u3002

xml - method

fun xml()

Change Records

v1.0.80 added

Function Illustrate

\u8BBE\u7F6E Resources \u7C7B\u578B\u4E3A Xml\u3002

mipmap - method

fun mipmap()

Change Records

v1.0.80 added

Function Illustrate

\u8BBE\u7F6E Resources \u7C7B\u578B\u4E3A\u4F4D\u56FE(Mipmap)\u3002

array - method

fun array()

Change Records

v1.1.0 added

Function Illustrate

\u8BBE\u7F6E Resources \u7C7B\u578B\u4E3A\u6570\u7EC4(Array)\u3002

Result - class

inner class Result internal constructor()

Change Records

v1.0.80 added

Function Illustrate

\u76D1\u542C\u5168\u90E8 Hook \u7ED3\u679C\u5B9E\u73B0\u7C7B\uFF0C\u53EF\u5728\u8FD9\u91CC\u5904\u7406\u5931\u8D25\u4E8B\u4EF6\u76D1\u542C\u3002

result - method

inline fun result(initiate: Result.() -> Unit): Result

Change Records

v1.0.80 added

Function Illustrate

\u521B\u5EFA\u76D1\u542C\u4E8B\u4EF6\u65B9\u6CD5\u4F53\u3002

by - method

inline fun by(condition: () -> Boolean): Result

Change Records

v1.0.80 added

Function Illustrate

\u6DFB\u52A0\u6267\u884C Hook \u9700\u8981\u6EE1\u8DB3\u7684\u6761\u4EF6\uFF0C\u4E0D\u6EE1\u8DB3\u6761\u4EF6\u5C06\u76F4\u63A5\u505C\u6B62 Hook\u3002

onHookingFailure - method

fun onHookingFailure(result: (Throwable) -> Unit): Result

Change Records

v1.0.80 added

Function Illustrate

\u76D1\u542C Hook \u8FC7\u7A0B\u53D1\u751F\u9519\u8BEF\u7684\u56DE\u8C03\u65B9\u6CD5\u3002

ignoredHookingFailure - method

fun ignoredHookingFailure(): Result

Change Records

v1.0.80 added

Function Illustrate

\u5FFD\u7565 Hook \u8FC7\u7A0B\u51FA\u73B0\u7684\u9519\u8BEF\u3002

`,231),p=[l];function c(r,t){return n(),e("div",null,p)}const d=s(o,[["render",c],["__file","YukiResourcesHookCreator.html.vue"]]);export{d as default};