-1

嘿,我的程序需要一些额外的功能,我想为我的 iPhone 程序使用一些未记录的 API。我下载了:DumpFrameworks as Dumpframeworks.pl 和 class-dump 来自:http ://ericasadun.com/HeaderDumpKit/

我将 DumpFrameworks.pl 放在 Downloads 中,并将 class-dump 文件放在 /usr/local/bin 中

在我运行的终端中:

$perl DumpFrameworks.pl

并出现了一些警告和错误:

Framework: Accelerate
2009-09-30 08:39:58.776 class-dump[466:903] Warning: This file does not contain any Objective-C runtime information.
Framework: ApplicationServices
2009-09-30 08:40:00.443 class-dump[473:903] Couldn't read file: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/ApplicationServices.framework/ApplicationServices
2009-09-30 08:40:00.449 class-dump[473:903] Couldn't read file: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/ApplicationServices.framework/ApplicationServices
class-dump: Input file (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/ApplicationServices.framework/ApplicationServices) is neither a Mach-O file nor a fat archive. 
... etc (above warnings are very common when I run the perl script)

***但最重要的是,脚本最终似乎失败了。

我有***

(after several warnings like above)
Framework: WebKit
    2009-09-30 08:40:24.228 class-dump[662:903] caught exception: expected (many things), got 260
    2009-09-30 08:40:24.232 class-dump[662:903] type: ^{WebDocumentLoaderMac=^^?iB^{Frame}{RefPtr<WebCore::MainResourceLoader>="m_ptr"^{MainResourceLoader}}{HashSet<WTF::RefPtr<WebCore::ResourceLoader>,WTF::PtrHash<WTF::RefPtr<WebCore::ResourceLoader> >,WTF::HashTraits<WTF::RefPtr<WebCore::ResourceLoader> > >="m_impl"{HashTable<WTF::RefPtr<WebCore::ResourceLoader>,WTF::RefPtr<WebCore::ResourceLoader>,WTF::IdentityExtractor<WTF::RefPtr<WebCore::ResourceLoader> >,WTF::PtrHash<WTF ... etc (I got many many lines of this kind of code in WebCore framework)

我想知道我在这里做错了什么?我需要一些额外的设置吗?

我正在使用 Mac OS 10.6.1 并想首先转储 3.0 框架,但我的真正目标是 3.1 框架

任何帮助将不胜感激。

4

3 回答 3

1

根据我对未记录 API 的理解,它们就在那里。所以在任何应用程序中我都可以调用它们。

根据我对类转储的理解,需要它们来发现未记录的 API。

她说,在萨顿的书中,这是一个未记录的 API 调用来使用它,将其包含在标题中。那你就可以用了。

我的建议是不要使用它们。

于 2009-09-30T00:20:52.450 回答
1

Erica 网站上包含的 class-dump 版本似乎已过时。可以在此处找到工作版本(从 iPhone OS 3.2 开始):http: //www.codethecode.com/projects/class-dump/

注意:在做了几个框架后,脚本仍然会失败;而不是修复脚本,您可以在您关心的框架上手动运行 class-dump。

IE:

cd /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/UIKit.framework
class-dump UIKit -H -o ~/temp/Headers/UIKit
于 2010-08-25T04:02:19.593 回答
0

我想我总共使用过一次 DumpFrameworks,所以我不太熟悉它或者它为什么会失败。然而,IIRC,它只是让转储在标题中找到的信息变得容易。

至于头文件在哪里,不仅仅是剪切和粘贴脚本。看看脚本做了什么。清楚地评论了它从哪里拉公共和私人框架。转到这些目录,开始钻取,您会找到头文件。

在您的项目中包含框架,将它们导入您希望调用函数的位置,然后调用标题中列出的函数。

以防万一您不知道,调用未记录的 API 是让您的应用被 Apple 拒绝的好方法。

于 2009-09-30T05:41:08.220 回答