Build an open-source version of WebKit and replace it system-wide on iOS jailbroken devices.
- Mobile Safari
- 3rd-party browsers (e.g. Chrome, Firefox, Edge)
-
WKWebView -
UIWebView(i.e.WebKitLegacy)
| WebKit Tag | Tested on iOS | Xcode Version | iOS SDK Version | Patch File |
|---|---|---|---|---|
| releases/Apple/Safari-16.1-iOS-16.1 (cherry-picks required) | 16.1 | 14.1 | 16.1 | webkit_iOS_16.3.1-worktree-20260412-004539.patch |
| 16.1.1 | ||||
| 16.1.2 | ||||
| releases/Apple/Safari-16.2-iOS-16.2 | 16.2 | 14.2 | 16.2 | |
| releases/Apple/Safari-16.3-iOS-16.3.1 | 16.3.1 | |||
| releases/Apple/Safari-16.4-iOS-16.4.1 | 16.4.1 | 14.3.1 | 16.4 | webkit_iOS_16.4.1-worktree-20260411-143740.patch |
| releases/Apple/Safari-16.5-iOS-16.5 | 16.5 | |||
| 16.5.1 |
- We need to patch dyld to allow
DYLD_FRAMEWORK_PATHto work on top of DSC - Check out source code of WebKit and apply patches
- Compile WebKit with the following command:
Tools/Scripts/build-webkit --ios-device --release --use-ccache \
WK_USE_CCACHE=YES \
ARCHS='arm64 arm64e' \
ONLY_ACTIVE_ARCH=NO \
GCC_TREAT_WARNINGS_AS_ERRORS=NO \
OTHER_CFLAGS='$(inherited) -Wno-error' \
OTHER_CPLUSPLUSFLAGS='$(inherited) -Wno-error'- Push compiled frameworks to
/Library/Frameworksor$JBROOT/Library/Frameworks(RootHide).
Use User-Agent to verify that replaced WebKit is active:
- Build/apply the patch and deploy frameworks to target device.
- Open Safari (or any
WKWebViewhost app) and visit a UA echo page (for example:https://httpbin.org/user-agent). - Confirm the returned
User-AgentcontainsWKDebugUA/1.0.
If WKDebugUA/1.0 is present, traffic is using the replaced WebKit build from this repo.
When building releases/Apple/Safari-16.1-iOS-16.1 for iOS device, apply these 4 commits first:
git cherry-pick --no-gpg-sign \
21349d858b6b \
60cfd7b1e096 \
b594a5e7e91a \
d09b8b302cadIf build fails with 'objc/objc-runtime.h' file not found, run:
sudo Tools/Scripts/configure-xcode-for-embedded-developmentIf you want to increase compile/build parallelism globally in Xcode, run:
defaults write com.apple.dt.Xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks 48
defaults write com.apple.Xcode PBXNumberOfParallelBuildSubtasks 48What they do:
IDEBuildOperationMaxNumberOfConcurrentCompileTasks: controls the max number of concurrent compile tasks.PBXNumberOfParallelBuildSubtasks: controls the number of parallel PBX build subtasks in the build graph.
Notes:
- These are global user defaults and affect Xcode-driven builds on this machine.
- Restart Xcode after changing these values.
- To restore defaults:
defaults delete com.apple.dt.Xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks
defaults delete com.apple.Xcode PBXNumberOfParallelBuildSubtasks