Skip to content

Conversation

@lukaskubanek
Copy link
Member

@lukaskubanek lukaskubanek commented Mar 25, 2025

  • ...
  • HookStrategy should define target properties (class, selector, scope)
  • HookStrategy.lookUpIMP() -> IMP?
  • Align handling of originalIMP
  • Hook: allow multiple apply() and revert() calls
  • KVO detection in ObjectHookStrategy
  • Hook: clean-up on deinit when not applied (to release the hookIMP)
  • Switch to static methods on Interpose

- Hook now stores a closure for lazily creating its strategy, replacing the unsafe approach with an implicitly unwrapped optional.
- Hook implementation is now created lazily at the point of applying a hook and released when a hook is reverted, managed in concrete hook strategies.
- Validation in HookStrategy is now performed in a separate step after initialization via `HookStrategy.validate()`.
- ObjectHookStrategy is now referenced weakly from its handle to prevent retain cycles.
- Removed hooks storage in legacy Interpose facade.
- AnyObject → NSObject
@lukaskubanek lukaskubanek marked this pull request as ready for review March 29, 2025 10:38
@lukaskubanek lukaskubanek merged commit 8d4bbb3 into main Mar 29, 2025
3 checks passed
@lukaskubanek lukaskubanek deleted the feature/hooks-refactor branch March 29, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants