我正试图在MobileSafari的书签中捕获函数的参数。但我得到编译错误。我怀疑WebBookmark类是未声明的,并且在Safari中没有发现任何标头声明接口。所以我补充道:
#import <WebKit/WebKit.h>
#import <WebCore/WebCore.h>
到我的Tweak.mk。有谁知道在哪里可以找到他们的接口?下面是我的makefile,调整和输出。谢谢!
#output: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
WHAt进去了:
#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; }
%端
makefile中有什么:
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 :(得分:0)
WebBookmark
来自WebBookmarks.framework
。这是一个私人框架,你必须class-dump
它。