mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-06 02:35:40 +08:00
Fix hookAllMethods/hookedAllConstructors unhook problem
This commit is contained in:
@@ -659,12 +659,16 @@ object YukiHookBridge {
|
|||||||
|
|
||||||
/** 解除 Hook */
|
/** 解除 Hook */
|
||||||
internal fun unhook() {
|
internal fun unhook() {
|
||||||
instance.unhook()
|
if (tag.isNotBlank()) runCatching {
|
||||||
runCatching {
|
if (hookedAllMethods.contains(tag))
|
||||||
if (tag.isNotBlank()) {
|
hookedAllMethods[tag]?.takeIf { it.isNotEmpty() }?.forEach { it.instance.unhook() }
|
||||||
hookedAllMethods.remove(tag)
|
if (hookedAllConstructors.contains(tag))
|
||||||
hookedAllConstructors.remove(tag)
|
hookedAllConstructors[tag]?.takeIf { it.isNotEmpty() }?.forEach { it.instance.unhook() }
|
||||||
} else hookedMembers.remove(this)
|
hookedAllMethods.remove(tag)
|
||||||
|
hookedAllConstructors.remove(tag)
|
||||||
|
} else {
|
||||||
|
instance.unhook()
|
||||||
|
runCatching { hookedMembers.remove(this) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user