mirror of
https://github.com/SnapEnhance/scripting-docs.git
synced 2026-08-30 20:24:23 +00:00
add unhook example
This commit is contained in:
@@ -142,12 +142,15 @@ module.onSnapActivity = () => {
|
||||
logInfo("Message constructor " + callback.thisObject)
|
||||
})
|
||||
|
||||
hooker.hook(
|
||||
val hookerUnhook = hooker.hook(
|
||||
hooker.findMethod("com.snapchat.client.network_api.NetworkApi$CppProxy", "submit"),
|
||||
"before",
|
||||
(callback) => {
|
||||
logInfo("NetworkApi submit " + callback.arg(0))
|
||||
}
|
||||
)
|
||||
|
||||
// unhook when needed using this call
|
||||
hookerUnhook();
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user