2012-02-20 1 views
0

Я пытаюсь захватить аргументы функции в закладках на MobileSafari. Но я получаю ошибки компиляции. Я подозреваю, что класс WebBookmark не объявлен и не нашел ни одного из заголовков в Safari, объявляющих интерфейс для него. Поэтому я добавил:Mobilesubstrate MobileSafari tweak Logos компиляция проблема

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

К моему Tweak.mk. Кто-нибудь знает, где найти свои интерфейсы? Ниже приведены мои make-файлы, настройки и вывод. Благодаря!

# выход:
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; } 

% конца

Что в 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

WebBookmark происходит от WebBookmarks.framework. Это частная структура, вам нужно будет class-dump.

+0

спасибо! это работает! – gigasai