简体   繁体   English

iPhone 3.0的转储框架不起作用?

[英]Dumping frameworks for iPhone 3.0 not working?

Hey I need some extra capabilities for my program and I would like to use some Undocumented APIs for my iPhone program. 嘿,我的程序需要一些额外的功能,我想为我的iPhone程序使用一些未公开的API。 I downloaded: DumpFrameworks as Dumpframeworks.pl and class-dump from : http://ericasadun.com/HeaderDumpKit/ 我下载了:DumpFrameworks作为Dumpframeworks.pl,并从以下网址下载了class-dump: http ://ericasadun.com/HeaderDumpKit/

I put DumpFrameworks.pl in Downloads and class-dump file in /usr/local/bin 我将DumpFrameworks.pl放在“下载”中,并将类转储文件放在/ usr / local / bin中

in the terminal I run: 在终端中,我运行:

$perl DumpFrameworks.pl

and some warnings and errors appeared: 并且出现了一些警告和错误:

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)

***But the most important thing, The script seems to fail in the end. ***但是最重要的是,脚本似乎最终还是失败了。

I got*** 我有***

(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)

I wonder What I am doing wrong here? 我想知道我在这里做错了什么吗? Do I need some additional settings? 我需要一些其他设置吗?

I am using Mac OS 10.6.1 and would like to dump 3.0 frameworks in first place but my real aim is 3.1 frameworks 我使用的是Mac OS 10.6.1,想首先转储3.0框架,但我的真正目标是3.1框架

Any help would be very appreciated. 任何帮助将不胜感激。

From my understanding of undocumented APIs they are there. 根据我对未公开的API的理解,它们在那里。 So in any app I could just call them. 因此,在任何应用程序中,我都可以调用它们。

From my understanding of class dumps, they are needed to discover undocumented APIs. 根据我对类转储的理解,需要使用它们来发现未记录的API。

In Sadun's book she says, here's an undocumented-API call this to use it, include this in the header. 她在Sadun的书中说,这是一个未记录的API调用,以使用它,并将其包含在标题中。 Then you could use it. 然后,您可以使用它。

My recommendation is don't use them. 我的建议是不要使用它们。

The version of class-dump included on Erica's site appears to be obsolete. 埃里卡(Erica)网站上包含的类转储版本似乎已过时。 A working version (as of iPhone OS 3.2, anyway) can be found here: http://www.codethecode.com/projects/class-dump/ 可以在以下位置找到有效的版本(无论如何为iPhone OS 3.2): http : //www.codethecode.com/projects/class-dump/

Note: The script will still fail after doing a few frameworks; 注意:在执行几个框架后,脚本仍将失败; rather than fix the script, you can just manually run class-dump on the frameworks you care about. 除了修复脚本之外,您还可以在自己关心的框架上手动运行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

I think I've used DumpFrameworks a total of once, so I'm not all that familiar with it or why it is failing. 我想我总共使用过DumpFrameworks一次,所以我并不十分熟悉它或失败的原因。 However, IIRC, it just makes it easy to dump the info found in the headers. 但是,IIRC仅使转储标头中的信息变得容易。

As to where the header files are, do more than just cut and paste a script. 至于头文件的位置,除了剪切和粘贴脚本外,还需要做更多的事情。 Look at what the script does. 一下脚本的作用。 It is clearly commented from whence it is pulling the public and private frameworks. 它从何处拉动了公共和私有框架,显然受到了评论。 Go to those directories, start drilling in, and you'll find the header files. 转到这些目录,开始钻取,您将找到头文件。

Include the frameworks in your project, import them where you wish to call the functions, and call the functions as they are listed in the headers. 在您的项目中包括框架,将它们导入到您希望调用函数的位置,并按照标题中列出的函数进行调用。

Just in case you are not aware, calling undocumented APIs is a good way to get your app rejected by Apple. 万一您不知道,调用未记录的API是使您的应用程序被Apple拒绝的好方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM