Patch iOS Apps, The Easy Way, Without Jailbreak.

IPAPatch provide a simple way to patch iOS Apps, without needing to jailbreak.
[Features • Instructions • Example • FAQ • License ]
Features
IPAPatch includes an template Xcode project, that provides following features:
- Build & Run third-party ipa with your code injected
- Step-by-step Debugging with lldb
> Debugging Youtube with Xcode > >
- Link external frameworks
- Generate distributable .ipa files
> Modified version of Facebook.ipa created by IPAPatch > >
Instructions
- Clone or Download This Project
- Prepare Decrypted IPA File
- Replace Placeholder IPA
IPAPatch/Assets/app.ipa with yours, this is a placeholder file. The filename should remain app.ipa after replacing.
- Place External Resources/Frameworks (Optional)
IPAPatch/Assets/Frameworks folder.
- Frameworks will be linked automatically.
- For example IPAPatch/Assets/Frameworks/RevealServer.framework
- Dynamic Libraries:
- External dynamic libraries can be placed at IPAPatch/Assets/Dylibs folder.
- Libraries will be linked automatically
- Resources/Bundles:
- Other resources or bundles can be placed at IPAPatch/Assets/Resources
- Resources will be copied directly to the main bundle of original app
- Configure Build Settings
IPAPatch.xcodeproj
- In the Project Editor, Select Target IPAPatch-DummyApp
- Display Name defaults to "๐", this is used as prefix of the final display name.
- Change Bundle Identifier to match your provisioning profiles
- Fix signing issues if any.
- Configure IPPatch Options
Tools/options.plist
| Name | Description | Default |
| --- | --- | --- |
| RESTORE_SYMBOLS | When YES, IPAPatch will try to restore symbol table from Mach-O for debugging propose (with tools from https://github.com/tobefuturer/restore-symbol, also thanks to @henrayluo and @dannion) | NO |
| CREATEIPAFILE | When YES, IPAPatch will generate a ipa file on each build. Genrated file is located at SRCROOT/Product | NO |
| IGNOREUISUPPORTED_DEVICES | When YES, IPAPatch will delete UISupportedDevices from source app's Info.plist | NO |
| REMOVE_WATCHPLACEHOLDER | When YES, IPAPatch will remove com.apple.WatchPlaceholder folder from source app's bundle | YES |
| USEORIGINALENTITLEMENTS | When YES, IPAPatch will use source app's entitlements to resign, you need to make sure your Provisioning Profile matches the entitlements, or you need to disable AMFI on target device | NO |
- Code Your Patch
+[IPAPatchEntry load], you can write code start from here. To change apps' behavior, You may need to use some method swizzling library, such as steipete/Aspects.
- Build and Run
Example
I created some demo project, which shows you how to use IPAPatch:
- Reveal + Youtube:
- Cycript + Youtube (Idea from @phpmaple):
FAQ
- Q: Library not loaded with reason:
mach-o, but wrong architecture?
IPAPatch target's Valid Architectures to match your ipa binary's architecture.
- Q: process launch failed: Unspecified (Disabled) ?
- Q: dyld: Symbol not found: XXX, Referenced from: XXX, Expected in: XXX/libswiftXXX.dylib
License
IPAPatch
IPAPatch is licensed under the MIT license. Copyright (c) 2017-present Wu Tian
OPTOOL
Copyright (c) 2014, Alex Zielenski All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
fishhook
Copyright (c) 2013, Facebook, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name Facebook nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.