mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-04 09:45:19 +08:00
Modify change YukiHookCallback.Param setArgs to args in YukiBridgeFactory
This commit is contained in:
@@ -352,7 +352,7 @@ class HookParam internal constructor(private val createrInstance: YukiMemberHook
|
|||||||
if (index < 0) error("HookParam Method args index must be >= 0")
|
if (index < 0) error("HookParam Method args index must be >= 0")
|
||||||
if (args.isEmpty()) error("HookParam Method args is empty, mabe not has args")
|
if (args.isEmpty()) error("HookParam Method args is empty, mabe not has args")
|
||||||
if (index > args.lastIndex) error("HookParam Method args index out of bounds, max is ${args.lastIndex}")
|
if (index > args.lastIndex) error("HookParam Method args index out of bounds, max is ${args.lastIndex}")
|
||||||
param?.setArgs(index, any)
|
param?.args(index, any)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -184,8 +184,8 @@ internal object YukiHookHelper {
|
|||||||
this@compat.throwable = value
|
this@compat.throwable = value
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setArgs(index: Int, any: Any?) {
|
override fun args(index: Int, value: Any?) {
|
||||||
this@compat.args[index] = any
|
this@compat.args[index] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun invokeOriginalMember(member: Member, vararg args: Any?) =
|
override fun invokeOriginalMember(member: Member, vararg args: Any?) =
|
||||||
@@ -305,9 +305,9 @@ internal abstract class YukiHookCallback(open val priority: Int) {
|
|||||||
/**
|
/**
|
||||||
* 设置方法参数
|
* 设置方法参数
|
||||||
* @param index 数组下标
|
* @param index 数组下标
|
||||||
* @param any 参数对象实例
|
* @param value 参数对象实例
|
||||||
*/
|
*/
|
||||||
fun setArgs(index: Int, any: Any?)
|
fun args(index: Int, value: Any?)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行原始 [Member]
|
* 执行原始 [Member]
|
||||||
|
@@ -133,7 +133,7 @@ internal object AppParasitics {
|
|||||||
if (YukiHookAPI.Configs.isEnableHookSharedPreferences && type == HookEntryType.PACKAGE)
|
if (YukiHookAPI.Configs.isEnableHookSharedPreferences && type == HookEntryType.PACKAGE)
|
||||||
YukiHookHelper.hook(ContextImplClass.method { name = "setFilePermissionsFromMode" }, object : YukiMemberHook() {
|
YukiHookHelper.hook(ContextImplClass.method { name = "setFilePermissionsFromMode" }, object : YukiMemberHook() {
|
||||||
override fun beforeHookedMember(param: Param) {
|
override fun beforeHookedMember(param: Param) {
|
||||||
if ((param.args?.get(0) as? String?)?.endsWith(suffix = "preferences.xml") == true) param.setArgs(index = 1, any = 1)
|
if ((param.args?.get(0) as? String?)?.endsWith(suffix = "preferences.xml") == true) param.args(index = 1, value = 1)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (YukiHookAPI.Configs.isEnableHookModuleStatus) classOf<YukiHookModuleStatus>(loader).apply {
|
if (YukiHookAPI.Configs.isEnableHookModuleStatus) classOf<YukiHookModuleStatus>(loader).apply {
|
||||||
|
Reference in New Issue
Block a user