You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README-legacy.md
-19Lines changed: 0 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,28 +29,9 @@ UIKit and AppKit won't go away, and the bugs won't go away either. I see this as
29
29
### Can I ship this?
30
30
Yes, absolutely. The goal for this one project is a simple library that doesn't try to be too smart. I did this in [Aspects](https://github.com/steipete/Aspects) and while I loved this to no end, it's problematic and can cause side-effects with other code that tries to be clever. InterposeKit is boring, so you don't have to worry about conditions like "We added New Relic to our app and now [your thing crashes](https://github.com/steipete/Aspects/issues/21)".
31
31
32
-
### It does not do X!
33
-
Pull Requests welcome! You might wanna open a draft before to lay out what you plan, I want to keep the feature-set minimal so it stays simple and no-magic.
34
-
35
-
## Installation
36
-
37
-
Building InterposeKit requires Xcode 15+ or a Swift 5.9+ toolchain with the Swift Package Manager.
38
-
39
-
### Swift Package Manager
40
-
41
-
Add `.package(url: "https://github.com/steipete/InterposeKit.git", from: "0.0.1")` to your
42
-
`Package.swift` file's `dependencies`.
43
-
44
32
## Improvement Ideas
45
33
46
34
- Write proposal to allow to [convert the calling convention of existing types](https://twitter.com/steipete/status/1266799174563041282?s=21).
47
35
- Use the C block struct to perform type checking between Method type and C type (I do that in [Aspects library](https://github.com/steipete/Aspects)), it's still a runtime crash but could be at hook time, not when we call it.
48
36
- Add a way to get all current hooks from an object/class.
49
-
- Add a way to revert hooks without super helper.
50
-
- Add a way to apply multiple hooks to classes
51
-
- Enable hooking of class methods.
52
-
- Add [dyld_dynamic_interpose](https://twitter.com/steipete/status/1258482647933870080) to hook pure C functions
53
-
- Combine Promise-API for `Interpose.whenAvailable` for better error bubbling.
54
-
- Experiment with [Swift function hooking](https://github.com/rodionovd/SWRoute/wiki/Function-hooking-in-Swift)? ⚡️
55
-
- Test against Swift Nightly as Cron Job
56
37
- Switch to Trampolines to manage cases where other code overrides super, so we end up with a super call that's [not on top of the class hierarchy](https://github.com/steipete/InterposeKit/pull/15#discussion_r439871752).
Copy file name to clipboardExpand all lines: README.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -152,6 +152,22 @@ Compared to the [original implementation](https://github.com/steipete/InterposeK
152
152
- Fixed a crash where `IKTAddSuperImplementationToClass` was stripped in release builds per [steipete/InterposeKit#29](https://github.com/steipete/InterposeKit/issues/29) by using the fix from [steipete/InterposeKit#30](https://github.com/steipete/InterposeKit/issues/30) submitted by @Thomvis, which replaces a call via dynamic library with a direct Swift call to `IKTSuperBuilder.addSuperInstanceMethod(to:selector:)`.
153
153
- Fixed floating-point register handling on arm64 using the patch from [steipete/InterposeKit#37](https://github.com/steipete/InterposeKit/issues/37) submitted by @ishutinvv, which resolves an issue affecting swizzled methods with `CGFloat` parameters or structs like `CGPoint` and `CGRect` due to floating-point registers not being restored in the correct order after the trampoline call.
154
154
155
+
## Q&A
156
+
157
+
### Why did Peter call it InterposeKit?
158
+
### Why another Objective-C swizzling library?
159
+
### Can I hook pure C functions or Swift methods?
160
+
161
+
No. Peter had plans to experiment with [Swift method hooking](https://github.com/rodionovd/SWRoute) and hooking C functions via [`dyld_dynamic_interpose`](https://twitter.com/steipete/status/1258482647933870080), but neither made it into the library. And honestly, it doesn’t really fit the scope of this library anyway.
162
+
163
+
### What the fork?
164
+
### Can I ship this?
165
+
166
+
## Improvement Ideas
167
+
168
+
- Signature type checking at hook construction
169
+
- Add support for reverting multiple hooks on a class in arbitrary order
170
+
155
171
## References
156
172
157
173
-[Peter’s original implementation](https://github.com/steipete/InterposeKit)
0 commit comments