findField

fun String.findField(classLoader: ClassLoader = HookClassLoader.currentOrDefault(), findSuper: Boolean? = null, query: FieldQuery.() -> Unit): Field

按类名查找字段。

默认使用当前 hook 运行时的 ClassLoader,适合在 Xposed 模块里直接用目标类名查找。

Parameters

classLoader

用于加载目标类的 ClassLoader

findSuper

null 为智能查找,false 只查当前类,true 查当前类和全部父类

query

字段查询条件


fun Class<*>.findField(name: String, type: Class<*>? = null): Field

按名称查找实例字段。

Parameters

name

字段名

type

可选字段类型,用于进一步确认匹配结果


fun String.findField(fieldName: String, classLoader: ClassLoader = HookClassLoader.currentOrDefault(), type: Class<*>? = null): Field

按类名和字段名查找实例字段。

Parameters

fieldName

字段名

classLoader

用于加载目标类的 ClassLoader

type

可选字段类型,用于进一步确认匹配结果