views:

748

answers:

4

Hey I need some extra capabilities for my program and I would like to use some Undocumented APIs for my iPhone program. I downloaded: DumpFrameworks as Dumpframeworks.pl and class-dump from : http://ericasadun.com/HeaderDumpKit/

I put DumpFrameworks.pl in Downloads and class-dump file in /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

Any help would be very appreciated.

+1  A: 

From my understanding of undocumented APIs they are there. So in any app I could just call them.

From my understanding of class dumps, they are needed to discover undocumented APIs.

In Sadun's book she says, here's an undocumented-API call this to use it, include this in the header. Then you could use it.

My recommendation is don't use them.

JoePasq
How can I just call them?I also want to include the headers, but where they are? I think they are not. That is why I am trying to do what I am trying to do. ;)
nacho4d
You don't include the headers you get from Class dump. You expose the undocumented API in a header you write for yourself, usually using categories. There is a very big difference to undocumented API and *private* API. You should never use the latter. Your app will not get approved if Apple discover that you use private API.
Jasarien
#import "Celestial.h"imports celestial, now I can call it. You just have to know the class header and info (methods, ivars)
JoePasq
I see... there is no neccessity of dumping nothing right? I just need to know the header name and use it as it were documented. I am ok?
nacho4d
A: 

I think I've used DumpFrameworks a total of once, so I'm not all that familiar with it or why it is failing. However, IIRC, it just makes it easy to dump the info found in the headers.

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.

mikestew
A: 

I have the same problem. Did anyone find a fix for this?

Bog
A: 

The version of class-dump included on Erica's site appears to be obsolete. A working version (as of iPhone OS 3.2, anyway) can be found here: 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.

ie:

cd /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/UIKit.framework
class-dump UIKit -H -o ~/temp/Headers/UIKit
colink