Xcode添加SpringBoard–API Dylib

本文详细介绍了如何在Xcode中添加并使用SpringBoard API,包括导出SpringBoard路径、生成.h文件、复制相关库文件、导入动态库以及配置工程等步骤。同时提供了创建自定义模板的方法,并演示了如何将动态库添加到工程中,以及如何在SpringBoard中启用hook应用。

来自http://hi.baidu.com/jl1872002/item/a272619b8d7054bdcc80e561

Xcode添加SpringBoard–API

导出的时候注意一下SpringBoard的路径,我这里导出ios5.0的如下:

class-dump -H /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/CoreServices/SpringBoard.app -o /Users/x/Desktop/Spring

执行完命令之后就会生成.h文件了

然后把头文件拷贝到

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/SpringBoard/

然后把libsubstrate.dylib复制到:

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/

目录下。

至此导入完成,剩下的就是在工程中加入libsubstrate.dylib,引入头文件了。

xcode添加MobileSubstrateDylib开发模版这里没有测试成功,

方法:把MobileSubstrateDylib模版复制到

/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/Project Templates/Application目录下

然后新建工程即可看到MobileSubstrateDylib模版

之后的操作都一样。

编译好后,右键点击生成的app,选择显示包内容,给里面的程序添加后缀—.dylib,即:***.dylib
自己新建个后缀为.plist的同名文件,在里面添加要hook的应用

最后将dylib和同名的plist放到/Library/MobileSubstrate/DynamicLibraries目录下,重启springboard即可

iOS崩溃日志: Application Specific Information: Could not allocate memory. Thread 0 name: Dispatch queue: fmdb.<FMDatabaseQueue: 0x281b26580> Thread 0 Crashed: 0 libswiftCore.dylib 0x1d54294fc swift_slowAlloc.cold.1 + 16 1 libswiftCore.dylib 0x1d53912e0 swift_slowAlloc + 116 2 libswiftCore.dylib 0x1d5391464 swift_allocObject + 52 3 libswiftCore.dylib 0x1d53426c8 specialized static _DictionaryStorage.resize(original:capacity:move:) + 260 4 IPrinter 0x10304597c specialized _NativeDictionary._copyOrMoveAndResize(capacity:moveElements:) + 92 5 IPrinter 0x1031f3e24 closure #1 in DatabaseManager.query(table:condition:sort:) + 1864 6 IPrinter 0x1031f5b0c partial apply for closure #1 in DatabaseManager.query(table:condition:sort:) + 44 7 IPrinter 0x102dd87fc MoyaProvider.endpoint(_:) + 20 8 IPrinter 0x1031f1a7c thunk for @escaping @callee_guaranteed (@guaranteed FMDatabase, @unowned UnsafeMutablePointer<ObjCBool>) -> () + 44 9 IPrinter 0x10347569c __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke + 180 10 libdispatch.dylib 0x1e1f78780 _dispatch_client_callout + 16 11 libdispatch.dylib 0x1e1f5aa50 _dispatch_lane_barrier_sync_invoke_and_complete + 52 12 IPrinter 0x1034755c8 -[FMDatabaseQueue beginTransaction:withBlock:] + 112 13 IPrinter 0x1031f349c DatabaseManager.query(table:condition:sort:) + 384 14 IPrinter 0x103083a98 DatabaseManager.querySystemTemplateData(deviceType:lang:) + 352 15 IPrinter 0x103083b24 @objc DatabaseManager.querySystemTemplateData(deviceType:lang:) + 48 16 IPrinter 0x1028b2e18 +[SFPublicMethods getLocalSystemTemplateData] + 348 17 IPrinter 0x102d16b20 -[FHYAPP refreshLocalTemplateAndMaterialData] + 44 18 IPrinter 0x102c31e00 -[SFG10TabBarController updateStyleTypeNotification] + 52 19 CoreFoundation 0x1db1fc7d8 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 140 20 CoreFoundation 0x1db2990c0 ___CFXRegistrationPost_block_invoke + 84 21 CoreFoundation 0x1db27d8a8 _CFXRegistrationPost + 404 22 CoreFoundation 0x1db20feec _CFXNotificationPost + 680 23 Foundation 0x1d55a9fd4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88 24 IPrinter 0x102a12940 -[SFLPSettingViewController selectCell:] + 3616 25 UIKitCore 0x1ddf13a84 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:isCellMultiSelect:deselectPrevious:performCustomSelectionAction:] + 1228 帮我分析一下错误原因
最新发布
11-29
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值