mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-06 18:55:35 +08:00
Merge code
This commit is contained in:
@@ -472,21 +472,21 @@ class YukiHookCreater(private val packageParam: PackageParam, private val hookCl
|
|||||||
HookMemberMode.HOOK_ALL_METHODS ->
|
HookMemberMode.HOOK_ALL_METHODS ->
|
||||||
if (isReplaceHookMode)
|
if (isReplaceHookMode)
|
||||||
XposedBridge.hookAllMethods(hookClass.instance, allMethodsName, replaceMent).also {
|
XposedBridge.hookAllMethods(hookClass.instance, allMethodsName, replaceMent).also {
|
||||||
if (it.isEmpty()) throw NoSuchMethodError("No method name \"$allMethodsName\" matched")
|
if (it.isEmpty()) throw NoSuchMethodError("No Method name \"$allMethodsName\" matched")
|
||||||
else it.forEach { e -> onHookedCallback?.invoke(e.hookedMethod) }
|
else it.forEach { e -> onHookedCallback?.invoke(e.hookedMethod) }
|
||||||
}
|
}
|
||||||
else XposedBridge.hookAllMethods(hookClass.instance, allMethodsName, beforeAfterHook).also {
|
else XposedBridge.hookAllMethods(hookClass.instance, allMethodsName, beforeAfterHook).also {
|
||||||
if (it.isEmpty()) throw NoSuchMethodError("No method name \"$allMethodsName\" matched")
|
if (it.isEmpty()) throw NoSuchMethodError("No Method name \"$allMethodsName\" matched")
|
||||||
else it.forEach { e -> onHookedCallback?.invoke(e.hookedMethod) }
|
else it.forEach { e -> onHookedCallback?.invoke(e.hookedMethod) }
|
||||||
}
|
}
|
||||||
HookMemberMode.HOOK_ALL_CONSTRUCTORS ->
|
HookMemberMode.HOOK_ALL_CONSTRUCTORS ->
|
||||||
if (isReplaceHookMode)
|
if (isReplaceHookMode)
|
||||||
XposedBridge.hookAllConstructors(hookClass.instance, replaceMent).also {
|
XposedBridge.hookAllConstructors(hookClass.instance, replaceMent).also {
|
||||||
if (it.isEmpty()) throw NoSuchMethodError("No constructor matched")
|
if (it.isEmpty()) throw NoSuchMethodError("No Constructor matched")
|
||||||
else it.forEach { e -> onHookedCallback?.invoke(e.hookedMethod) }
|
else it.forEach { e -> onHookedCallback?.invoke(e.hookedMethod) }
|
||||||
}
|
}
|
||||||
else XposedBridge.hookAllConstructors(hookClass.instance, beforeAfterHook).also {
|
else XposedBridge.hookAllConstructors(hookClass.instance, beforeAfterHook).also {
|
||||||
if (it.isEmpty()) throw NoSuchMethodError("No constructor matched")
|
if (it.isEmpty()) throw NoSuchMethodError("No Constructor matched")
|
||||||
else it.forEach { e -> onHookedCallback?.invoke(e.hookedMethod) }
|
else it.forEach { e -> onHookedCallback?.invoke(e.hookedMethod) }
|
||||||
}
|
}
|
||||||
else -> error("Hooked got a no error possible")
|
else -> error("Hooked got a no error possible")
|
||||||
|
Reference in New Issue
Block a user