diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..44df830 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +.ipa filter=lfs diff=lfs merge=lfs -text +.framework filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bb7e956 --- /dev/null +++ b/.gitignore @@ -0,0 +1,60 @@ +# IPAPatch + +Temp/ + +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData/ + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata/ + +## Other +*.moved-aside +*.xccheckout +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa +*.dSYM.zip +*.dSYM + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output diff --git a/Assets/.gitkeep b/Assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Assets/Frameworks/.gitkeep b/Assets/Frameworks/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Assets/Frameworks/RevealServer.framework/Headers/RevealServer.h b/Assets/Frameworks/RevealServer.framework/Headers/RevealServer.h new file mode 100644 index 0000000..f6296a2 --- /dev/null +++ b/Assets/Frameworks/RevealServer.framework/Headers/RevealServer.h @@ -0,0 +1,19 @@ +// +// RevealServer.h +// RevealServer +// +// Created by Tony Arnold on 25/11/2015. +// Copyright © 2015 Itty Bitty Apps, Pty Ltd. All rights reserved. +// + +#import + +//! Project version number for RevealServer. +FOUNDATION_EXPORT double RevealServerVersionNumber; + +//! Project version string for RevealServer. +FOUNDATION_EXPORT const unsigned char RevealServerVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/Assets/Frameworks/RevealServer.framework/Info.plist b/Assets/Frameworks/RevealServer.framework/Info.plist new file mode 100644 index 0000000..2bb07d6 --- /dev/null +++ b/Assets/Frameworks/RevealServer.framework/Info.plist @@ -0,0 +1,52 @@ + + + + + BuildMachineOSBuild + 16B2555 + CFBundleDevelopmentRegion + en + CFBundleExecutable + RevealServer + CFBundleIdentifier + com.ittybittyapps.RevealServer + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + RevealServer + CFBundlePackageType + FMWK + CFBundleShortVersionString + 7 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + iPhoneOS + + CFBundleVersion + 9558 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 14C89 + DTPlatformName + iphoneos + DTPlatformVersion + 10.2 + DTSDKBuild + 14C89 + DTSDKName + iphoneos10.2 + DTXcode + 0821 + DTXcodeBuild + 8C1002 + MinimumOSVersion + 8.0 + UIDeviceFamily + + 1 + + + diff --git a/Assets/Frameworks/RevealServer.framework/Modules/module.modulemap b/Assets/Frameworks/RevealServer.framework/Modules/module.modulemap new file mode 100644 index 0000000..8b2d46c --- /dev/null +++ b/Assets/Frameworks/RevealServer.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module RevealServer { + umbrella header "RevealServer.h" + + export * + module * { export * } +} diff --git a/Assets/Frameworks/RevealServer.framework/RevealServer b/Assets/Frameworks/RevealServer.framework/RevealServer new file mode 100755 index 0000000..5cf6cf8 Binary files /dev/null and b/Assets/Frameworks/RevealServer.framework/RevealServer differ diff --git a/Assets/Frameworks/RevealServer.framework/Scripts/copy_and_codesign_revealserver.sh b/Assets/Frameworks/RevealServer.framework/Scripts/copy_and_codesign_revealserver.sh new file mode 100755 index 0000000..5be5670 --- /dev/null +++ b/Assets/Frameworks/RevealServer.framework/Scripts/copy_and_codesign_revealserver.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +set -o errexit +set -o nounset + +# Ensure that we have a valid OTHER_LDFLAGS environment variable +OTHER_LDFLAGS=${OTHER_LDFLAGS:=""} + +# Ensure that we have a valid REVEAL_SERVER_FILENAME environment variable +REVEAL_SERVER_FILENAME=${REVEAL_SERVER_FILENAME:="RevealServer.framework"} + +# Ensure that we have a valid REVEAL_SERVER_PATH environment variable +REVEAL_SERVER_PATH=${REVEAL_SERVER_PATH:="${SRCROOT}/${REVEAL_SERVER_FILENAME}"} + +# The path to copy the framework to +app_frameworks_dir="${CODESIGNING_FOLDER_PATH}/Frameworks" + +copy_library() { + mkdir -p "$app_frameworks_dir" + cp -vRf "$REVEAL_SERVER_PATH" "${app_frameworks_dir}/" +} + +codesign_library() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" ]; then + codesign -fs "${EXPANDED_CODE_SIGN_IDENTITY}" "${app_frameworks_dir}/${REVEAL_SERVER_FILENAME}" + fi +} + +main() { + if [[ $OTHER_LDFLAGS =~ "RevealServer" ]]; then + if [ -e "$REVEAL_SERVER_PATH" ]; then + copy_library + codesign_library + echo "${REVEAL_SERVER_FILENAME} is included in this build, and has been copied to $CODESIGNING_FOLDER_PATH" + else + echo "${REVEAL_SERVER_FILENAME} is not included in this build, as it could not be found at $REVEAL_SERVER_PATH" + fi + else + echo "${REVEAL_SERVER_FILENAME} is not included in this build because RevealServer was not present in the OTHER_LDFLAGS environment variable." + fi +} + +main diff --git a/Assets/Frameworks/RevealServer.framework/_CodeSignature/CodeResources b/Assets/Frameworks/RevealServer.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..43887a1 --- /dev/null +++ b/Assets/Frameworks/RevealServer.framework/_CodeSignature/CodeResources @@ -0,0 +1,166 @@ + + + + + files + + Headers/RevealServer.h + + e2S6Vuf8iJXurblvYWL8e3IMO7E= + + Info.plist + + mRYRWnn89cvA0oOFg/OtVl0TKqA= + + Modules/module.modulemap + + EuDEeG1dcC1sd+hIW2SkUAImUg8= + + Scripts/copy_and_codesign_revealserver.sh + + yB2zXTggmRD0rra2Hbpxn2zfCRo= + + + files2 + + Headers/RevealServer.h + + hash + + e2S6Vuf8iJXurblvYWL8e3IMO7E= + + hash2 + + i4zuiS2fsgwsoicYEzHuBx32JYfKW38gkopt/7FdINY= + + + Modules/module.modulemap + + hash + + EuDEeG1dcC1sd+hIW2SkUAImUg8= + + hash2 + + tstqiJpIPr4iEd3MDHClLuTB/ciSC/zNlke1AjfSVuU= + + + Scripts/copy_and_codesign_revealserver.sh + + hash + + yB2zXTggmRD0rra2Hbpxn2zfCRo= + + hash2 + + SL0x5cGSOyS1RcojHFEmFX5IDfon/vO37cFsjSIX7LA= + + + + rules + + ^ + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^ + + weight + 20 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/IPAPatch-DummyApp/AppDelegate.h b/IPAPatch-DummyApp/AppDelegate.h new file mode 100644 index 0000000..8d339f5 --- /dev/null +++ b/IPAPatch-DummyApp/AppDelegate.h @@ -0,0 +1,20 @@ +// +// AppDelegate.h +// IPAPatch-DummyApp +// +// Created by wutian on 2017/3/17. +// Copyright © 2017年 Weibo. All rights reserved. +// + +// ⚠️ Note: This is placeholder target for installing the ipa file +// DO NOT MODIFY. + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/IPAPatch-DummyApp/AppDelegate.m b/IPAPatch-DummyApp/AppDelegate.m new file mode 100644 index 0000000..153cfa1 --- /dev/null +++ b/IPAPatch-DummyApp/AppDelegate.m @@ -0,0 +1,20 @@ +// +// AppDelegate.m +// IPAPatch-DummyApp +// +// Created by wutian on 2017/3/17. +// Copyright © 2017年 Weibo. All rights reserved. +// + +// ⚠️ Note: This is placeholder target for installing the ipa file +// DO NOT MODIFY. + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +@end diff --git a/IPAPatch-DummyApp/Info.plist b/IPAPatch-DummyApp/Info.plist new file mode 100644 index 0000000..10a5324 --- /dev/null +++ b/IPAPatch-DummyApp/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + 💊 + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/IPAPatch-DummyApp/ProjectConfigurationWarning.cpp b/IPAPatch-DummyApp/ProjectConfigurationWarning.cpp new file mode 100644 index 0000000..d39b5f8 --- /dev/null +++ b/IPAPatch-DummyApp/ProjectConfigurationWarning.cpp @@ -0,0 +1,13 @@ +// +// ProjectConfigurationWarning.cpp +// IPAPatch +// +// Created by wutian on 2017/3/17. +// Copyright © 2017年 Weibo. All rights reserved. +// +// ⚠️ Note: This is placeholder target for installing the ipa file +// DO NOT MODIFY. + +#include "ProjectConfigurationWarning.hpp" + +// This file is only for warning generation of unconfiguration build settings. see "ProjectConfigurationWarning.hpp" diff --git a/IPAPatch-DummyApp/ProjectConfigurationWarning.hpp b/IPAPatch-DummyApp/ProjectConfigurationWarning.hpp new file mode 100644 index 0000000..93208d1 --- /dev/null +++ b/IPAPatch-DummyApp/ProjectConfigurationWarning.hpp @@ -0,0 +1,34 @@ +// +// ProjectConfigurationWarning.hpp +// IPAPatch +// +// Created by wutian on 2017/3/17. +// Copyright © 2017年 Weibo. All rights reserved. +// + +// ⚠️ Note: This is placeholder target for installing the ipa file +// DO NOT MODIFY. + +// This file is only for warning generation of unconfiguration build settings." + +#ifndef ProjectConfigurationWarning_hpp +#define ProjectConfigurationWarning_hpp + +#include + +// compares two strings in compile time constant fashion +constexpr bool strings_equal(char const * a, char const * b) { + return *a == *b && (*a == '\0' || strings_equal(a + 1, b + 1)); +} + +#define STRINGIZE(x) #x +#define STRINGIZE2(x) STRINGIZE(x) +#define TARGET_BUNDLE_ID_STRING STRINGIZE2(TARGET_BUNDLE_ID) + +static_assert(!strings_equal(TARGET_BUNDLE_ID_STRING, "com.wutian.example"), "You Should Update the BundleID in Build Settings before Patching"); + +// ⚠️ Note: "com.wutian.example" is placeholder bundleID for the result app, you should change it to your own and fixes the signing issues (if any), in the "IPAPatch-DummyApp - Project - General tab" +// ⚠️ Note: The BundleDisplayName of DummyApp will used as prefix of the final name. + + +#endif /* ProjectConfigurationWarning_hpp */ diff --git a/IPAPatch-DummyApp/main.m b/IPAPatch-DummyApp/main.m new file mode 100644 index 0000000..f67cb01 --- /dev/null +++ b/IPAPatch-DummyApp/main.m @@ -0,0 +1,16 @@ +// +// main.m +// IPAPatch-DummyApp +// +// Created by wutian on 2017/3/17. +// Copyright © 2017年 Weibo. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/IPAPatch.xcodeproj/project.pbxproj b/IPAPatch.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c9b7ef3 --- /dev/null +++ b/IPAPatch.xcodeproj/project.pbxproj @@ -0,0 +1,471 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + C64288391E7BF9E900C0BBB0 /* ProjectConfigurationWarning.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C64288371E7BF9E900C0BBB0 /* ProjectConfigurationWarning.cpp */; }; + C6B263271E7BC9DF009B4DEA /* IPAPatchEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = C6B263251E7BC9DF009B4DEA /* IPAPatchEntry.h */; }; + C6B263281E7BC9DF009B4DEA /* IPAPatchEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = C6B263261E7BC9DF009B4DEA /* IPAPatchEntry.m */; }; + C6B2634D1E7BCB31009B4DEA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C6B2634C1E7BCB31009B4DEA /* main.m */; }; + C6B263501E7BCB31009B4DEA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C6B2634F1E7BCB31009B4DEA /* AppDelegate.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + C6B263601E7BCC65009B4DEA /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C6B262FE1E7BC97B009B4DEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = C6B263061E7BC97B009B4DEA; + remoteInfo = IPAPatch; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + C64288371E7BF9E900C0BBB0 /* ProjectConfigurationWarning.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProjectConfigurationWarning.cpp; sourceTree = ""; }; + C64288381E7BF9E900C0BBB0 /* ProjectConfigurationWarning.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ProjectConfigurationWarning.hpp; sourceTree = ""; }; + C6B263071E7BC97B009B4DEA /* IPAPatch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = IPAPatch.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C6B2630B1E7BC97B009B4DEA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C6B263251E7BC9DF009B4DEA /* IPAPatchEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IPAPatchEntry.h; sourceTree = ""; }; + C6B263261E7BC9DF009B4DEA /* IPAPatchEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IPAPatchEntry.m; sourceTree = ""; }; + C6B263491E7BCB31009B4DEA /* IPAPatch-DummyApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "IPAPatch-DummyApp.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + C6B2634C1E7BCB31009B4DEA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + C6B2634E1E7BCB31009B4DEA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + C6B2634F1E7BCB31009B4DEA /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + C6B2635C1E7BCB31009B4DEA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C6B263621E7BCD03009B4DEA /* patch.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = patch.sh; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + C6B263031E7BC97B009B4DEA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C6B263461E7BCB31009B4DEA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + C6B262FD1E7BC97B009B4DEA = { + isa = PBXGroup; + children = ( + C6B263091E7BC97B009B4DEA /* IPAPatch */, + C6B263291E7BCA86009B4DEA /* Tools */, + C6B2634A1E7BCB31009B4DEA /* IPAPatch-DummyApp */, + C6B263081E7BC97B009B4DEA /* Products */, + ); + sourceTree = ""; + }; + C6B263081E7BC97B009B4DEA /* Products */ = { + isa = PBXGroup; + children = ( + C6B263071E7BC97B009B4DEA /* IPAPatch.framework */, + C6B263491E7BCB31009B4DEA /* IPAPatch-DummyApp.app */, + ); + name = Products; + sourceTree = ""; + }; + C6B263091E7BC97B009B4DEA /* IPAPatch */ = { + isa = PBXGroup; + children = ( + C6B2630B1E7BC97B009B4DEA /* Info.plist */, + C6B263251E7BC9DF009B4DEA /* IPAPatchEntry.h */, + C6B263261E7BC9DF009B4DEA /* IPAPatchEntry.m */, + ); + path = IPAPatch; + sourceTree = ""; + }; + C6B263291E7BCA86009B4DEA /* Tools */ = { + isa = PBXGroup; + children = ( + C6B263621E7BCD03009B4DEA /* patch.sh */, + ); + path = Tools; + sourceTree = ""; + }; + C6B2634A1E7BCB31009B4DEA /* IPAPatch-DummyApp */ = { + isa = PBXGroup; + children = ( + C6B2634E1E7BCB31009B4DEA /* AppDelegate.h */, + C6B2634F1E7BCB31009B4DEA /* AppDelegate.m */, + C64288381E7BF9E900C0BBB0 /* ProjectConfigurationWarning.hpp */, + C64288371E7BF9E900C0BBB0 /* ProjectConfigurationWarning.cpp */, + C6B2635C1E7BCB31009B4DEA /* Info.plist */, + C6B2634B1E7BCB31009B4DEA /* Supporting Files */, + ); + path = "IPAPatch-DummyApp"; + sourceTree = ""; + }; + C6B2634B1E7BCB31009B4DEA /* Supporting Files */ = { + isa = PBXGroup; + children = ( + C6B2634C1E7BCB31009B4DEA /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + C6B263041E7BC97B009B4DEA /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C6B263271E7BC9DF009B4DEA /* IPAPatchEntry.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + C6B263061E7BC97B009B4DEA /* IPAPatch */ = { + isa = PBXNativeTarget; + buildConfigurationList = C6B2631B1E7BC97B009B4DEA /* Build configuration list for PBXNativeTarget "IPAPatch" */; + buildPhases = ( + C6B263021E7BC97B009B4DEA /* Sources */, + C6B263031E7BC97B009B4DEA /* Frameworks */, + C6B263041E7BC97B009B4DEA /* Headers */, + C6B263051E7BC97B009B4DEA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = IPAPatch; + productName = IPAPatch; + productReference = C6B263071E7BC97B009B4DEA /* IPAPatch.framework */; + productType = "com.apple.product-type.framework"; + }; + C6B263481E7BCB31009B4DEA /* IPAPatch-DummyApp */ = { + isa = PBXNativeTarget; + buildConfigurationList = C6B2635D1E7BCB31009B4DEA /* Build configuration list for PBXNativeTarget "IPAPatch-DummyApp" */; + buildPhases = ( + C6B263451E7BCB31009B4DEA /* Sources */, + C6B263461E7BCB31009B4DEA /* Frameworks */, + C6B263471E7BCB31009B4DEA /* Resources */, + C6B263631E7BD0B4009B4DEA /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + C6B263611E7BCC65009B4DEA /* PBXTargetDependency */, + ); + name = "IPAPatch-DummyApp"; + productName = "IPAPatch-DummyApp"; + productReference = C6B263491E7BCB31009B4DEA /* IPAPatch-DummyApp.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C6B262FE1E7BC97B009B4DEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0830; + ORGANIZATIONNAME = Weibo; + TargetAttributes = { + C6B263061E7BC97B009B4DEA = { + CreatedOnToolsVersion = 8.3; + DevelopmentTeam = DMJXDB9H6Q; + ProvisioningStyle = Automatic; + }; + C6B263481E7BCB31009B4DEA = { + CreatedOnToolsVersion = 8.3; + DevelopmentTeam = DMJXDB9H6Q; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = C6B263011E7BC97B009B4DEA /* Build configuration list for PBXProject "IPAPatch" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = C6B262FD1E7BC97B009B4DEA; + productRefGroup = C6B263081E7BC97B009B4DEA /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C6B263481E7BCB31009B4DEA /* IPAPatch-DummyApp */, + C6B263061E7BC97B009B4DEA /* IPAPatch */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + C6B263051E7BC97B009B4DEA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C6B263471E7BCB31009B4DEA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + C6B263631E7BD0B4009B4DEA /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Tools/patch.sh\""; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + C6B263021E7BC97B009B4DEA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C6B263281E7BC9DF009B4DEA /* IPAPatchEntry.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C6B263451E7BCB31009B4DEA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C64288391E7BF9E900C0BBB0 /* ProjectConfigurationWarning.cpp in Sources */, + C6B263501E7BCB31009B4DEA /* AppDelegate.m in Sources */, + C6B2634D1E7BCB31009B4DEA /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + C6B263611E7BCC65009B4DEA /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C6B263061E7BC97B009B4DEA /* IPAPatch */; + targetProxy = C6B263601E7BCC65009B4DEA /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + C6B263191E7BC97B009B4DEA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + C6B2631A1E7BC97B009B4DEA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + C6B2631C1E7BC97B009B4DEA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = NO; + DEVELOPMENT_TEAM = DMJXDB9H6Q; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = IPAPatch/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.wutian.IPAPatch; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + C6B2631D1E7BC97B009B4DEA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = NO; + DEVELOPMENT_TEAM = DMJXDB9H6Q; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = IPAPatch/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.wutian.IPAPatch; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + C6B2635E1E7BCB31009B4DEA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++14"; + DEVELOPMENT_TEAM = DMJXDB9H6Q; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + "TARGET_BUNDLE_ID=$(PRODUCT_BUNDLE_IDENTIFIER)", + ); + INFOPLIST_FILE = "IPAPatch-DummyApp/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.wutian.example1; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + C6B2635F1E7BCB31009B4DEA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++14"; + DEVELOPMENT_TEAM = DMJXDB9H6Q; + GCC_PREPROCESSOR_DEFINITIONS = "TARGET_BUNDLE_ID=$(PRODUCT_BUNDLE_IDENTIFIER)"; + INFOPLIST_FILE = "IPAPatch-DummyApp/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.wutian.example1; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C6B263011E7BC97B009B4DEA /* Build configuration list for PBXProject "IPAPatch" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C6B263191E7BC97B009B4DEA /* Debug */, + C6B2631A1E7BC97B009B4DEA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C6B2631B1E7BC97B009B4DEA /* Build configuration list for PBXNativeTarget "IPAPatch" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C6B2631C1E7BC97B009B4DEA /* Debug */, + C6B2631D1E7BC97B009B4DEA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C6B2635D1E7BCB31009B4DEA /* Build configuration list for PBXNativeTarget "IPAPatch-DummyApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C6B2635E1E7BCB31009B4DEA /* Debug */, + C6B2635F1E7BCB31009B4DEA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = C6B262FE1E7BC97B009B4DEA /* Project object */; +} diff --git a/IPAPatch.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/IPAPatch.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..03316b5 --- /dev/null +++ b/IPAPatch.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/IPAPatch/IPAPatchEntry.h b/IPAPatch/IPAPatchEntry.h new file mode 100644 index 0000000..a9e6cc2 --- /dev/null +++ b/IPAPatch/IPAPatchEntry.h @@ -0,0 +1,13 @@ +// +// IPAPatchEntry.h +// IPAPatch +// +// Created by wutian on 2017/3/17. +// Copyright © 2017年 Weibo. All rights reserved. +// + +#import + +@interface IPAPatchEntry : NSObject + +@end diff --git a/IPAPatch/IPAPatchEntry.m b/IPAPatch/IPAPatchEntry.m new file mode 100644 index 0000000..648e9dc --- /dev/null +++ b/IPAPatch/IPAPatchEntry.m @@ -0,0 +1,37 @@ +// +// IPAPatchEntry.m +// IPAPatch +// +// Created by wutian on 2017/3/17. +// Copyright © 2017年 Weibo. All rights reserved. +// + +#import "IPAPatchEntry.h" +#import + +#include "dlfcn.h" + +@implementation IPAPatchEntry + ++ (void)load +{ + // DO YOUR WORKS... + + // For Example: + [self for_example_showAlert]; +} + ++ (void)for_example_showAlert +{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + UIAlertController * alertController = [UIAlertController alertControllerWithTitle:@"Hacked" message:@"Hacked with IPAPatch" preferredStyle:UIAlertControllerStyleAlert]; + [alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:NULL]]; + UIViewController * controller = [UIApplication sharedApplication].keyWindow.rootViewController; + while (controller.presentedViewController) { + controller = controller.presentedViewController; + } + [controller presentViewController:alertController animated:YES completion:NULL]; + }); +} + +@end diff --git a/IPAPatch/Info.plist b/IPAPatch/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/IPAPatch/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c655ac2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +This project is licensed under the MIT license. + +Copyright (c) 2017-present Wu Tian . + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..150b172 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +![IPAPatch Hero](http://wx1.sinaimg.cn/large/bebedbb5ly1fdrazk5s6kj20xr0gjwh4.jpg) + diff --git a/Tools/optool b/Tools/optool new file mode 100755 index 0000000..981deeb Binary files /dev/null and b/Tools/optool differ diff --git a/Tools/patch.sh b/Tools/patch.sh new file mode 100755 index 0000000..141ca28 --- /dev/null +++ b/Tools/patch.sh @@ -0,0 +1,148 @@ +#!/bin/sh + +# patch.sh +# IPAPatch +# +# Created by wutian on 2017/3/17. +# Copyright © 2017年 Weibo. All rights reserved. + +TEMP_PATH="${SRCROOT}/Temp" +ASSETS_PATH="${SRCROOT}/Assets" +TARGET_IPA_PATH="${ASSETS_PATH}/app.ipa" +FRAMEWORKS_TO_INJECT_PATH="${ASSETS_PATH}/Frameworks" + +TEMP_APP_PATH="" # To be found in Step 1 +TARGET_APP_PATH="" # To be found in Step 2 +DUMMY_DISPLAY_NAME="" # To be found in Step 2 +TARGET_APP_FRAMEWORKS_PATH="" # To be found in Step 4 + + + +# --------------------------------------------------- +# 0. Prepare Working Enviroment + +rm -rf "$TEMP_PATH" || true +mkdir -p "$TEMP_PATH" || true + + +# --------------------------------------------------- +# 1. Extract Target IPA + +unzip -oqq "$TARGET_IPA_PATH" -d "$TEMP_PATH" +TEMP_APP_PATH=$(set -- "$TEMP_PATH/Payload/"*.app; echo "$1") +echo "TEMP_APP_PATH: $TEMP_APP_PATH" + + + + +# --------------------------------------------------- +# 2. Overwrite DummyApp IPA with Target App Contents + +TARGET_APP_PATH="$BUILT_PRODUCTS_DIR/$TARGET_NAME.app" +echo "TARGET_APP_PATH: $TARGET_APP_PATH" + +DUMMY_DISPLAY_NAME=$(/usr/libexec/PlistBuddy -c "Print CFBundleDisplayName" "${SRCROOT}/$TARGET_NAME/Info.plist") +echo "DUMMY_DISPLAY_NAME: $DUMMY_DISPLAY_NAME" + +rm -rf "$TARGET_APP_PATH" || true +mkdir -p "$TARGET_APP_PATH" || true +cp -rf "$TEMP_APP_PATH/" "$TARGET_APP_PATH/" + + + + +# --------------------------------------------------- +# 3. Inject the Executable We Wrote and Built (IPAPatch.framework) + +APP_BINARY=`plutil -convert xml1 -o - $TARGET_APP_PATH/Info.plist|grep -A1 Exec|tail -n1|cut -f2 -d\>|cut -f1 -d\<` +OPTOOL="${SRCROOT}/Tools/optool" + +mkdir "$TARGET_APP_PATH/Dylibs" +cp "$BUILT_PRODUCTS_DIR/IPAPatch.framework/IPAPatch" "$TARGET_APP_PATH/Dylibs/IPAPatch" +for file in `ls -1 $TARGET_APP_PATH/Dylibs`; do + echo -n ' ' + echo "Install Load: $file -> @executable_path/Dylibs/$file" + $OPTOOL install -c load -p "@executable_path/Dylibs/$file" -t $TARGET_APP_PATH/$APP_BINARY >& /dev/null +done + +chmod +x "$TARGET_APP_PATH/$APP_BINARY" + + + + +# --------------------------------------------------- +# 4. Inject External Frameworks if Exists + +TARGET_APP_FRAMEWORKS_PATH="$BUILT_PRODUCTS_DIR/$TARGET_NAME.app/Frameworks" + +echo "Injecting Frameworks from $FRAMEWORKS_TO_INJECT_PATH" +for file in `ls -1 ${FRAMEWORKS_TO_INJECT_PATH}`; do + extension="${file##*.}" + echo "$file 's extension is $extension" + + if [ "$extension" != "framework" ] + then + continue + fi + + filename="${file%.*}" + + cp "$FRAMEWORKS_TO_INJECT_PATH/$file/$filename" "$TARGET_APP_PATH/Dylibs/$filename" + + echo -n ' ' + echo "Install Load: $file -> @executable_path/Dylibs/$filename" + $OPTOOL install -c load -p "@executable_path/Dylibs/$filename" -t $TARGET_APP_PATH/$APP_BINARY >& /dev/null +done + + + + +# --------------------------------------------------- +# 5. Remove Plugins (AppExtensions), To Simplify the Signing Process + +rm -rf "$TARGET_APP_PATH/PlugIns" || true + + + + +# --------------------------------------------------- +# 7. Update Info.plist for Target App + +TARGET_BUNDLE_ID="$PRODUCT_BUNDLE_IDENTIFIER" +TARGET_DISPLAY_NAME=$(/usr/libexec/PlistBuddy -c "Print CFBundleDisplayName" "$TARGET_APP_PATH/Info.plist") +TARGET_DISPLAY_NAME="$DUMMY_DISPLAY_NAME$TARGET_DISPLAY_NAME" + +/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier $PRODUCT_BUNDLE_IDENTIFIER" "$TARGET_APP_PATH/Info.plist" +/usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName $TARGET_DISPLAY_NAME" "$TARGET_APP_PATH/Info.plist" + + + +# --------------------------------------------------- +# 8. Code Sign All The Things + +for DYLIB in "$TARGET_APP_PATH/Dylibs/"* +do + FILENAME=$(basename $DYLIB) + /usr/bin/codesign --force --sign "$EXPANDED_CODE_SIGN_IDENTITY" "$DYLIB" +done + +if [ -d "$TARGET_APP_FRAMEWORKS_PATH" ]; then +for FRAMEWORK in "$TARGET_APP_FRAMEWORKS_PATH/"* +do + FILENAME=$(basename $FRAMEWORK) + /usr/bin/codesign --force --sign "$EXPANDED_CODE_SIGN_IDENTITY" "$FRAMEWORK" +done +fi + +/usr/bin/codesign --force --sign "$EXPANDED_CODE_SIGN_IDENTITY" --timestamp=none "$TARGET_APP_PATH/$APP_BINARY" + + + + +# --------------------------------------------------- +# 9. Install +# +# Nothing To Do, Xcode Will Automatically Install the DummyApp We Overwrited + + +