mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-04 09:45:19 +08:00
Modify remove args function in Param in YukiBridgeFactory
This commit is contained in:
@@ -380,7 +380,7 @@ class HookParam internal constructor(private val creatorInstance: YukiMemberHook
|
||||
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 (index > args.lastIndex) error("HookParam Method args index out of bounds, max is ${args.lastIndex}")
|
||||
param?.args(index, any)
|
||||
param?.args?.set(index, any)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -183,10 +183,6 @@ internal object YukiHookHelper {
|
||||
set(value) {
|
||||
this@compat.throwable = value
|
||||
}
|
||||
|
||||
override fun args(index: Int, value: Any?) {
|
||||
this@compat.args[index] = value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,12 +294,5 @@ internal abstract class YukiHookCallback(open val priority: Int) {
|
||||
* @throws Throwable
|
||||
*/
|
||||
var throwable: Throwable?
|
||||
|
||||
/**
|
||||
* 设置方法参数
|
||||
* @param index 数组下标
|
||||
* @param value 参数对象实例
|
||||
*/
|
||||
fun args(index: Int, value: Any?)
|
||||
}
|
||||
}
|
@@ -140,7 +140,7 @@ internal object AppParasitics {
|
||||
if (YukiHookAPI.Configs.isEnableHookSharedPreferences && type == HookEntryType.PACKAGE)
|
||||
YukiHookHelper.hook(ContextImplClass.method { name = "setFilePermissionsFromMode" }, object : YukiMemberHook() {
|
||||
override fun beforeHookedMember(param: Param) {
|
||||
if ((param.args?.get(0) as? String?)?.endsWith(suffix = "preferences.xml") == true) param.args(index = 1, value = 1)
|
||||
if ((param.args?.get(0) as? String?)?.endsWith(suffix = "preferences.xml") == true) param.args?.set(1, 1)
|
||||
}
|
||||
})
|
||||
if (YukiHookAPI.Configs.isEnableHookModuleStatus) classOf<YukiHookModuleStatus>(loader).apply {
|
||||
|
Reference in New Issue
Block a user