2012-02-20 75 views
0

我试图在MobileSafari的书签上捕获函数的参数。但我得到编译错误。我怀疑WebBookmark类是未声明的,并且在Safari中没有发现为它声明接口的头文件。所以我补充说:Mobilesubstrate MobileSafari调整徽标编译问题

#import <WebKit/WebKit.h> 
#import <WebCore/WebCore.h> 

To my Tweak.mk。有谁知道在哪里可以找到他们的界面?以下是我的makefile,调整和输出。谢谢!

#输出:
Making all for tweak TestingTweak... 
Preprocessing Tweak.xm... 
Compiling Tweak.xm... 
In file included from /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h:11, 
       from /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h:11, 
       from /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h:10, 
       from /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:12, 
       from /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:10, 
       from /opt/theos/Prefix.pch:4, 
       from <command-line>:0: 
/opt/theos/include/UIKit/UISwipeGestureRecognizer.h:6:26: error: Availability2.h: No such file or directory 
Tweak.xm:30: error: ‘WebBookmark’ has not been declared 
Tweak.xm:30: error: ‘WebBookmark’ has not been declared 
Tweak.xm:30: error: expected initializer before ‘*’ token 
Tweak.xm:30: error: expected initializer before ‘*’ token 
Tweak.xm:30: error: ‘WebBookmark’ has not been declared 
Tweak.xm:30: error: ‘WebBookmark’ has not been declared 
Tweak.xm:30: error: expected initializer before ‘*’ token 
Tweak.xm:30: error: expected initializer before ‘*’ token 
Tweak.xm:464: error: ‘WebBookmark’ has not been declared 
Tweak.xm:465: error: expected initializer before ‘*’ token 
Tweak.xm:466: error: ‘WebBookmark’ has not been declared 
Tweak.xm:467: error: expected initializer before ‘*’ token 
Tweak.xm: In function ‘void _logosLocalInit()’: 
Tweak.xm:2569: error: ‘_logos_method$_ungrouped$FolderPickerViewController$parentBookmark’ was not declared in this scope 
Tweak.xm:2569: error: ‘_logos_orig$_ungrouped$FolderPickerViewController$parentBookmark’ was not declared in this scope 
Tweak.xm:2569: error: ‘_logos_method$_ungrouped$FolderPickerViewController$movingBookmark’ was not declared in this scope 
Tweak.xm:2569: error: ‘_logos_orig$_ungrouped$FolderPickerViewController$movingBookmark’ was not declared in this scope 
make[2]: *** [obj/Tweak.xm.o] Error 1 
make[1]: *** [internal-library-all_] Error 2 
make: *** [TestingTweak.all.tweak.variables] Error 2 
什么去:
#import <UIKit/UIKit2.h> 

%hook FolderPickerViewController 
- (id)initWithDelegate:(id)arg1 bookmarkCollection:(id)arg2 { %log; id r = %orig; NSLog(@" = %@", r); return r; } 
- (void)dealloc { %log; %orig; } 
- (int)tableView:(id)arg1 numberOfRowsInSection:(int)arg2 { %log; int r = %orig; NSLog(@" = %d", r); return r; } 
- (id)tableView:(id)arg1 cellForRowAtIndexPath:(id)arg2 { %log; id r = %orig; NSLog(@" = %@", r); return r; } 
- (void)tableView:(id)arg1 didSelectRowAtIndexPath:(id)arg2 { %log; %orig; } 
- (void)_cancel { %log; %orig; } 
- (void)willShowForBookmark:(id)arg1 parent:(id)arg2 { %log; %orig; } 
// the following properties seem to be the culprit 
- (void)setParentBookmark:(WebBookmark *)parentBookmark { %log; %orig; } 
- (WebBookmark *)parentBookmark { %log; WebBookmark * r = %orig; NSLog(@" = %@", r); return r; } 
- (void)setMovingBookmark:(WebBookmark *)movingBookmark { %log; %orig; } 
- (WebBookmark *)movingBookmark { %log; WebBookmark * r = %orig; NSLog(@" = %@", r); return r; } 

%结束

什么是在生成文件:

SDKVERSION=5.0 
include theos/makefiles/common.mk 

TWEAK_NAME = TestingTweak 
TestingTweak_FILES = Tweak.xm 

include $(THEOS_MAKE_PATH)/tweak.mk 

筛选:

{ Filter = { Bundles = ("com.apple.mobilesafari"); }; } 

回答

0

WebBookmark来自WebBookmarks.framework。这是一个私人框架,你必须要class-dump它。

+0

谢谢!这样可行! – gigasai 2012-02-29 08:27:49